kammerje / spaceKLIP

Pipeline for reducing JWST high-contrast imaging data. Published in Kammerer et al. 2022 and Carter et al. 2022.
https://ui.adsabs.harvard.edu/abs/2022SPIE12180E..3NK/abstract
MIT License
16 stars 9 forks source link

photlam units need to be in lowercase #178

Closed wbalmer closed 1 month ago

wbalmer commented 1 month ago

William:

I'm getting an error in this line of starphot.get_stellar_magnitudes when trying to run extract_companions. I'm trying to figure out whether this is a bug I need to make an issue about or whether I've just mis-installed the new synphot/stsynphot/new webbpsf_ext. input_flux = u.Quantity(spec.sp_model.flux, str(spec.sp_model.fluxunits))

ValueError: 'PHOTLAM' did not parse as unit edit: input_flux = u.Quantity(spec.sp_model.flux, str(spec.sp_model.fluxunits).lower()) worked to fix this bug

Jarron:

yep, these are the fluxunits definitions in synphot.units:

synphot flux units

PHOTLAM = u.def_unit( 'photlam', u.photon / (u.cm2 u.s u.AA), format={'generic': 'PHOTLAM', 'console': 'PHOTLAM'}) PHOTNU = u.def_unit( 'photnu', u.photon / (u.cm2 u.s u.Hz), format={'generic': 'PHOTNU', 'console': 'PHOTNU'}) FLAM = u.def_unit( 'flam', u.erg / (u.cm2 u.s u.AA), format={'generic': 'FLAM', 'console': 'FLAM'}) FNU = u.def_unit( 'fnu', u.erg / (u.cm2 u.s u.Hz), format={'generic': 'FNU', 'console': 'FNU'})