Skip to content

Commit 618096f

Browse files
committed
Merge branch 'main' of https://github.com/spacetelescope/jwst into JP-4151
2 parents e7082e6 + bbadc65 commit 618096f

File tree

19 files changed

+181
-192
lines changed

19 files changed

+181
-192
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ the specified context and less than the context for the next release.
263263

264264
| jwst tag | DMS build | SDP_VER | CRDS_CONTEXT | Released | Ops Install | Notes |
265265
|---------------------|-----------|----------|--------------|------------|-------------|-----------------------------------------------|
266+
| 1.20.0 | B12.0.3 | 2025.4.0 | 1439 | 2025-09-23 | | First release candidate for B12.0.3 |
266267
| 1.19.2 | B12.0.2 | 2025.3.0 | 1408 | 2025-09-11 | | Patch release for B12.0.2 |
267268
| 1.19.1 | B12.0.1 | 2025.3.0 | 1408 | 2025-07-21 | | Patch release for B12.0.1 |
268269
| 1.19.0 | B12.0 | 2025.3.0 | 1408 | 2025-06-26 | | First release candidate for B12.0 |

changes/9878.stpipe.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove ``kwargs`` from the ``JwstStep.run`` signature to match the parent method (``Step.run``).

changes/9879.assign_wcs.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove legacy support for the old-style NIRSpec WCS. All processed data should now have a full slit-based WCS implementation.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Simplify WCS access for NIRSpec FS and MOS data processed with the ``mask_science_regions`` option.

changes/9879.msaflagopen.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Simplify WCS access for flagging open MSA shutters and remove unnecessary data copies.

changes/9903.pipeline.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use ``Step.prepare_output`` in pipeline steps to open input models and make copies only when necessary.

changes/9903.stpipe.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add an option to ``Step.prepare_output`` to open the input with a specific datamodel class.

docs/jwst/data_products/msa_metadata.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ a crucial component of calibration processing for NIRSpec MOS exposures.
77
It contains all the slitlet, shutter, and source configuration information that's needed
88
by the :ref:`calwebb_spec2 <calwebb_spec2>` pipeline to process a MOS exposure.
99
These metadata are originally generated by the
10-
`MSA Planning Tool <https://jwst-docs.stsci.edu/display/JDOX/.NIRSpec+MSA+Planning+Tool%2C+MPT+v2.0>`_
10+
`MSA Planning Tool <https://jwst-docs.stsci.edu/jwst-near-infrared-spectrograph/nirspec-apt-templates/nirspec-multi-object-spectroscopy-apt-template/nirspec-msa-planning-tool-mpt>`_
1111
(MPT) in APT and passed through the ground system to populate the
1212
FITS metafile. Details of the metadata and how it is used in calibration processing
1313
are given below.

docs/jwst/references_general/apcorr_reffile.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ corrections for different radii.
283283
+------------+-------+-------------+-----------+------------+----------+
284284
| Instrument | Mode | Column name | Data type | Dimensions | Units |
285285
+============+=======+=============+===========+============+==========+
286-
| NIRSpec | MOS | filter | string | 12 | N/A |
286+
| NIRSpec | IFU | filter | string | 12 | N/A |
287287
+ + +-------------+-----------+------------+----------+
288288
| | | grating | string | 15 | N/A |
289289
+ + +-------------+-----------+------------+----------+

jwst/assign_wcs/nirspec.py

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import copy
88
import logging
9-
import warnings
109

1110
import gwcs
1211
import numpy as np
@@ -41,7 +40,6 @@
4140
Rotation3DToGWA,
4241
Slit,
4342
Slit2Msa,
44-
Slit2MsaLegacy,
4543
Snell,
4644
Unitless2DirCos,
4745
WavelengthFromGratingEquation,
@@ -2282,109 +2280,6 @@ def gwa_to_ymsa(msa2gwa_model, lam_cen=None, slit=None, slit_y_range=None):
22822280
return tab
22832281

22842282

2285-
def _nrs_wcs_set_slit_input_legacy(input_model, slit_name):
2286-
"""
2287-
Return a WCS object for a specific slit, slice or shutter.
2288-
2289-
Does not compute the bounding box.
2290-
2291-
Parameters
2292-
----------
2293-
input_model : JwstDataModel
2294-
A WCS object for the all open slitlets in an observation.
2295-
slit_name : int or str
2296-
Slit.name of an open slit.
2297-
2298-
Returns
2299-
-------
2300-
wcsobj : `~gwcs.wcs.WCS`
2301-
WCS object for this slit.
2302-
"""
2303-
wcsobj = input_model.meta.wcs
2304-
2305-
slit_wcs = copy.deepcopy(wcsobj)
2306-
slit_wcs.set_transform("sca", "gwa", wcsobj.pipeline[1].transform[1:])
2307-
g2s = slit_wcs.pipeline[2].transform
2308-
slit_wcs.set_transform("gwa", "slit_frame", g2s.get_model(slit_name))
2309-
2310-
exp_type = input_model.meta.exposure.type
2311-
is_nirspec_ifu = is_nrs_ifu_lamp(input_model) or (exp_type.lower() == "nrs_ifu")
2312-
if is_nirspec_ifu:
2313-
slit_wcs.set_transform(
2314-
"slit_frame", "slicer", wcsobj.pipeline[3].transform.get_model(slit_name) & Identity(1)
2315-
)
2316-
else:
2317-
slit_wcs.set_transform(
2318-
"slit_frame",
2319-
"msa_frame",
2320-
wcsobj.pipeline[3].transform.get_model(slit_name) & Identity(1),
2321-
)
2322-
return slit_wcs
2323-
2324-
2325-
def nrs_wcs_set_input_legacy(
2326-
input_model, slit_name, wavelength_range=None, slit_y_low=None, slit_y_high=None
2327-
):
2328-
"""
2329-
Return a WCS object for a specific slit, slice or shutter.
2330-
2331-
This function is intended to work with old-style NIRSpec WCS implementations,
2332-
to support reading in WCS data from existing datamodels. For new datamodels,
2333-
produced after v1.18.0, use `nrs_wcs_set_input`.
2334-
2335-
Parameters
2336-
----------
2337-
input_model : JwstDataModel
2338-
A WCS object for the all open slitlets in an observation.
2339-
slit_name : int or str
2340-
Slit.name of an open slit.
2341-
wavelength_range : list
2342-
Wavelength range for the combination of filter and grating.
2343-
slit_y_low, slit_y_high : float
2344-
The lower and upper bounds of the slit. Optional.
2345-
2346-
Returns
2347-
-------
2348-
wcsobj : `~gwcs.wcs.WCS`
2349-
WCS object for this slit.
2350-
"""
2351-
warnings.warn(
2352-
"The nrs_wcs_set_input_legacy function is intended for use with an "
2353-
"old-style NIRSpec WCS pipeline. "
2354-
"It will be removed in a future build.",
2355-
DeprecationWarning,
2356-
stacklevel=2,
2357-
)
2358-
2359-
def _get_y_range(input_model):
2360-
# get the open slits from the model
2361-
# Need them to get the slit ymin,ymax
2362-
g2s = input_model.meta.wcs.get_transform("gwa", "slit_frame")
2363-
open_slits = g2s.slits
2364-
slit = [s for s in open_slits if s.name == slit_name][0]
2365-
return slit.ymin, slit.ymax
2366-
2367-
if wavelength_range is None:
2368-
_, wavelength_range = spectral_order_wrange_from_model(input_model)
2369-
2370-
slit_wcs = _nrs_wcs_set_slit_input_legacy(input_model, slit_name)
2371-
transform = slit_wcs.get_transform("detector", "slit_frame")
2372-
is_nirspec_ifu = (
2373-
is_nrs_ifu_lamp(input_model) or input_model.meta.exposure.type.lower() == "nrs_ifu"
2374-
)
2375-
if is_nirspec_ifu:
2376-
bb = compute_bounding_box(transform, None, wavelength_range)
2377-
else:
2378-
if slit_y_low is None or slit_y_high is None:
2379-
slit_y_low, slit_y_high = _get_y_range(input_model)
2380-
bb = compute_bounding_box(
2381-
transform, None, wavelength_range, slit_ymin=slit_y_low, slit_ymax=slit_y_high
2382-
)
2383-
2384-
slit_wcs.bounding_box = bb
2385-
return slit_wcs
2386-
2387-
23882283
def _fix_slit_name(transform, slit_name):
23892284
"""
23902285
Create a new WCS transform by fixing the slit input to a specific value.
@@ -2563,13 +2458,6 @@ def nrs_wcs_set_input(input_model, slit_name):
25632458
# Get the full WCS object
25642459
full_wcs = input_model.meta.wcs
25652460

2566-
# Check for an old-style WCS that needs different handling
2567-
for step in full_wcs.pipeline:
2568-
if isinstance(step.transform, Slit2MsaLegacy):
2569-
# There is a legacy slit2msa transform somewhere in the pipeline.
2570-
# Use the old deepcopy-and-replace method.
2571-
return nrs_wcs_set_input_legacy(input_model, slit_name)
2572-
25732461
# Convert FS slit names to numbers
25742462
if str(slit_name).upper() in FIXED_SLIT_NUMS.keys():
25752463
slit_id = nrs_fs_slit_id(str(slit_name).upper())

0 commit comments

Comments
 (0)