Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-23841: Add option to have Mag use calibrated fluxes #358

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions python/lsst/pipe/tasks/functors.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,14 +521,17 @@ class Mag(Functor):
`'modelfit_CModel'` instead of `'modelfit_CModel_instFlux'`) and it will
understand.
calib : `lsst.afw.image.calib.Calib` (optional)
Object that knows zero point.
Object that knows zero point. If `False`, then flux column is assumed
to be already calibrated (e.g., ZP=1.).
"""
_defaultDataset = 'meas'

def __init__(self, col, calib=None, **kwargs):
self.col = fluxName(col)
self.calib = calib
if calib is not None:
if calib is False:
self.fluxMag0 = 1.
elif calib is not None:
self.fluxMag0 = calib.getFluxMag0()[0]
else:
# TO DO: DM-21955 Replace hard coded photometic calibration values
Expand Down Expand Up @@ -560,15 +563,16 @@ class MagErr(Mag):
col : `str`
Name of flux column
calib : `lsst.afw.image.calib.Calib` (optional)
Object that knows zero point.
Object that knows zero point. If `False` or `None` (default),
then flux ZP error is assumed to be zero.
"""

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if self.calib is not None:
self.fluxMag0Err = self.calib.getFluxMag0()[1]
else:
if not self.calib:
self.fluxMag0Err = 0.
else:
self.fluxMag0Err = self.calib.getFluxMag0()[1]

@property
def columns(self):
Expand Down