estimate_pixel_scale_ratio¶
- drizzle.utils.estimate_pixel_scale_ratio(wcs_from, wcs_to, refpix_from=None, refpix_to=None)[source]¶
Compute the ratio of the pixel scale of the “to” WCS at the
refpix_toposition to the pixel scale of the “from” WCS at therefpix_fromposition. Pixel scale ratio, when requested, is computed near the centers of the bounding box (a property of the WCS object) or nearrefpix_*coordinates if supplied.Pixel scale is estimated as the square root of pixel’s area, i.e., pixels are assumed to have a square shape at the reference pixel position. If input reference pixel position for a WCS is None, it will be taken as the center of the bounding box if
wcs_*has a bounding box defined, or as the center of the box defined by thepixel_shapeattribute of the input WCS ifpixel_shapeis defined (not None), or at pixel coordinates(0, 0).- Parameters:
wcs_from (wcs) – A WCS object representing the coordinate system you are converting from. This object must have
pixel_shapeproperty defined.wcs_to (wcs) – A WCS object representing the coordinate system you are converting to.
refpix_from (numpy.ndarray, tuple, list) – Image coordinates of the reference pixel near which pixel scale should be computed in the “from” image. In FITS WCS this could be, for example, the value of CRPIX of the
wcs_fromWCS.refpix_to (numpy.ndarray, tuple, list) – Image coordinates of the reference pixel near which pixel scale should be computed in the “to” image. In FITS WCS this could be, for example, the value of CRPIX of the
wcs_toWCS.
- Returns:
pixel_scale_ratio – Estimate the ratio of “to” to “from” WCS pixel scales. This value is returned only when
estimate_pixel_scale_ratiois True.- Return type:
float