<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><span class=""><div>Ah, thanks for the hint, I can reproduce this using IsolatedGalaxy now.  I will file an issue shortly. Having a repro script should help debugging here.</div></span></div></blockquote><div><br></div><div>Awesome. Let me know if I can help out with your debuging.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div></div><div>For now, a workaround would be to avoid using the total_mass derived quantity and instead do something like this:</div></div></blockquote><div><br></div><div>Groovy.  That seems good for now.</div><div><br></div><div>Thanks a ton!</div><div>d.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div><br></div><div>clump = ...</div><div>total_mass = clump.quantity.total_quantity('cell_mass')</div><div>clump['density']</div><div>clump['cell_mass']</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>The curious disappearing data can be seen here:</div><div><br></div><div><div>>>> leaf_clumps[0]['density']</div><div>YTArray([  94330.76550569,  111095.42419888,  111000.87780872,</div><div>        158489.47273191,  114487.69237444,  129849.08390983,</div><div>         95651.97426045,   95462.47824957,  104785.15137116,</div><div>        149758.92528478,  122558.83598019,   91829.8174425 ,</div><div>         97015.49553846,  118157.84068288]) g/cm**3</div><div>>>> leaf_clumps[0]['cell_mass']</div><div>YTArray([ 0.00070282,  0.00082773,  0.00082702,  0.00118084,  0.000853  ,</div><div>        0.00096745,  0.00071266,  0.00071125,  0.00078071,  0.00111579,</div><div>        0.00091313,  0.00068419,  0.00072282,  0.00088034]) g</div><div>>>> leaf_clumps[0].quantities.total_quantity('cell_mass')<br></div><div>0.0118797558199 g</div><div>>>> leaf_clumps[0].quantities.total_mass()</div></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>Traceback (most recent call last):</div><div>  File "<stdin>", line 1, in <module></div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py", line 193, in __call__</div><div>    rv = super(TotalMass, self).__call__(fields)</div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py", line 160, in __call__</div><div>    rv = super(TotalQuantity, self).__call__(fields)</div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py", line 56, in __call__</div><div>    sto.result = self.process_chunk(ds, *args, **kwargs)</div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py", line 166, in process_chunk</div><div>    for field in fields]</div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/data_containers.py", line 248, in __getitem__</div><div>    self.get_data(f)</div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/selection_data_containers.py", line 749, in get_data</div><div>    raise YTMixedCutRegion(self.conditionals, field)</div><div>yt.utilities.exceptions.YTMixedCutRegion: Can't mix particle/discrete and fluid/mesh conditions or</div><div>               quantities.  Field: ('all', 'particle_mass') and Conditions specified:</div></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>            obj['contours_72e8d63701e04d13bfec60cada79b7ad'] == 1</div><div>>>> leaf_clumps[0].quantities.total_quantity('cell_mass')</div><div>0.0 g</div></div><div><div>>>> leaf_clumps[0]['cell_mass']</div><div>YTArray([], dtype=float64) g</div></div><div><br></div><div><br></div><div><br></div><div>The code to make the clumps</div><div><br></div><div><div>    ds = yt.load(setname)</div><div>    val, loc = ds.find_max('density')<br></div></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>    width = (0.05,'code_length')</div><div>    sphere = ds.sphere(loc,width)</div><div>    master_clump = Clump(sphere,"density")</div></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>    c_min = sphere["gas", "density"].min()<br></div><div>    c_max = sphere["gas", "density"].max()</div><div>    step = 2.0</div><div>    find_clumps(master_clump, c_min, c_max, step)</div><div>    leaf_clumps = get_lowest_clumps(master_clump)</div></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><div></div></span><div>I'll give that a shot in the morning and report back.</div><div><br></div><div><br></div><div>Thanks!</div><span><font color="#888888"><div>d.</div></font></span><div><div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><div></div></span><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>If I instead try quantities.total_mass(), I get an odd error. </div><div><div>>>> leaf_clumps[22].quantities.total_mass()</div><div>Traceback (most recent call last):</div><div>  File "<stdin>", line 1, in <module></div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py", line 193, in __call__</div><div>    rv = super(TotalMass, self).__call__(fields)</div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py", line 160, in __call__</div><div>    rv = super(TotalQuantity, self).__call__(fields)</div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py", line 56, in __call__</div><div>    sto.result = self.process_chunk(ds, *args, **kwargs)</div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py", line 166, in process_chunk</div><div>    for field in fields]</div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/data_containers.py", line 248, in __getitem__</div><div>    self.get_data(f)</div><div>  File "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/selection_data_containers.py", line 749, in get_data</div><div>    raise YTMixedCutRegion(self.conditionals, field)</div><div>yt.utilities.exceptions.YTMixedCutRegion: Can't mix particle/discrete and fluid/mesh conditions or</div><div>               quantities.  Field: ('all', 'particle_mass') and Conditions specified:</div><div>            obj['contours_8d0408a91fc34e2bbe9eb838d48de46e'] == 1</div></div></div></blockquote><div><br></div></span><div>This is happening because, as the error indicates, you can't combine mesh and particle quantities in a cut_region (like a clump is).  The total_mass() quantity returns the total mass in particles and gas, so that's what's triggering the error. I bet this would work if you asked for the total gas mass only. Of course, that would only work if clump['cell_mass'] returned something sensible.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><div dir="ltr"><div><br></div><div><br></div><div><br></div><div>I build the clumps in the following manner.  I don't have any validators by design.  Plotting the clumps with annotate_clumps(leaf_clumps) gives reasonable results.  </div><div><br></div><div><div>    ds = yt.load(setname)</div><div>    loc = ds.arr([ 0.03613281,  0.79589844,  0.03027344], 'code_length')<br></div><div>    width = (0.05,'code_length')</div><div>    sphere = ds.sphere(loc,width)</div><div>    master_clump = Clump(sphere,"density")</div><div>use_particles=False, use_thermal_energy=False)<br></div><div>    c_min = sphere["gas", "density"].min()</div><div>    c_max = sphere["gas", "density"].max()</div><div>    step = 2.0</div><div>    find_clumps(master_clump, c_min, c_max, step)</div><div>    leaf_clumps = get_lowest_clumps(master_clump)<br></div><div><br></div><div>Thanks a ton!</div><span><font color="#888888"><div>d.</div><div><br></div>-- <br><div><div dir="ltr">-- Sent from a computer.<br></div></div>
</font></span></div></div>
<br></span>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div></div></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div></div></div><div><div><br clear="all"><div><br></div>-- <br><div><div dir="ltr">-- Sent from a computer.<br></div></div>
</div></div></div></div>
</blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><br clear="all"><div><br></div>-- <br><div><div dir="ltr">-- Sent from a computer.<br></div></div>
</div></div>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote></div></div></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">-- Sent from a computer.<br></div></div>
</div></div>