[yt-users] How the field ('gas', 'temperature') was derived?

bazhaoyu_sjtu hudan_bazhaoyu at sjtu.edu.cn
Mon Jan 2 22:52:58 PST 2017


Hi Nathan,

Thank you for your kind reply!

Yes, I have noticed this part, but there is always some mistakes.

In my Gadget data, ('PartType0', 'ElectronAbundance') is not a initial 
field, so I derived it by manumotive.

Firstly, I set it equal to 1.15, and checked it is normal:
-------------------------------------------------------------------------------------------------------------------------------------------
 > 
@derived_field(name=("PartType0","ElectronAbundance"),particle_type=True, force_override=True)
 > def _ElectronAbundance(field,data):
            return 1.15

 > print(ad['PartType0','ElectronAbundance'])
1.15 dimensionless
-------------------------------------------------------------------------------------------------------------------------------------------

Then the corresponding fields:
-------------------------------------------------------------------------------------------------------------------------------------------
 > print(ad['PartType0','InternalEnergy'].in_units('km**2/s**2')[8000])
193516.9375 km**2/s**2
 > print(ad['gas','kT'][8000])
1.609844329629573 keV
-------------------------------------------------------------------------------------------------------------------------------------------

I don't think the value of kT is right, so I made a test:
------------------------------------------------------------------------------------------------------------------------------------------- 

 > 
@derived_field(name=("PartType0","ElectronAbundance"),particle_type=True, force_override=True)
 > def _ElectronAbundance(field,data):
            return 0

 > print(ad['PartType0','ElectronAbundance'])
0.0 dimensionless

 > print(ad['PartType0','InternalEnergy'].in_units('km**2/s**2')[8000])
193516.9375 km**2/s**2
 > print(ad['gas','kT'][8000])
1.609844329629573 keV
-------------------------------------------------------------------------------------------------------------------------------------------

To my amazement, I got a same value of kT, though I changed the 
("PartType0","ElectronAbundance").
I'm confused about it. Is there any points I didn't realize?

Thank you again!

Regard,
Dan



On 01/02/2017 10:50 PM, Nathan Goldbaum wrote:
> Hi Dan,
>
> This particular field is defined specifically for Gadget data in the 
> Gadget frontend:
>
> https://bitbucket.org/yt_analysis/yt/src/09f0ef297d7068078a021fc8290d9e3519baf82d/yt/frontends/gadget/fields.py?at=yt&fileviewer=file-view-default#fields.py-72
>
> Nathan
>
>
> On Mon, Jan 2, 2017 at 6:33 AM hudan_bazhaoyu 
> <hudan_bazhaoyu at sjtu.edu.cn <mailto:hudan_bazhaoyu at sjtu.edu.cn>> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>     Dear yt:
>
>
>
>
>
>     I have one simple question, but it bothers me these days.
>
>
>
>
>
>     I used the yt to analysis the "hdf5" files, which generated by
>
>     Gadget-2. These files have basic fields, like: ("PartType0", "*"),
>
>     ("PartType1", "*") and ("all", "*"). Then I want to plot the density
>
>     map and temperature map, it seems need some derived fields, like:
>
>     ("gas", "density") and ("gas", "temperature").
>
>
>
>
>
>     I'm curious about how the ("gas","temperature") was derived, so I
>
>     browsed a lots of documents on the Web, but found nothing. Please
>
>     see
>
>
>     http://yt-project.org/doc/reference/field_list.html?highlight=field%20list
>
>
>     About the field of ('gas','temperature'),  there is "No source
>
>     available" in "Field Source"!
>
>
>
>
>
>     In my data, the field ("PartType0","InternalEnergy") is provided by
>
>     me, and I think the temperature should calculated by Internal Energy
>
>     "E" with the function: k*T = (Gamma -1)*µ*mp*E, where k = 1.38E-16
>
>     erg/K is Boltzmann constant, Gamma = 5/3 for adiabat particles, μ =
>
>     0.6 is the corresponding mean molecular weight, and mp = 1.67E-24 g
>
>     is proton mass. But this result is about half of the value of
>
>     ("gas","temperature").
>
>
>     So what you may know is why, which one is right? I need your help!
>
>
>
>
>
>     Thank you a lot, and happy new year!
>
>
>
>
>
>     Regard,
>
>
>     Dan
>
>
>
>
>
>
>
>
>      --
>
>
>     Dan Hu
>
>
>     =======================================
>
>
>     Department of Physics, Shanghai Jiao Tong
>
>     University
>
>
>     800 Dongchuan Road, Minhang, Shanghai 200240, PRC
>
>
>     E-mail : hudan_bazhaoyu at 163.com <mailto:hudan_bazhaoyu at 163.com>
>
>
>     hudan_bazhaoyu at sjtu.edu.cn <mailto:hudan_bazhaoyu at sjtu.edu.cn>
>
>
>     =======================================
>
>
>
>
>
>     _______________________________________________
>
>     yt-users mailing list
>
>     yt-users at lists.spacepope.org <mailto: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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170103/58da3331/attachment.htm>


More information about the yt-users mailing list