forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexglobal_offline_atmos_analysis.py
More file actions
executable file
·40 lines (29 loc) · 1.24 KB
/
exglobal_offline_atmos_analysis.py
File metadata and controls
executable file
·40 lines (29 loc) · 1.24 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
#!/usr/bin/env python3
# exglobal_offline_analysis.py
# This script creates an OfflineAnalysis class
# and runs the initialize, run, and finalize methods
# which will stage files, interpolate the offline analysis,
# produce analysis increments from the previous forecast
# and the regridded offline analysis,
# and copy the new increments to COM
import os
from wxflow import Logger, cast_strdict_as_dtypedict
from pygfs.task.offline_analysis import OfflineAnalysis
# 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 offline analysis task
offline_anl = OfflineAnalysis(config)
# Initialize and stage the runtime directory
offline_anl.initialize()
# Interpolate the Gaussian analysis to the background resolution
offline_anl.interpolate_analysis()
# Compute the increment between the analysis and background
offline_anl.calc_increment()
# Compute the tref increment
offline_anl.calc_tref_inc()
# Copy the analysis increment and regridded analysis back to COM
offline_anl.finalize()