CatalogSource¶
- class nsb2.core.sources.CatalogSource[source]¶
Bases:
SourceResolved point sources from a photometric catalogue.
Positions are indexed by a ball tree on the unit sphere, so that the per-pixel cone searches stay tractable for catalogues of millions of stars.
build_balltree()must be called before querying.- Parameters:
coords (astropy.coordinates.SkyCoord) – Source positions, shape
(N,).weight (astropy.units.Quantity) – Brightness weights, shape
(N,)or(N, C_w).data (numpy.ndarray) – Spectral grid coordinates, shape
(N,)or(N, D).spectral_grid (nsb2.core.spectral.SpectralGrid) – Grid the spectral coordinates refer to.
name (str, optional) – Identifier for the source. Defaults to the class name.
See also
from_photometric_catalogBuild one from magnitudes and colours.
Attributes Summary
Spectra of this source's emitters.
Methods Summary
apply_space_motion(time)Propagate the catalogue positions to a new epoch.
Build the spatial index used by the query methods.
from_photometric_catalog(coords, magnitude, ...)Build a catalogue source from magnitudes and colour indices.
query_direct(observation, pixel_coords, ...)Cone-search the catalogue around each pixel centre.
query_scattered(observation[, nside])Select every catalogue source above the horizon.
to_map(nside)Bin the catalogue into a HEALPix radiance map.
Attributes Documentation
- spectral_grid¶
Spectra of this source’s emitters.
Methods Documentation
- apply_space_motion(time)[source]¶
Propagate the catalogue positions to a new epoch.
Rebuilds the spatial index afterwards. Unlike the query methods, this mutates the source in place.
- Parameters:
time (astropy.time.Time) – Epoch to propagate the positions to.
- build_balltree()[source]¶
Build the spatial index used by the query methods.
Must be called once before
query_direct()orquery_scattered(), and again after the positions change.
- classmethod from_photometric_catalog(coords, magnitude, color, spectral_library, name='')[source]¶
Build a catalogue source from magnitudes and colour indices.
- Parameters:
coords (astropy.coordinates.SkyCoord) – Source positions, shape
(N,).magnitude (list) –
[bandpass, values]: the passband the magnitudes are measured in, and the magnitude of each source.color (list) –
[[blue_band, red_band], values]: the two passbands defining the colour index, and the index of each source.spectral_library (nsb2.core.spectral.SpectralGrid) – Template spectra, e.g. from
nsb2.core.photometry.PicklesTRDSAtlas1998().name (str, optional) – Identifier for the source. Defaults to the class name.
- Returns:
Source whose spectra are interpolated by colour index.
- Return type:
- query_direct(observation, pixel_coords, pixel_radii)[source]¶
Cone-search the catalogue around each pixel centre.
See
Source.query_direct()for the parameters and returns.
- query_scattered(observation, nside=64)[source]¶
Select every catalogue source above the horizon.
See
Source.query_scattered()for the parameters and returns.nsideis unused, since the catalogue is already discrete.
- to_map(nside)[source]¶
Bin the catalogue into a HEALPix radiance map.
Faint stars are far too numerous to trace individually but too dim to resolve, so binning them into a map and treating them as diffuse emission is both cheaper and closer to what the instrument sees. Spectral coordinates are averaged with brightness weighting, and missing ones are replaced by the catalogue mean.
Uses the HEALPix pixelisation [Gorski2005] through healpy [Zonca2019]; see Acknowledgements.
- Parameters:
nside (int) – HEALPix resolution of the output map.
- Returns:
The binned map, with brightness converted to a radiance by dividing by the pixel solid angle.
- Return type:
- classmethod __new__(*args, **kwargs)¶