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_shapeor theshapeargument.- 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:
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_shapeor theshape) and projects it to world coordinates. It then usesspherical_geometryto compute the area of the polygon defined by this outline on the sky. In order to minimize errors due to distortions in thewcs, 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.