ResampleSpecStep

class jwst.resample.ResampleSpecStep(name=None, parent=None, config_file=None, _validate_kwds=True, **kws)[source]

Bases: JwstStep

Resample spectral data onto a regular grid using the drizzle algorithm.

Create a Step instance.

Parameters:
namestr

The name of the Step instance. Used in logging messages and in cache filenames. If not provided, one will be generated based on the class name.

parentStep

The parent step of this step. Used to determine a fully-qualified name for this step, and to determine the mode in which to run this step.

config_filestr or pathlib.Path

The path to the config file that this step was initialized with. Use to determine relative path names of other config files.

_validate_kwdsbool

Validate given kws against specs/config.

**kwsdict

Additional parameters to set. These will be set as member variables on the new Step instance.

Attributes Summary

class_alias

spec

Methods Summary

get_drizpars()

Load all drizzle-related parameter values into kwargs list.

process(input_data)

Run the resample step on the input data.

update_slit_metadata(model)

Update slit attributes in the resampled slit image.

Attributes Documentation

class_alias = 'resample_spec'
spec = "\n        pixfrac = float(min=0.0, max=1.0, default=1.0)  # Pixel shrinkage factor\n        kernel = option('square', 'point', default='square')  # Flux distribution kernel\n        fillval = string(default='NAN')  # Output value for pixels with no weight or flux\n        weight_type = option('ivm', 'exptime', None, default='ivm')  # Input image weighting type\n        output_shape = int_list(min=2, max=2, default=None)  # [x, y] order\n        pixel_scale_ratio = float(default=1.0)  # Ratio of input to output spatial pixel scale\n        pixel_scale = float(default=None)  # Spatial pixel scale in arcsec\n        output_wcs = string(default='')  # Custom output WCS\n        single = boolean(default=False)  # Resample each input to its own output grid\n        blendheaders = boolean(default=True)  # Blend metadata from inputs into output\n        in_memory = boolean(default=True)  # Keep images in memory\n    "

Methods Documentation

get_drizpars()[source]

Load all drizzle-related parameter values into kwargs list.

Returns:
kwargsdict

Dictionary of drizzle parameters

process(input_data)[source]

Run the resample step on the input data.

Parameters:
input_dataMultiSlitModel, ModelContainer, str

A single datamodel, a container of datamodels, or an association file.

Returns:
SlitModel or MultiSlitModel

The resampled output, one slit per source.

update_slit_metadata(model)[source]

Update slit attributes in the resampled slit image.

This is needed because model.slit attributes are not in model.meta, so the normal update() method doesn’t work with them. Updates output_model in-place.