I am working on the GAIA XP sampled spectral data and want to implement XP spectrum correction for extinction. I would like to check if my approach is correct as I am not an astronomer. I followed the gaia documentation here
assuming that the XP spectra $f(\lambda)$ is the observed flux, the corrected $F(\lambda)$ can be computed by $$ F(\lambda)=f(\lambda)⋅10^{0.4A_0 A(\lambda)/3.1} $$
Where $A_0$ is azero_gspphot
from here. $A(\lambda)$ is the extinction curve for $\lambda$ in the same range as the sampled XP spectra, but converted to $Å$.
This is my code in python
# wavelengths for xp spectra range in nm
wavelengths = np.arange(336, 1021, 2)
# extinction curve using fitzpatrick99
# convert nm to angstrom
ext_curve = extinction.fitzpatrick99(wavelengths * 10, 1., 3.1)
# get star info. eg source id 2080220238201704832
star = {
flux: np.array([...]), # array of size 343 representing the sampled xp spectra from
azero: 0.1336,
}
# extinction factor
extinguish = 10** (0.4 * star.azero * ext_curve / 3.1)
corrected_flux = star.flux * extinguish
# plot
plt.plot(wavelengths, star.flux, label="observed")
plt.plot(wavelengths, corrected_flux)
my questions:
According to the documentation here the XP spectra flux is given in $W m^{−2} nm^{−1}$ and $A_0$ is a magnitude quantity. Is there any units conversion I should be doing?
Is my assumption that $f(\lambda)$ is the XP spectra? therefore using $0.4$ instead of $-0.4$ in the extinction factor exponent?
Is the extinction factor exponent correct? particularly the division by 3.1? I saw a few other tutorials that do not include it. I am not sure if that means it is implicitly there in the library they used or if they're using a different approach.
Should convoluting with a filtering kernel (e.g., hydrogen alpha emission) be applied to the XP spectra after the extinction correction?
Thank you