<div><div dir="auto">Thanks!  I was not familiar with the converting to arrays step, looks very straightforward. </div><div dir="auto"><br></div><div dir="auto">Best,</div><div dir="auto">Stephanie</div><br><div class="gmail_quote"><div>On Thu, Jul 6, 2017 at 9:56 PM Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 6, 2017 at 11:44 PM, Stephanie Tonnesen <span><<a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi all,<div><br></div><div>I am trying to write a bunch of information from a gas-only single enzo output to a file for colleagues to read.  I don't think they are familiar with HDF5, so I am hoping to write to a fits file.  What I want to put in the file is the x,y,z coordinates, the x,y,z velocity, and the total energy of the gas--which is a user-defined function in my case.  Ideally I also only want to include gas that has a tracer fraction of some value.  </div><div><br></div><div>so basically I have something like:</div><div><br></div><div>ds = yt.load("file")</div><div>galgas = ds.cut_region(["obj['Metal_Density']/obj['density'] > 0.1"])</div></div></blockquote><div><br></div></div></div></div><div><div class="gmail_extra"><div class="gmail_quote"><div>To get the x, y, z position:</div><div><br></div><div>    x = galgas['x']</div><div>    y = galgas['y']</div><div>    z = galgas['z']</div><div><br></div><div>And the velocity:</div><div><br></div><div>    vx = galgas['velocity_x']</div><div>    vy = galgas['velocity_y']</div><div>    vz = galgas['velocity_z']</div><div><br></div><div>And your tnermal energy derived field:</div><div><br></div><div>    te = galgas['your_te_field']</div><div><br></div><div>These will all be YTArrays. You can convert these to astropy quantities by doing:</div><div><br></div><div>    vx = vx.to_astropy()</div><div><br></div><div>Or you could convert them to ndarrays:</div><div><br></div><div>    vx = np.array(vx)</div><div><br></div><div>And then you could use astropy.io.fits to make a fits file from these arrays.</div><div><br></div><div>-Nathan</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div></div><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br></div><div>can I just create an array of the fields I want from galgas?</div><div><br></div><div>Thanks,</div><div>Stephanie</div><div><br></div><div><div><div class="m_-2489193169533917649m_-3751397478806789678gmail_signature" data-smartmail="gmail_signature"><div><div><div><div><font face="garamond,serif">--<br>Dr. Stephanie Tonnesen<br></font></div><font face="garamond,serif">Alvin E. Nashman Postdoctoral Fellow<br></font></div><font face="garamond,serif">Carnegie Observatories, Pasadena, CA<br></font></div><font face="garamond,serif"><a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</a><br></font></div></div></div>
</div></div>
<br></blockquote></div></div></div><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div></div>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><div><div><div><font face="garamond,serif">--<br>Dr. Stephanie Tonnesen<br></font></div><font face="garamond,serif">Alvin E. Nashman Postdoctoral Fellow<br></font></div><font face="garamond,serif">Carnegie Observatories, Pasadena, CA<br></font></div><font face="garamond,serif"><a href="mailto:stonnes@gmail.com" target="_blank">stonnes@gmail.com</a><br></font></div></div>