[yt-users] FLASH 1D Data Radial Profiles

Jill Naiman jnaiman at gmail.com
Wed Jul 9 16:01:57 PDT 2014


My bad, yeah, this is yt-2.x stuff.   Also, ninterp is just some number to
bin things in.   In my code I have the note:

ninterp = 1400 # for example: nblockx =1500 => ninterp ~ 500-1400



On Wed, Jul 9, 2014 at 3:58 PM, John ZuHone <jzuhone at gmail.com> wrote:

> Hi Melinda and all,
>
> Just for clarification, Jill's code works in yt 2.x. The 3.0 beta version
> (to be released soon) of this code would be:
>
> import yt
> pf = yt.load(fname)
> sphere = pf.sphere([0.,0.,0.], (pf.domain_right_edge[0]/3.1e18, "pc"))
> rad_profile = yt.create_profile(sphere, "radius",
> ["density","temperature","velocity_x"],
> extrema={"radius":(0.0,pf.domain_right_edge[0]/3.1e18*yt.units*pc)},
>                                                 n_bins=ninterp,
> units={"radius":"pc"}, logs={"radius":False})
>
> radius = rad_profile.x
>
> Then you can access the fields like so:
>
> rad_profile["density"]
> rad_profile["temperature"]
> rad_profile["velocity_x"]
>
> Also, yt 3.0 is aware of spherical geometries, so you could also just use
> the unbinned quantities:
>
> sp = pf.sphere([0.0,0.0,0.0], (pf.domain_right_edge[0]/3.1e18, "pc"))
> radius = sp["radius"].in_units("pc")
> density = sp["density"]
>
> etc...
>
> Best,
>
> John ZuHone
>
> On Jul 9, 2014, at 5:25 PM, Jill Naiman <jnaiman at gmail.com> wrote:
>
> The following has worked for me:
>
> pf = load(fname)
> sphere = pf.h.sphere([0.,0.,0.], (pf.domain_right_edge[0]/3.1e18, "pc"))
> rad_profile = BinnedProfile1D(sphere, ninterp, "Radiuspc", 0.0, \
>                                   pf.domain_right_edge[0]/3.1e18,
> log_space=False)
> radius = rad_profile['Radiuspc']
>
> rad_profile.add_fields("Density")
> rad_profile.add_fields("Temperature")
> rad_profile.add_fields("x-velocity")
>
>
> And then I just plot using "fig"
>
>
> On Wed, Jul 9, 2014 at 2:47 PM, Melinda Soares-Furtado <
> msoares.physics at gmail.com> wrote:
>
>> Is there a simple way to create density/temp/velocity profiles using 1D
>> FLASH data? I've done this in the past for 3-dimensional data, which is
>> very user friendly.
>>
>> Is the best method of attack is dumping the data to np arrays and then
>> plotting from these arrays?
>>
>> Regards,
>> Melinda Soares-Furtado
>> msoares at princeton.edu
>> http://cargo.ucsc.edu/msoares
>> 415-860-0438
>>
>>
>> _______________________________________________
>> 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
>
>
>
> _______________________________________________
> 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/20140709/77614352/attachment.html>


More information about the yt-users mailing list