[yt-users] Stacked temperature profiles

Britton Smith brittonsmith at gmail.com
Fri Mar 3 10:16:36 PST 2017


Hi Andreas,

I forgot about the constraints of the naming conventions for halo catalog
files.  They need to be named in the following convention:
<prefix>.<integer>.h5
where the integer should start at 0.  That integer is in case your catalog
is split over multiple files.  In examining the code, I can see that it
counts the number of files by basically doing glob(<prefix>*h5), so if
you've got a file named test.h5 and test.0.h5 in the same directory, it
will fool the code into thinking there should be test.0.h5 and test.1.h5.
This is clearly a bit of a silly shortcoming of this approach, and I will
submit a pull request to make this more intelligent.  In the mean time, I
think you can fix this by making sure that there is only one file,
test.0.h5 in the directory.

Let me know if that doesn't fix it.

Britton

On Fri, Mar 3, 2017 at 6:28 AM, Thor Andreas Seiff Ellewsen <
tellewsen at gmail.com> wrote:

> Hi again.
>
> Thank for helping me Britton!
>
> I think I've gotten the halo catalog saved to file now, but I'm having
> problems loading it using HaloCatalog.
> I've used the code you provided, and everything seems to be going fine
> until I try loading the catalog.
>
> If I try this:
> save_as_dataset(ds,'test.h5', data, field_types=ftypes,
> extra_attrs=extra_attrs)
> ds_halo = load('test.h5')
> hc = HaloCatalog(data_ds=ds, halos_ds=ds_halo)
>
> This returns
> 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)
>
> I tried using
> save_as_dataset(ds,'test.0.h5', data, field_types=ftypes,
> extra_attrs=extra_attrs)
> ds_halo = load('test.0.h5')
> hc = HaloCatalog(data_ds=ds, halos_ds=ds_halo)
> instead, but then I get
>
> 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)
>
> It seems it's trying to open more than one file for some reason?
> Did I misunderstand something?
>
> I've uploaded the code again to http://paste.yt-project.org/show/7062/
>
> Best,
> Andreas Ellewsen
>
> On Thu, 2 Mar 2017 at 19:37 Britton Smith <brittonsmith at gmail.com> wrote:
>
> Hi Andreas,
>
> I think all this can be done very cleanly using yt's halo analysis
> toolkit.  I'd be happy to help you with this.
>
> Documentation for the halo analysis, also called the HaloCatalog, is here:
> http://yt-project.org/docs/dev/analyzing/analysis_
> modules/halo_catalogs.html#halo-catalog-analysis
>
> 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.
>
> 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:
> http://paste.yt-project.org/show/7061/
> The code snippet there assumes some of the variables you've got in the
> script you posted.
>
> 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.
>
> Britton
>
> On Wed, Mar 1, 2017 at 5:16 AM, Thor Andreas Seiff Ellewsen <
> tellewsen at gmail.com> wrote:
>
> Hi everyone.
>
> I'm currently working on making temperature and density profiles from some
> ramses simulations.
> I'd like to make these profiles the average radial profile of the halos in
> the simulation.
>
> 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.
>
> To do this I need help with two things:
> The first one is how to scale the radius of each profile to the
> corresponding virial radius.
> The other is how to actually average all these profiles.
>
> Is this something that can be done?
>
> 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.
>
> The code I'm currently using for this can be found at
> http://paste.yt-project.org/show/7058/
>
> Best,
> Andreas Ellewsen
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170303/53869bcd/attachment-0001.htm>


More information about the yt-users mailing list