# How can I calculate the uncertainties in magnitude like the CDS does?

When you check an entry of the Gaia DR2 stellar catalogue in Vizier, for example this one, you can see that there is a value for the G magnitude (in our case 18.0733 mag) and a value for the uncertainty on that (in our case 0.0023 mag). The thing is that the G value is part of Gaia DR2 but the uncertainty is not, it was calculated by the CDS for Vizier (using the values presented for the flux as far as I can understand). I have two small related questions:

1. How does the CDS calculate the value from the uncertainty exactly? at least so that the one given by the CDS and the calculated one agree to the fourth decimal.

2. Is there a way in astropy or astroquery to retrieve the photometric uncertainty value from the catalog? Or do I have to calculate it as in the first question?

• Swike, please dont override my edits that remove useless salutation as policy states they should be removed Jun 19 at 20:08
• I don't find courtesy a useless thing. But anyways, I approve your edit if it is such a burden to have a four word "salutation". Jun 19 at 21:28
• Others disagree Jun 19 at 23:49

That is because what is measured is a flux and the flux errors are in the DR2 catalogue.

Since magnitudes are based on the logarithm of the flux, then there is no straightforward correspondence (although it matters little if the error bars are less than a few hundredths if a magnitude).

Simple error propagation formulae give $$|\Delta G| \simeq \frac{2.5}{\ln 10} \left(\frac{\Delta f}{f}\right),$$ where $$f$$ is the flux in the G band.

This gives $$\Delta G= 0.0023(1)$$ for your example. Other algorithms give almost the same result, e.g. taking the average of the $$\pm \Delta G$$ from using $$\pm \Delta f$$ to calculate the magnitude.

If the difference between the algorithms (they do give differing results when the flux error exceeds $$\sim 10$$%), or the fact that the true error is asymmetric in magnitude are important, then you shouldn't be using the symmetric magnitude error bar from CDS.

For Gaia EDR3：

Note (G1): Note on magnitude errors:

They are obtained with a simple propagation of errors with the formulas

e_Gmag   = sqrt((-2.5/ln(10)*e_FG/FG)**2 + sigmaG_0**2)
e_GBPmag = sqrt((-2.5/ln(10)*e_FGBP/FGBP)**2 + sigmaGBP_0**2))
e_GRPmag = sqrt((-2.5/ln(10)*e_FGRP/FGRP)**2 + sigmaGRP_0**2))


with the G, G_BP, G_RP zero point uncertainties

sigmaG_0 = 0.0027553202
sigmaGBP_0 = 0.0027901700
sigmaGRP_0 = 0.0037793818


See https://www.cosmos.esa.int/web/gaia/edr3-passbands for more details