The IRATE library includes convinience functions for working with IRATE format files. The functions documented below are present in the irate namespace, so the typical way to import is:
from irate import validate_irate
rather than importing from irate.core.
This exception is raised if a file is loaded that does not conform to the IRATE Format.
This exception is raised if a file is loaded that does not conform to the strict IRATE Format.
A Convinience function to create an IRATE format file data as numpy arrays. This will overwrite a currently existing file.
Parameters: |
|
---|---|
Returns: | The h5py.File of the newly-created file (still open). |
Raises: |
|
Convinience function to build an array with all the particles of a requested type or types (i.e. all subgroups, if present, will be visited).
Parameters: |
|
---|---|
Returns: | A 3-tuple (data,grpidx,grpmap) where data is the data arrays, grpidx is an int array with the same first dimension as data, and grpmap is a dictionary mapping the values in grpidx to group names. |
Raises ValueError: | |
If a group does not have the requested dataname. |
Convinience function to determine the number of entries in an IRATE halo catalog file.
Parameters: | |
---|---|
Returns: | an integer with the total number of halos |
Convinience function to determine the number of particles of each type in an IRATE format file.
Parameters: | |
---|---|
Returns: | a 3-namedtuple (ndark,nstar,ngas) |
Ensures the supplied file conforms to the IRATE halo catalog format. If it does not, an exception will be raised.
Parameters: | file – The file name or h5py.File object to be validated. |
---|---|
Raises: |
|
Ensures the supplied file conforms to the IRATE format. If it does not, an exception will be raised.
Parameters: | |
---|---|
Raises: |
|