psf_profile
- jwst.extract_1d.psf_profile.psf_profile(input_model, trace, wl_array, psf_ref_name, optimize_shifts=True, model_nod_pair=True)[source]
Create a spatial profile from a PSF reference.
Provides PSF-based profiles for point sources in slit-like data containing one positive trace and, optionally, one negative trace resulting from nod subtraction. The location of the positive trace should be provided in the
trace
input parameter; the negative trace location will be guessed from the input metadata. If a negative trace is modeled, it is recommended thatoptimize_shifts
also be set to True, to improve the initial guess for the trace location.- Parameters:
input_model (data model) – This can be either the input science file or one SlitModel out of a list of slits.
trace (ndarray or None) – Array of source cross-dispersion position values, one for each dispersion element in the input model data. If None, the source is assumed to be at the center of the slit.
wl_array (ndarray) – Array of wavelength values, matching the input model data shape, for each pixel in the array.
psf_ref_name (str) – PSF reference filename.
optimize_shifts (bool, optional) – If True, the spatial location of the trace will be optimized by minimizing the residuals in a scene model compared to the data in the first integration of
input_model
.model_nod_pair (bool, optional) – If True, and if background subtraction has taken place, a negative PSF will be modeled at the mirrored spatial location of the positive trace.
- Returns:
profile (ndarray) – Spatial profile matching the input data.
lower_limit (int) – Lower limit of the aperture in the cross-dispersion direction. For PSF profiles, this is always set to the lower edge of the bounding box, since the full array may have non-zero weight.
upper_limit (int) – Upper limit of the aperture in the cross-dispersion direction. For PSF profiles, this is always set to the upper edge of the bounding box, since the full array may have non-zero weight.