Skip to content

Commit

Permalink
Fix use of string for coordinate frame
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson committed Dec 20, 2024
1 parent d519823 commit fdee76b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions jwst/assign_wcs/nirspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def ifu(input_model, reference_files, slit_y_range=[-.55, .55]):
# SLICER to MSA Entrance
slicer2msa = slicer_to_msa(reference_files)

det, sca, gwa, slit_frame, msa_frame, oteip, v2v3, v2v3vacorr, world = create_frames()
det, sca, gwa, slit_frame, slicer_frame, msa_frame, oteip, v2v3, v2v3vacorr, world = create_frames()

exp_type = input_model.meta.exposure.type.upper()

Expand All @@ -241,7 +241,7 @@ def ifu(input_model, reference_files, slit_y_range=[-.55, .55]):
(sca, det2gwa.rename('detector2gwa')),
(gwa, gwa2slit.rename('gwa2slit')),
(slit_frame, slit2slicer),
('slicer', slicer2msa),
(slicer_frame, slicer2msa),
(msa_frame, None)]
else:
# MSA to OTEIP transform
Expand Down Expand Up @@ -271,7 +271,7 @@ def ifu(input_model, reference_files, slit_y_range=[-.55, .55]):
(sca, det2gwa.rename('detector2gwa')),
(gwa, gwa2slit.rename('gwa2slit')),
(slit_frame, slit2slicer),
('slicer', slicer2msa),
(slicer_frame, slicer2msa),
(msa_frame, msa2oteip.rename('msa2oteip')),
(oteip, oteip2v23.rename('oteip2v23')),
(v2v3, va_corr),
Expand Down Expand Up @@ -352,7 +352,8 @@ def slitlets_wcs(input_model, reference_files, open_slits_id):

# Create coordinate frames in the NIRSPEC WCS pipeline"
# "detector", "gwa", "slit_frame", "msa_frame", "oteip", "v2v3", "v2v3vacorr", "world"
det, sca, gwa, slit_frame, msa_frame, oteip, v2v3, v2v3vacorr, world = create_frames()
# _ would be the slicer_frame that is not used
det, sca, gwa, slit_frame, _, msa_frame, oteip, v2v3, v2v3vacorr, world = create_frames()

exp_type = input_model.meta.exposure.type.upper()

Expand Down Expand Up @@ -1593,6 +1594,8 @@ def create_frames():
axes_names=('x_msa', 'y_msa'))
slit_spatial = cf.Frame2D(name='slit_spatial', axes_order=(0, 1), unit=("", ""),
axes_names=('x_slit', 'y_slit'))
slicer_spatial = cf.Frame2D(name='slicer_spatial', axes_order=(0, 1), unit=("", ""),
axes_names=('x_slicer', 'y_slicer'))
sky = cf.CelestialFrame(name='sky', axes_order=(0, 1), reference_frame=coord.ICRS())
v2v3_spatial = cf.Frame2D(name='v2v3_spatial', axes_order=(0, 1),
unit=(u.arcsec, u.arcsec), axes_names=('v2', 'v3'))
Expand All @@ -1606,12 +1609,13 @@ def create_frames():
v2v3 = cf.CompositeFrame([v2v3_spatial, spec], name='v2v3')
v2v3vacorr = cf.CompositeFrame([v2v3vacorr_spatial, spec], name='v2v3vacorr')
slit_frame = cf.CompositeFrame([slit_spatial, spec], name='slit_frame')
slicer_frame = cf.CompositeFrame([slicer_spatial, spec], name='slicer')
msa_frame = cf.CompositeFrame([msa_spatial, spec], name='msa_frame')
oteip_spatial = cf.Frame2D(name='oteip', axes_order=(0, 1), unit=(u.deg, u.deg),
axes_names=('X_OTEIP', 'Y_OTEIP'))
oteip = cf.CompositeFrame([oteip_spatial, spec], name='oteip')
world = cf.CompositeFrame([sky, spec], name='world')
return det, sca, gwa, slit_frame, msa_frame, oteip, v2v3, v2v3vacorr, world
return det, sca, gwa, slit_frame, slicer_frame, msa_frame, oteip, v2v3, v2v3vacorr, world


def create_imaging_frames():
Expand Down

0 comments on commit fdee76b

Please sign in to comment.