Skip to content

Commit 4a0c4c0

Browse files
tapastrohbushouse
andauthored
JP-3084: Separate photometric calibration factors for point vs. uniform use (#7464)
* Process separate scalar through 2D conversion; store array for extended src * changelog * cleanup loose usage of slit reference * remove my bad idea * no need for photom extension if extended source --------- Co-authored-by: Howard Bushouse <[email protected]>
1 parent 90c9524 commit 4a0c4c0

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ photom
3232
calibration applied, based on the slit-dependent source type (POINT or EXTENDED).
3333
[#7451]
3434

35+
- Correct units of ``photom_uniform`` array to MJy/sr for NIRSpec fixed
36+
slit data, to allow for expected behavior in ``master_background`` processing. [#7464]
37+
3538
pipeline
3639
--------
3740

jwst/photom/photom.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ def photom_io(self, tabdata, order=None):
721721
"to surface brightness")
722722
conversion /= slit.meta.photometry.pixelarea_steradians
723723
else:
724+
conversion_uniform = conversion / slit.meta.photometry.pixelarea_steradians
724725
unit_is_surface_brightness = False
725726
elif isinstance(self.input, datamodels.MultiSpecModel):
726727
# MultiSpecModel output from extract1d should not require this area conversion?
@@ -735,6 +736,7 @@ def photom_io(self, tabdata, order=None):
735736
"to surface brightness")
736737
conversion /= self.input.meta.photometry.pixelarea_steradians
737738
else:
739+
conversion_uniform = conversion / self.input.meta.photometry.pixelarea_steradians
738740
unit_is_surface_brightness = False
739741

740742
# Store the conversion factor in the meta data
@@ -795,35 +797,35 @@ def photom_io(self, tabdata, order=None):
795797

796798
# Compute a 2-D grid of conversion factors, as a function of wavelength
797799
if isinstance(self.input, datamodels.MultiSlitModel):
798-
800+
slit = self.input.slits[self.slitnum]
799801
# The NIRSpec fixed-slit primary slit needs special handling if
800802
# it contains a point source
801803
if self.exptype.upper() == 'NRS_FIXEDSLIT' and \
802-
self.input.slits[self.slitnum].name == self.input.meta.instrument.fixed_slit and \
803-
self.input.slits[self.slitnum].source_type.upper() == 'POINT':
804+
slit.name == self.input.meta.instrument.fixed_slit and \
805+
slit.source_type.upper() == 'POINT':
804806

805807
# First, compute 2D array of photom correction values using
806808
# uncorrected wavelengths, which is appropriate for a uniform source
807-
scalar_conv = conversion
808-
conversion, no_cal = self.create_2d_conversion(self.input.slits[self.slitnum],
809-
self.exptype, scalar_conv,
809+
conversion_2d_uniform, no_cal = self.create_2d_conversion(slit,
810+
self.exptype, conversion_uniform,
810811
waves, relresps, order,
811812
use_wavecorr=False)
812-
slit.photom_uniform = conversion # store the result
813+
slit.photom_uniform = conversion_2d_uniform # store the result
813814

814815
# Now repeat the process using corrected wavelength values,
815816
# which is appropriate for a point source. This is the version of
816817
# the correction that will actually get applied to the data below.
817-
conversion, no_cal = self.create_2d_conversion(self.input.slits[self.slitnum],
818-
self.exptype, scalar_conv,
818+
conversion, no_cal = self.create_2d_conversion(slit,
819+
self.exptype, conversion,
819820
waves, relresps, order,
820821
use_wavecorr=True)
821822
slit.photom_point = conversion # store the result
822823

823824
else:
824-
conversion, no_cal = self.create_2d_conversion(self.input.slits[self.slitnum],
825+
conversion, no_cal = self.create_2d_conversion(slit,
825826
self.exptype, conversion,
826827
waves, relresps, order)
828+
827829
elif isinstance(self.input, datamodels.MultiSpecModel):
828830

829831
# This input does not require a 2d conversion, but a 1d interpolation on the

0 commit comments

Comments
 (0)