-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmulti_config.py
85 lines (64 loc) · 1.98 KB
/
multi_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
78
79
80
81
82
83
84
85
# type: ignore
import os
import textwrap
import argparse
from src_scripts.cfg_manager import CfgManager
from src_scripts.wkr_manager import PipelineWorker
# Parse arguments.
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
usage=argparse.SUPPRESS,
description=textwrap.dedent(
"""
################################################
GHRSS Survey FFA Pipeline: Multiple Nodes Script
################################################
Launches the GHRSS Survey FFA Pipeline on mutliple
machines. All dates are processed in parallel.
usage: python %(prog)s [node] [date] -config [config_file] [backend]"""
),
)
parser.add_argument(
"node",
type=str,
help=textwrap.dedent("""The node on which the data is going to be processed."""),
)
parser.add_argument(
"date",
type=str,
help=textwrap.dedent("""The date to be processed on a particular node."""),
)
parser.add_argument(
"-config",
type=str,
default="./configurations/ghrss_config.yaml",
help=textwrap.dedent("""The absolute 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.
node = args.node
date = args.date
config_file = os.path.realpath(args.config)
backend = args.backend
# Get the pipeline configuration.
cfg = CfgManager(config_file, backend)
# Initialise the pipeline.
worker = PipelineWorker(cfg)
worker(date)