Be sure to divide the relevant quantities (pos, rvir etc.) by header.hubble. See the Gadget section in the sidebar for more information on the header and block types available.
If you wanted to get the postions of all the particles for a specific halo (or any block).
pos = htils.load_partblock(hpath,zoomid,"POS ")# units Mpc/h
# "VEL ", "ID ", "MASS" etc. also work (notice the space)
# check readsnapshots/readsnapHDF5.py for the other block names
# you can call in the caterpillar modules
print pos*1000.# kpc/h
If you want to read in the entire block, use the following:
import haloutils as htils
hpath = htils.hid_hpath_lx(hid,lx)
pos = htils.load_partblock(hpath,319,"POS ")
mass = htils.load_partblock(hpath,319,"MASS")
Note that the mass block will have different values depending on how many layers of refinement there are for that zoom in simulation. If you use this code on a parent simulation it will be an array of length N all of the same value because there is only one particle type.
If you wanted just the ids for a selection of particle ids:
pos = htils.load_partblock(hpath,zoomid,"POS ",partids=[listofids])# units Mpc/h