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

Add default slot for PSF shape #98

Merged
merged 1 commit into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions python/lsst/meas/base/baseMeasurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class SourceSlotConfig(lsst.pex.config.Config):
doc="the name of the centroiding algorithm used to set source x,y")
shape = lsst.pex.config.Field(dtype=str, default="base_SdssShape", optional=True,
doc="the name of the algorithm used to set source moments parameters")
psfShape = lsst.pex.config.Field(dtype=str, default="base_SdssShape_psf", optional=True,
doc="the name of the algorithm used to set PSF moments parameters")
apFlux = lsst.pex.config.Field(dtype=str, default="base_CircularApertureFlux_12_0", optional=True,
doc="the name of the algorithm used to set the source aperture flux slot")
modelFlux = lsst.pex.config.Field(dtype=str, default="base_GaussianFlux", optional=True,
Expand All @@ -101,6 +103,8 @@ def setupSchema(self, schema):
aliases.set("slot_Centroid", self.centroid)
if self.shape is not None:
aliases.set("slot_Shape", self.shape)
if self.psfShape is not None:
aliases.set("slot_PsfShape", self.psfShape)
if self.apFlux is not None:
aliases.set("slot_ApFlux", self.apFlux)
if self.modelFlux is not None:
Expand Down
1 change: 1 addition & 0 deletions tests/test_CentroidChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def makeConfig(self, algName=None):
config.slots.modelFlux = None
config.slots.psfFlux = None
config.slots.shape = None
config.slots.psfShape = None
return config

def tearDown(self):
Expand Down
1 change: 1 addition & 0 deletions tests/test_FlagHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def setUp(self):
config.slots.modelFlux = None
config.slots.psfFlux = None
config.slots.shape = None
config.slots.psfShape = None
self.config = config

def tearDown(self):
Expand Down
1 change: 1 addition & 0 deletions tests/test_ImportCentroidAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def testMeasureCentroid(self):
sfm_config.plugins["testLib_SillyCentroid"].param = 5
sfm_config.slots.centroid = "testLib_SillyCentroid"
sfm_config.slots.shape = None
sfm_config.slots.psfShape = None
sfm_config.slots.psfFlux = None
sfm_config.slots.instFlux = None
sfm_config.slots.calibFlux = None
Expand Down
3 changes: 3 additions & 0 deletions tests/test_InputUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def testCentroidFlagAliases(self):
config = self.makeSingleFrameMeasurementConfig("base_NaiveCentroid", ["base_SdssCentroid"])
config.slots.centroid = "base_SdssCentroid"
config.slots.shape = None
config.slots.psfShape = None
task = self.makeSingleFrameMeasurementTask(config=config)
# Test that the alias resolves to the correct field.
self.assertEqual(task.schema.find("base_NaiveCentroid_flag_badInitialCentroid").key,
Expand All @@ -74,6 +75,7 @@ def testUnmetCentroidDependency(self):
["base_SdssCentroid", "base_SdssShape"])
config.slots.centroid = None
config.slots.shape = "base_SdssShape"
config.slots.psfShape = "base_SdssShape_psf"
with self.assertRaises(lsst.pex.exceptions.LogicError):
self.makeSingleFrameMeasurementTask(config=config)

Expand All @@ -85,6 +87,7 @@ def testUnmetShapeDependency(self):
["base_SdssCentroid", "base_SdssShape"])
config.slots.centroid = "base_SdssCentroid"
config.slots.shape = None
config.slots.psfShape = None
with self.assertRaises(lsst.pex.exceptions.LogicError):
self.makeSingleFrameMeasurementTask(config=config)

Expand Down
1 change: 1 addition & 0 deletions tests/test_PluginLogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def setUp(self):
config.slots.modelFlux = None
config.slots.psfFlux = None
config.slots.shape = None
config.slots.psfShape = None
self.config = config

def tearDown(self):
Expand Down
1 change: 1 addition & 0 deletions tests/test_Variance.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def setUp(self):
config.slots.instFlux = None
config.slots.calibFlux = None
config.slots.shape = "base_SdssShape"
config.slots.psfShape = None
config.plugins["base_Variance"].mask = ["BAD", "SAT"]

config.validate()
Expand Down
2 changes: 2 additions & 0 deletions tests/test_centroid.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def mySetup(self):
msConfig.algorithms.names = ["base_SdssCentroid"]
msConfig.slots.centroid = "base_SdssCentroid"
msConfig.slots.shape = None
msConfig.slots.psfShape = None
msConfig.slots.apFlux = None
msConfig.slots.modelFlux = None
msConfig.slots.psfFlux = None
Expand Down Expand Up @@ -213,6 +214,7 @@ def setUp(self):
msConfig.plugins["base_GaussianCentroid"].doFootprintCheck = False
msConfig.slots.centroid = "base_GaussianCentroid"
msConfig.slots.shape = None
msConfig.slots.psfShape = None
msConfig.slots.apFlux = None
msConfig.slots.modelFlux = None
msConfig.slots.psfFlux = None
Expand Down
1 change: 1 addition & 0 deletions tests/test_undeblended.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def testUndeblendedMeasurement(self):
slots = sfmConfig.slots
slots.centroid = "centroid"
slots.shape = None
slots.psfShape = None
slots.apFlux = None
slots.modelFlux = None
slots.psfFlux = None
Expand Down