<div dir="ltr"><div dir="ltr" class="gmail_msg">Hi again.</div><div dir="ltr" class="gmail_msg"><br><div class="gmail_msg">Thank for helping me Britton!</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I think I've gotten the halo catalog saved to file now, but I'm having problems loading it using HaloCatalog.</div><div class="gmail_msg">I've used the code you provided, and everything seems to be going fine until I try loading the catalog.</div><div class="gmail_msg"><br class="gmail_msg">If I try this:</div><div class="gmail_msg">save_as_dataset(ds,'test.h5', data, field_types=ftypes, extra_attrs=extra_attrs)</div><div class="gmail_msg">ds_halo = load('test.h5')<br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">hc = HaloCatalog(data_ds=ds, halos_ds=ds_halo)<br class="gmail_msg"></div><div class="gmail_msg"><br></div></div><div class="gmail_msg">This returns</div><div class="gmail_msg">IOError: Unable to open file (Unable to open file: name = '.0.h5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)<br class="gmail_msg"></div><div class="gmail_msg"><br></div><div class="gmail_msg">I tried using </div><div class="gmail_msg">save_as_dataset(ds,'test.0.h5', data, field_types=ftypes, extra_attrs=extra_attrs)<br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">ds_halo = load('test.0.h5')</div><div class="gmail_msg">hc = HaloCatalog(data_ds=ds, halos_ds=ds_halo)</div></div><div class="gmail_msg">instead, but then I get<br></div><div class="gmail_msg"><div class="gmail_msg"><br></div></div><div class="gmail_msg"><div class="gmail_msg">IOError: Unable to open file (Unable to open file: name = 'test.1.h5', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)</div><div><br></div></div><div class="gmail_msg">It seems it's trying to open more than one file for some reason?</div><div class="gmail_msg">Did I misunderstand something?</div><div class="gmail_msg"><br></div><div class="gmail_msg">I've uploaded the code again to <a href="http://paste.yt-project.org/show/7062/">http://paste.yt-project.org/show/7062/</a></div><div class="gmail_msg"><br></div><div class="gmail_msg">Best,</div><div class="gmail_msg">Andreas Ellewsen</div></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Thu, 2 Mar 2017 at 19:37 Britton Smith <<a href="mailto:brittonsmith@gmail.com" class="gmail_msg" target="_blank">brittonsmith@gmail.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Hi Andreas,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I think all this can be done very cleanly using yt's halo analysis toolkit. I'd be happy to help you with this.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Documentation for the halo analysis, also called the HaloCatalog, is here:</div><div class="gmail_msg"><a href="http://yt-project.org/docs/dev/analyzing/analysis_modules/halo_catalogs.html#halo-catalog-analysis" class="gmail_msg" target="_blank">http://yt-project.org/docs/dev/analyzing/analysis_modules/halo_catalogs.html#halo-catalog-analysis</a><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The HaloCatalog works with the simulation snapshot and the halo finder output in tandem to run a pipeline of analysis that you define. yt comes with a number of functions out of the box for doing profiling, etc, including scaling of profiles to r_vir.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Before that, you will need to convert your halo finder output into a form that yt can read in using yt.load. This should be relatively straightforward. I've sketched out how to do this here:</div><div class="gmail_msg"><a href="http://paste.yt-project.org/show/7061/" class="gmail_msg" target="_blank">http://paste.yt-project.org/show/7061/</a><br class="gmail_msg"></div><div class="gmail_msg">The code snippet there assumes some of the variables you've got in the script you posted.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">There may be some hiccups still, but I'm happy to work with you to get it going. Once that works, you should be able to use the HaloCatalog as documented to do the rest, but feel free to ask any other questions you might have.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Britton</div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"></div></div><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg">On Wed, Mar 1, 2017 at 5:16 AM, Thor Andreas Seiff Ellewsen <span dir="ltr" class="gmail_msg"><<a href="mailto:tellewsen@gmail.com" class="gmail_msg" target="_blank">tellewsen@gmail.com</a>></span> wrote:<br class="gmail_msg"></div></div><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">Hi everyone.<br class="gmail_msg"><br class="gmail_msg"></div>I'm currently working on making temperature and density profiles from some ramses simulations.<br class="gmail_msg"></div><div class="gmail_msg">I'd like to make these profiles the average radial profile of the halos in the simulation.<br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I think the included rockstar in yt supports this in some form, but my halo catalog is made using AHF and then imported from an ascii file.<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">To do this I need help with two things:<br class="gmail_msg"></div><div class="gmail_msg">The first one is how to scale the radius of each profile to the corresponding virial radius.<br class="gmail_msg"></div><div class="gmail_msg">The other is how to actually average all these profiles.<br class="gmail_msg"><br class="gmail_msg">Is this something that can be done?<br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I will be trying to compare the resulting profile with the same for different simulations in the end, but I don't expect to have any big problems with that.<br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The code I'm currently using for this can be found at <br class="gmail_msg"><a href="http://paste.yt-project.org/show/7058/" class="gmail_msg" target="_blank">http://paste.yt-project.org/show/7058/</a><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Best,<br class="gmail_msg"></div><div class="gmail_msg">Andreas Ellewsen<br class="gmail_msg"></div></div>
<br class="gmail_msg"></blockquote></div></div><div class="gmail_extra gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br class="gmail_msg">
yt-users mailing list<br class="gmail_msg">
<a href="mailto:yt-users@lists.spacepope.org" class="gmail_msg" target="_blank">yt-users@lists.spacepope.org</a><br class="gmail_msg">
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br class="gmail_msg">
<br class="gmail_msg"></blockquote></div><br class="gmail_msg"></div>
_______________________________________________<br class="gmail_msg">
yt-users mailing list<br class="gmail_msg">
<a href="mailto:yt-users@lists.spacepope.org" class="gmail_msg" target="_blank">yt-users@lists.spacepope.org</a><br class="gmail_msg">
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br class="gmail_msg">
</blockquote></div></div>