-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.py
85 lines (69 loc) · 2.43 KB
/
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
import os
import json
# General:
if (base_dir := os.getenv("OLMO_BASE_DIRECTORY")) is None:
print("Warning. Env var OLMO_BASE_DIRECTORY not set correctly.")
output_dir = os.path.join(base_dir, 'Output')
secrets_dir = os.path.join(base_dir, 'Secrets')
with open(os.path.join(secrets_dir, 'config_secrets.json')) as f:
data = json.load(f)
loggernet_pc = data['loggernet_pc']
loggernet_user = data['loggernet_user']
munkholmen_pc = data['munkholmen_pc']
munkholmen_ssh_port = int(data['munkholmen_ssh_port'])
munkholmen_user = data['munkholmen_user']
sintef_influx_pc = data['sintef_influx_pc']
az_influx_pc = data['az_influx_pc']
# Sync munkholmen (main):
rsync_inbox = os.path.join(base_dir, 'Rsync_inbox')
rsync_inbox_adcp = os.path.join(base_dir, 'Rsync_inbox_adcp')
main_logfile = "log_munkholmen_ingest_"
gas_logfile = "log_gasanalyser_ingest_"
# Sync loggernet:
loggernet_outbox = f"c:\\Users\{loggernet_user}\LoggerNet_output"
loggernet_inbox = os.path.join(base_dir, 'Loggernet_inbox')
loggernet_files_basenames = [
"CR6_EOL2p0_meteo_ais_",
"CR6_EOL2p0_Power_", # instr.: solar_regulator
"CR6_EOL2p0_Meteo_avgd_",
"CR6_EOL2p0_Current_", # intr.: signature_100
"CR6_EOL2p0_Wave_sensor_", # instr.: seaview
# "CR6_EOL2p0_Winch_log_", # none
"IngdalenCR6_victron_",
"IngdalenCR6_SUNA_",
"IngdalenCR6_System_",
"IngdalenCR6_signatureRecord_",
"IngdalenCR6_signatureCurrentProf_",
"IngdalenCR6_Seabird_",
"IngdalenCR6_Power_",
"IngdalenCR6_PAR_",
"IngdalenCR6_MetData_",
"IngdalenCR6_Hydrocat_",
"IngdalenCR6_GPSData_",
"IngdalenCR6_Debug_",
"IngdalenCR6_CFluor_",
"IngdalenCR6_Wave_",
]
loggernet_logfile = "log_loggernet_ingest_"
logpc_ssh_max_attempts = 3
# Backup files:
backup_dir = os.path.join(base_dir, 'backups')
bu_logfile_basename = "log_influx_backup_"
backup_basename = 'influxbackup_'
az_backups_folder = 'influx_backups'
# Website figures
webfigs_dir = os.path.join(output_dir, 'Website_figures')
# Node 2 ingestion:
with open(os.path.join(secrets_dir, 'node2_password'), 'r') as f:
node2_pwd = f.read()[:-1]
with open(os.path.join(secrets_dir, 'node2_secrets.json'), 'r') as f:
data = json.load(f)
node2_dbname = data['dbname']
node2_user = data['user']
node2_host = data['host']
node2_port = data['port']
node2_sslmode = data['sslmode']
node2_logfile = "log_node2_ingest_"
# Silcam ingestion:
# Custom data ingestion:
custom_data_folder = "Custom_Data"