SkyGroup
- class stcal.skymatch.skyimage.SkyGroup(images, sky_id=None, sky=0.0)[source]
Bases:
objectCollection of
SkyImageobjects.Holds multiple
SkyImageobjects whose sky background values must be adjusted together.SkyGroup provides methods for obtaining bounding polygon of the group of
SkyImageobjects and to compute sky value of the group.Attributes Summary
Get image's bounding polygon.
RA and DEC of the bounding polygon.
Sky background value.
Methods Summary
append(value)Append a SkyImage to the group.
calc_sky([overlap, delta])Compute sky background value.
insert(idx, value)Insert a SkyImage into the group.
intersection(skyimage)Compute intersection.
Attributes Documentation
- polygon
Get image’s bounding polygon.
- radec
RA and DEC of the bounding polygon.
Get RA and DEC of the vertices of the bounding polygon as a ~numpy.ndarray of shape (N, 2) where N is the number of vertices + 1.
- sky
Sky background value. See calc_sky for more details.
Methods Documentation
- calc_sky(overlap=None, delta=True)[source]
Compute sky background value.
- Parameters:
overlap (SkyImage, SkyGroup, SphericalPolygon, list[tuple[typing.Any]], None, optional) – Another SkyImage, SkyGroup,
spherical_geometry.polygon.SphericalPolygon, or a list of tuples of (RA, DEC) of vertices of a spherical polygon. This parameter is used to indicate that sky statistics should computed only in the region of intersection of this image with the polygon indicated by overlap. When overlap is None, sky statistics will be computed over the entire image.delta (bool, optional) – Should this function return absolute sky value or the difference between the computed value and the value of the sky stored in the sky property.
- Returns:
skyval (float, None) – Computed sky value (absolute or relative to the sky attribute). If there are no valid data to perform this computations (e.g., because this image does not overlap with the image indicated by overlap), skyval will be set to None.
npix (int) – Number of pixels used to compute sky statistics.
polyarea (float) – Area (in srad) of the polygon that bounds data used to compute sky statistics.
- intersection(skyimage)[source]
Compute intersection.
Compute intersection of this SkyImage object and another SkyImage, SkyGroup, or
SphericalPolygonobject.- Parameters:
skyimage (SkyImage, SkyGroup, SphericalPolygon) – Another object that should be intersected with this SkyImage.
- Returns:
intersect_poly – A
SphericalPolygonthat is the intersection of this SkyImage and skyimage.- Return type:
SphericalPolygon