Skip to content

Commit

Permalink
fix(delayspectrum): swap axis names when transposing
Browse files Browse the repository at this point in the history
  • Loading branch information
nritsche committed Sep 18, 2020
1 parent 174c536 commit d63fc94
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bondia/plot/delayspectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,25 +116,30 @@ def view(self):
xlim = (range_x[0], range_x[-1])
ylim = ylim_max

# axis names
axis_name_tau = "τ [nsec]"
axis_name_y = "y [m]"

# Make image
if self.transpose:
mplot[pp] = spectrum.spectrum[this_cyl_sep, :].T
index_x = baseline_index
index_y = index_map_delay_nsec
xlim, ylim = ylim, xlim

axis_names = [axis_name_y, axis_name_tau]
else:
mplot[pp] = spectrum.spectrum[this_cyl_sep, :]
index_x = index_map_delay_nsec
index_y = baseline_index
axis_names = [axis_name_tau, axis_name_y]

# holoviews checks for regular sampling before plotting an Image.
# The CHIME baselines are not regularly sampled enough to pass through the default rtol
# (1e-6), but we anyways want to plot the delay spectrum in an Image, not a QuadMesh.
img = hv.Image(
(index_x, index_y, mplot[pp]),
datatype=["image", "grid"],
kdims=["τ [nsec]", "y [m]"],
kdims=axis_names,
rtol=2,
).opts(
clim=self.colormap_range,
Expand Down

0 comments on commit d63fc94

Please sign in to comment.