Skip to content

Commit

Permalink
Removed Version0FlagMapper -- but still uses version 0 ref table
Browse files Browse the repository at this point in the history
  • Loading branch information
pgee committed Mar 14, 2015
1 parent 85c615b commit ae89fd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 1 addition & 5 deletions python/lsst/meas/astrom/catalogStarSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import lsst.afw.geom.ellipses as geomEllip
import lsst.afw.cameraGeom as cameraGeom
import lsst.meas.algorithms as measAlg
from lsst.meas.base import Version0FlagMapper

class CatalogStarSelectorConfig(pexConfig.Config):
fluxLim = pexConfig.Field(
Expand Down Expand Up @@ -140,10 +139,7 @@ def selectStars(self, exposure, sources, matches=None):
imageSize = exposure.getDimensions()
filterName = exposure.getFilter().getName()
calib = exposure.getCalib()
if sources.getVersion() == 0:
isGoodSource = CheckSource(sources, self._fluxLim, self._fluxMax, Version0FlagMapper(self._badStarPixelFlags))
else:
isGoodSource = CheckSource(sources, self._fluxLim, self._fluxMax, self._badStarPixelFlags)
isGoodSource = CheckSource(sources, self._fluxLim, self._fluxMax, self._badStarPixelFlags)

#
# Go through and find all the PSFs in the catalogue
Expand Down
9 changes: 5 additions & 4 deletions python/lsst/meas/photocal/PhotoCal.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import lsst.afw.table as afwTable
from lsst.afw.image import abMagFromFlux, abMagErrFromFluxErr, fluxFromABMag, Calib
import lsst.afw.display.ds9 as ds9
from lsst.meas.base.base import Version0FlagMapper
from lsst.meas.algorithms import getRefFluxField

def checkSourceFlags(source, sourceKeys):
Expand Down Expand Up @@ -244,17 +243,19 @@ def getSourceKeys(self, schema):
- badFlags: a list of keys for field names in self.config.badFlags
"""
fluxField = self.config.fluxField
goodFlags = [schema.find(name).key for name in self.config.goodFlags]
if schema.getVersion() == 0:
if fluxField == 'base_PsfFlux_flux': fluxField = "flux.psf"
flux = schema.find(fluxField).key
fluxErr = schema.find(fluxField + ".err").key
goodFlags = [schema.find(name).key for name in Version0FlagMapper(self.config.goodFlags)]
badFlags = [schema.find(name).key for name in Version0FlagMapper(self.config.badFlags)]
version0BadFlags=["flags.pixel.edge", "flags.pixel.interpolated.any",
"flags.pixel.saturated.any"]
badFlags = [schema.find(name).key for name in version0BadFlags]
else:
flux = schema.find(self.config.fluxField).key
fluxErr = schema.find(self.config.fluxField + "Sigma").key
goodFlags = [schema.find(name).key for name in self.config.goodFlags]
badFlags = [schema.find(name).key for name in self.config.badFlags]

return pipeBase.Struct(flux=flux, fluxErr=fluxErr, goodFlags=goodFlags, badFlags=badFlags)

@pipeBase.timeMethod
Expand Down

0 comments on commit ae89fd5

Please sign in to comment.