CatalogSource

class nsb2.core.sources.CatalogSource[source]

Bases: Source

Resolved 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:

See also

from_photometric_catalog

Build one from magnitudes and colours.

Attributes Summary

spectral_grid

Spectra of this source's emitters.

Methods Summary

apply_space_motion(time)

Propagate the catalogue positions to a new epoch.

build_balltree()

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.

Type:

nsb2.core.spectral.SpectralGrid

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() or query_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:
Returns:

Source whose spectra are interpolated by colour index.

Return type:

CatalogSource

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. nside is 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:

HEALPixSource

__init__(coords, weight, data, spectral_grid, name='')[source]
classmethod __new__(*args, **kwargs)