Skip to content
Snippets Groups Projects
Commit 898b01e5 authored by Stefan Reck's avatar Stefan Reck
Browse files

moved toml presets to seperate directory

parent 54e27cb9
No related branches found
No related tags found
No related merge requests found
......@@ -30,9 +30,9 @@ If you have an orcasong config file, you can use it via the command line like th
For some examples of config files you can check out the git repo here
https://git.km3net.de/ml/OrcaSong/-/tree/master/examples .
https://git.km3net.de/ml/OrcaSong/-/tree/master/configs .
These can be loaded from the command line by using the prefix
``orcasong:`` before the filename, e.g. ``orcasong:orcasong_bundle_mupage.toml``.
``orcasong:`` before the filename, e.g. ``orcasong:bundle_ORCA4_data_v5-40.toml``.
Alternatively, you can use the python frontend of orcasong.
See :ref:`orcasong_page` for instructions on how to do this.
......
......@@ -28,7 +28,7 @@ def add_parser_run(subparsers):
parser.add_argument('infile', type=str, help="Aanet file in h5 format.")
parser.add_argument('toml_file', type=str, help=(
"Orcasong configuration in toml format. Use prefix 'orcasong:' to load "
"a toml from OrcaSong/examples."))
"a toml from OrcaSong/configs."))
parser.add_argument('--detx_file', type=str, default=None, help=(
"Optional detx file to calibrate on the fly. Can not be used if a "
"detx_file has also been given in the toml file."))
......@@ -44,7 +44,7 @@ def run_orcasong(infile, toml_file, detx_file=None, outfile=None):
def setup_processor(infile, toml_file, detx_file=None):
if toml_file.startswith("orcasong:"):
toml_file = _get_from_examples(toml_file[9:])
toml_file = _get_config(toml_file[9:])
cfg = toml.load(toml_file)
processor = _get_verbose(cfg.pop("mode"), MODES)
......@@ -72,7 +72,7 @@ def _get_verbose(key, d):
return d[key]
def _get_from_examples(filename):
direc = os.path.join(Path(orcasong.core.__file__).parents[1], "examples")
def _get_config(filename):
direc = os.path.join(Path(orcasong.core.__file__).parents[1], "configs")
files = {file: os.path.join(direc, file) for file in os.listdir(direc)}
return _get_verbose(filename, files)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment