trace_from_wcs
- jwst.extract_1d.source_location.trace_from_wcs(exp_type, shape, bounding_box, wcs_ref, source_x, source_y, dispaxis)[source]
Calculate a source trace from WCS.
The source trace is calculated by projecting a fixed source positions onto detector pixels, to get a source location at each dispersion element. For MIRI LRS fixed slit and NIRSpec modes, this will be a curved trace, using the sky or slit frame as appropriate. For all other modes, a flat trace is returned, containing the cross-dispersion position at all dispersion elements.
- Parameters:
exp_type (str) – Exposure type for the input data.
shape (tuple of int) – 2D shape for the full input data array, (ny, nx).
bounding_box (tuple) – A pair of tuples, each consisting of two numbers. Represents the range of useful pixel values in both dimensions, ((xmin, xmax), (ymin, ymax)).
wcs_ref (
WCS
) – WCS for the input data model, containing sky and detector transforms, forward and backward.source_x (float) – X pixel coordinate for the target.
source_y (float) – Y pixel coordinate for the target.
dispaxis (int) – Dispersion axis.
- Returns:
trace – Pixel positions in the cross-dispersion direction of the trace for each dispersion pixel.
- Return type:
ndarray of float