pyatran.input.save_input_files

pyatran.input.save_input_files(cfg, path)[source]

Copy SCIATRAN input files into runtime directory.

This function scans the SCIATRAN configuration cfg for parameters which specify any input file that is being used by the configuration. These input files (e.g., cross-sections, profiles, …) are then copied to the directory path/DATA_IN, and the runtime configuration is adapted accordingly, to reflect the new directory structure.

This function is meant to assist in creating independent SCIATRAN runtime directories which contain all the information needed to reproduce the run.

Parameters:

cfg : collections.OrderedDict

The SCIATRAN configuration.

path : str

The directory where the input files shall be copied to.

Returns:

runcfg : collections.OrderedDict

The SCIATRAN configuration cfg, but with the paths to all input files, which have been copied by this function to the folder path/DATA_IN, updated so that they point to the input files within path/DATA_IN.

Notes

  • input files referenced indirectly in control.inp which are related to collision induced absorption are not treated yet
  • input files referenced indirectly in control_prof.inp which are related to the ozone climatologies are not treated yet

Examples

First, we need to load a SCIATRAN configuration from JSON:

>>> cfg = pyatran.params.load_json('sciaconf.json')

Say we want to copy all input files referenced in this configuration to the directory /path/to/DATA_IN. Then, we would call this function as

>>> runcfg = save_input_files(cfg, '/path/to')

The configuration dict runcfg has the same contents as cfg with the exception that the paths to all input files referenced in cfg have been updated to point to the input file’s copy in /path/to/DATA_IN.