Skip to content

Commit

Permalink
moving metadata addition to before add_results_from_plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
gibsongreen committed Mar 22, 2024
1 parent 270123a commit bf012bd
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit bf012bd

Please sign in to comment.