[yt-users] yt with gadget

Nathan Goldbaum nathan12343 at gmail.com
Fri Jun 16 09:06:55 PDT 2017


Hi Aaron,

Unfortunately no.

In the past when I had to do this, I made some ad-hoc scripts following the
C and IDL examples included with the Gadget2 source distribution that show
how to write Gadget binary files. If I was doing this today I'd probably
use h5py to generate Gadget HDF5 snapshots, since HDF5 is a nicer format
and h5py is pretty straightforward to work with.

If someone wanted to work on adding support for this to yt, I think it
would definitely be in scope for the project - we've always had long-term
goals for setting up initial conditions and also have support for writing
both in-memory patch AMR data and data loaded from another code in the Grid
Data Format.

The Gadget output format is relatively simple (in HDF5 or binary). I think
it would be doable to start a new project from scratch outside of the yt
project that ships a function accepting ndarrays for various fields and
writes valid Gadget snapshots to disk. Basically the inverse of
pygadgetreader:

https://bitbucket.org/rthompson/pygadgetreader

As far as I'm aware there isn't something like that available. If anyone on
the mailing list knows of free open source code that allows one to generate
Gadget snapshots from Python, I'd love to heard about it :)

-Nathan

On Fri, Jun 16, 2017 at 10:33 AM, Aaron <125892615 at qq.com> wrote:

>
> Hi everyone,
> I’m pretty new to this package and primarily use it to load Gadget
> snapshots, I’m wondering if it can in turn generate snapshots (used as
> initial conditions) , given all the initial conditions.
>
> _______________________________________________
> 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/20170616/cfba71ad/attachment-0001.htm>


More information about the yt-users mailing list