Skip to content

Commit

Permalink
add comment in code to generalize in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Dec 10, 2024
1 parent f657a92 commit 398aecd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jdaviz/core/freezable_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ def _convert_units_y_limits(self, old_unit, new_unit):
y_corners = np.array([self.y_min, self.y_max, self.y_min, self.y_max])
spectral_axis = x_corners * u.Unit(self.x_display_unit)

# NOTE: this uses the scale factor from the first found layer. We may want to
# generalize this to iterate over all scale factors if/when we support multiple
# flux cubes (with potentially different pixel scale factors).
for layer in self.layers:
if psc := getattr(layer.layer, 'meta', {}).get('_pixel_scale_factor', None): # noqa
spectral_axis.info.meta = {'_pixel_scale_factor',
Expand Down

0 comments on commit 398aecd

Please sign in to comment.