wcs_from_footprints¶
- stcal.alignment.wcs_from_footprints(dmodels, refmodel=None, transform=None, bounding_box=None, pscale_ratio=None, pscale=None, rotation=None, shape=None, crpix=None, crval=None)[source]¶
Create a WCS from a list of input datamodels.
A fiducial point in the output coordinate frame is created from the footprints of all WCS objects. For a spatial frame this is the center of the union of the footprints. For a spectral frame the fiducial is in the beginning of the footprint range. If
refmodel
is None, the first WCS object in the list is considered a reference. The output coordinate frame and projection (for celestial frames) is taken fromrefmodel
. Iftransform
is not supplied, a compound transform is created using CDELTs and PC. Ifbounding_box
is not supplied, the bounding_box of the new WCS is computed from bounding_box of all input WCSs.- Parameters:
dmodels (list) – A list of valid datamodels.
refmodel – A valid datamodel whose WCS is used as reference for the creation of the output coordinate frame, projection, and scaling and rotation transforms. If not supplied the first model in the list is used as
refmodel
.transform (Model) – A transform, passed to
gwcs.wcstools.wcs_from_fiducial()
If not supplied Scaling | Rotation is computed fromrefmodel
.bounding_box (tuple) – Bounding_box of the new WCS. If not supplied it is computed from the bounding_box of all inputs.
pscale_ratio (float, None) – Ratio of input to output pixel scale. Ignored when either
transform
orpscale
are provided.pscale (float, None) – Absolute pixel scale in degrees. When provided, overrides
pscale_ratio
. Ignored whentransform
is provided.rotation (float, None) – 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 when
transform
is provided.shape (tuple of int, None) – Shape of the image (data array) using
numpy.ndarray
convention (ny
first andnx
second). This value will be assigned topixel_shape
andarray_shape
properties of the returned WCS object.crpix (tuple of float, None) – Position of the reference pixel in the 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) – Right ascension and declination of the reference pixel. Automatically computed if not provided.
- Returns:
wcs_new – The WCS object corresponding to the combined input footprints.
- Return type: