Skip to content

Commit

Permalink
Merge pull request #132 from lsst/tickets/DM-10156
Browse files Browse the repository at this point in the history
DM-10156: Replace all uses of Calib with PhotoCalib
  • Loading branch information
parejkoj committed Apr 5, 2019
2 parents be0b4f5 + 3097e0c commit 8a03198
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bin.src/plot_photoCalib.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def makePhotoCalibImages(visit, butler, step=8, chips=[], tract=None,
if meanCalib:
meanCalibScaling = 0
for ccd in chips:
calib = butler.get('calexp_calib', dataId=dict(visit=int(visit), ccd=int(ccd), tract=tract))
calib = butler.get('calexp_photoCalib', dataId=dict(visit=int(visit), ccd=int(ccd), tract=tract))
meanCalibScaling += calib.getFluxMag0()[0]
meanCalibScaling /= len(chips)
if verbose:
Expand Down
8 changes: 1 addition & 7 deletions python/lsst/jointcal/jointcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import lsst.utils
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
import lsst.afw.image as afwImage
from lsst.afw.image import fluxErrFromABMagErr
import lsst.afw.geom as afwGeom
import lsst.pex.exceptions as pexExceptions
Expand Down Expand Up @@ -417,16 +416,11 @@ def _build_ccdImage(self, dataRef, associations, jointcalControl):
visitInfo = dataRef.get('calexp_visitInfo')
detector = dataRef.get('calexp_detector')
ccdId = detector.getId()
calib = dataRef.get('calexp_calib')
photoCalib = dataRef.get('calexp_photoCalib')
tanWcs = dataRef.get('calexp_wcs')
bbox = dataRef.get('calexp_bbox')
filt = dataRef.get('calexp_filter')
filterName = filt.getName()
fluxMag0 = calib.getFluxMag0()
# TODO: need to scale these until DM-10153 is completed and PhotoCalib has replaced Calib entirely
referenceFlux = 1e23 * 10**(48.6 / -2.5) * 1e9
photoCalib = afwImage.PhotoCalib(referenceFlux/fluxMag0[0],
referenceFlux*fluxMag0[1]/fluxMag0[0]**2, bbox)

goodSrc = self.sourceSelector.run(src)

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/jointcal/testUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def createTwoFakeCcdImages(num1=4, num2=4, seed=100, fakeCcdId=12,
seed : `int`, optional
Seed value for np.random.
fakeCcdId : `int`, optional
Sensor identifier to use for both CcdImages. The wcs, bbox, calib, etc.
Sensor identifier to use for both CcdImages. The wcs, bbox, photoCalib, etc.
will still be drawn from the CFHT ccd=12 files, as that is the only
testdata that is included in this simple test dataset.
photoCalibMean1, photoCalibMean2: `float`, optional
Expand Down
6 changes: 1 addition & 5 deletions python/lsst/jointcal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,7 @@ def compute(catalogs, photoCalibs):
# TODO: we can make this a listcomp again once DM-10153 is finished.
old_calibs = []
if self.do_photometry:
for ref in data_refs:
calib = ref.get('calexp_calib')
fluxMag0 = calib.getFluxMag0()
# TODO: the old Calib is defined in Jy, so convert to nJy (goes away post-DM-10153)
old_calibs.append(lsst.afw.image.PhotoCalib(1e9/fluxMag0[0], 1e9*fluxMag0[1]/fluxMag0[0]**2))
old_calibs = [ref.get('calexp_photoCalib') for ref in data_refs]

self.old_dist, self.old_flux, self.old_ref_flux, self.old_source = compute(old_cats, old_calibs)

Expand Down

0 comments on commit 8a03198

Please sign in to comment.