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
cfgfor 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 directorypath/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 folderpath/DATA_IN, updated so that they point to the input files withinpath/DATA_IN.Notes
- input files referenced indirectly in
control.inpwhich are related to collision induced absorption are not treated yet - input files referenced indirectly in
control_prof.inpwhich 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
runcfghas the same contents ascfgwith the exception that the paths to all input files referenced incfghave been updated to point to the input file’s copy in/path/to/DATA_IN.- input files referenced indirectly in