hats.inspection#

Submodules#

Functions#

plot_density(catalog, *[, plot_title, order, unit])

Create a visual map of the density of input points of a catalog on-disk.

plot_moc(→ tuple[matplotlib.figure.Figure, ...)

Plots a moc

plot_pixel_list(pixels[, plot_title, projection, ...])

Create a visual map of the pixel density of a list of pixels.

plot_pixels(catalog[, plot_title])

Create a visual map of the pixel density of the catalog.

Package Contents#

plot_density(catalog: hats.catalog.healpix_dataset.healpix_dataset.HealpixDataset | hats.catalog.catalog_collection.CatalogCollection | None, *, plot_title: str | None = None, order=None, unit=None, **kwargs)[source]#

Create a visual map of the density of input points of a catalog on-disk.

Parameters:
catalog: HealpixDataset | CatalogCollection | None

on-disk catalog object or collection

plot_titlestr | None

Optional title for the plot

orderint

Optionally reduce the display healpix order, and aggregate smaller tiles. (Default value = None)

unitastropy.units.Unit

Unit to show for the angle for angular density. (Default value = None)

**kwargs

Additional args to pass to plot_healpix_map

Raises:
ImportError

if matplotlib is not installed in the current environment.

ValueError

if an in-memory-only catalog is provided.

plot_moc(moc: mocpy.MOC, *, projection: str = 'MOL', title: str = '', fov: astropy.units.Quantity | tuple[astropy.units.Quantity, astropy.units.Quantity] = None, center: astropy.coordinates.SkyCoord | None = None, wcs: astropy.wcs.WCS = None, frame_class: Type[astropy.visualization.wcsaxes.frame.BaseFrame] | None = None, ax: astropy.visualization.wcsaxes.WCSAxes | None = None, fig: matplotlib.figure.Figure | None = None, **kwargs) → tuple[matplotlib.figure.Figure, astropy.visualization.wcsaxes.WCSAxes][source]#

Plots a moc

By default, a new matplotlib figure and axis will be created, and the projection will be a Molleweide projection across the whole sky.

Parameters:
mocmocpy.MOC

MOC to plot

projectionstr

The projection to use in the WCS. Available projections listed at https://docs.astropy.org/en/stable/wcs/supported_projections.html (Default value = “MOL”)

titlestr

The title of the plot (Default value = “”)

fovQuantity | tuple[Quantity, Quantity] = None

The Field of View of the WCS. Must be an astropy Quantity with an angular unit, or a tuple of quantities for different longitude and latitude FOVs (Default covers the full sky)

centerSkyCoord | None

The center of the projection in the WCS (Default: SkyCoord(0, 0))

wcsWCS | None

The WCS to specify the projection of the plot. If used, all other WCS parameters are ignored and the parameters from the WCS object is used.

frame_classType[BaseFrame] | None

The class of the frame for the WCSAxes to be initialized with. if the ax kwarg is used, this value is ignored (By Default uses EllipticalFrame for full sky projection. If FOV is set, RectangularFrame is used)

axWCSAxes | None

The matplotlib axes to plot onto. If None, an axes will be created to be used. If specified, the axes must be an astropy WCSAxes, and the wcs parameter must be set with the WCS object used in the axes. (Default: None)

figFigure | None

The matplotlib figure to add the axes to. If None, one will be created, unless ax is specified (Default: None)

**kwargs

Additional kwargs to pass to mocpy.MOC.fill

Returns:
Tuple[Figure, WCSAxes]

The figure and axes used to plot the healpix map

Raises:
ImportError

if matplotlib is not installed in the current environment.

plot_pixel_list(pixels: list[hats.pixel_math.HealpixPixel], plot_title: str = '', projection='MOL', color_by_order=True, **kwargs)[source]#

Create a visual map of the pixel density of a list of pixels.

Parameters:
pixelslist[HealpixPixel]

healpix pixels (order and pixel number) to visualize

plot_titlestr

(Default value = “”) heading for the plot

projectionstr

The projection to use. Available projections listed at https://docs.astropy.org/en/stable/wcs/supported_projections.html (Default value = “MOL”)

color_by_orderbool

Whether to color the pixels by their order. True by default.

**kwargs

Additional args to pass to plot_healpix_map

Raises:
ImportError

if matplotlib is not installed in the current environment.

plot_pixels(catalog: hats.catalog.healpix_dataset.healpix_dataset.HealpixDataset | hats.catalog.catalog_collection.CatalogCollection, plot_title: str | None = None, **kwargs)[source]#

Create a visual map of the pixel density of the catalog.

Parameters:
plot_titlestr | None

Optional title for the plot

catalog: HealpixDataset | CatalogCollection

on-disk or in-memory catalog, or collection, with healpix pixels.

**kwargs

Additional args to pass to plot_healpix_map