Wiki

Clone wiki

pygad / Configuration

home - up - previous next

Configuring pygad

After you have installed pygad, it is ready to use. However, due to the large variety of Gadget snapshots out there, one might need to adjust the config files that determine the behaviour of pygad.

There are three different types of config files:

For all of them there exists a default version within the module. At start-up of pygad it is looked for them in the following directories, highest priority first:

  1. the working directory .,
  2. ~/.config/pygad,
  3. the modules default path (pygad/config/ -- do not change them!).

One can, of course, only customise some of them (e.g. only create a custom gadget.cfg in the current directory and use the default ones for the others). If you want to customise a config file, it is recommended to copy the default one and to then modify it.

units.cfg

The unit configuration file sets up the unit system used by pygad. pygad has a class UnitArr that inherits from numpy.ndarray and decorates them with units (in form the class pygad.Unit). It is a core functionality of pygad which is extensively used.

Some units need to be defined to use some of functions and some units even need to be defined (in one or the other way) to import pygad! However, this config file is very seldom needed to be customised and the default one is sufficient.

For more details see: Unit Definition Config File.

gadget.cfg

This configuration file is for setting parameters of Gadget snapshots that cannot be read from the snapshot files themselves.

This is the config file that by far is the one that needs to be modified most often. Typical parameters to adjust are the units used in the snapshot files (though this can be done on a per-snapshot basis with pygad.Snap), the correspondence of particle types to particle families (e.g. setting particles of types 1, 2, and 3 as dark matter particles), and the names used for the blocks in the snapshots.

For more details see: Gadget Configuration File.

derived.cfg

In this configuration file, derived blocks can be defined. Such derived blocks are blocks that can be calculated from blocks (typically) available in the snapshots and depend on them. An example is radius r that is a function of the position vectors pos. These blocks get automatically updated, if a block they depend on has changed.

For more details see: Derived Block Definition File.

Updated