Details
-
Type:
Story
-
Status: To Do
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: afw
-
Labels:None
-
Story Points:2
-
Epic Link:
-
Team:Alert Production
Description
Calib.h has a handful of free functions for converting between physical flux and magnitude (abMagFromFlux, fluxFromABMag) and their errors (abMagErrFromFluxErr and fluxErrFromABMagErr). The former two are used 10 times total outside of Calib and its tests, the latter two are used 8 times (error uses are in PhotoCalTask and fgcmcal). The flux/mag conversions can be trivially replaced by astropy (e.g. (flux*units.Jy).to_value(units.ABmag)), but it's less clear what to do with the error calculations. Unfortunately astropy doesn't support that error propagation directly (though I'm sure they'd be happy to take a PR from us) to do so.
lsst.afw.image doesn't seem like the right place for them to live. Possibly lsst.utils? They'll get more useful names (e.g. nanojanskyErrToABMagErr, abMagErrToNanojanskyErr?) too.
Replacing the flux/mag functions with astropy.units blocks DM-10156.
Attachments
Issue Links
- is blocked by
-
DM-10156 Replace all uses of Calib with PhotoCalib
- Done
I'm not sure why these can't live in lsst.afw.image, because that's where PhotoCalib lives, and these routines are clearly related to that. Certainly it's where I would think to look for these sorts of routines.
And (at the risk of repeating myself) I think that if we need/have convenience functions for the errors, we would want convenience functions for the transformations as well, even if they are trivial wrappers around astropy.units.