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.
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.
Return a simple test Sources instance.
to_pixel(wcs)Convert the RA-DEC coordinates to pixel coordinates using the given WCS.
Attributes
centerMidpoint RA and DEC of the sources in degrees.
decDeclination coordinates of the sources.
raRight Ascension coordinates of the sources.
coordsSkyCoords instance with the RA and DEC coordinates of the sources.
fluxesAn array of shape (n,) containing the fluxes of the sources in units of photons/s/m².
ra_ratesOn-sky RA motion rates dα·cos(δ)/dt, shape (n,) in arcsec/s.
dec_ratesDec motion rates, shape (n,) in arcsec/s.