<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 26, 2015 at 12:00 PM, Will Dawson <span dir="ltr"><<a href="mailto:will@dawsonresearch.com" target="_blank">will@dawsonresearch.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Jim,<div><br></div><div>Thank you for the thorough clarification.<br><div><blockquote type="cite"><div><br></div><div><div dir="ltr"><span class=""><div>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:</div><div><br></div><div>import lsst.meas.modelfit  # import registers the CModel algorithm with meas_base</div><div>import lsst.meas.base</div><div><span style="font-size:12.8000001907349px">measureConfig = lsst.meas.base.</span><span style="font-size:12.8000001907349px">SingleFrameMeasurementConfig()</span><br></div></span><div>measureConfig.plugins.names += ["modelfit_ShapeletPsfApprox", "modelfit_CModel”]</div></div></div></blockquote><div><br></div>Note that the += operator caused an error when I ran it so I just replaced it with:</div><div><div>measureConfig.plugins.names.add("modelfit_ShapeletPsfApprox")</div><div>measureConfig.plugins.names.add("modelfit_CModel”)</div><span class=""><blockquote type="cite"><div><div dir="ltr"><div><br></div></div></div></blockquote></span></div></div></div></blockquote><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><span class=""><blockquote type="cite"><div><div dir="ltr"><div></div><div>You can then create SingleFrameMeasurementTask and proceed as usual with that; the CModel model fitting will automatically be included. </div></div></div></blockquote><div><br></div></span>Confirmed. modelfit_* objects are now in the table schema. </div><div><br></div><div>However I do run into the following error when some of the CModelAlgorithms are being run on the detected object:</div><div><br></div></div></div></blockquote><div><br></div><div><snip></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div></div><div><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17.000059127807617px;word-break:break-all;word-wrap:break-word;border:0px;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;white-space:pre-wrap;vertical-align:baseline"><span style="color:rgb(70,130,180)"><span style="color:rgb(0,100,0)"><span style="color:rgb(70,130,180)"><span style="color:rgb(0,100,0)"><span style="color:rgb(70,130,180)"><span style="color:rgb(0,100,0)"><span style="color:rgb(70,130,180)"><span style="color:rgb(0,100,0)"><span style="color:rgb(70,130,180)"><span style="color:rgb(0,100,0)"><span style="color:rgb(139,0,0)"><span>FatalAlgorithmError</span>: 
  File "src/<a href="http://CModel.cc" target="_blank">CModel.cc</a>", 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'</span></span></span></span></span></span></span></span></span></span></span></pre><div><br></div></div><div>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)?</div></div><div><br></div></div></blockquote><div><br></div><div>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.</div><div><br></div><div>Jim</div><div><br></div></div></div></div>