<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 7, 2015 at 4:35 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">Dominique,<div><br></div><div>Thank you for translating the error. The problem then seems to be with an inconsistent DM functions default parameter settings. From the notebook the schema and measurement configuration is set by</div><div><br></div><div>schema = lsst.afw.table.SourceTable.makeMinimalSchema()</div><div>measureSourcesConfig  = lsst.meas.algorithms.SourceMeasurementConfig()</div><div><br></div><div>So it appears that makeMinimialSchema() and SourceMeasurementConfig() need to be made compatible (perhaps is has been in v10_1). Should I be using v10_1 instead of v10_0?</div><div><div class="h5"><div><div><blockquote type="cite"><div><div bgcolor="#FFFFFF" text="#000000"><br></div></div></blockquote></div></div></div></div></div></blockquote><div>Try replacing</div><div><br></div><div>lsst.meas.algorithms.SourceMeasurement[Config/Task]</div><div><br></div><div>with</div><div><br></div><div>lsst.meas.base.SingleFrameMeasurement[Config/Task]</div><div><br></div><div>throughout the example.</div><div><br></div><div>That may just solve the problem.  SourceMeasurementTask is deprecated in favor of SingleFrameMeasurementTask, and some of the other code now expects that you're using SingleFrameMeasurementTask unless you set some other configuration options stating that you're using the old one.</div><div><br></div><div><br></div><div>Jim</div><div><br></div><div><br></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 class="h5"><div><div><blockquote type="cite"><div><div bgcolor="#FFFFFF" text="#000000">
    Yes, the schema has changed in the latest stack versions and
    "flux.sinc_flux" is not any more in the source table schema.
    Something directly replacing sinc_flux was present  in the v10_0 but
    this has been completely replaced in the latest stack_v10_1. There
    are now 10 Aperture flux corresponding to 10 different radii. <br>
    <br>
    You can have a look to
    <a href="http://nbviewer.ipython.org/github/DarkEnergyScienceCollaboration/CFHTLS-Reprocess/tree/master/notebooks/" target="_blank">http://nbviewer.ipython.org/github/DarkEnergyScienceCollaboration/CFHTLS-Reprocess/tree/master/notebooks/</a>
    to get notebook examples with the most recent stack.<br>
    <br>
    I can have a look to Chris' notebooks if you wish.<br>
    <br>
    Best,<br>
    <br>
    Dominique<br>
    <br>
    <div>On 05/07/2015 11:52 AM, Will Dawson
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      I encountered an error when running Chris Walter’s <a href="http://nbviewer.ipython.org/github/DarkEnergyScienceCollaboration/DataManagementWorkbook/blob/master/Basic%20DM%20AFW%20Introduction.ipynb" target="_blank">Introduction to the DM AFW packages</a> ipython
      notebook. In the second to last step when I run the command:
      <div><br>
      </div>
      <div>
        <div># Apply the measurement routines to the exposure
          using the sources as input</div>
        <div>measure.run(exposure, sources)</div>
      </div>
      <div><br>
      </div>
      <div>I get the following error:</div>
      <div><br>
      </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(139,0,0)">---------------------------------------------------------------------------</span>
<span style="color:rgb(139,0,0)">NotFoundError</span>                             Traceback (most recent call last)
<span style="color:rgb(0,100,0)"><ipython-input-19-77c6eca8bda0></span> in <span style="color:rgb(70,130,180)"><module><span style="color:rgb(0,0,139)">()</span>
<span style="color:rgb(0,100,0)">     16</span> <span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">     17</span> <span style="color:rgb(139,0,0)"># Apply the measurement routines to the exposure using the sources as input</span><span style="color:rgb(0,0,139)"></span><span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">---> 18<span style="color:rgb(139,0,0)"> </span>measure<span style="color:rgb(0,0,139)">.</span>run<span style="color:rgb(0,0,139)">(</span>exposure<span style="color:rgb(0,0,139)">,</span> sources<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>
<span>     19</span> <span style="color:rgb(0,0,139)"></span>
<span>     20</span> <span style="color:rgb(139,0,0)"># Now let's look at the output from some of the measurment algorithms.</span><span style="color:rgb(0,0,139)"></span><span style="color:rgb(0,0,139)"></span>

<span>/Users/dawson/lsst/DarwinX86/pipe_base/10.0+2/python/lsst/pipe/base/timer.pyc</span> in <span style="color:rgb(70,130,180)">wrapper<span style="color:rgb(0,0,139)">(self, *args, **keyArgs)</span>
<span style="color:rgb(0,100,0)">    116</span>         logInfo<span style="color:rgb(0,0,139)">(</span>obj <span style="color:rgb(0,0,139)">=</span> self<span style="color:rgb(0,0,139)">,</span> prefix <span style="color:rgb(0,0,139)">=</span> func<span style="color:rgb(0,0,139)">.</span>__name__ <span style="color:rgb(0,0,139)">+</span> <span style="color:rgb(0,0,139)">"Start"</span><span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">    117</span>         <span style="color:rgb(0,100,0)">try</span><span style="color:rgb(0,0,139)">:</span><span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">--> 118<span style="color:rgb(139,0,0)">             </span>res <span style="color:rgb(0,0,139)">=</span> func<span style="color:rgb(0,0,139)">(</span>self<span style="color:rgb(0,0,139)">,</span> <span style="color:rgb(0,0,139)">*</span>args<span style="color:rgb(0,0,139)">,</span> <span style="color:rgb(0,0,139)">**</span>keyArgs<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>
<span>    119</span>         <span>finally</span><span style="color:rgb(0,0,139)">:</span><span style="color:rgb(0,0,139)"></span>
<span>    120</span>             logInfo<span style="color:rgb(0,0,139)">(</span>obj <span style="color:rgb(0,0,139)">=</span> self<span style="color:rgb(0,0,139)">,</span> prefix <span style="color:rgb(0,0,139)">=</span> func<span style="color:rgb(0,0,139)">.</span>__name__ <span style="color:rgb(0,0,139)">+</span> <span style="color:rgb(0,0,139)">"End"</span><span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>

<span>/Users/dawson/lsst/DarwinX86/meas_algorithms/10.0+2/python/lsst/meas/algorithms/measurement.pyc</span> in <span style="color:rgb(70,130,180)">measure<span style="color:rgb(0,0,139)">(self, exposure, sources, noiseImage, noiseMeanVar, references, refWcs)</span>
<span style="color:rgb(0,100,0)">    422</span> <span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">    423</span>         self<span style="color:rgb(0,0,139)">.</span>log<span style="color:rgb(0,0,139)">.</span>info<span style="color:rgb(0,0,139)">(</span><span style="color:rgb(0,0,139)">"Measuring %d sources"</span> <span style="color:rgb(0,0,139)">%</span> len<span style="color:rgb(0,0,139)">(</span>sources<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">--> 424<span style="color:rgb(139,0,0)">         </span>self<span style="color:rgb(0,0,139)">.</span>config<span style="color:rgb(0,0,139)">.</span>slots<span style="color:rgb(0,0,139)">.</span>setupTable<span style="color:rgb(0,0,139)">(</span>sources<span style="color:rgb(0,0,139)">.</span>table<span style="color:rgb(0,0,139)">,</span> prefix<span style="color:rgb(0,0,139)">=</span>self<span style="color:rgb(0,0,139)">.</span>config<span style="color:rgb(0,0,139)">.</span>prefix<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>
<span>    425</span> <span style="color:rgb(0,0,139)"></span>
<span>    426</span>         self<span style="color:rgb(0,0,139)">.</span>preMeasureHook<span style="color:rgb(0,0,139)">(</span>exposure<span style="color:rgb(0,0,139)">,</span> sources<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>

<span>/Users/dawson/lsst/DarwinX86/meas_algorithms/10.0+2/python/lsst/meas/algorithms/measurement.pyc</span> in <span style="color:rgb(70,130,180)">setupTable<span style="color:rgb(0,0,139)">(self, table, prefix)</span>
<span style="color:rgb(0,100,0)">     57</span>         <span style="color:rgb(0,100,0)">if</span> self<span style="color:rgb(0,0,139)">.</span>centroid <span style="color:rgb(0,100,0)">is</span> <span style="color:rgb(0,100,0)">not</span> None<span style="color:rgb(0,0,139)">:</span> table<span style="color:rgb(0,0,139)">.</span>defineCentroid<span style="color:rgb(0,0,139)">(</span>prefix <span style="color:rgb(0,0,139)">+</span> self<span style="color:rgb(0,0,139)">.</span>centroid<span>)</span><span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">     58</span>         <span style="color:rgb(0,100,0)">if</span> self<span style="color:rgb(0,0,139)">.</span>shape <span style="color:rgb(0,100,0)">is</span> <span style="color:rgb(0,100,0)">not</span> None<span style="color:rgb(0,0,139)">:</span> table<span style="color:rgb(0,0,139)">.</span>defineShape<span style="color:rgb(0,0,139)">(</span>prefix <span style="color:rgb(0,0,139)">+</span> self<span style="color:rgb(0,0,139)">.</span>shape<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">---> 59<span style="color:rgb(139,0,0)">         <span style="color:rgb(0,100,0)">if</span> self<span style="color:rgb(0,0,139)">.</span>apFlux <span style="color:rgb(0,100,0)">is</span> <span style="color:rgb(0,100,0)">not</span> None<span style="color:rgb(0,0,139)">:</span> table<span style="color:rgb(0,0,139)">.</span>defineApFlux<span style="color:rgb(0,0,139)">(</span>prefix <span style="color:rgb(0,0,139)">+</span> self<span style="color:rgb(0,0,139)">.apFlux<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">     60</span>         <span style="color:rgb(0,100,0)">if</span> self<span style="color:rgb(0,0,139)">.</span>modelFlux <span style="color:rgb(0,100,0)">is</span> <span style="color:rgb(0,100,0)">not</span> None<span style="color:rgb(0,0,139)">:</span> table<span style="color:rgb(0,0,139)">.</span>defineModelFlux<span style="color:rgb(0,0,139)">(</span>prefix <span style="color:rgb(0,0,139)">+</span> self<span style="color:rgb(0,0,139)">.</span>modelFlux<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">     61</span>         <span style="color:rgb(0,100,0)">if</span> self<span style="color:rgb(0,0,139)">.</span>psfFlux <span style="color:rgb(0,100,0)">is</span> <span style="color:rgb(0,100,0)">not</span> None<span style="color:rgb(0,0,139)">:</span> table<span style="color:rgb(0,0,139)">.</span>definePsfFlux<span style="color:rgb(0,0,139)">(</span>prefix <span style="color:rgb(0,0,139)">+</span> self<span style="color:rgb(0,0,139)">.</span>psfFlux<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>

<span style="color:rgb(0,100,0)">/Users/dawson/lsst/DarwinX86/afw/10.0+3/python/lsst/afw/table/tableLib.pyc</span> in <span style="color:rgb(70,130,180)">defineApFlux<span style="color:rgb(0,0,139)">(self, *args)</span>
<span style="color:rgb(0,100,0)">   9869</span>     <span style="color:rgb(0,100,0)">def</span> defineApFlux<span style="color:rgb(0,0,139)">(</span>self<span style="color:rgb(0,0,139)">,</span> <span style="color:rgb(0,0,139)">*</span>args<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)">:</span><span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">   9870</span>         <span style="color:rgb(0,0,139)">"""defineApFlux(SourceTable self, std::string const & name)"""</span><span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">-> 9871<span style="color:rgb(139,0,0)">         <span style="color:rgb(0,100,0)">return</span> _tableLib<span style="color:rgb(0,0,139)">.</span>SourceTable_defineApFlux<span style="color:rgb(0,0,139)">(</span>self<span style="color:rgb(0,0,139)">,</span> <span style="color:rgb(0,0,139)">*</span>args<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">   9872</span> <span style="color:rgb(0,0,139)"></span>
<span style="color:rgb(0,100,0)">   9873</span>     <span style="color:rgb(0,100,0)">def</span> getApFluxDefinition<span style="color:rgb(0,0,139)">(</span>self<span style="color:rgb(0,0,139)">)</span><span style="color:rgb(0,0,139)">:</span><span style="color:rgb(0,0,139)"></span>

<span>NotFoundError</span>: 
  File "src/table/<a href="http://schema.cc/" target="_blank">Schema.cc</a>", line 239, in SchemaItem<T> lsst::afw::table::detail::SchemaImpl::find(const std::string &) const [T = double]
    Field or subfield withname 'flux.sinc_flux' not found with type 'D'. {0}
lsst::pex::exceptions::NotFoundError: 'Field or subfield withname 'flux.sinc_flux' not found with type 'D'.'</span></span></span></span></span></span></span></span></span></span></span></span></span></pre>
        <div><br>
        </div>
      </div>
      <div>Perhaps this is related to the fact that the
        notebook was written in 2013 and I am using v10.0 of the stack.
        As I am new to the stack, and given the surprisingly complex
        error message for such a seemingly simple command, I am hoping
        that the experts can shed some light on the matter.</div>
      <div><br>
      </div>
      <div>Thanks,</div>
      <div>Will Dawson</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
dm-users mailing list
<a href="mailto:dm-users@lists.lsst.org" target="_blank">dm-users@lists.lsst.org</a>
<a href="https://lists.lsst.org/mailman/listinfo/dm-users" target="_blank">https://lists.lsst.org/mailman/listinfo/dm-users</a></pre>
    </blockquote>
    <br>
    <pre cols="72">-- 
Dominique Boutigny  -  CNRS / CC-IN2P3
Now at SLAC National Accelerator Laboratory

Kavli Building - Room 221
Mail     : <a href="mailto:boutigny@in2p3.fr" target="_blank">boutigny@in2p3.fr</a> -  <a href="mailto:boutigny@slac.stanford.edu" target="_blank">boutigny@slac.stanford.edu</a>
Office   : <a href="tel:%2B1%20650-926-5759" value="+16509265759" target="_blank">+1 650-926-5759</a>   -  Cellular : <a href="tel:%2B1%20774-232-0912" value="+17742320912" target="_blank">+1 774-232-0912</a>

</pre>
  </div>

_______________________________________________<br>dm-users mailing list<br><a href="mailto:dm-users@lists.lsst.org" target="_blank">dm-users@lists.lsst.org</a><br><a href="https://lists.lsst.org/mailman/listinfo/dm-users" target="_blank">https://lists.lsst.org/mailman/listinfo/dm-users</a></div></blockquote></div><br></div></div></div></div><br>_______________________________________________<br>
dm-users mailing list<br>
<a href="mailto:dm-users@lists.lsst.org">dm-users@lists.lsst.org</a><br>
<a href="https://lists.lsst.org/mailman/listinfo/dm-users" target="_blank">https://lists.lsst.org/mailman/listinfo/dm-users</a><br></blockquote></div><br></div></div>