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 of SkyImage objects and to compute sky value of the group.

Attributes Summary

id

Set or get SkyImage's id.

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.

sky

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 another SkyImage, SkyGroup, or SphericalPolygon object.

Attributes Documentation

id

Set or get SkyImage’s id.

While id can be of any type, it is preferable that id 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.

sky

Sky background value. See calc_sky for more details.

Methods Documentation

append(value)[source]

Appends a SkyImage to the group.

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 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.

insert(idx, value)[source]

Inserts a SkyImage into the group.

intersection(skyimage)[source]

Compute intersection of this SkyImage object and another SkyImage, SkyGroup, or SphericalPolygon 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 this SkyImage and skyimage.

Return type:

SphericalPolygon