Skip to content

Commit

Permalink
fix pixel scale factor to use wavelength-dependent aperture areas
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed May 8, 2024
1 parent d8159cb commit 01f0da0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ def bg_weight_mask(self):
def aperture_area_along_spectral(self):
# Weight mask summed along the spatial axes so that we get area of the aperture, in pixels,
# as a function of wavelength.
# To convert to steradians, multiply by self.spectral_cube.meta.get('PIXAR_SR', 1.0)
return np.sum(self.aperture_weight_mask, axis=(0, 1))

@property
Expand Down Expand Up @@ -478,7 +479,7 @@ def extract(self, return_bg=False, add_data=True, **kwargs):
spec = spec - bg_spec

# 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 * self.spectral_cube.meta.get('PIXAR_SR', 1.0)
pix_scale_factor = self.aperture_area_along_spectral * self.spectral_cube.meta.get('PIXAR_SR', 1.0) # noqa
spec.meta['_pixel_scale_factor'] = pix_scale_factor

# stuff for exporting to file
Expand Down

0 comments on commit 01f0da0

Please sign in to comment.