[yt-users] yt basic visualization for gadget output
Junhwan Choi (최준환)
choi.junhwan at gmail.com
Mon Dec 15 09:52:20 PST 2014
Hi Nathan and Matt,
I found a potential mistake in my side while I generate the HDF5 output.
I will fix it and report you.
Thank you,
Junhwan
On Sun, Dec 14, 2014 at 5:45 PM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:
> When I run "h5ls -r" on the snapshot you shared with me off-list, I get the
> following:
>
> goldbaum at ROUS in ~/Dropbox/Gadget_yt_test
> ○ h5ls -r snap_agora_100.hdf5
> / Group
> /Header Group
> /PartType0 Group
> /PartType0/ArtificialViscosity Dataset {2277264}
> /PartType0/Coordinates Dataset {2277264, 3}
> /PartType0/Density Dataset {2277264, 2}
> /PartType0/ElectronAbundance Dataset {2277264, 2}
> /PartType0/H2I Dataset {2277264, 2}
> /PartType0/H2II Dataset {2277264, 2}
> /PartType0/HI Dataset {2277264, 2}
> /PartType0/HII Dataset {2277264, 2}
> /PartType0/HM Dataset {2277264, 2}
> /PartType0/HeI Dataset {2277264, 2}
> /PartType0/HeII Dataset {2277264, 2}
> /PartType0/HeIII Dataset {2277264, 2}
> /PartType0/InternalEnergy Dataset {2277264, 2}
> /PartType0/NeutralHydrogenAbundance Dataset {2277264, 2}
> /PartType0/ParticleIDs Dataset {2277264, 2}
> /PartType0/Potential Dataset {2277264}
> /PartType0/SmoothingLength Dataset {2277264, 2}
> /PartType0/Velocities Dataset {2277264, 3}
> /PartType1 Group
> /PartType1/Coordinates Dataset {2277264, 3}
> /PartType1/ParticleIDs Dataset {2277264, 2}
> /PartType1/Potential Dataset {2277264}
> /PartType1/Velocities Dataset {2277264, 3}
> /PartType5 Group
> /PartType5/Coordinates Dataset {3206474, 3}
> /PartType5/Masses Dataset {3206474, 2}
> /PartType5/ParticleIDs Dataset {3206474, 2}
> /PartType5/Potential Dataset {3206474}
> /PartType5/Velocities Dataset {3206474, 3}
>
> It seems that many of the datasets are matrices with two rows rather than
> vectors. Do you know where this is coming from? I don't think I've seen a
> gadget hdf5 dataset with this structure before.
>
> Is the data duplicated or has it just been arbitrarily split over two rows,
> which we should concatenate internally?
>
> On Sun, Dec 14, 2014 at 4:34 AM, Matthew Turk <matthewturk at gmail.com> wrote:
>>
>> On Sat, Dec 13, 2014 at 11:11 PM, Nathan Goldbaum <nathan12343 at gmail.com>
>> wrote:
>> >
>> >
>> > On Sat, Dec 13, 2014 at 8:58 PM, Junhwan Choi (최준환)
>> > <choi.junhwan at gmail.com>
>> > wrote:
>> >>
>> >> Thank you Nathan,
>> >>
>> >> I change Density to density and still experience the errors.
>> >> I paste the error message on https://bpaste.net/show/bfff704acb9c
>> >> However, I would like to see some basic documents regarding this
>> >> issue, if there is any new tip for particle data dealing in yt.
>> >> For example, I would like to know how to make dark matter density
>> >> field and something more.
>> >
>> >
>> > Hmm, I've never seen an error like this actually. This looks like a yt
>> > bug.
>> > All I can say based on the traceback is that this is happening at a low
>> > level right after we read the data off disk.
>>
>> Junhwan, what's happening is that your density field on disk is a
>> vector, with two elements. (Checking this with h5dump -r on one of
>> your hdf5 files should verify that.) If that's intentional, we'll
>> need to come up with a way to break the uncertainty as to which one is
>> the "right" one. Could you send a link to a paste of h5dump -r on
>> your output file? The yt pastebin is back up.
>>
>> >
>> > Is there any chance you can share the dataset you're trying to load?
>> > Your
>> > dataset might be breaking an assumption we're making somewhere in the
>> > gadget
>> > frontend. We've had a lot of success sharing big datasets on the mailing
>> > list using Google drive or dropbox.
>> >
>> > You can visualize the dark matter density (and most other particle
>> > fields)
>> > using the deposition functionality. Deposit fields are a special type
>> > of
>> > field that yt computes by depositing particle quantities onto a mesh -
>> > specifically an octree mesh for Gadget data.
>> >
>> > There's some documentation for deposit fields in the field documentation
>> > here:
>> >
>> > http://yt-project.org/docs/dev/analyzing/fields.html
>> >
>> > You can see a fully worked out example of how to use a deposition field
>> > in
>> > this notebook:
>> >
>> >
>> > http://yt-project.org/docs/dev/examining/generic_particle_data.html?highlight=generic%20particle%20data
>> >
>> > There's also this notebook specifically about gadget data:
>> >
>> >
>> > http://yt-project.org/docs/dev/cookbook/gadget_notebook.html?highlight=gadget
>> >
>> >>
>> >>
>> >> Thank you,
>> >> Junhwan
>> >>
>> >> On Sat, Dec 13, 2014 at 10:51 PM, Nathan Goldbaum
>> >> <nathan12343 at gmail.com>
>> >> wrote:
>> >> >
>> >> >
>> >> > On Sat, Dec 13, 2014 at 8:48 PM, Nathan Goldbaum
>> >> > <nathan12343 at gmail.com>
>> >> > wrote:
>> >> >>
>> >> >>
>> >> >>
>> >> >> On Sat, Dec 13, 2014 at 8:46 PM, Junhwan Choi (최준환)
>> >> >> <choi.junhwan at gmail.com> wrote:
>> >> >>>
>> >> >>> Hi yt users and developers:
>> >> >>>
>> >> >>> I try to use yt to visualize my gadget output (hdf5 format).
>> >> >>> I made following simple script:
>> >> >>> ========================
>> >> >>> import matplotlib as matplotlib
>> >> >>> matplotlib.use('Agg')
>> >> >>> import matplotlib.pylab as pylab
>> >> >>> import yt
>> >> >>>
>> >> >>> ds = yt.load("snap_agora_100.hdf5")
>> >> >>>
>> >> >>> print ds.field_list
>> >> >>> print ds.derived_field_list
>> >> >>>
>> >> >>> pc = yt.ProjectionPlot(ds, "x", ('gas', 'Density'))
>> >> >>
>> >> >>
>> >> >> I think it will work if you use ('gas', 'density')
>> >> >>
>> >> >> (note the lower-case D)
>> >> >>
>> >> >> If that doesn't work, can you pastebin the error you're seeing,
>> >> >> along
>> >> >> with
>> >> >> the traceback? We have paste.yt-project.org for this purpose.
>> >> >
>> >> >
>> >> > Which is unfortunately down at the moment - bpaste.net or
>> >> > gist.github.com
>> >> > are good alternatives.
>> >> >
>> >> >>
>> >> >>
>> >> >>>
>> >> >>> pc.save("gadget")
>> >> >>> ==========================
>> >> >>> But it results in unknown error messages.
>> >> >>> And, I have searched some documents for yt for gadget, but there is
>> >> >>> also nothing I can find.
>> >> >>> Is there any yt gadget documents I can consult ?
>> >> >>> I have used yt for my enzo simulation analysis.
>> >> >>>
>> >> >>> Thanks in advance,
>> >> >>> Junhwan Choi
>> >> >>> _______________________________________________
>> >> >>> 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
>> >
>> >
>> > _______________________________________________
>> > 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
>
_______________________________________________
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