8000 JP-2303: Allow user input for resample weight_type param by hbushouse · Pull Request #6406 · spacetelescope/jwst · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

JP-2303: Allow user input for resample weight_type param #6406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ cube_build
- Using assign_wsc.utils.in_ifu_slice function to determine which NIRSpec
sky values mapped to each detector slice. [#6326]

- Fixed error final exposure times calculated by blend headers.Only the input models
used in the IFU cube are past to blend headers. [#6360]
- Fixed error in final exposure times calculated by blend headers. Only the input models
used in the IFU cube are passed to blend headers. [#6360]

- Update of documentation to explain 3d drizzling and remove miri psf weighting [#6371]

Expand Down Expand Up @@ -105,7 +105,7 @@ flatfield
- Updated flatfield step docs to include complete details on how the
variance and error arrays are updated. [#6245]

- Fixed a bug in flatfield for brightobj mode where the S-flat cutout
- Fixed a bug in flatfield for NIRSpec BrightObj mode where the S-flat cutout
was calculated incorrectly by not accounting for the slit offset [#6332]

jump
Expand Down Expand Up @@ -170,6 +170,8 @@ resample

- Fix a crash in ``resample_spec`` due to undefined variance arrays. [#6305]

- Fix handling of ``weight_type`` parameter to allow for user override. [#6406]

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

Expand Down
7 changes: 6 additions & 1 deletion jwst/resample/resample_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def process(self, input):
kwargs = self._set_spec_defaults()

kwargs['allowed_memory'] = self.allowed_memory
kwargs['weight_type'] = str(self.weight_type)
if self.weight_type == 'exptime':
self.log.warning("Use of EXPTIME weighting will result in incorrect")
self.log.warning("propagated errors in the resampled product")

# Call the resampling routine
resamp = resample.ResampleData(input_models, output=output, **kwargs)
Expand All @@ -95,6 +99,7 @@ def process(self, input):
if len(result) == 1:
result = result[0]

input_models.close()
return result

def update_phot_keywords(self, model):
Expand All @@ -120,7 +125,7 @@ def get_drizpars(self, ref_filename, input_models):

Once the defaults are set from the reference file, if the user has
used a resample.cfg file or run ResampleStep using command line args,
then these will overwerite the defaults pulled from the reference file.
then these will overwrite the defaults pulled from the reference file.
"""
with datamodels.DrizParsModel(ref_filename) as drpt:
drizpars_table = drpt.data
Expand Down
4 changes: 2 additions & 2 deletions jwst/resample/tests/test_resample_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ def test_weight_type(nircam_rate, _jail):

result2 = ResampleStep.call(c, weight_type="exptime", blendheaders=False)

assert_allclose(result2.data[100:105, 100:105], 7.5, rtol=1e-2)
assert_allclose(result2.wht[100:105, 100:105], 20, rtol=1e-2)
assert_allclose(result2.data[100:105, 100:105], 6.667, rtol=1e-2)
assert_allclose(result2.wht[100:105, 100:105], 450.9, rtol=1e-1)


def test_sip_coeffs_do_not_propagate(nircam_rate):
Expand Down
0