Skip to content
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

JP-3281: Change resampling defaults to NaN padding instead of INDEF #8488

Merged
merged 6 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,15 @@ resample
- Update variance handling to propagate resampled variance components with
weights that match the science `weight_type`. [#8437]

- Change default no-value padding from INDEF to NaN [#8488]
hbushouse marked this conversation as resolved.
Show resolved Hide resolved

resample_spec
-------------

- Populate the wavelength array in resampled `Slit` and `MultiSlit` models. [#8374]

- Change default no-value padding from INDEF to NaN [#8488]
hbushouse marked this conversation as resolved.
Show resolved Hide resolved

residual_fringe
---------------

Expand Down
2 changes: 1 addition & 1 deletion docs/jwst/resample/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ image.
``pixel_scale_ratio``, ``pixel_scale``, ``rotation``, ``crpix``,
and ``crval`` will be ignored.

``--fillval`` (str, default='INDEF')
``--fillval`` (str, default='NAN')
The value to assign to output pixels that have zero weight or do not
receive any flux from any input pixels during drizzling.

Expand Down
10 changes: 5 additions & 5 deletions jwst/resample/gwcs_drizzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""

def __init__(self, product, outwcs=None, wt_scl=None,
pixfrac=1.0, kernel="square", fillval="INDEF"):
pixfrac=1.0, kernel="square", fillval="NAN"):
"""
Create a new Drizzle output object and set the drizzle parameters.

Expand Down Expand Up @@ -53,7 +53,7 @@

fillval : str, optional
The value a pixel is set to in the output if the input image does
not overlap it. The default value of INDEF does not set a value.
not overlap it. The default value of NAN sets NaN values.
"""

# Initialize the object fields
Expand Down Expand Up @@ -231,7 +231,7 @@

def dodrizzle(insci, input_wcs, inwht, output_wcs, outsci, outwht, outcon,
expin, in_units, wt_scl, uniqid=1, xmin=0, xmax=0, ymin=0, ymax=0,
iscale=1.0, pixfrac=1.0, kernel='square', fillval="INDEF"):
iscale=1.0, pixfrac=1.0, kernel='square', fillval="NAN"):
"""
Low level routine for performing 'drizzle' operation on one image.

Expand Down Expand Up @@ -326,7 +326,7 @@

fillval: str, optional
The value a pixel is set to in the output if the input image does
not overlap it. The default value of INDEF does not set a value.
not overlap it. The default value of NAN sets NaN values.

Returns
-------
Expand All @@ -339,7 +339,7 @@

# Insure that the fillval parameter gets properly interpreted for use with tdriz
if util.is_blank(str(fillval)):
fillval = 'INDEF'
fillval = 'NAN'

Check warning on line 342 in jwst/resample/gwcs_drizzle.py

View check run for this annotation

Codecov / codecov/patch

jwst/resample/gwcs_drizzle.py#L342

Added line #L342 was not covered by tests
else:
fillval = str(fillval)

Expand Down
8 changes: 4 additions & 4 deletions jwst/resample/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"""

def __init__(self, input_models, output=None, single=False, blendheaders=True,
pixfrac=1.0, kernel="square", fillval="INDEF", wht_type="ivm",
pixfrac=1.0, kernel="square", fillval="NAN", wht_type="ivm",
good_bits=0, pscale_ratio=1.0, pscale=None, **kwargs):
"""
Parameters
Expand Down Expand Up @@ -595,7 +595,7 @@
def drizzle_arrays(insci, inwht, input_wcs, output_wcs, outsci, outwht,
outcon, uniqid=1, xmin=0, xmax=0, ymin=0, ymax=0,
iscale=1.0, pixfrac=1.0, kernel='square',
fillval="INDEF", wtscale=1.0):
fillval="NAN", wtscale=1.0):
"""
Low level routine for performing 'drizzle' operation on one image.

Expand Down Expand Up @@ -685,7 +685,7 @@

fillval: str, optional
The value a pixel is set to in the output if the input image does
not overlap it. The default value of INDEF does not set a value.
not overlap it. The default value of NAN sets NaN values.

Returns
-------
Expand All @@ -698,7 +698,7 @@

# Insure that the fillval parameter gets properly interpreted for use with tdriz
if util.is_blank(str(fillval)):
fillval = 'INDEF'
fillval = 'NAN'

Check warning on line 701 in jwst/resample/resample.py

View check run for this annotation

Codecov / codecov/patch

jwst/resample/resample.py#L701

Added line #L701 was not covered by tests
else:
fillval = str(fillval)

Expand Down
4 changes: 2 additions & 2 deletions jwst/resample/resample_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
spec = """
pixfrac = float(default=1.0) # change back to None when drizpar reference files are updated
kernel = string(default='square') # change back to None when drizpar reference files are updated
fillval = string(default='INDEF' ) # change back to None when drizpar reference files are updated
fillval = string(default='NAN' )
weight_type = option('ivm', 'exptime', None, default='ivm') # change back to None when drizpar ref update
output_shape = int_list(min=2, max=2, default=None) # [x, y] order
crpix = float_list(min=2, max=2, default=None)
Expand Down Expand Up @@ -304,7 +304,7 @@
if self.kernel is None:
self.kernel = 'square'
if self.fillval is None:
self.fillval = 'INDEF'
self.fillval = 'NAN'

Check warning on line 307 in jwst/resample/resample_step.py

View check run for this annotation

Codecov / codecov/patch

jwst/resample/resample_step.py#L307

Added line #L307 was not covered by tests
# Force definition of good bits
kwargs['good_bits'] = GOOD_BITS
kwargs['pixfrac'] = self.pixfrac
Expand Down
Loading