Skip to content

Commit

Permalink
Move adding fields to test data schema
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsaunders committed Aug 18, 2023
1 parent f61f28a commit ad5fbd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion python/lsst/meas/base/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def makeMinimalSchema(cls):
cls.keys["centroid"] = lsst.afw.table.Point2DKey.addFields(
schema, "truth", "true simulated centroid", "pixel"
)
print('coord_raErr' in schema, 'truth_xErr' in schema)
cls.keys["centroid_sigma"] = lsst.afw.table.CovarianceMatrix2fKey.addFields(
schema, "truth", ['x', 'y'], "pixel"
)
Expand All @@ -210,7 +211,6 @@ def makeMinimalSchema(cls):
)
cls.keys["isStar"] = schema.addField("truth_isStar", type="Flag",
doc="set if the object is a star")
cls.keys["coord_sigma"] = lsst.afw.table.CoordKey.addErrorFields(schema)
schema.getAliasMap().set("slot_Shape", "truth")
schema.getAliasMap().set("slot_Centroid", "truth")
schema.getAliasMap().set("slot_ModelFlux", "truth")
Expand Down
3 changes: 3 additions & 0 deletions tests/test_forcedPhot.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import lsst.afw.image
from lsst.afw.math import ChebyshevBoundedField
from lsst.afw.table import CoordKey
from lsst.meas.base import ForcedPhotCcdTask, ForcedPhotCcdFromDataFrameTask
import lsst.meas.base.tests
import lsst.utils.tests
Expand All @@ -50,6 +51,8 @@ def setUp(self):
dataset.addSource(instFlux=10000, centroid=lsst.geom.Point2D(60, 70))

schema = dataset.makeMinimalSchema()
# Add coordinate error fields needed by updateSourceCoords below:
CoordKey.addErrorFields(schema)
self.exposure, self.refCat = dataset.realize(noise=10, schema=schema)
lsst.afw.table.updateSourceCoords(self.exposure.wcs, self.refCat)
# Simple aperture correction map in case the task needs it.
Expand Down

0 comments on commit ad5fbd4

Please sign in to comment.