resampled_wcs_from_models
- jwst.resample.resample_utils.resampled_wcs_from_models(input_models, pixel_scale_ratio=1.0, pixel_scale=None, output_shape=None, rotation=None, crpix=None, crval=None)[source]
Compute the WCS of the resampled image from input models and specified WCS parameters.
- Parameters:
input_models (
ModelLibrary
) – Each datamodel must have amodel.meta.wcs
set to a ~gwcs.WCS object.pixel_scale_ratio (float, optional) – Desired pixel scale ratio defined as the ratio of the desired output pixel scale to the first input model’s pixel scale computed from this model’s WCS at the fiducial point (taken as the
ref_ra
andref_dec
from thewcsinfo
meta attribute of the first input image). Ignored whenpixel_scale
is specified.pixel_scale (float, None, optional) – Desired pixel scale (in degrees) of the output WCS. When provided, overrides
pixel_scale_ratio
.output_shape (tuple of two integers (int, int), None, optional) – Shape of the image (data array) using
np.ndarray
convention (ny
first andnx
second). This value will be assigned topixel_shape
andarray_shape
properties of the returned WCS object.rotation (float, None, optional) – Position angle of output image’s Y-axis relative to North. A value of 0.0 would orient the final output image to be North up. The default of
None
specifies that the images will not be rotated, but will instead be resampled in the default orientation for the camera with the x and y axes of the resampled image corresponding approximately to the detector axes. Ignored whentransform
is provided.crpix (tuple of float, None, optional) – Position of the reference pixel in the resampled image array. If
crpix
is not specified, it will be set to the center of the bounding box of the returned WCS object.crval (tuple of float, None, optional) – Right ascension and declination of the reference pixel. Automatically computed if not provided.
- Returns:
wcs (~gwcs.wcs.WCS) – The WCS object corresponding to the combined input footprints.
pscale_in (float) – Computed pixel scale (in degrees) of the first input image.
pscale_out (float) – Computed pixel scale (in degrees) of the output image.
pixel_scale_ratio (float) – Pixel scale ratio (output to input).