cylammarco / ASPIRED

Automated SpectroPhotometric Image REDuction (ASPIRED)
https://aspired.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
30 stars 4 forks source link

v0.4.9 Logging error for science and standard airmass in apply_atmospheric_extinction_correction() #113

Closed rjs3273 closed 1 year ago

rjs3273 commented 1 year ago

Trivial. Not sure it is even really a 'bug'. Maybe just 'documentation'

When I specify airmasses on apply_atmospheric_extinction_correction(), it appears to use the wrong value.

target1D.apply_atmospheric_extinction_correction(science_airmass=1.5, standard_airmass=1.0)
[Wed, 05 Apr 2023 10:30:34] INFO [onedspec.py:5178] Standard airmass is set to be 1.0.
[Wed, 05 Apr 2023 10:30:34] INFO [onedspec.py:5247] Science airmass is set to be 1.0.

In fact I think it is using the correct values. It is only the log message that is printing standard_airmass twice.

I installed what I understand to be the latest stable version 0.4.9. I see that the apply_atmospheric_extinction_correction() code is quite different in the 0.5 branch. Would I be better to just install and use that?

cylammarco commented 1 year ago

In v0.4, the atmospheric correction is directly modifying the spectrum; while in v0.5, the atmospheric extinction corrected spectrum is stored separately. So there is a small API difference. I would recommend using v0.5.X development version at this point, it is getting close to releasing v0.5.0.

rjs3273 commented 1 year ago

Thanks. I will look again at 0.5. I tried it very briefly yesterday and had some other unrelated problem that I now cannot remember. I'll move over to 0.5 and open another issue if need be.

cylammarco commented 1 year ago

And indeed, the standard's airmass is used twice by the logger, but the correct value is used. Fixed in dev 0.4.X 2226826.