forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexglobal_analysis_stats.py
More file actions
executable file
·42 lines (33 loc) · 1.38 KB
/
exglobal_analysis_stats.py
File metadata and controls
executable file
·42 lines (33 loc) · 1.38 KB
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
#!/usr/bin/env python3
# exglobal_analysis_stats.py
# This script creates a AnalysisStats class
# and runs the initialize, execute, and finalize
# methods which create and stage the runtime directory
# and create the YAML configuration
# to produce summary statistics from the desired analyses
import os
from wxflow import Logger, cast_strdict_as_dtypedict
from pygfs.task.analysis_stats import AnalysisStats
# Initialize root logger
logger = Logger(level='DEBUG', colored_log=True)
if __name__ == '__main__':
# Take configuration from environment and cast it as python dictionary
config = cast_strdict_as_dtypedict(os.environ)
# Instantiate the atm analysis task
AnlStats = AnalysisStats(config)
# Create list based on DA components
AnlStats.task_config['STAT_ANALYSES'] = []
if AnlStats.task_config.DO_AERO_ANL:
AnlStats.task_config['STAT_ANALYSES'].append('aero')
if AnlStats.task_config.DO_JEDISNOWDA:
AnlStats.task_config['STAT_ANALYSES'].append('snow')
if AnlStats.task_config.DO_JEDIATMVAR:
AnlStats.task_config['STAT_ANALYSES'].append('atmos')
else:
AnlStats.task_config['STAT_ANALYSES'].append('atmos_gsi')
AnlStats.convert_gsi_diags()
# Initialize JEDI variational analysis
AnlStats.initialize()
for anl in AnlStats.task_config.STAT_ANALYSES:
AnlStats.execute(anl)
AnlStats.finalize(anl)