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:
  • name (str, optional) – 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.

  • parent (Step instance, optional) – 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_file (str or pathlib.Path, optional) – The path to the config file that this step was initialized with. Use to determine relative path names of other config files.

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

Methods Documentation

get_drizpars()[source]

Load all drizzle-related parameter values into kwargs list.

Returns:

kwargs – Dictionary of drizzle parameters

Return type:

dict

process(input_data)[source]

Run the resample step on the input data.

Parameters:

input_data (MultiSlitModel, ModelContainer, str) – A single datamodel, a container of datamodels, or an association file.

Returns:

The resampled output, one slit per source.

Return type:

SlitModel or MultiSlitModel

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.