[yt-users] Stacked temperature profiles

Thor Andreas Seiff Ellewsen tellewsen at gmail.com
Fri Mar 10 04:30:44 PST 2017


Hi again everyone.
Sorry for not getting back to you faster.

I've tried implementing what you said Britton, and it seems to work.
However I'm still doing something wrong.

I'm using this script to make the halo catalog:
http://paste.yt-project.org/show/7077/
And this one to load the sim and the catalog, and making radial temperature
profiles: http://paste.yt-project.org/show/7078/

I'm simply copying the example found here:
http://yt-project.org/doc/cookbook/halo_analysis_example.html#Finding-Radial-Profiles

In the example we calculate the virial radius instead of just using the one
I already have in the catalog.
I'm not sure how to use the one I already have so any tips on that is also
appreciated.

Still, it is extremely slow and returns the following:
yt : [INFO     ] 2017-03-10 11:55:17,007 Calculating 1D profile for halo 1.
yt : [INFO     ] 2017-03-10 12:23:13,269 Calculating virial quantities for
halo 1.
yt : [INFO     ] 2017-03-10 12:23:13,270 Calculating 1D profile for halo 1.
yt : [INFO     ] 2017-03-10 12:23:13,270 Skipping halo 1 since data_object
is None.
yt : [INFO     ] 2017-03-10 12:23:13,272 Calculating 1D profile for halo 2.
yt : [INFO     ] 2017-03-10 12:40:49,659 Calculating virial quantities for
halo 2.
yt : [INFO     ] 2017-03-10 12:40:49,660 Calculating 1D profile for halo 2.
yt : [INFO     ] 2017-03-10 12:40:49,660 Skipping halo 2 since data_object
is None.
yt : [INFO     ] 2017-03-10 12:40:49,662 Calculating 1D profile for halo 3.
yt : [INFO     ] 2017-03-10 12:46:30,547 Calculating virial quantities for
halo 3.
yt : [INFO     ] 2017-03-10 12:46:30,548 Calculating 1D profile for halo 3.
yt : [INFO     ] 2017-03-10 12:46:30,548 Skipping halo 3 since data_object
is None.
yt : [INFO     ] 2017-03-10 12:46:30,550 Calculating 1D profile for halo 4.
yt : [INFO     ] 2017-03-10 12:54:56,886 Calculating virial quantities for
halo 4.
yt : [INFO     ] 2017-03-10 12:54:56,888 Calculating 1D profile for halo 4.
yt : [INFO     ] 2017-03-10 12:54:56,888 Skipping halo 4 since data_object
is None.
yt : [INFO     ] 2017-03-10 12:54:56,890 Calculating 1D profile for halo 5.
yt : [INFO     ] 2017-03-10 13:01:48,086 Calculating virial quantities for
halo 5.
yt : [INFO     ] 2017-03-10 13:01:48,087 Calculating 1D profile for halo 5.
yt : [INFO     ] 2017-03-10 13:01:48,087 Skipping halo 5 since data_object
is None.
yt : [INFO     ] 2017-03-10 13:01:48,089 Calculating 1D profile for halo 6.

I at this point I killed it.
Thank you for any insight you can provide on this.

Best,
Andreas Ellewsen

On Fri, 3 Mar 2017 at 20:09 Britton Smith <brittonsmith at gmail.com> wrote:

Hi Andreas,

Ah, I think I see the problem.  It wants the halos_ds to have halo ids and
masses.  If it's possible, could you add fields to your save_as_dataset
script called "particle_identifier" for halo ids and "particle_mass" for
masses.  If you don't have those fields specifically, you can probably just
make up values.  When I fix the other issues, I'll make sure to make this a
little smarter as well.

Britton

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

Hi again,

Thanks again for helping me Britton.
That actually made a difference. Unfortunately I now get a RuntimeError
from
hc = HaloCatalog(data_ds=ds, halo_ds=ds_halo)

RuntimeError: HaloCatalog quantity must be a registered function or a field
of a known type.

Best,
Andreas Ellewsen


On Fri, 3 Mar 2017 at 19:16 Britton Smith <brittonsmith at gmail.com> wrote:

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


_______________________________________________
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/20170310/3f582ad4/attachment-0001.htm>


More information about the yt-users mailing list