U0Interpolator#
- class agabpylib.gaia.ruwetools.U0Interpolator#
Bases:
object
Class which holds functions that can used to calculate u0 values given the G-band magnitude only, or the G-band magnitude and the BP-RP colour of a source. The class initialization takes care of reading the necessary data and setting up the interpolators.
Methods Summary
get_u0
(gmag, bprp)Calculate the RUWE normalization factor u0 for the input G-band magnitude(s) and BP-RP colour(s).
get_u0_g
(gmag)Calculate the normalization factor u0 for the RUWE for the input G-band magnitude(s).
get_u0_g_col
(gmag, bprp[, asgrid])Calculate the u0 value for the input G-band magnitude(s) and BP-RP colour(s).
Methods Documentation
- get_u0(gmag, bprp)#
Calculate the RUWE normalization factor u0 for the input G-band magnitude(s) and BP-RP colour(s).
Attention
This is a version of get_u0_g_col that is robust against missing (BP-RP) values and against magnitudes and colours outside the interpolation range. Input values outside the interpolation range will be clamped to the corresponding edge of that range.
- Parameters:
gmag (float array) – Values of G (size n)
bprp (float array) – Values of BP-RP (size m)
- Returns:
u0 – The values of u0 evaluated at the input (G, BP-RP) combinations.
- Return type:
float array
- get_u0_g(gmag)#
Calculate the normalization factor u0 for the RUWE for the input G-band magnitude(s).
- Parameters:
gmag (float array) – Values of G
- Returns:
u0 – Array of u0 values evaluated at the input G-band magnitudes.
- Return type:
float array
- Raises:
ValueError – For input values outside the interpolation range.
- get_u0_g_col(gmag, bprp, asgrid=False)#
Calculate the u0 value for the input G-band magnitude(s) and BP-RP colour(s).
- Parameters:
gmag (float array) – Values of G (size n)
bprp (float array) – Values of BP-RP (size m)
asgrid (boolean) – If True treat the input gmag and bprp arrays as the coordinates for a 2D grid. If set to True the sizes of the input arrays n and m may be different. If set to False n=m is required.
- Returns:
u0 – The values of u0 evaluated at the input (G, BP-RP) combinations. The returned list consists of n values for
asgrid=False
and n*m otherwise.- Return type:
array-like
- Raises:
ValueError – For input values outside the interpolation range.