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

Jim Bosch jbosch at astro.princeton.edu
Tue May 26 09:06:33 PDT 2015


On Tue, May 26, 2015 at 12:00 PM, Will Dawson <will at dawsonresearch.com>
wrote:

> 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”)
>
>
> Ah, my mistake - .plugins is set-like, not list-like.  So what you used
works fine, and "|=" (not "+=") would be the approach for adding multiple
elements at once.

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:
>
>
<snip>


> 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)?
>
>
In this case, "Calib" object refers to "afw.image.Calib", which is the
object we attach to an Exposure to store its magnitude zeropoint (and other
photometric calibration information).  CModel needs it (as well as a Wcs)
because it works in absolute units so it can use Bayesian priors (though it
just uses flat priors by default).  So if you can construct a
afw.image.Calib object, give it a reasonable zeropoint, and add it to the
Exposure (with exposure.setCalib(...)), that should solve your problem.

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


More information about the dm-users mailing list