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

Use and enforce Astropy compliant units #19

Merged
merged 1 commit into from
May 10, 2016
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
2 changes: 1 addition & 1 deletion include/lsst/meas/modelfit/CModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace lsst { namespace meas { namespace modelfit {
*
* Unlike most measurement algorithms, CModel requires the Exposure it is given to have both a Wcs and
* a Calib. This is because it makes use of Bayesian priors, and hence it has to know the relationship
* between the raw units of the image (pixels and dn) and the global units in which the priors are defined.
* between the raw units of the image (pixel and count) and the global units in which the priors are defined.
*
* In fact, all of the nonlinear fits in CModel are done in a special, local coordinate system, defined
* by a Wcs in which the "pixels" have units of arcseconds (because we never create an image in this system,
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/meas/modelfit/baseMeasure.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __init__(self, butler=None, **kwds):
self.schema = modelfitLib.ModelFitTable.makeMinimalSchema()
self.keys = {}
self.keys["center"] = lsst.afw.table.Point2DKey.addFields(
self.schema, "center", "input centroid of the object in image coordinates", "pixels"
self.schema, "center", "input centroid of the object in image coordinates", "pixel"
)
self.keys["initial.nonlinear"] = self.schema.addField(
"initial.nonlinear", type="ArrayD", size=self.model.getNonlinearDim(),
Expand Down
4 changes: 2 additions & 2 deletions src/CModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ struct CModelStageKeys {
schema.addField<meas::base::Flux>(
schema.join(prefix, "flux"),
"flux from the " + stage + " fit",
"dn"
"count"
)
),
fluxSigma(
schema.addField<meas::base::FluxErrElement>(
schema.join(prefix, "fluxSigma"),
"flux uncertainty from the " + stage + " fit",
"dn"
"count"
)
),
fluxFlag(
Expand Down
2 changes: 1 addition & 1 deletion src/psf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ shapelet::MultiShapeletFunctionKey PsfFitter::addFields(
}
return shapelet::MultiShapeletFunctionKey::addFields(
schema, prefix, "multi-Shapelet approximation to the PSF model",
"pixels", // ellipse units
"pixel", // ellipse units
"", // coefficient units (unitless)
orders
);
Expand Down
4 changes: 2 additions & 2 deletions tests/data/calexp.fits

Large diffs are not rendered by default.

Binary file modified tests/data/psfs/great3-0.fits
Binary file not shown.
Binary file modified tests/data/psfs/great3-1.fits
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/data/refcat.fits

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/data/src.fits

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/testCModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def makeMultiShapeletCircularGaussian(sigma):

def computePsfFlux(centroid, exposure):
schema = lsst.afw.table.SourceTable.makeMinimalSchema()
pointKey = lsst.afw.table.Point2DKey.addFields(schema, "centroid", "known input centroid", "pixels")
pointKey = lsst.afw.table.Point2DKey.addFields(schema, "centroid", "known input centroid", "pixel")
schema.getAliasMap().set("slot_Centroid", "centroid")
algorithm = lsst.meas.base.PsfFluxAlgorithm(lsst.meas.base.PsfFluxControl(), "base_PsfFlux", schema)
table = lsst.afw.table.SourceTable.make(schema)
Expand Down
2 changes: 1 addition & 1 deletion tests/testShapeletPsfApproxPlugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def setUp(self):
self.exposure = lsst.afw.image.ExposureF(41, 41)
self.psf = lsst.afw.detection.GaussianPsf(19, 19, self.psfSigma)
self.schema = lsst.afw.table.SourceTable.makeMinimalSchema()
self.centroidKey = lsst.afw.table.Point2DKey.addFields(self.schema, "centroid", "centroid", "pixels")
self.centroidKey = lsst.afw.table.Point2DKey.addFields(self.schema, "centroid", "centroid", "pixel")
self.schema.getAliasMap().set("slot_Centroid", "centroid")
self.psfDir = os.path.join(os.environ["MEAS_MODELFIT_DIR"], "tests", "data", "psfs")

Expand Down
2 changes: 1 addition & 1 deletion tests/testShapeletPsfModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ShapeletPsfApproxPluginsTestCase(lsst.utils.tests.TestCase):
def setUp(self):
self.exposure = lsst.afw.image.ExposureF(41, 41)
self.schema = lsst.afw.table.SourceTable.makeMinimalSchema()
self.centroidKey = lsst.afw.table.Point2DKey.addFields(self.schema, "centroid", "centroid", "pixels")
self.centroidKey = lsst.afw.table.Point2DKey.addFields(self.schema, "centroid", "centroid", "pixel")
self.schema.getAliasMap().set("slot_Centroid", "centroid")
self.psfDir = os.path.join(os.environ["MEAS_MODELFIT_DIR"], "tests", "data", "psfs")

Expand Down