ResampleStep

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

Bases: JwstStep

Resample imaging 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

reference_file_types

spec

Methods Summary

check_list_pars(vals, name[, min_vals])

Validate step parameters that may take a 2-element list.

get_drizpars()

Load all drizzle-related parameter values into kwargs list.

process(input_data)

Run the resample step on the input data.

Attributes Documentation

class_alias = 'resample'
reference_file_types: list = []
spec = "\n        pixfrac = float(min=0.0, max=1.0, default=1.0)  # Pixel shrinkage factor\n        kernel = option('square','gaussian','point','turbo','lanczos2','lanczos3',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        crpix = float_list(min=2, max=2, default=None)  # 0-based image coordinates of the reference pixel\n        crval = float_list(min=2, max=2, default=None)  # world coordinates of the reference pixel\n        rotation = float(default=None)  # Output image Y-axis PA relative to North\n        pixel_scale_ratio = float(default=1.0)  # Ratio of output to input pixel scale.\n        pixel_scale = float(default=None)  # Absolute pixel scale in arcsec\n        output_wcs = string(default='')  # Custom output WCS. Overrides other WCS parameters if provided.\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        enable_ctx = boolean(default=True)  # Compute and report the context array\n        enable_err = boolean(default=True)  # Compute and report the err array\n        report_var = boolean(default=True)  # Report the variance array\n    "

Methods Documentation

static check_list_pars(vals, name, min_vals=None)[source]

Validate step parameters that may take a 2-element list.

Parameters:
valslist or None

Values to validate.

namestr

Parameter name.

min_valslist, optional

Minimum allowed values for the parameter. Must have 2 values.

Returns:
valueslist

The validated list of values.

Raises:
ValueError

If the values do not have expected values.

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_datastr, ImageModel, or any asn-type input loadable into ModelLibrary

Filename pointing to an ImageModel or an association, or the object itself.

Returns:
ModelLibrary or ImageModel

The final output data. If the single parameter is set to True, then this is a single ModelLibrary; otherwise, it is a ModelLibrary.

Notes

When supplied via output_wcs, a custom WCS overrides other custom WCS parameters such as output_shape (now computed from by output_wcs.bounding_box) and crpix.