diff --git a/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py b/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py index eb22f72f4c..97cbd65ff6 100644 --- a/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py +++ b/jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py @@ -333,6 +333,10 @@ def collapse_to_spectrum(self, add_data=True, **kwargs): fname_label = self.dataset_selected.replace("[", "_").replace("]", "") self.filename = f"extracted_{selected_func}_{fname_label}.fits" + # per https://jwst-docs.stsci.edu/jwst-near-infrared-camera/nircam-performance/nircam-absolute-flux-calibration-and-zeropoints # noqa + pix_scale_factor = self.aperture.scale_factor * spectral_cube.meta.get('PIXAR_SR', 1.0) + collapsed_spec.meta['_pixel_scale_factor'] = pix_scale_factor + if add_data: self.add_results.add_results_from_plugin( collapsed_spec, label=self.results_label, replace=False @@ -344,10 +348,6 @@ def collapse_to_spectrum(self, add_data=True, **kwargs): sender=self) self.hub.broadcast(snackbar_message) - # per https://jwst-docs.stsci.edu/jwst-near-infrared-camera/nircam-performance/nircam-absolute-flux-calibration-and-zeropoints # noqa - pix_scale_factor = self.aperture.scale_factor * spectral_cube.meta.get('PIXAR_SR', 1.0) - collapsed_spec.meta['_pixel_scale_factor'] = pix_scale_factor - return collapsed_spec def get_aperture(self):