Hi all,--
I'm trying to run AHF through pynbody (as explained here: http://pynbody.github.io/pynbody/tutorials/halos.html) but get the following error:
File "hmf.py", line 8, in <module>
h = pynbody.halo.AHFCatalogue(s)
File "/PATH/TO/PYTHON/python2.6/site-packages/pynbody/halo.py", line 285, in __init__
self._run_ahf(sim)
File "/PATH/TO/PYTHON/python2.6/site-packages/pynbody/halo.py", line 571, in _run_ahf
1.0 / np.min(sim['eps'])))), 131072])
File "/PATH/TO/PYTHON/python2.6/site-packages/pynbody/snapshot.py", line 286, in __getitem__
self._derive_array(i)
File "/PATH/TO/PYTHON/python2.6/site-packages/pynbody/snapshot.py", line 1357, in _derive_array
raise KeyError("No derivation rule for "+name)
I'm using AHF v1.0-075, although in the github issues it looks like only versions up to 1.0-067 are supported. Is this still the case? If so, does anyone know where I can get a copy of 1.1-067 (I can only find down to 1.0-071). Greatly appreciate any help.
Many thanks,
David
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/groups/opt_out.
time = 0.000000
nbodies = 687402840
ndim = 62
nsph = 7530992
ndark = 0
nstar = 7531024
Hi Andrew,
Many thanks for your reply, that took care of the above problem. I'm getting some strange particles counts however:
time = 0.000000
nbodies = 687402840
ndim = 62
nsph = 7530992
ndark = 0
nstar = 7531024
This is for a 4 Mpc/h 256^3 (both AMR cells and particles) simulation. Does pynbody perform on the fly format conversion of RAMSES data to a AHF supported format? If so could there be some issues with the header?
Many thanks,
David
On Wednesday, 29 January 2014 22:41:02 UTC, Andrew Pontzen wrote:
Hello all,
I'm trying to do something similar except with a Gadget HDF file. I keep getting errors that are similar to the one David was encountering. Do Gadget HDF files have to be converted into Gadget binary format in order to be used by AHF? Or is there a way to funnel them into AHF after using the pynbody.load function?
Cheers,
Alex Fitts
On Monday, February 3, 2014 7:51:03 PM UTC-5, David Sullivan wrote:
For more options, visit https://groups.google.com/d/optout.
Andrew,
Let me back up. After loading the hdf5 files, i cannot even access all of the information in the file. Invoking snap['pos'] or snap['iord'] works fine but neither snap['vel'] nor snap['mass'] have 'derivation rules'. Is this possibly a mistake with my config.ini script in the pynbody directory? In an attempt to temporarily sidestep the hdf5 issue, i have resorted to using binary snapshots. I am confused by the error i am receiving when trying to use the halos function. If i have already run AHF and have the corresponding .AHF_halos, .AHF_profiles etc how can i get pynbody to notice them? Do the files have to be gzipped with the snapshot? I'm getting the following error when trying to run the halos function:
>>> h=s.halos()
gunzip: snapdir_051/snapshot_051.gz: No such file or directory
sh: ./AHF.in: Permission denied
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/homes/afitts/.local/lib/python2.7/site-packages/pynbody/snapshot/__init__.py", line 793, in halos
return c(self, *args, **kwargs)
File "/homes/afitts/.local/lib/python2.7/site-packages/pynbody/halo.py", line 612, in __init__
glob.glob(sim._filename + '*z*halos*')[0])[:-5]
IndexError: list index out of range
On Friday, September 19, 2014 5:30:29 PM UTC-4, Andrew Pontzen wrote:
Hey Andrew,
Here is a link to the snapshot and a script that should reproduce the hdf5 loading error. https://www.dropbox.com/s/gl61p6bz1t5jhfe/example.tar?dl=0 Thanks for your help!
-Alex
Interestingly, your velocity array, which in HDF files I’ve seen in the past is called ‘Velocity’ is instead called ‘Velocities’.
Similarly, your mass array is called “Masses” rather than “Mass”.
Is this file written using regular Gadget or is it some variant?
We should produce a patch if this is a common variant but in the meantime you can fix the problem by creating a .pynbodyrc file in your home folder with the following contents:
[gadgethdf-name-mapping]Velocities: velVelocity: xvelMasses: massMass: xmass
There is an added complication which is that “Mass” was hardcoded into the gadgethdf handler for cases where the mass derives from the header (which is partially true in your case) so you will also need to update your version of pynbody to the new version I just created
git pull origin gadgethdf_flexibilitypython setup.py install
should do it.
Hope this helps. Please let us know what variant of gadget you are using and I can prepare a more permanent fix for this.
Best wishes, Andrew
On 21 Sep 2014, at 21:20, Alex Fitts <fitts...@gmail.com> wrote:
Hey Andrew,
Here is a link to the snapshot and a script that should reproduce the hdf5 loading error. https://www.dropbox.com/s/gl61p6bz1t5jhfe/example.tar?dl=0 Thanks for your help!
-Alex
Great! That worked perfectly. The file was produced using Gadget 3.
Thanks Again,
Alex