Open kelle opened 2 years ago
This is really hard because the specutils reader generally works. When it fails, it's not due to the units- it's due to the file itself.
We can however, consider something: do we force the units of a Spectrum1D object? That is, after specutils work, do we overwrite something like wave.unit to be whatever the database says? I'm not sure if it's possible, but we could consider it. Note, that it doesn't guarantee that we'll get anything better; I'm seeing flux units of erg s-1 cm-2 A-1
in the database which are likely to be interpreted as ampere rather than Ansgtroms...
I will point out that I added https://github.com/dr-rodriguez/SEDkitSIMPLE/blob/main/sedsimple.py#L162 to do a check for ampere and convert it if present. Not an elegant fix, but something to quickly address that issue.
Try getting units from units column in the spectrum table if
specutils
reader doesn't work.