Sources

Contents

Sources#

class cabaret.Sources(coords: SkyCoord, fluxes: ndarray, ra_rates: ndarray | Quantity | None = None, dec_rates: ndarray | Quantity | None = None)[source]#

A collection of sources with their sky coordinates and fluxes.

Examples

Create a Sources instance from arrays:

>>> from cabaret.sources import Sources
>>> import numpy as np
>>> from astropy.coordinates import SkyCoord
>>> coords = np.array([[10.64, 41.26], [10.68, 41.22]])
>>> fluxes = np.array([169435.6, 52203.9])
>>> sources = Sources(SkyCoord(coords, unit='deg'), fluxes)
>>> sources
Sources(coords=<SkyCoord (ICRS): (ra, dec) in deg
    [(10.64, 41.26), (10.68, 41.22)]>, fluxes=array([169435.6,  52203.9]))

Methods

__init__(coords, fluxes[, ra_rates, dec_rates])

concat(*sources_list)

Concatenate multiple Sources objects into one.

drop_nan_fluxes()

Return a new Sources instance with any sources that have NaN fluxes removed.

from_arrays(ra, dec, fluxes[, units, ...])

Create a Sources instance from separate RA and DEC arrays.

get_test_sources()

Return a simple test Sources instance.

to_pixel(wcs)

Convert the RA-DEC coordinates to pixel coordinates using the given WCS.

Attributes

center

Midpoint RA and DEC of the sources in degrees.

dec

Declination coordinates of the sources.

ra

Right Ascension coordinates of the sources.

coords

SkyCoords instance with the RA and DEC coordinates of the sources.

fluxes

An array of shape (n,) containing the fluxes of the sources in units of photons/s/m².

ra_rates

On-sky RA motion rates dα·cos(δ)/dt, shape (n,) in arcsec/s.

dec_rates

Dec motion rates, shape (n,) in arcsec/s.