gaia-dpci / GaiaXPy

Gaia BP/RP spectra package
BSD 3-Clause "New" or "Revised" License
36 stars 9 forks source link

Error requesting Gaia_DR3_Vega photometry when error_correction=True after additional photometric systems loaded #83

Closed druzm closed 6 months ago

druzm commented 6 months ago

When using the generate function with error correction enabled with PhotometricSystem.Gaia_DR3_Vega in the photometric_system input, and only after the user has loaded additional photometric systems, the Gaia_DR3_Vega system is unexpectedly removed from the data, which raises an AttributeError when correcting the systems. This bug has been fixed in the dev branch but should be propagated to the main branch.

To reproduce:

from gaiaxpy import load_additional_systems, PhotometricSystem, generate

f = '/path/to/xp_cont_raw_data'
PhotometricSystem = load_additional_systems('/path/to/additional_filters_dir')

phot_systems = [PhotometricSystem.Gaia_DR3_Vega]
generate(f, photometric_system=phot_systems, save_file=False, error_correction=True)

Expected behavior: The program should generate corrected photometry for all of the systems requested in photometric_system.

Additional context: Bug internally reported by Giuseppe Altavilla in September 2023.

druzm commented 6 months ago

Pipeline fixed in commit https://github.com/gaia-dpci/GaiaXPy/commit/dad780d49f0745cbb85418d04ef12f83d5c03e6b.