Exo-TiC / ExoTiC-LD

Limb-darkening package to calculate the coefficients for specific instruments, stars, and wavelength ranges
https://exotic-ld.readthedocs.io
MIT License
8 stars 6 forks source link

Corrupted phoenix spectra files #55

Open ben-cassese opened 1 month ago

ben-cassese commented 1 month ago

Hello, and congrats on the recent JOSS acceptance! This looks like a great package and I'm looking forward to using it in my research πŸ™‚

I noticed that a handful of the phoenix spectra hosted online seem to have been corrupted. I found eight in total:

Most of these are missing the first header line (which disrupts the skiprows here) though the last one seems to be missing data. When creating a StellarLimbDarkening object that relies on any of these files, it fails the StellarLimbDarkening._check_stellar_model() method that's called during __init__. For example:

sld = StellarLimbDarkening(
    M_H=-1.5,
    Teff=6900,
    logg=5.0,
    ld_model="phoenix",
    ld_data_path=EXOTIC_LD_PATH,
    interpolate_type="nearest",
    verbose=2,
)

produces the output that ends in an error message:

Input stellar parameters are M_H=-1.5, Teff=6900, logg=5.0. Loading stellar model from phoenix grid. Using interpolation type = nearest. Exact match found with M_H=-1.5, Teff=6900.0, logg=5.0. Downloading https://www.star.bris.ac.uk/exotic-ld-data/phoenix/MH-1.5/teff6900/logg5.0/phoenix_spectra.dat: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 81.0M/81.0M [00:53<00:00, 1.60MiB/s] Downloaded ExoTic_LD_data/phoenix/MH-1.5/teff6900/logg5.0/phoenix_spectra.dat. Stellar model loaded.

ValueError: mu values must have the same shape as stellar_intensities.shape[1].

I think these are the only spectra files with issues since all of the others (phoenix and the other grids) passed that check, but I didn't do any tests for problems that wouldn't be caught by that initial shape comparison. It'd be great if either these files could be fixed, or if their leaves could be removed from the phoenix KD tree. Thanks again!