proj_plane_pixel_area#

astropy.wcs.utils.proj_plane_pixel_area(wcs)[source]#

For a celestial WCS (see astropy.wcs.WCS.celestial) returns pixel area of the image pixel at the CRPIX location once it is projected onto the “plane of intermediate world coordinates” as defined in Greisen & Calabretta 2002, A&A, 395, 1061.

Note

This function is concerned only about the transformation “image plane”->”projection plane” and not about the transformation “celestial sphere”->”projection plane”->”image plane”. Therefore, this function ignores distortions arising due to non-linear nature of most projections.

Note

In order to compute the area of pixels corresponding to celestial axes only, this function uses the celestial WCS object of the input wcs. This is different from the proj_plane_pixel_scales function that computes the scales for the axes of the input WCS itself.

Parameters:
wcsWCS

A world coordinate system object.

Returns:
areafloat

Area (in the projection plane) of the pixel at CRPIX location. The units of the returned result are the same as the units of the cdelt, crval, and cd for the celestial WCS and can be obtained by inquiring the value of cunit property of the celestial WCS object.

Raises:
ValueError

Pixel area is defined only for 2D pixels. Most likely the cd matrix of the celestial WCS is not a square matrix of second order.

Notes

Depending on the application, square root of the pixel area can be used to represent a single pixel scale of an equivalent square pixel whose area is equal to the area of a generally non-square pixel.