Skip to content

Commit

Permalink
removing wcs keywords after resample (#5971)
Browse files Browse the repository at this point in the history
  • Loading branch information
cshanahan1 authored May 4, 2021
1 parent d15cce3 commit 14749b0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ resample

- Propagate variance arrays into ``SlitModel`` used as input for ``ResampleSpecStep`` [#5941]

- Remove certain WCS keywords that are irrelevant after resampling. [#5971]

source_catalog
--------------

Expand Down
7 changes: 7 additions & 0 deletions jwst/resample/resample_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ def process(self, input):
else:
result = resamp.output_models

# remove irrelevant WCS keywords
rm_keys = ['v2_ref', 'v3_ref', 'ra_ref', 'dec_ref', 'roll_ref',
'v3yangle', 'vparity']
for key in rm_keys:
if key in result.meta.wcsinfo.instance:
del result.meta.wcsinfo.instance[key]

return result

def update_phot_keywords(self, model):
Expand Down
15 changes: 15 additions & 0 deletions jwst/resample/tests/test_resample_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,18 @@ def test_build_interpolated_output_wcs(miri_rate_pair):
# Make sure the output slit size is larger than the input slit size
# for this nodded data
assert driz.data_size[1] > ra.shape[1]


def test_wcs_keywords(nircam_rate):
# make sure certain wcs keywords are removed after resample

im = AssignWcsStep.call(nircam_rate)
result = ResampleStep.call(im)

assert result.meta.wcsinfo.v2_ref is None
assert result.meta.wcsinfo.v3_ref is None
assert result.meta.wcsinfo.ra_ref is None
assert result.meta.wcsinfo.dec_ref is None
assert result.meta.wcsinfo.roll_ref is None
assert result.meta.wcsinfo.v3yangle is None
assert result.meta.wcsinfo.vparity is None

0 comments on commit 14749b0

Please sign in to comment.