forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexglobal_snow_analysis.py
More file actions
executable file
·45 lines (32 loc) · 1.23 KB
/
exglobal_snow_analysis.py
File metadata and controls
executable file
·45 lines (32 loc) · 1.23 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
#!/usr/bin/env python3
# exglobal_snow_analysis.py
# This script creates an SnowAnalysis class
# and runs the initialize, execute and finalize methods
# for a global Snow Depth analysis
import os
from wxflow import Logger, cast_strdict_as_dtypedict
from pygfs.task.snow_analysis import SnowAnalysis
# Initialize root logger
logger = Logger(level=os.environ.get("LOGGING_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 snow analysis task
snow_anl = SnowAnalysis(config)
# Initialize JEDI 2DVar snow analysis
snow_anl.initialize()
# Process SNOCVR and SNOMAD (if applicable)
if snow_anl.task_config.DO_SNOCVR_SNOMAD:
snow_anl.prepare_SNOCVR_SNOMAD()
# Process IMS snow cover (if applicable)
if snow_anl.task_config.DO_IMS_SCF:
snow_anl.execute('scf_to_ioda')
# Process GHCN (if applicable)
if snow_anl.task_config.DO_GHCN:
snow_anl.prepare_GHCN()
# Execute JEDI snow analysis
snow_anl.execute('snowanlvar')
# Add increments
snow_anl.add_increments()
# Finalize JEDI snow analysis
snow_anl.finalize()