-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
31 lines (21 loc) · 1.1 KB
/
main.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
import yaml
from src.download_data import retrieve_n100, retrieve_cams_reanalysis
from src.preprocess_data import preprocess_n100, preprocess_cams, unite_data, merge_final_files
if __name__ == '__main__':
try:
with open ('configuration.yml', 'r') as file:
config = yaml.safe_load(file)
except Exception as e:
print('Error reading the config file')
if config['load_data']['n100']:
retrieve_n100(config['raw']['n100'])
if config['preprocess']['n100']:
preprocess_n100(config['raw']['n100'], config['data']['n100'], config['cities'])
if config['load_data']['cams']:
retrieve_cams_reanalysis(config['data']['n100'], config['raw']['cams'], config['cities'])
if config['preprocess']['cams']:
preprocess_cams(config['raw']['cams'], config['data']['cams'], config['cities'])
if config['preprocess']['unite']:
unite_data(config['data']['n100'], config['data']['cams'], config['cities'], config['data']['final'])
if config['preprocess']['merge']:
merge_final_files(config['cities'], config['data']['final'])