From 031ce2ce1fd5cf031494014137f47d403ae1aa02 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Tue, 10 Dec 2024 08:54:44 -0500 Subject: [PATCH] ensure info.meta is populated --- jdaviz/core/freezable_state.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jdaviz/core/freezable_state.py b/jdaviz/core/freezable_state.py index 6238d0741e..e61aa3d3f7 100644 --- a/jdaviz/core/freezable_state.py +++ b/jdaviz/core/freezable_state.py @@ -69,10 +69,12 @@ def _convert_units_y_limits(self, old_unit, new_unit): spectral_axis = x_corners * u.Unit(self.x_display_unit) for layer in self.layers: - if layer.layer.meta.get('_pixel_scale_factor'): + if psc := layer.layer.meta.get('_pixel_scale_factor', None) is not None: spectral_axis.info.meta = {'_pixel_scale_factor', - layer.layer.meta.get('_pixel_scale_factor')} + psc} break + else: + spectral_axis.info.meta = {} y_corners_new = flux_conversion(y_corners, old_unit, new_unit, spectral_axis=spectral_axis) # noqa