Command Line Scripts and Conversion Tools

One of the main intents of the IRATE format is to unify the variety of formats currently used for simulations into a standard format that many tools can access efficiently. Hence, the IRATE package provides a number of conversion tools from various formats

IRATE Utilities

Validate IRATE File Structure

The iratevalidate script tests whether or not a file conforms to the IRATE format. It can also be used to show the general structure of a supplied file (or files).

Options:

-v, --verbose

Prints detailed messages during validation

-i, --immediate

Causes the script to immediately exit on first validaton error instead of reporting all errors.

-c, --print-cosmology

Print cosmology information from the supplied IRATE file(s) in addition to validating.

-p, --print-structure

Print group and dataset structure information for the supplied IRATE file(s) in addition to validating.

-t, --type

The type of IRATE file to assume for validation - used to load custom validators.

-l, --list-types

Lists all valid types and immediately exits.

-s, --skips

Skips the validation stage.

Gather IRATE File

The irategather script takes an IRATE file (or really any HDF5 file) and combines any externally linked datasets or groups into a single monolithic file. See irate.core.gather_files() for additional information.

Options:

-o, --output

File to output gathered file to. If not given, the input file will be overwritten.

-d, --delete-gathered

Delete all files that were combined to make the output file after gathering is complete.

-v, --validate

Validate before gathering. If validation fails, gathering will not occur.

Format Converters

Tipsy Binary -> IRATE

The tipsy2irate script converts files in the tipsy binary format to IRATE. Use it as tipsy2irate [options] infile [outfile]. If outfile is not specified, it will be the same as infile with ‘.h5’ added.

Options:

add options

Gadget Binary -> IRATE

The gadget2irate script converts files in the Gadget format to IRATE. Use it as gadget2irate input-file output-file [options].

Options:

-i, --inits

Specifies that the input file is an initial conditions file, in which case gas densities and smoothing lengths are skipped.

-p, --potential

Specifies that the gravitational potential is contained in the GADGET file, which is controlled via the Makefile of GADGET2. Has no effect if –type2 is enabled.

-a, --acceleration

Specifies that the acceleration is contained in the GADGET file, which is controlled via the Makefile of GADGET2. No effect if –type2 is enabled.

-s, --entropy

Specifies that the rate of change of entropy of gas particles is included in the GADGET file, which is controlled via the Makefile of GADGET2. Has no effect if –type2 is enabled.

-t, --timestep

Specifies that the timestep of each particle is contained in the GADGET file, which is controlled via the Makefile of GADGET2. Has no effect if –type2 is enabled.

--t0name, --gasname

Name of the group that the particles in the gas group of the GADGET file is given, under the specified tree.

--t1name, --haloname

Name of the group that the particles in the halo group of the GADGET file is given, under the specified tree.

--t2name, --diskname

Name of the group that the particles in the disk group of the GADGET file is given, under the specified tree.

--t3name, --bulgename

Name of the group that the particles in the bulge group of the GADGET file is given, under the specified tree.

--t4name, --starname

Name of the group that the particles in the star group of the GADGET file is given, under the specified tree.

--t5name, --bndryname

Name of the group that the particles in the boundary group of the GADGET file is given, under the specified tree.

--s8, --sigma8

Specify the cosmology parameter sigma8 for inclusion in the Cosmology group

--ns, --n_s

Specify the Power Spectrum Index for inclusion in the Cosmology group

--snap, --snapshot

Explicitely identify the snapshot number that data will be saved under in the IRATE file, rather than using the GADGET convention

-L

Human readable string the specifies the units of length in the file

-v

Human readable string the specifies the units of velocity in the file

-M

Human readable string the specifies the units of mass in the file

--_unit

Factor to convert units for the property given by the underscore to CGS

--_hfact

The exponent of the reduced Hubble Parameter as it appears in the units for the quantity given by the underscore

--_afact

The exponent of the scale factor as it appears in the units for the quantity given by the underscore

EnBiD -> IRATE

The enbid2irate script adds the data from files produced by EnBiD in the GADGET format to existing IRATE files. Use it as enbid2irate enbid-file irate-file [output-file] [options]. If outfile is not specified, it defaults to irate-file with ‘-wenbid.hdf5’ added. enbid-file should be a binary file as produced by EnBiD, and irate-file should be an existing IRATE file. All data is saved under /Analysis

Warning

This script hasn’t been updated to conform to the new IRATE standard, and, as such, should probably not be used yet.

Options:

--t0tree, --gastree

Tree (either gas, dark, or star) that the particles in the gas group of the GADGET file will be saved under.

--t1tree, --halotree

Tree (either gas, dark, or star) that the particles in the halo group of the GADGET file will be saved under.

--t2tree, --disktree

Tree (either gas, dark, or star) that the particles in the disk group of the GADGET file will be saved under.

--t3tree, --bulgetree

Tree (either gas, dark, or star) that the particles in the bulge group of the GADGET file will be saved under.

--t4tree, --startree

Tree (either gas, dark, or star) that the particles in the star group of the GADGET file will be saved under.

--t5tree, --bndrytree

Tree (either gas, dark, or star) that the particles in the boundary group of the GADGET file will be saved under.

--t0name, --gasname

Name of the group that the particles in the gas group of the GADGET file is given, under the specified tree.

--t1name, --haloname

Name of the group that the particles in the halo group of the GADGET file is given, under the specified tree.

--t2name, --diskname

Name of the group that the particles in the disk group of the GADGET file is given, under the specified tree.

--t3name, --bulgename

Name of the group that the particles in the bulge group of the GADGET file is given, under the specified tree.

--t4name, --starname

Name of the group that the particles in the star group of the GADGET file is given, under the specified tree.

--t5name, --bndryname

Name of the group that the particles in the boundary group of the GADGET file is given, under the specified tree.

Gadget Binary + EnBiD -> IRATE

The gb2-enbid2irate script combines the gb2irate and enbid2irate scripts into one step. Use it as gb-enbid2irate gadget-file enbid-file [output-file] [options]. If outfile isn’t specified, it defaults to gadget-file with ‘-enbid-irate.hdf5’ added. Takes the same options as gb2irate.

Warning

This script hasn’t been updated to conform to the new IRATE standard, and, as such, should probably not be used yet.

AHF ASCII -> IRATE

The ahf2irate script converts files in the AHF ASCII format to IRATE. Use it as ahf2irate input-file-base output-file snapshot-number [options]. The input file base should be provided as *.AHF_; i.e. everything up to the “halos” or “particles” or “profiles” part of the filename.

Options:

--name

The name that will be used for the group that the halo catalog is saved in.

--particles

Include particle data from input-file-base + ‘particles’. If given, the data will be saved in a second HDF5 file that will be linked to the main IRATE catalog file.

--profiles

Include radial profiles from input-file-base + ‘profiles’. Data will be saved under /Catalog/RadialProfiles/

-p

Include both particles and profiles data; i.e. enables both –particles and –particles.

--nogas

Enable if AHF was not compiled with -DGAS_PARTICLES or code will fail in trying to combine spatial datasets related to gas and star particles.

--paramfile=<parameter file>

Specify an AHF parameter file to be saved as attributes to the group that contains the halo catalog.

-s, --size

Maximum size that particle data will be in memory before writing to a file, in GB. Note that this only has an effect if using HDF5 1.8; otherwise, all the particles will be read before anything is written.

--hdf5-16

Force the usage of HDF5 1.6 API, even if 1.8 is found. At present, the benefits that 1.8 provides aren’t working, so this is always enabled.

--pos

Human readable string that identifies the units used for position

--vel

Human readable string that identifies the units used for velocity

--mass

Human readable string that identifies the units used for mass

--rad

Human readable string that identifies the units used for radius

--energy

Human readable string that identifies the units used for energy

--phi

Human readable string that identifies the units used for Phi0

--ang

Human readable string that identifies the units used for angular momentum

--___unit

Factor to convert the units for the quantity given by the underscore to CGS

--___hfact

The exponent of the reduced Hubble Parameter as it appears in the units for the quantity given by the underscore

--___afact

The exponent of the scale factor as it appears in the units for the quantity given by the underscore

AHF Particles -> IRATE

The ahfparticles2irate script reads an AHF _particles file, saves it to an HDF5 file, then links the resulting datasets to an existing IRATE catalog file. Use it as ahfparticles2irate particle-file irate-file output-file snapshot-number [options]. If output-file isn’t specified, it defaults to irate-file + ‘-{snapshot number}particles.hdf5’.

Options:

-o, --overwrite

Overwrite the existing output file, if it exists.

-s, --size

Maximum size that particle data will be in memory before writing to a file, in GB. Note that this only has an effect if using HDF5 1.8; otherwise, all the particles will be read before anything is written.

--hdf5-16

Force the usage of HDF5 1.6 API, even if 1.8 is found. At present, the benefits that 1.8 provides aren’t working, so this is always enabled.

--name

The name of the group that the halo catalog is saved under. Must match what is already in the file.

Rockstar -> IRATE

The rockstar2irate script converts Rockstar halo catalogs to IRATE catalog files. Use it as rockstar2irate input-file output-file snapshot-number [format] [options]. If output-file isn’t specified, it defaults to input-file with ‘-irate.hdf5’ added.

Options:

-b

Specifies that the input file is a Rockstar binary file.

-a

Specifies that the input file is a Rockstar ASCII file.

-n, --name

Specify the name of the group that the halo catalog is to be saved under.

--ns, --n_s

Specify the Power Spectrum Index for inclusion in the Cosmology group

--s8, --sigma8

Specify the cosmological parameter sigma8 for inclusion in the Cosmology group.