lsst.afw g7304ef7ade+559a34a84e
Loading...
Searching...
No Matches
Functions
lsst.afw.image.exposure.exposureUtils Namespace Reference

Functions

def bbox_to_convex_polygon (bbox, wcs, padding=10)
 
def bbox_contains_sky_coords (bbox, wcs, ra, dec, padding=10)
 

Function Documentation

◆ bbox_contains_sky_coords()

def lsst.afw.image.exposure.exposureUtils.bbox_contains_sky_coords (   bbox,
  wcs,
  ra,
  dec,
  padding = 10 
)
Check if a set of sky positions are in the bounding box.

This uses a two-step process: first check that the coordinates are
inside a padded version of the bbox projected on the sky, and then
project the remaining points onto the bbox, to avoid inverting
the WCS outside of the valid region. The default padding
size was chosen to be sufficient for the most warped detectors at
the edges of the HyperSuprimeCam focal plane.

Parameters
----------
bbox : `lsst.geom.Box2I`
    Pixel bounding box to check sky positions in.
wcs : `lsst.afw.image.SkyWcs`
    WCS associated with the bounding box.
ra : `astropy.Quantity`, (N,)
    Array of Right Ascension, angular units.
dec : `astropy.Quantity`, (N,)
    Array of Declination, angular units.
padding : `int`
   Pixel padding to ensure that bounding box is entirely contained
   within the resulting polygon.

Returns
-------
contained : `np.ndarray`, (N,)
   Boolean array indicating which points are contained in the
   bounding box.

Definition at line 60 of file exposureUtils.py.

◆ bbox_to_convex_polygon()

def lsst.afw.image.exposure.exposureUtils.bbox_to_convex_polygon (   bbox,
  wcs,
  padding = 10 
)
Convert a bounding box and wcs to a convex polygon on the sky, with paddding.

The returned polygon has additional padding to ensure that the
bounding box is entirely contained within it.  The default padding
size was chosen to be sufficient for the most warped detectors at
the edges of the HyperSuprimeCam focal plane.

Parameters
----------
bbox : `lsst.geom.Box2I`
    Bounding box to convert.
wcs : `lsst.afw.image.SkyWcs`
    WCS associated with the bounding box.
padding : `int`
   Pixel padding to ensure that bounding box is entirely contained
   within the resulting polygon.

Returns
-------
convex_polygon : `lsst.sphgeom.ConvexPolygon`
   Will be None if wcs is not valid.

Definition at line 29 of file exposureUtils.py.