SelectionFunctionBase#

class gaiaunlimited.selectionfunctions.SelectionFunctionBase(ds)#

Bases: object

Base class for Gaia selection functions.

Selection function is defined as the selection probability as a function of Gaia G magnitude and healpix location, and optionally also on G-G_PR color.

We use xarray.Dataset as the main data structure to contain this multi-dimensional map of probabilities. This Dataset instance should be attach as .ds and have the following schema:

  • must contain data variable p and logitp for selection probability and logit of that selection probability.

  • must have coodinates
    • ipix for healpix id in int64 dtype

    • g for Gaia G magnitude

    • c for Gaia G - G_RP color

It is assumed that ipix is the full index array for the given healpix order with no missing index.

Attributes Summary

factors

Variables other than HEALPix id that define the selection function.

nside

Nside of the HEALPix.

order

Order of the HEALPix.

Methods Summary

from_conditions(conditions)

query(coords[, return_variance, fill_nan])

Query the selection function at the given coordinates.

Attributes Documentation

factors#

Variables other than HEALPix id that define the selection function.

nside#

Nside of the HEALPix.

order#

Order of the HEALPix.

Methods Documentation

classmethod from_conditions(conditions)#
query(coords, return_variance=False, fill_nan=False, **kwargs)#

Query the selection function at the given coordinates.

Parameters:

coords – sky coordinates as an astropy coordinates instance.

Other factors that determine this selection function should be given as keyword arguments of the same shape as coords.

Returns:

array of internal selection probabilities.

Return type:

np.array