<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 7, 2015 at 2:03 PM, Chen Jingjing <span dir="ltr"><<a href="mailto:chenjj235@gmail.com" target="_blank">chenjj235@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear yt-users,<div>I was trying to calculate only the total mass of cold gas(<1e4.5) within a sphere and I tried the following script:</div><div><br></div><div>ds=yt.load('RedshiftOutputxxxx')</div><div>sp = ds.sphere(center,radius)</div><div><b>spcut = sp.cut_region(["obj['temperature']<1e4.5"])</b></div><div><b>spcut.quantities.total_mass()</b></div><div><b><br></b></div><div>But  I got an error that says:</div><div>







<p><span>yt.utilities.exceptions.YTMixedCutRegion: Can't mix particle/discrete and fluid/mesh conditions or </span></p><p>quantities.  Field: ('all', 'particle_mass') and Conditions specified:</p>
<p><span>            obj['temperature']<1e4.5</span></p><p><span><br></span></p></div></div></blockquote><div><br></div><div>The total_mass() quantity includes both gas and particle mass. As you've discovered, cut_regions don't support selecting particle fields. </div><div><br></div><div>Instead you should use the total_quantity() derived quantity to find the total of the 'cell_mass' field, which will only include the gas mass.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><p><span></span></p><p><span>Does anyone know how to fix it?</span></p><p><span>Thanks,</span></p><p><span>Jingjing</span></p><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr"><pre>Jingjing Chen [ <a href="mailto:chenjj235@gmail.com" target="_blank">chenjj235@gmail.com</a> ]
Department of Astronomy
Columbia University
550 West 120th Street
New York, New York 10027<br>Cell Phone: <a href="tel:%2B1%28347%295746709" value="+13475746709" target="_blank">+1(347)5746709</a><br></pre></div></div>
</font></span></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></div></div>