compute_mean_pixel_area

stcal.resample.compute_mean_pixel_area(wcs, shape=None)[source]

Compute mean pixel area.

Computes the average pixel area (in steradians) based on input WCS using pixels within either the bounding box (if available) or the entire data array as defined either by wcs.array_shape or the shape argument.

Parameters:

shape (tuple, optional) – Shape of the region over which average pixel area will be computed. When not provided, pixel average will be estimated over a region defined by wcs.array_shape.

Returns:

pix_area – Pixel area in steradians.

Return type:

float

Notes

This function takes the outline of the region in which the average is computed (a rectangle defined by either the bounding box or wcs.array_shape or the shape) and projects it to world coordinates. It then uses spherical_geometry to compute the area of the polygon defined by this outline on the sky. In order to minimize errors due to distortions in the wcs, the code defines the outline using pixels spaced no more than 15 pixels apart along the border of the rectangle in which the average is computed.