-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobs2html
More file actions
executable file
·199 lines (178 loc) · 6.1 KB
/
Copy pathobs2html
File metadata and controls
executable file
·199 lines (178 loc) · 6.1 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#!/bin/csh
# --------------------------------------------------------------
#
# csh script for on-line obs monitoring: see -usage below
#
# externals:
#
# MATLAB command for invoking MATLAB
# TBPATH paths for required MATLAB toolbox directories
#
# 01Apr2005 Dick Dee (dee@gmao.gsfc.nasa.gov)
# 15Apr2025 Wesley Davis (wesley.j.davis@nasa.gov)
# --------------------------------------------------------------
set ods_type = `pwd | awk -F/ '{print $NF}'`
set MATLAB = '/ford1/local/matlab_r2024a/bin/matlab'
#set TBPATH = '/ford1/local/obsview'
set TBPATH = '/home/wjdavis5/github_repos/Obsview'
# Parse input arguments:
# ---------------------
if ( $#argv < 1 ) goto usage
set html = 0
set EXPID = 0
set BEGDATE = 0
set ENDDATE = 0
set PCOVERG = "true"
set PTSTATS = "true"
set PSERIES = "true"
set DIRNAME = "obsmon"
set GRPFILE = "obsgroups"
set GRPNUM = "[]"
set PLOTFMT = "png"
set PLOTDPI = "120"
foreach token ( $argv )
if ( "$token" == "-expid" ) then
shift
if ( $#argv < 1 ) goto usage
set EXPID = ( $1 )
shift
endif
if ( "$token" == "-begdate" ) then
shift
if ( $#argv < 1 ) goto usage
set BEGDATE = ( $1 )
shift
endif
if ( "$token" == "-enddate" ) then
shift
if ( $#argv < 1 ) goto usage
set ENDDATE = ( $1 )
shift
endif
if ( "$token" == "-nocoverage" ) then
set PCOVERG = "false"
shift
endif
if ( "$token" == "-noseries" ) then
set PSERIES = "false"
shift
endif
if ( "$token" == "-nostats" ) then
set PTSTATS = "false"
shift
endif
if ( "$token" == "-dirname" ) then
shift
if ( $#argv < 1 ) goto usage
set DIRNAME = ( $1 )
shift
endif
if ( "$token" == "-grpfile" ) then
shift
if ( $#argv < 1 ) goto usage
set GRPFILE = ( $1 )
shift
endif
if ( "$token" == "-grpnum" ) then
shift
if ( $#argv < 1 ) goto usage
set GRPNUM = ( $1 )
shift
endif
if ( "$token" == "-plotfmt" ) then
shift
if ( $#argv < 1 ) goto usage
set PLOTFMT = ( $1 )
shift
endif
if ( "$token" == "-plotdpi" ) then
shift
if ( $#argv < 1 ) goto usage
set PLOTDPI = ( $1 )
shift
endif
end
if ( $EXPID == 0 ) goto usage
if ( -e matlabscript.m ) /bin/rm matlabscript.m
echo diary obs2html.log > matlabscript.m
echo addpath $TBPATH -begin >> matlabscript.m
echo warning off >> matlabscript.m
echo try >> matlabscript.m
echo " options.browser = false ;" >> matlabscript.m
echo " options.dirname = '$DIRNAME';" >> matlabscript.m
echo " options.grpfile = '$GRPFILE';" >> matlabscript.m
echo " options.grpnums = $GRPNUM ;" >> matlabscript.m
echo " options.pcoverg = $PCOVERG ;" >> matlabscript.m
echo " options.pseries = $PSERIES ;" >> matlabscript.m
echo " options.ptstats = $PTSTATS ;" >> matlabscript.m
echo " options.plotfmt = '$PLOTFMT';" >> matlabscript.m
echo " options.plotdpi = '$PLOTDPI';" >> matlabscript.m
if ( $ods_type == 'aer' ) then
echo " options.dsynhhs = [ 0 3 6 9 12 15 18 21 ];" >> matlabscript.m
else
echo " options.dsynhhs = [ 0 6 12 18 ];" >> matlabscript.m
endif
if ( !( $BEGDATE == 0 ) ) then
echo " obs2html('$EXPID','$BEGDATE','$ENDDATE',options);">> matlabscript.m
else
echo " obs2html('$EXPID','$argv',options);"
echo " obs2html('$EXPID','$argv',options);" >> matlabscript.m
endif
echo catch >> matlabscript.m
echo " str = lasterr; disp(str)" >> matlabscript.m
echo end >> matlabscript.m
echo quit >> matlabscript.m
# Create plots and html using MATLAB:
# ----------------------------------
echo "obs2html: Starting MATLAB, please wait..."
nohup $MATLAB < matlabscript.m
# Done.
# ----
exit 0
# Help section:
# ------------
usage:
cat << ---//---
NAME
OBS2HTML - Creates HTML with Observing System Summary Plots.
SYNOPSIS
obs2html -expid expid [...] odsfile
obs2html -expid expid -begdate yyyymmddhh -enddate yyyymmddhh [...]
DESCRIPTION
Creates an HTML document with observing system summary.
Must be run in a writeable directory.
Requires MATLAB.
Use the first form to process one or more ods files, create
data coverage plots, and compute/store various statistics.
Use the second form to compute/plot time-averaged statistics
over the period specified, to create time series plots, and
to create html.
ARGUMENTS
odsfile name of ods file containing observations
-expid expid identification string
-begdate yyyymmddhh start date for time series and statistics
-enddate yyyymmddhh end date for time series and statistics
[-nocoverage] do not plot data coverage
[-noseries] do not plot time series
[-nostats] do not plot statistics
[-dirname dirname] directory for storing results
(Default: obsmon)
[-grpfile grpfile] .m file containing data group definitions
(Default: obsgroups)
[-grpnum grpnum ] Process only group number grpnum
(Default: process all groups)
[-plotfmt plotfmt] graphics format plots
(Default: png)
[-plotdpi plotdpi] graphics resolution, in dots per inch
(Default: 120)
EXAMPLE
obs2html -expid 'myexp' "*.ods" (note the double quotes)
obs2html -expid 'myexp' -begdate 2004080100 -enddate 2004080718
netscape obsmon/index.html
NOTE
If the input filename contains wild cards (*)
then it must be surrounded with double quotes.
Dick Dee (dee@gmao.gsfc.nasa.gov) - Version of 18May2005
Wesley Davis (wesley.j.davis@nasa.gov) - Version of 15Apri2025
---//---
exit 1