tomasstolker / species

Toolkit for atmospheric characterization of directly imaged exoplanets
https://species.readthedocs.io
MIT License
22 stars 10 forks source link

[bug] Flux-To-Magnitude conversion: error propagation #64

Closed nenasedk closed 1 year ago

nenasedk commented 1 year ago

The conversion from flux to magnitude does not correctly calculate the uncertainty if the uncertainty is greater than the flux measurement, and the magnitude uncertainty will be nan (tries to take the log of a negative number).

Suggest adding a check if error>flux in line 474 of species.analysis.photometry, and if so, only return error_app_lower.

tomasstolker commented 1 year ago

Thanks a lot for pointing out this issue and the suggested fix!

I have implemented the fix in commit 7c785d8 ✅