Skip to content

Commit

Permalink
Merge pull request #28 from lsst/tickets/DM-37532
Browse files Browse the repository at this point in the history
DM-37532: Fix meas_base imports
  • Loading branch information
mwittgen committed Feb 11, 2023
2 parents 2b9520f + 5544741 commit 687cf57
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions python/lsst/meas/extensions/gaap/_gaap.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import lsst.afw.table as afwTable
import lsst.geom
import lsst.meas.base as measBase
from lsst.meas.base.fluxUtilities import FluxResultKey
import lsst.pex.config as pexConfig
from lsst.pex.exceptions import InvalidParameterError
import scipy.signal
Expand All @@ -44,7 +43,7 @@
PLUGIN_NAME = "ext_gaap_GaapFlux"


class GaapConvolutionError(measBase.exceptions.MeasurementError):
class GaapConvolutionError(measBase.MeasurementError):
"""Collection of any unexpected errors in GAaP during PSF Gaussianization.
The PSF Gaussianization procedure using `modelPsfMatchTask` may throw
Expand Down Expand Up @@ -290,7 +289,7 @@ def __init__(self, config: BaseGaapFluxConfig, name, schema, logName=None) -> No
for scalingFactor, sigma in itertools.product(config.scalingFactors, config.sigmas):
baseName = self.ConfigClass._getGaapResultName(scalingFactor, sigma, name)
doc = f"GAaP Flux with {sigma} aperture after multiplying the seeing by {scalingFactor}"
FluxResultKey.addFields(schema, name=baseName, doc=doc)
measBase.FluxResultKey.addFields(schema, name=baseName, doc=doc)

# Remove the prefix_ since FlagHandler prepends it
middleName = self.ConfigClass._getGaapResultName(scalingFactor, sigma)
Expand All @@ -304,7 +303,7 @@ def __init__(self, config: BaseGaapFluxConfig, name, schema, logName=None) -> No
for scalingFactor in config.scalingFactors:
baseName = self.ConfigClass._getGaapResultName(scalingFactor, "PsfFlux", name)
doc = f"GAaP Flux with PSF aperture after multiplying the seeing by {scalingFactor}"
FluxResultKey.addFields(schema, name=baseName, doc=doc)
measBase.FluxResultKey.addFields(schema, name=baseName, doc=doc)

# Remove the prefix_ since FlagHandler prepends it
middleName = self.ConfigClass._getGaapResultName(scalingFactor, "PsfFlux")
Expand All @@ -320,7 +319,7 @@ def __init__(self, config: BaseGaapFluxConfig, name, schema, logName=None) -> No
for scalingFactor in config.scalingFactors:
baseName = self.ConfigClass._getGaapResultName(scalingFactor, "Optimal", name)
docstring = f"GAaP Flux with optimal aperture after multiplying the seeing by {scalingFactor}"
FluxResultKey.addFields(schema, name=baseName, doc=docstring)
measBase.FluxResultKey.addFields(schema, name=baseName, doc=docstring)

# Remove the prefix_ since FlagHandler prepends it
middleName = self.ConfigClass._getGaapResultName(scalingFactor, "Optimal")
Expand Down Expand Up @@ -511,7 +510,7 @@ def _measureFlux(self, measRecord: lsst.afw.table.SourceRecord,
# Scale the quantities in fluxResult and copy result to record
fluxResult.instFlux *= fluxScaling
fluxResult.instFluxErr *= fluxScaling*fluxErrScaling
fluxResultKey = FluxResultKey(measRecord.schema[baseName])
fluxResultKey = measBase.FluxResultKey(measRecord.schema[baseName])
fluxResultKey.set(measRecord, fluxResult)

def _gaussianizeAndMeasure(self, measRecord: lsst.afw.table.SourceRecord,
Expand Down

0 comments on commit 687cf57

Please sign in to comment.