NIRCAMBackwardGrismDispersion

class stdatamodels.jwst.transforms.NIRCAMBackwardGrismDispersion(orders, lmodels=None, xmodels=None, ymodels=None, inv_lmodels=None, inv_xmodels=None, inv_ymodels=None, sampling=40)

Bases: _BackwardGrismDispersionBase

Calculate the dispersion extent of NIRCAM pixels.

Initialize the model.

Parameters:
orderslist[int]

List of spectral orders corresponding to the dispersion models given by the lmodels, xmodels, and ymodels parameters.

lmodelslist[astropy.modeling.polynomial.Polynomial1D]

The forward dispersion polynomial models, one per order, such that wavelength = lmodel(t) computes the wavelength from the trace parameter. Only used if inv_lmodels is not set.

xmodelslist[astropy.modeling.polynomial.Polynomial1D] or list[list[astropy.modeling.polynomial.Polynomial2D]]

The models encoding the x-position of the spectral trace. Because the shape of the trace depends on the direct-image x0, y0 position, this takes the form dx = C0(x0, y0) + C1(x0, y0) * t + C2(x0, y0) * t^2. The inner list corresponds to the 2-D polynomials (C0, C1, C2). The outer list corresponds to the different spectral orders. Legacy calibrations of the trace did not encode the x0, y0 dependence; models of the form dx = xmodel(t) were used instead, and are also supported here.

ymodelslist[astropy.modeling.polynomial.Polynomial1D] or list[list[astropy.modeling.polynomial.Polynomial2D]]

The models encoding the y-position of the spectral trace. Because the shape of the trace depends on the direct-image x0, y0 position, this takes the form dy = C0(x0, y0) + C1(x0, y0) * t + C2(x0, y0) * t^2. The inner list corresponds to the 2-D polynomials (C0, C1, C2). The outer list corresponds to the different spectral orders. Legacy calibrations of the trace did not encode the x0, y0 dependence; models of the form dy = ymodel(t) were used instead, and are also supported here.

inv_lmodelslist[astropy.modeling.core.Model]

The inverse dispersion polynomial models, one per order, such that t = lmodel(wavelength) computes the trace parameter from the wavelength.

inv_xmodelslist[astropy.modeling.polynomial.Polynomial1D]

Not used for the backward transform.

inv_ymodelslist[astropy.modeling.polynomial.Polynomial1D]

Not used for the backward transform.

samplingint, optional

Number of sampling points in t to use; these will be linearly interpolated.

Methods Summary

evaluate(x, y, wavelength, order)

Transform from the direct image plane to the dispersed plane.

invdisp_interp(model, x0, y0, wavelength)

Make a polynomial fit to lmodel and interpolate to find the inverse dispersion.

Methods Documentation

evaluate(x, y, wavelength, order)

Transform from the direct image plane to the dispersed plane.

Parameters:
x, yfloat

Input x, y pixel(s). If a 2-D array, it is assumed that the model is being called on a grid where all wavelengths are the same along the first axis, and all the x,y coordinates are the same along the second axis. In this case, x0, y0, and wavelength must all have the same shape.

wavelengthfloat

Wavelength(s) in microns. If a 2-D array, it is assumed that the model is being called on a grid where all wavelengths are the same along the first axis, and all the x,y coordinates are the same along the second axis. In this case, x0, y0, and wavelength must all have the same shape.

orderint

Input spectral order

Returns:
x, yfloat or np.ndarray

The x, y values in the dispersed plane.

x0, y0float or np.ndarray

Source object x-center, y-center. Same as input x, y.

orderint

Output spectral order, same as input

invdisp_interp(model, x0, y0, wavelength)

Make a polynomial fit to lmodel and interpolate to find the inverse dispersion.

Parameters:
modeltuple[astropy.modeling.polynomial.Polynomial2D]

The models encoding the x, y dependence of the trace model’s polynomial coefficients.

x0, y0float or np.ndarray

Source object x-center, y-center. If a 2-D array, it is assumed that the model is being called on a grid where all wavelengths are the same along the first axis, and all the x,y coordinates are the same along the second axis. In this case, x0, y0, and wavelength must all have the same shape.

wavelengthfloat or np.ndarray

Wavelength(s) in microns. If a 2-D array, it is assumed that the model is being called on a grid where all wavelengths are the same along the first axis, and all the x,y coordinates are the same along the second axis. In this case, x0, y0, and wavelength must all have the same shape.

Returns:
t_outfloat

The inverse dispersion value for the given wavelength