pynbody can't load ahf file

57 views
Skip to first unread message

Nick Samaras

unread,
Jan 31, 2023, 10:59:41 AM1/31/23
to pynbody-users
Hello pynbody team,

My name is Nick Samaras and I am trying to use your package to analyze my simulations.
I am doing simulations with RAMSES and then finding the halos with AHF. However, when trying to load the output with s = pynbody, I am getting an error "File 'filename': format not understood or does not exist." . 

I have been testing the command "pynbody.snapshot.ramses.RamsesSnap" --> "[Errno 2] No such file or directory: 'testdata/testrun1_output_013.z8.063.AHF_halos.gz/info_None.txt' "

or "pynbody.halo.AmigaGrpCatalogue" -->  "TypeError: string indices must be integers'" and

 "pynbody.halo.ahf.AHFCatalogue" --> AttributeError: 'str' object has no attribute '_filename'

I have also had a look at the file you are proposing online and my AHF output and they are different. They don't have the same number of columns either they start with npart variable as yours.

Could you help me? do you have any ideas?

Cheers,
Nick

Andrew Pontzen

unread,
Jan 31, 2023, 11:54:05 AM1/31/23
to Nick Samaras, pynbody-users
Hi Nick

It looks to me like you're passing the path to the AHF halos file rather than the ramses snapshot to the RamsesSnap constructor. You need to pass the Ramses file (with a filename of the sort output_00xxx). But without an explicit example it's a bit hard to tell whether this guess is right.

All the best

Andrew 

--
You received this message because you are subscribed to the Google Groups "pynbody-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynbody-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynbody-users/ee0448d6-9cdd-4235-97ad-1245c2d3689bn%40googlegroups.com.

Nick Samaras

unread,
Feb 1, 2023, 4:10:49 AM2/1/23
to Andrew Pontzen, pynbody-users
Hi Andrew,

and thanks for your prompt reply.

Maybe I didn't say it properly; I want to load ahf data, exactly like you example at the webpage:

s = pynbody.load('testdata/g15784.lr.01024.gz')

The problem is either the name of my file; should it be like this? g15..?

or the format: I am looking at your _AHF_halos file and it's not identical: the columns are in different order; my file starts with the IDs of the halos while yours not and other stuff...

Any tips?

Cheers,
Nick

From: Andrew Pontzen <a.po...@ucl.ac.uk>
Sent: Tuesday, January 31, 2023 17:53
To: Nick Samaras <NickS...@hotmail.com>
Cc: pynbody-users <pynbod...@googlegroups.com>
Subject: Re: pynbody can't load ahf file
 

Pontzen, Andrew

unread,
Feb 1, 2023, 7:16:04 AM2/1/23
to pynbody-users
The example you are quoting is of loading a tipsy file, not an AHF halos file.

To load halos, you must first load the snapshot data (e.g. s=pynbody.load(“output_xxxxx”)), then load the halos e.g. h = s.halos() or h = pynbody.halo.ahf.AHFCatalogue(s)

Hope this helps

With best wishes

Andrew


On 1 Feb 2023, at 09:10, Nick Samaras <NickS...@hotmail.com> wrote:

⚠ Caution: External sender

Nick Samaras

unread,
Feb 6, 2023, 8:57:32 AM2/6/23
to Pontzen, Andrew, pynbody-users
Hi Andrew,

Thanks for your help. I managed to load the AHF file and place the main halo in a separate variable h1= h[1] but, when trying the rest, I keep having errors of type: 

" 'DummyHalo object has no attribute 'ancestor' "

Is there any particular reason for this? 

I am using a modified version of ramses and AHF, so I am also having that 'DummyHalo' object has no attribute 'gas' which is most likely not a matter of pynbody, right?

Sorry for the newbie questions.

Cheers,
Nick

From: pynbod...@googlegroups.com <pynbod...@googlegroups.com> on behalf of Pontzen, Andrew <a.po...@ucl.ac.uk>
Sent: Wednesday, February 1, 2023 13:16
To: pynbody-users <pynbod...@googlegroups.com>
You received this message because you are subscribed to a topic in the Google Groups "pynbody-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pynbody-users/mJuQy5ek3Dc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pynbody-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynbody-users/64CB1389-F948-428B-8923-8482EC528EC2%40ucl.ac.uk.

Pontzen, Andrew

unread,
Feb 8, 2023, 7:23:53 AM2/8/23
to Nick Samaras, pynbody-users
Hi Nick

It’s hard to guess at what’s going on here. You’ll need to spell out clearly what you’re trying to do by posting an example that reproduces your problem.

All the best

Andrew
Reply all
Reply to author
Forward
0 new messages