astrobase.magnitudes module

Contains various useful functions for converting between magnitude systems.

astrobase.magnitudes.convert_constants(jmag, hmag, kmag, cjhk, cjh, cjk, chk, cj, ch, ck)[source]

This converts between JHK and BVRI/SDSS mags.

Not meant to be used directly. See the functions below for more sensible interface. This function does the grunt work of converting from JHK to either BVRI or SDSS ugriz. while taking care of missing values for any of jmag, hmag, or kmag.

Parameters:
  • jmag,hmag,kmag (float) – 2MASS J, H, Ks mags to use to convert.
  • cjhk,cjh,cjk,chk,cj,ch,ck (lists) – Constants to use when converting.
Returns:

The converted magnitude in SDSS or BVRI system.

Return type:

float

astrobase.magnitudes.jhk_to_bmag(jmag, hmag, kmag)[source]

Converts given J, H, Ks mags to a B magnitude value.

Parameters:jmag,hmag,kmag (float) – 2MASS J, H, Ks mags of the object.
Returns:The converted B band magnitude.
Return type:float
astrobase.magnitudes.jhk_to_vmag(jmag, hmag, kmag)[source]

Converts given J, H, Ks mags to a V magnitude value.

Parameters:jmag,hmag,kmag (float) – 2MASS J, H, Ks mags of the object.
Returns:The converted V band magnitude.
Return type:float
astrobase.magnitudes.jhk_to_rmag(jmag, hmag, kmag)[source]

Converts given J, H, Ks mags to an R magnitude value.

Parameters:jmag,hmag,kmag (float) – 2MASS J, H, Ks mags of the object.
Returns:The converted R band magnitude.
Return type:float
astrobase.magnitudes.jhk_to_imag(jmag, hmag, kmag)[source]

Converts given J, H, Ks mags to an I magnitude value.

Parameters:jmag,hmag,kmag (float) – 2MASS J, H, Ks mags of the object.
Returns:The converted I band magnitude.
Return type:float
astrobase.magnitudes.jhk_to_sdssu(jmag, hmag, kmag)[source]

Converts given J, H, Ks mags to an SDSS u magnitude value.

Parameters:jmag,hmag,kmag (float) – 2MASS J, H, Ks mags of the object.
Returns:The converted SDSS u band magnitude.
Return type:float
astrobase.magnitudes.jhk_to_sdssg(jmag, hmag, kmag)[source]

Converts given J, H, Ks mags to an SDSS g magnitude value.

Parameters:jmag,hmag,kmag (float) – 2MASS J, H, Ks mags of the object.
Returns:The converted SDSS g band magnitude.
Return type:float
astrobase.magnitudes.jhk_to_sdssr(jmag, hmag, kmag)[source]

Converts given J, H, Ks mags to an SDSS r magnitude value.

Parameters:jmag,hmag,kmag (float) – 2MASS J, H, Ks mags of the object.
Returns:The converted SDSS r band magnitude.
Return type:float
astrobase.magnitudes.jhk_to_sdssi(jmag, hmag, kmag)[source]

Converts given J, H, Ks mags to an SDSS i magnitude value.

Parameters:jmag,hmag,kmag (float) – 2MASS J, H, Ks mags of the object.
Returns:The converted SDSS i band magnitude.
Return type:float
astrobase.magnitudes.jhk_to_sdssz(jmag, hmag, kmag)[source]

Converts given J, H, Ks mags to an SDSS z magnitude value.

Parameters:jmag,hmag,kmag (float) – 2MASS J, H, Ks mags of the object.
Returns:The converted SDSS z band magnitude.
Return type:float
astrobase.magnitudes.absolute_gaia_magnitude(gaia_mag, gaia_parallax_mas, gaia_mag_err=None, gaia_parallax_err_mas=None)[source]

Calculates the GAIA absolute magnitude for object (or array of objects).

Given a G mag and the parallax measured by GAIA, gets the absolute mag using the usual equation:

G - M_G = 5 x log10(d_pc) - 5
M_G = 5 - 5log10(d_pc) + G
Parameters:
  • gaia_mag (float or array-like) – The measured GAIA G magnitude.
  • gaia_parallax_max (float or array-like) – The measured parallax of the object in mas.
  • gaia_mag_err (float or array-like or None) – The measurement error in GAIA G magnitude.
  • gaia_parallax_err_mas (float or array-like or None) – The measurement error in GAIA parallax in mas.
Returns:

  • float or array-like – The absolute magnitude M_G of the object(s).
  • If both _err input kwargs are provided, will return a tuple of the form:: – (M_G float or array-like, M_G_err float or array-like)