[yt-users] Field extraction from arbitrary grids

Carla Bernhardt carla.j.bernhardt at gmail.com
Thu Jul 20 03:03:00 PDT 2017


Hi yt-users,

I was able to get the arbitrary grid working by updating yt to the newest
version. I am quite confused, however, by the output. If I extract my
arbitrary grid:

obj = ds.arbitrary_grid(left_edge, right_edge, dims=[256, 256, 256])

and extract the desired fields:

temp = obj["temperature"]
HIdens = obj["HI_Density"]

(which all works successfully), I then want to write this to a file and
would expect that such a file would have 256^3 = 16777216 lines, but I not
only don't get this number of lines for my outputs, I even get different
number of lines for different fields. Here is the part of my code
<https://pastebin.com/REcRd2u0> that writes the file. Ideas? Thanks in
advance.

Cheers,
Carla

2017-07-12 12:35 GMT+02:00 Carla Bernhardt <carla.j.bernhardt at gmail.com>:

> Hi Matthew,
>
> Thank you for your reply. I was using yt Version 3.2.3 and am working out
> some installation issues on our server with version 3.3.5. As for the type
> of data, I have an enzo simulation with static nested grids as well as up
> to 6 levels AMR grids. I will have to get back to you once I get past the
> issues with the newest installation of yt.... Thanks for the initial
> pointers.
>
> Cheers,
> Carla
>
>
> 2017-07-11 14:15 GMT+02:00 Matthew Turk <matthewturk at gmail.com>:
>
>> Hi Carla,
>>
>> Interesting.  It's possible, for the call to "temperature" (which
>> raises NotImplementedError) that the version of yt you're on doesn't
>> yet support mesh fields in arbitrary grids; that was added reasonably
>> recently.  For the others, I'm not totally sure why it's breaking --
>> which version of yt are you using, and what type of data?  It may just
>> be that they aren't deposit fields.  In that case, try explicitly
>> stating obj["gas","temperature"] or obj["gas","HI_Density"].  It may
>> also be that the aliasing is getting in the way, in which case instead
>> of "HI_Density" you might need to try "Hp0_density".
>>
>> On Tue, Jul 11, 2017 at 5:42 AM, Carla Bernhardt
>> <carla.j.bernhardt at gmail.com> wrote:
>> > Dear yt-users,
>> >
>> > I am trying to extract a unigrid data cube within a specific region and
>> > specified dimensions, thus I am using arbitrary_grid(), however, beyond
>> the
>> > example given in the docs, my field extractions all fail. I would like
>> to
>> > extract temperature, HI_Density and HII_Density. Here is a snippet from
>> my
>> > code:
>> >
>> > obj = ds.arbitrary_grid(left_edge, right_edge, dims=[256, 256, 256])
>> > print(obj["deposit", "all_density"])
>> > print(obj["temperature"])
>> > print(obj["HI_Density"])
>> >
>> > The line print(obj["deposit", "all_density"]) works, but the two lines
>> after
>> > both fail. Here is the traceback from the temperature, and I even tried
>> out
>> > deposited temperature and deposited HI_Density. Am I formatting this
>> > incorrectly, or is there a different way to extract the fields?
>> >
>> > Kind regards,
>> > Carla Bernhardt
>> > PhD Student
>> > ZAH Institut für Theoretische Astrophysik
>> > Universität Heidelberg
>> >
>> > _______________________________________________
>> > 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/20170720/b2f609cb/attachment.htm>


More information about the yt-users mailing list