Skip to content

Commit

Permalink
Merge branch 'master' into abs-sep-tol-check
Browse files Browse the repository at this point in the history
  • Loading branch information
hbushouse committed May 29, 2024
2 parents a2fb49a + 36728a3 commit 4e69f2e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 19 deletions.
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ ramp_fitting
fitting or "OLS_C" to use the C extension implementation of
ramp fitting. [#8503]

refpix
------

- Use ``double`` for fft filter coefficients to improve compatibility
across system. [#8512]

resample
--------

Expand All @@ -138,11 +144,15 @@ resample
- Update variance handling to propagate resampled variance components with
weights that match the science `weight_type`. [#8437]

- Change `fillval` parameter default from INDEF to NaN [#8488]

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

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

- Change `fillval` parameter default from INDEF to NaN [#8488]

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
8 changes: 4 additions & 4 deletions jwst/refpix/irs2_subtract_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,19 +1082,19 @@ def fill_bad_regions(data0, ngroups, ny, nx, row, scipix_n, refpix_r, pad, hnorm
(scipix_n + refpix_r + 2) * ny // 2 - elen // 2

# Construct the filter [1, cos, 0, cos, 1].
temp_a1 = (np.cos(np.arange(elen, dtype=np.float32) *
temp_a1 = (np.cos(np.arange(elen, dtype=np.float64) *
np.pi / float(elen)) + 1.) / 2.

# elen = 5000
# blen = 30268
# row * ny // 2 - 2 * blen - 2 * elen = 658552
# len(temp_a2) = 729088
temp_a2 = np.concatenate((np.ones(blen, dtype=np.float32),
temp_a2 = np.concatenate((np.ones(blen, dtype=np.float64),
temp_a1.copy(),
np.zeros(row * ny // 2 - 2 * blen - 2 * elen,
dtype=np.float32),
dtype=np.float64),
temp_a1[::-1].copy(),
np.ones(blen, dtype=np.float32)))
np.ones(blen, dtype=np.float64)))

roll_a2 = np.roll(temp_a2, -1)
aa = np.concatenate((temp_a2, roll_a2[::-1]))
Expand Down
4 changes: 1 addition & 3 deletions jwst/regtest/test_nirspec_lamp_ifu_spec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def run_pipeline(rtdata_module):
args = ["jwst.pipeline.Spec2Pipeline", rtdata.input,
"--steps.assign_wcs.save_results=true",
"--steps.msa_flagging.save_results=true",
"--steps.flat_field.save_results=true",
# Hardwire extract1d ref file selection until CRDS-525 is implemented
"--steps.extract_1d.override_extract1d=/grp/crds/jwst/references/jwst/jwst_nirspec_extract1d_0001.asdf"]
"--steps.flat_field.save_results=true"]
Step.from_cmdline(args)

return rtdata
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 @@ class GWCSDrizzle:
"""

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 @@ def __init__(self, product, outwcs=None, wt_scl=None,
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 increment_id(self):

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 @@ def dodrizzle(insci, input_wcs, inwht, output_wcs, outsci, outwht, outcon,
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 @@ def dodrizzle(insci, input_wcs, inwht, output_wcs, outsci, outwht, outcon,

# Insure that the fillval parameter gets properly interpreted for use with tdriz
if util.is_blank(str(fillval)):
fillval = 'INDEF'
fillval = 'NAN'
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 @@ class ResampleData:
"""

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 update_exposure_times(self, output_model):
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 @@ def drizzle_arrays(insci, inwht, input_wcs, output_wcs, outsci, outwht,
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 @@ def drizzle_arrays(insci, inwht, input_wcs, output_wcs, outsci, outwht,

# Insure that the fillval parameter gets properly interpreted for use with tdriz
if util.is_blank(str(fillval)):
fillval = 'INDEF'
fillval = 'NAN'
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 @@ class ResampleStep(Step):
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 @@ def _set_spec_defaults(self):
if self.kernel is None:
self.kernel = 'square'
if self.fillval is None:
self.fillval = 'INDEF'
self.fillval = 'NAN'
# Force definition of good bits
kwargs['good_bits'] = GOOD_BITS
kwargs['pixfrac'] = self.pixfrac
Expand Down
1 change: 1 addition & 0 deletions jwst/resample/tests/test_resample_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ def test_custom_wcs_resample_imaging(nircam_rate, ratio, rotation, crpix, crval,
'output_shape2, match',
[((1205, 1100), True), ((1222, 1111), False), (None, True)]
)
@pytest.mark.xfail(reason="Empty output region, unclear what this is meant to test.")
def test_custom_refwcs_resample_imaging(nircam_rate, output_shape2, match,
tmp_path):
crpix = (600, 550)
Expand Down

0 comments on commit 4e69f2e

Please sign in to comment.