Wednesday, May 13, 2015

A New Format For Galacticus Parameter Files

As part of the Galacticus v0.9.4 development, we've introduced a major change in the structure of Galacticus parameter files. This change provides three improvements:
  1. Allows for more compact XML;
  2. Makes associations between groups of parameters more clear (and prevents the need for extremely long parameter names!);
  3. Paves the way for more complete object composition within Galacticus defined directly through the XML parameter file.
As an example, here's the old format for parameter files showing setting of cosmological parameters:

  <!-- Cosmological parameters -->


In the new format, this same set of parameters is described as:

  <!-- Cosmological parameters and options -->
  <cosmologyParametersMethod value="simple">
    <HubbleConstant  value="70.2"   />
    <OmegaMatter     value="0.2725" />
    <OmegaDarkEnergy value="0.7275" />
    <OmegaBaryon     value="0.0455" />
    <temperatureCMB  value="2.72548"/>


The parameter name is now simply the name of each XML element, and the parameter value is stored as an attribute of the element. (You can also store the value in a <value> element within each parameter if necessary.) In this example, values of the "simple" cosmology parameters method are now specified as subparameters within the cosmologyParametersMethod element itself.

If you have old-format parameter files, you can convert them to the new format using the migration script:

scripts/aux/ oldParametersFile.xml newParametersFile.xml

Internally, this new format will be used to allow detailed construction of objects (e.g. the ability to construct multiple cosmological models each with different sets of cosmology parameters), and, for example, to construct nested sets of filters which can be applied to merger tree construction (e.g. build a tree → measure the tree information content → prune the tree → measure the information content again).

No comments:

Post a Comment