load AHF halo file from different path than snapshot

154 views
Skip to first unread message

Isabel Santos Santos

unread,
Aug 27, 2018, 5:30:35 AM8/27/18
to pynbody-users
Hi,
I wanted to know if it is possible to load an AHF halos file when it is not inside the same directory as the snapshot. I tried using *pathname* (i read about this in a previous question) like this:
h= sim.halos( pathname= path+' name of the halos file' )
but it keeps saying "No halo catalogue found for SimSnap..etc"

thanks for your help,
Isabel

Andrew Pontzen

unread,
Aug 27, 2018, 4:31:23 PM8/27/18
to Isabel Santos Santos, pynbody-users
Dear Isabel,

According to the docstring for AHFCatalogue, looks like you have to use ahf_basename instead - see 

I guess this is because AHF catalogues are split across multiple files

Hope this helps - 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.
For more options, visit https://groups.google.com/d/optout.

Isabel Santos Santos

unread,
Aug 27, 2018, 5:00:27 PM8/27/18
to pynbody-users
Dear Andrew, thank you, I eventually found it out but it did not work, I had to rename the files. I got the following error:
RuntimeError("Path to AHF (None) is invalid"
Looking at the code, I think pynbody searches for the AHF files with the same basename and if it does not find them, it tries to run AHF, instead of first checking if the ahf_basename keyword was used (?)

thank you
Isabel

Andrew Pontzen

unread,
Aug 27, 2018, 5:05:28 PM8/27/18
to Isabel Santos Santos, pynbody-users
Dear Isabel

Yes it looks like it - to get round this you could invoke the AHFCatalogue class directly I.e.

h=pynbody.halo.ahf.AHFCatalogue(f, ahf_basebame=‘...’)

or of course patch the code so it looks for the keyword in can_load (in which case please submit a pull request!)

Best regards

Andrew
Reply all
Reply to author
Forward
0 new messages