zkbt / chromatic

Tools for visualizing spectrosopic light curves, with flux as a function of wavelength and time.
MIT License
14 stars 4 forks source link

use `ok` in `normalize` #223

Closed zkbt closed 1 year ago

zkbt commented 1 year ago
zkbt commented 1 year ago

@catrionamurray , this should now at least ignore values that are not ok in the normalization. It will still happily normalize by a negative number and therefore produce negative uncertainties, but at least it warns you about it now. I think for the vast majority of applications you could probably consider negative median flux as making a wavelength effectively useless.

catrionamurray commented 1 year ago

This is great, thank you! I think that maybe a statement in the init file is missing? Should there be from .fluxlike import * in the /get/init.py?

zkbt commented 1 year ago

Oh, yeah, I guess so. I think it works for me without it because the only place it's needed is as a direct import into the Rainbow class definition...

https://github.com/zkbt/chromatic/blob/567e1319414d0b37935b2ca061efe78d67fcad6e/chromatic/rainbows/rainbow.py#L1018

...but it's possible that including in the get/__init__.py helps for some other versions of Python?

zkbt commented 1 year ago

(Just updated this directly in the develop branch).