[yt-users] Cold Gas

Chen Jingjing chenjj235 at gmail.com
Tue Apr 7 14:10:23 PDT 2015


It works. Thanks!

2015-04-07 17:06 GMT-04:00 Nathan Goldbaum <nathan12343 at gmail.com>:

>
>
> On Tue, Apr 7, 2015 at 2:03 PM, Chen Jingjing <chenjj235 at gmail.com> wrote:
>
>> Dear yt-users,
>> I was trying to calculate only the total mass of cold gas(<1e4.5) within
>> a sphere and I tried the following script:
>>
>> ds=yt.load('RedshiftOutputxxxx')
>> sp = ds.sphere(center,radius)
>> *spcut = sp.cut_region(["obj['temperature']<1e4.5"])*
>> *spcut.quantities.total_mass()*
>>
>> But  I got an error that says:
>>
>> yt.utilities.exceptions.YTMixedCutRegion: Can't mix particle/discrete and
>> fluid/mesh conditions or
>>
>> quantities.  Field: ('all', 'particle_mass') and Conditions specified:
>>
>>             obj['temperature']<1e4.5
>>
>>
>>
> The total_mass() quantity includes both gas and particle mass. As you've
> discovered, cut_regions don't support selecting particle fields.
>
> 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.
>
>
>> Does anyone know how to fix it?
>>
>> Thanks,
>>
>> Jingjing
>> --
>>
>> Jingjing Chen [ chenjj235 at gmail.com ]
>> Department of Astronomy
>> Columbia University
>> 550 West 120th Street
>> New York, New York 10027
>> Cell Phone: +1(347)5746709
>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>


-- 

Jingjing Chen [ chenjj235 at gmail.com ]
Department of Astronomy
Columbia University
550 West 120th Street
New York, New York 10027
Cell Phone: +1(347)5746709
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150407/01ccf3ad/attachment.htm>
-------------- next part --------------
_______________________________________________
yt-users mailing list
yt-users at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org


More information about the yt-users mailing list