-
Notifications
You must be signed in to change notification settings - Fork 0
/
single_config.py
77 lines (57 loc) · 1.69 KB
/
single_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# type: ignore
import os
import textwrap
import argparse
from src_scripts.cfg_manager import CfgManager
from src_scripts.wkr_manager import PipelineManager
# Parse arguments.
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
usage=argparse.SUPPRESS,
description=textwrap.dedent(
"""
#############################################
GHRSS Survey FFA Pipeline: Single Node Script
#############################################
Launches the GHRSS Survey FFA Pipeline on a
single machine. All dates are processed in
parallel.
usage: python %(prog)s -config [config_file] [backend]"""
),
)
parser.add_argument(
"-config",
type=str,
default="./configurations/ghrss_config.yaml",
help=textwrap.dedent(
"""
The path to the "ghrss_config.yaml" file."""
),
)
parser.add_argument(
"backend",
type=str,
help=textwrap.dedent(
"""
The specific backend which produced the data.
Could be one of:
1. GMRT Software Backend (GSB),
2. GMRT Wideband Backend (GWB), or
3. SIMulated GWB data (SIM).
The SIM backend is used only for testing purposes."""
),
)
try:
args = parser.parse_args()
except:
parser.print_help()
parser.exit(1)
# Convert any relative paths to absolute paths, just in case.
# Store all arguments.
config_file = os.path.realpath(args.config)
backend = args.backend
# Get the pipeline configuration.
cfg = CfgManager(config_file, backend)
# Initialise the pipeline.
manager = PipelineManager(cfg)
manager.process()