<div dir="ltr">Hi Aaron,<div><br></div><div>Unfortunately no.</div><div><br></div><div>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.<br></div><div><br></div><div>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.</div><div><br></div><div>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:</div><div><br></div><div><a href="https://bitbucket.org/rthompson/pygadgetreader">https://bitbucket.org/rthompson/pygadgetreader</a><br></div><div><br></div><div>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 :)</div><div><br></div><div>-Nathan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 16, 2017 at 10:33 AM, Aaron <span dir="ltr"><<a href="mailto:125892615@qq.com" target="_blank">125892615@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi everyone,<br>
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.<br>
<br>
______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
</blockquote></div><br></div>