SkyGroup¶
- class jwst.skymatch.skyimage.SkyGroup(images, id=None, sky=0.0)[source]
Bases:
object
Holds multiple
SkyImage
objects whose sky background values must be adjusted together.SkyGroup
provides methods for obtaining bounding polygon of the group ofSkyImage
objects and to compute sky value of the group.Attributes Summary
Set or get
SkyImage
'sid
.Get image's bounding polygon.
Get RA and DEC of the vertices of the bounding polygon as a
ndarray
of shape (N, 2) where N is the number of vertices + 1.Sky background value.
Methods Summary
append
(value)Appends a
SkyImage
to the group.calc_sky
([overlap, delta])Compute sky background value.
insert
(idx, value)Inserts a
SkyImage
into the group.intersection
(skyimage)Compute intersection of this
SkyImage
object and anotherSkyImage
,SkyGroup
, orSphericalPolygon
object.Attributes Documentation
- id¶
Set or get
SkyImage
’sid
.While
id
can be of any type, it is preferable thatid
be of a type with nice string representation.
- polygon¶
Get image’s bounding polygon.
- radec¶
Get RA and DEC of the vertices of the bounding polygon as a
ndarray
of shape (N, 2) where N is the number of vertices + 1.
Methods Documentation
- calc_sky(overlap=None, delta=True)[source]¶
Compute sky background value.
- Parameters:
overlap (SkyImage, SkyGroup, SphericalPolygon, list of tuples, None, optional) – Another
SkyImage
,SkyGroup
,spherical_geometry.polygons.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 byoverlap
. Whenoverlap
isNone
, 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 byoverlap
),skyval
will be set toNone
.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 of this
SkyImage
object and anotherSkyImage
,SkyGroup
, orSphericalPolygon
object.- Parameters:
skyimage (SkyImage, SkyGroup, SphericalPolygon) – Another object that should be intersected with this
SkyImage
.- Returns:
intersect_poly – A
SphericalPolygon
that is the intersection of thisSkyImage
andskyimage
.- Return type:
SphericalPolygon