[LSST|dm-users 679] Re: How to Use meas_modelfit to Measure Sersic Properties

Will Dawson will at dawsonresearch.com
Tue May 26 09:00:41 PDT 2015


Jim,

Thank you for the thorough clarification.
> 
> The CModel algorithm is very much usable, and you can run it just like the algorithms in meas_base using the meas_base tasks, but just modifying your meas_base configuration:
> 
> import lsst.meas.modelfit  # import registers the CModel algorithm with meas_base
> import lsst.meas.base
> measureConfig = lsst.meas.base.SingleFrameMeasurementConfig()
> measureConfig.plugins.names += ["modelfit_ShapeletPsfApprox", "modelfit_CModel”]

Note that the += operator caused an error when I ran it so I just replaced it with:
measureConfig.plugins.names.add("modelfit_ShapeletPsfApprox")
measureConfig.plugins.names.add("modelfit_CModel”)
> 
> You can then create SingleFrameMeasurementTask and proceed as usual with that; the CModel model fitting will automatically be included. 

Confirmed. modelfit_* objects are now in the table schema. 

However I do run into the following error when some of the CModelAlgorithms are being run on the detected object:

---------------------------------------------------------------------------
FatalAlgorithmError                       Traceback (most recent call last)
<ipython-input-11-1ff7722999a9> in <module>()
      3 
      4 # Apply the measurement routines to the exposure using the sources as input
----> 5 measure.run(exposure, sources)
      6 
      7 # Now let's look at the output from some of the measurment algorithms.

/Users/dawson/lsst/DarwinX86/meas_base/10.1+1/python/lsst/meas/base/sfm.pyc in run(self, measCat, exposure, noiseImage, exposureId)
    309             # Then insert the parent footprint, and measure that
    310             noiseReplacer.insertSource(measParentRecord.getId())
--> 311             self.callMeasure(measParentRecord, exposure)
    312             # Finally, process both the parent and the child set through measureN
    313             self.callMeasureN(measParentCat[parentIdx:parentIdx+1], exposure)

/Users/dawson/lsst/DarwinX86/meas_base/10.1+1/python/lsst/meas/base/base.pyc in callMeasure(self, measRecord, *args, **kwds)
    409         for plugin in self.plugins.iter():
    410             try:
--> 411                 plugin.measure(measRecord, *args, **kwds)
    412             except FATAL_EXCEPTIONS:
    413                 raise

/Users/dawson/lsst/DarwinX86/meas_modelfit/10.1+4/python/lsst/meas/modelfit/cmodel.pyc in measure(self, measRecord, exposure)
     51 
     52     def measure(self, measRecord, exposure):
---> 53         self.algorithm.measure(measRecord, exposure)
     54 
     55     def fail(self, measRecord, error=None):

/Users/dawson/lsst/DarwinX86/meas_modelfit/10.1+4/python/lsst/meas/modelfit/modelfitLib.pyc in measure(self, *args)
   6685         measure(CModelAlgorithm self, SourceRecord measRecord, ExposureF exposure, SourceRecord refRecord)
   6686         """
-> 6687         return _modelfitLib.CModelAlgorithm_measure(self, *args)
   6688 
   6689     def fail(self, *args):

FatalAlgorithmError: 
  File "src/CModel.cc", line 1205, in shapelet::MultiShapeletFunction lsst::meas::modelfit::CModelAlgorithm::_processInputs(afw::table::SourceRecord &, const afw::image::Exposure<PixelT> &) const [PixelT = float]
    Exposure has no valid Calib {0}
lsst::meas::base::FatalAlgorithmError: 'Exposure has no valid Calib'

I am not sure what `Calib` it needs. A wild guess: Is it looking for some calibrations that might be generated when processing a raw image or stack of raw images, where as I am running it on a “preprocessed” postage stamp (i.e. background subtracted)?

Thank you again for all your help,
Will


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lsst.org/pipermail/dm-users/attachments/20150526/f892452a/attachment.html>


More information about the dm-users mailing list