Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

README

This aims to breakup the long splat control files into a smaller file where only the inputs that most commonly change from run to run appear.

Also includes a Bokeh application to serve as a GUI for creating SPLAT control files

Installation

First create a python environment with Python == 3.10.9, then install with:

pip install git+https://github.com/rocheseb/splat_setup

Entry points

Use these with -h for usage info

splatsetup: starts the bokeh server to create a SPLAT control file

toml2ctrl: convert a given SPLAT .toml file to a .control file

ctrlsetup: creates a .toml or .control file based on input .toml files

updtoml: update a .toml file with the contents of a second .toml file

A. Breakup control file

Entry point: splatsetup

Bokeh application to serve as a GUI for creating SPLAT control files

Takes a full SPLAT .toml file as input with the -t/--toml-file argument.

There is an example input file included: tomltest_o2.toml that is used as default for --toml-file

this is the splat control file with all input fields translated into a jinja template

toml file that contains all the fields necessary to fill template.control

The first level keys are ignored

It accepts the special syntax "=X" for values, then control_setup.py will replace this value with the value associated with the "X" key

Entry point: ctrlsetup

Python code that reads control_setup.toml and fills the template file fields

Because control_setup.toml is read into a dictionary, it can then be updated with more modular toml files that contain only the fields that typically change between splat runs

Example of the more modular input toml file, it is given to control_setup.py along template.control and overwrites the template fields with new values.

To keep o2_test_setup.toml more compact, I also added a separate toml file to set up the spectral windows (window.toml) and the cross sections (xsec.toml).

It accepts a list to setup multiple windows "window":["co2_window","ch4_window"]

Also accepts the "=X" special syntax.

Input toml file that defines the input for spectral windows. Then in o2_test_setup.toml there just need to be a "window":["window_name"] key:value pair where window_name is one of the first level keys of window.toml

Also accepts the "=X" special syntax.

similar to window.toml but to set up the cross section files to be used

Also accepts the "=X" special syntax.

B. Utilities

Entry point: toml2ctrl

Can be used to converted a full .toml input file (e.g. output by control_setup.py when the output file is given with a .toml extension) to a .control file.

python toml_to_control.py output.control --toml-file full_toml.toml

Entry point: updtoml

Can be used to update a .toml file using a second .toml file (preserving keys that exist in the 1st but not the 2nd file)

python update_toml.py -i input_file.toml -u update_file.toml -o output_file.toml

This code reads in file like controls.toml where the value of each key:value pair is a list of different inputs for the given key , then the code calls control_setup.py with all possible permutations of the given inputs (e.g. to setup control files with different versions of cross section tables)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages