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
·47 lines (37 loc) · 1.46 KB
/
exglobal_analysis_stats.py
File metadata and controls
executable file
·47 lines (37 loc) · 1.46 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
43
44
45
46
47
#!/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)
# Create list based on DA components
config.STAT_ANALYSES = []
if config.DO_AERO_ANL:
config.STAT_ANALYSES.append('aero')
if config.DO_JEDISNOWDA:
config.STAT_ANALYSES.append('snow')
if config.DO_JEDIATMVAR:
config.STAT_ANALYSES.append('atmos')
else:
config.STAT_ANALYSES.append('atmos_gsi')
# GCDAS uses offline GDAS, remove atmos analysis
if config.RUN == 'gcdas':
config.STAT_ANALYSES = [anl for anl in config.STAT_ANALYSES if 'atmos' not in anl]
# Instantiate the analysis stats task
AnlStats = AnalysisStats(config)
# Initialize JEDI variational analysis
if 'atmos_gsi' in config.STAT_ANALYSES:
AnlStats.convert_gsi_diags()
AnlStats.initialize()
for anl in config.STAT_ANALYSES:
AnlStats.execute(anl)
AnlStats.finalize(anl)