gphys 1.5.5 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/ChangeLog +0 -7595
- data/LICENSE.txt +1 -1
- data/bin/gpcut +12 -0
- data/bin/gpvect +88 -77
- data/bin/gpview +200 -103
- data/ext/numru/ganalysis/ext_init.c +9 -0
- data/ext/numru/ganalysis/extconf.rb +43 -0
- data/ext/numru/ganalysis/narray_ext_dfloat.c +84 -0
- data/ext/numru/ganalysis/pde_ext.c +130 -0
- data/ext/numru/gphys/dim_op.c +336 -44
- data/ext/numru/gphys/ext_init.c +6 -0
- data/ext/numru/gphys/interpo.c +326 -3
- data/gphys.gemspec +1 -0
- data/lib/numru/dclext.rb +78 -16
- data/lib/numru/ganalysis/beta_plane.rb +6 -4
- data/lib/numru/ganalysis/eof.rb +63 -41
- data/lib/numru/ganalysis/fitting.rb +109 -30
- data/lib/numru/ganalysis/histogram.rb +3 -3
- data/lib/numru/ganalysis/log_p.rb +20 -0
- data/lib/numru/ganalysis/lomb_scargle.rb +205 -0
- data/lib/numru/ganalysis/met_z.rb +132 -3
- data/lib/numru/ganalysis/narray_ext.rb +13 -0
- data/lib/numru/ganalysis/pde.rb +109 -0
- data/lib/numru/ganalysis/planet.rb +136 -1
- data/lib/numru/ganalysis/qg.rb +224 -3
- data/lib/numru/ggraph.rb +95 -23
- data/lib/numru/gphys/axis.rb +4 -2
- data/lib/numru/gphys/gphys.rb +6 -5
- data/lib/numru/gphys/gphys_dim_op.rb +69 -6
- data/lib/numru/gphys/gphys_fft.rb +30 -0
- data/lib/numru/gphys/gphys_io_common.rb +2 -0
- data/lib/numru/gphys/grads_gridded.rb +77 -29
- data/lib/numru/gphys/grib.rb +2 -2
- data/lib/numru/gphys/grib_params.rb +3 -3
- data/lib/numru/gphys/interpolate.rb +153 -1
- data/lib/numru/gphys/varraycomposite.rb +7 -4
- data/lib/numru/gphys/version.rb +1 -1
- data/lib/numru/gphys.rb +1 -0
- data/testdata/pres.jan.nc +0 -0
- metadata +13 -4
data/LICENSE.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
GPhys is copyrighted free software by Takeshi Horinouchi and
|
2
2
|
GFD Dennou Club (http://www.gfd-dennou.org/).
|
3
3
|
|
4
|
-
Copyright 2003-
|
4
|
+
Copyright 2003-2019 (C) Takeshi Horinouchi and GFD Dennou Club
|
5
5
|
(http://www.gfd-dennou.org/) All rights reserved.
|
6
6
|
|
7
7
|
Redistribution and use in source and binary forms, with or without
|
data/bin/gpcut
CHANGED
@@ -18,6 +18,8 @@ gpcut - Extract, slicing and thinning a GPhys variable.
|
|
18
18
|
print this message.
|
19
19
|
:-m dim, --mean dim
|
20
20
|
average along dim axis (optional).
|
21
|
+
:-s dim, --sum dim
|
22
|
+
sum up along dim axis (optional).
|
21
23
|
:-e dim, --eddy dim:
|
22
24
|
deviation from mean along dim axis (optional).
|
23
25
|
:-o file, --output file
|
@@ -34,6 +36,7 @@ gpcut - Extract, slicing and thinning a GPhys variable.
|
|
34
36
|
2010/03/10 Y SASAKI (change help block into RD format)
|
35
37
|
2012/02/19 S Takehiro (description for gturl format updated)
|
36
38
|
2014/04/23 S Takehiro (add --eddy option)
|
39
|
+
2021/05/19 S Takehiro (added options --sum)
|
37
40
|
|
38
41
|
=end
|
39
42
|
|
@@ -49,6 +52,7 @@ URLfmt = "path[@|/]varname[,dimname=pos1[:pos2[:thinning_intv]][,dimname=...]]"
|
|
49
52
|
|
50
53
|
#---------------------- Option Configuration ----------------------
|
51
54
|
parser = GetoptLong.new(
|
55
|
+
["--sum", "-s", GetoptLong::REQUIRED_ARGUMENT],
|
52
56
|
["--mean", "-m", GetoptLong::REQUIRED_ARGUMENT],
|
53
57
|
['--eddy', "-e", GetoptLong::REQUIRED_ARGUMENT],
|
54
58
|
["--output", "-o", GetoptLong::REQUIRED_ARGUMENT],
|
@@ -100,6 +104,14 @@ if ($OPT_mean)
|
|
100
104
|
}
|
101
105
|
end
|
102
106
|
|
107
|
+
if ($OPT_sum)
|
108
|
+
dims = ($OPT_sum).split(/\s*,\s*/)
|
109
|
+
dims.each{|dim|
|
110
|
+
dim = dim.to_i if dim.to_i.to_s == dim
|
111
|
+
gphys = gphys.sum(dim)
|
112
|
+
}
|
113
|
+
end
|
114
|
+
|
103
115
|
## deviation from mean along any axis
|
104
116
|
if ($OPT_eddy)
|
105
117
|
dims_eddy = ($OPT_eddy).split(/\s*,\s*/)
|
data/bin/gpvect
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
=begin
|
4
4
|
=NAME
|
5
5
|
|
6
|
-
gpvect - drawing 2-dim vector fiels. Contour/tone of scalar field can be plotted simultaneously.
|
7
|
-
|
6
|
+
gpvect - drawing 2-dim vector fiels. Contour/tone of scalar field can be plotted simultaneously.
|
7
|
+
|
8
8
|
==USAGE
|
9
9
|
|
10
|
-
The first command form is for only vector field plotting.
|
10
|
+
The first command form is for only vector field plotting.
|
11
11
|
|
12
12
|
% gpvect [options] gturl_x gturl_y ....
|
13
13
|
|
@@ -15,9 +15,9 @@ where the format of the gturl is
|
|
15
15
|
|
16
16
|
path[@|/]varname[,dimname=pos1[:pos2[:thinning_intv]][,dimname=...]]
|
17
17
|
|
18
|
-
The command loads two gphys variables in each time and draws
|
19
|
-
vector field whose x and y components are the first and the second argument,
|
20
|
-
gturl_x gturl_y.
|
18
|
+
The command loads two gphys variables in each time and draws
|
19
|
+
vector field whose x and y components are the first and the second argument,
|
20
|
+
gturl_x gturl_y.
|
21
21
|
|
22
22
|
When the slice parameters are the same throughout the all Gphys
|
23
23
|
variables, the following form can be used:
|
@@ -42,7 +42,7 @@ gturl_x gturl_y.
|
|
42
42
|
===GLOBAL OPTIONS
|
43
43
|
|
44
44
|
:--help:
|
45
|
-
print this message.
|
45
|
+
print this message.
|
46
46
|
|
47
47
|
:--slice url:
|
48
48
|
set the slicing parameters.
|
@@ -50,7 +50,7 @@ gturl_x gturl_y.
|
|
50
50
|
:--wsn [1-4]:
|
51
51
|
set work staion number. each number represent output device.
|
52
52
|
1: X window.
|
53
|
-
2: PS file. (named dcl.ps)
|
53
|
+
2: PS file. (named dcl.ps)
|
54
54
|
3: Tektronix output.
|
55
55
|
4: GTK Windows (depend on dcl-5.3)
|
56
56
|
|
@@ -59,16 +59,16 @@ gturl_x gturl_y.
|
|
59
59
|
|
60
60
|
:--itr [1-4,5-7,10-15,20-23,30-33]:
|
61
61
|
set axis scale. default is 1.
|
62
|
-
1: linear scale for x/y axis
|
62
|
+
1: linear scale for x/y axis
|
63
63
|
2: linear scale for x , log scale for y axis
|
64
64
|
3: log scale for x , linear scale for y axis
|
65
65
|
4: log scale for x/y axis
|
66
66
|
|
67
67
|
:--similar [simfac,vxoff,vyoff]:
|
68
|
-
(for 5<=itr<=7) set similarity parameters which are fed in DCL.grssim.
|
68
|
+
(for 5<=itr<=7) set similarity parameters which are fed in DCL.grssim.
|
69
69
|
|
70
70
|
:--map_axis [uxc,uyc,rot]:
|
71
|
-
(for 10<=itr<=33) set mapping parameters which are fed in DCL.umpcnt.
|
71
|
+
(for 10<=itr<=33) set mapping parameters which are fed in DCL.umpcnt.
|
72
72
|
|
73
73
|
:--title:
|
74
74
|
set title of figure
|
@@ -76,32 +76,32 @@ gturl_x gturl_y.
|
|
76
76
|
:--aspect <aspect>:
|
77
77
|
set aspect ratio of Viewport. default is 2.0.
|
78
78
|
|
79
|
-
:--noannotate:
|
80
|
-
not draw annotations.
|
79
|
+
:--noannotate:
|
80
|
+
not draw annotations.
|
81
81
|
|
82
82
|
:--animate/anim <dim>:
|
83
|
-
plot animation along <dim>. <dim> must be name of dimension.
|
83
|
+
plot animation along <dim>. <dim> must be name of dimension.
|
84
84
|
|
85
|
-
:--alternate, --Ga:
|
85
|
+
:--alternate, --Ga:
|
86
86
|
enable to backing store.
|
87
87
|
|
88
|
-
:--nowait, --Gw:
|
89
|
-
not wait for any actions if animate
|
88
|
+
:--nowait, --Gw:
|
89
|
+
not wait for any actions if animate
|
90
90
|
|
91
|
-
:--reverse, --Gr:
|
91
|
+
:--reverse, --Gr:
|
92
92
|
plot animation reversible if animate
|
93
93
|
|
94
|
-
:--smooth, --Gaw:
|
94
|
+
:--smooth, --Gaw:
|
95
95
|
equal to --anlternate && --nowait
|
96
96
|
|
97
|
-
:--exch:
|
97
|
+
:--exch:
|
98
98
|
exchange(transpose) x/y axis.
|
99
99
|
|
100
100
|
:--mean <dim>:
|
101
|
-
mean along axis <dim>.
|
101
|
+
mean along axis <dim>.
|
102
102
|
|
103
103
|
:--eddy <dim>:
|
104
|
-
deviation from mean along axis <dim>.
|
104
|
+
deviation from mean along axis <dim>.
|
105
105
|
|
106
106
|
:--m, --map <map_type>:
|
107
107
|
plot map. itr number must be set. this option is neglect if itr
|
@@ -112,7 +112,7 @@ gturl_x gturl_y.
|
|
112
112
|
plot scaler field (contour,tone)
|
113
113
|
|
114
114
|
:-xx:yyyy=value:
|
115
|
-
specify Dennou Club Library internal variable.
|
115
|
+
specify Dennou Club Library internal variable.
|
116
116
|
'xx' is a package name prefix of DCL (eg. sg=>sgpack).
|
117
117
|
'yy' is a variable name of DCL.
|
118
118
|
'value' is a value of the DCL variable.
|
@@ -120,22 +120,22 @@ gturl_x gturl_y.
|
|
120
120
|
|
121
121
|
===CONTOUR/TONE OPTIONS
|
122
122
|
|
123
|
-
:--shade:
|
123
|
+
:--shade:
|
124
124
|
make contour and tone plot.
|
125
125
|
|
126
126
|
:--noshade:
|
127
127
|
make contour plot, without tone.
|
128
128
|
|
129
|
-
:--nocont:
|
129
|
+
:--nocont:
|
130
130
|
make tone plot, without contour.
|
131
131
|
|
132
132
|
:--range [min:max]:
|
133
133
|
set min/max value for contour/tone plot. min or max must be set.
|
134
134
|
|
135
|
-
:--crange:
|
135
|
+
:--crange:
|
136
136
|
set min/max value for contour plot. this is more dominant than --range
|
137
137
|
|
138
|
-
:--srange:
|
138
|
+
:--srange:
|
139
139
|
set min/max value for tone plot. this is more dominant than --interval/int
|
140
140
|
|
141
141
|
:--interval,--int [num]:
|
@@ -149,16 +149,16 @@ gturl_x gturl_y.
|
|
149
149
|
set interval value for tone plot. this is more dominant than --interval/int.
|
150
150
|
|
151
151
|
:--levels:
|
152
|
-
set values of contour/tone levels.
|
152
|
+
set values of contour/tone levels.
|
153
153
|
|
154
154
|
:--clevels:
|
155
|
-
set values of contour levels.
|
155
|
+
set values of contour levels.
|
156
156
|
|
157
157
|
:--slevels:
|
158
|
-
set tone of contour levels.
|
158
|
+
set tone of contour levels.
|
159
159
|
|
160
160
|
:--patterns:
|
161
|
-
set each patterns for tone plot.
|
161
|
+
set each patterns for tone plot.
|
162
162
|
|
163
163
|
:--tone [a|e|f|b|c]:
|
164
164
|
set tone subroutine:
|
@@ -188,7 +188,7 @@ gturl_x gturl_y.
|
|
188
188
|
|
189
189
|
:--yintv <yintv>:
|
190
190
|
interval of data sampling in y
|
191
|
-
|
191
|
+
|
192
192
|
:--factor <factor>:
|
193
193
|
(Effective only if flow_vect) scaling factor to strech/reduce the
|
194
194
|
arrow lengths
|
@@ -201,39 +201,39 @@ gturl_x gturl_y.
|
|
201
201
|
scale the unit vector
|
202
202
|
|
203
203
|
:--ux_unit <value>:
|
204
|
-
(Effective only if flow_vect) length of the x direction unit vector
|
204
|
+
(Effective only if flow_vect) length of the x direction unit vector
|
205
205
|
(precedence of this option is lower than max_unit_vect)
|
206
206
|
|
207
207
|
:--uy_unit <value>:
|
208
|
-
(Effective only if flow_vect) length of the y direction unit vector
|
208
|
+
(Effective only if flow_vect) length of the y direction unit vector
|
209
209
|
(precedence of this option is lower than max_unit_vect)
|
210
210
|
|
211
211
|
:--xscale <value>:
|
212
|
-
(Effective only if noflow_vect) scaling of the x direction vector
|
212
|
+
(Effective only if noflow_vect) scaling of the x direction vector
|
213
213
|
|
214
214
|
:--yscale <value>:
|
215
|
-
(Effective only if noflow_vect) scaling of the y direction vector
|
215
|
+
(Effective only if noflow_vect) scaling of the y direction vector
|
216
216
|
|
217
217
|
|
218
218
|
==EXAMPLES
|
219
219
|
|
220
|
-
For the first command format,
|
220
|
+
For the first command format,
|
221
221
|
|
222
222
|
% gpvect data.nc@vx data.nc@vy
|
223
223
|
% gpvect data.nc@vx,lon=0 data.nc@vy,lon=0
|
224
224
|
% gpvect --scalar data.nc@temp datax.nc@vx datay.nc@vy
|
225
225
|
% gpvect --scalar --anim t --nocont data.nc@temp data.nc@vx data.nc@vy
|
226
226
|
|
227
|
-
For the second command format,
|
227
|
+
For the second command format,
|
228
228
|
% gpvect --scalar --slice lat=0 data.nc@temp data.nc@vx data.nc@vy
|
229
229
|
|
230
230
|
|
231
231
|
==HISTORY
|
232
232
|
|
233
233
|
2007/07/02 S Takehiro (created based on gpview)
|
234
|
-
2007/07/04 S Takehiro (polar coodinate vector component conversion
|
235
|
-
from U to N coordinates moved to ggraph.rb)
|
236
|
-
2007/07/06 S Takehiro (default title was set when --scalar option is given)
|
234
|
+
2007/07/04 S Takehiro (polar coodinate vector component conversion
|
235
|
+
from U to N coordinates moved to ggraph.rb)
|
236
|
+
2007/07/06 S Takehiro (default title was set when --scalar option is given)
|
237
237
|
2009/09/30 S Takehiro (option --nocolorbar and --nozero implemented)
|
238
238
|
2010/03/10 Y SASAKI (change help block into RD format)
|
239
239
|
2010/07/16 Y SASAKI (option --clrmap implemented)
|
@@ -290,7 +290,7 @@ def each_along_dims(gp1, gp2, gp3, loopdim)
|
|
290
290
|
if loopdim.is_a?(String)
|
291
291
|
dimname = loopdim
|
292
292
|
elsif
|
293
|
-
if loopdim < 0
|
293
|
+
if loopdim < 0
|
294
294
|
dimname = gp1.coord(gphys.rank + loopdim).name
|
295
295
|
else
|
296
296
|
dimname = gp1.coord(loopdim).name
|
@@ -300,7 +300,7 @@ def each_along_dims(gp1, gp2, gp3, loopdim)
|
|
300
300
|
end
|
301
301
|
|
302
302
|
loopdim_na = gp1.coord(dimname).val # get coord ary
|
303
|
-
loopdim_na = loopdim_na[-1..0] if $OPT_reverse || $OPT_Gr # reverse
|
303
|
+
loopdim_na = loopdim_na[-1..0] if $OPT_reverse || $OPT_Gr # reverse
|
304
304
|
loopdim_na.each { |x|
|
305
305
|
yield( gp1.cut(dimname=>x), gp2.cut(dimname=>x), gp3.cut(dimname=>x) )
|
306
306
|
}
|
@@ -318,24 +318,34 @@ def draw_setup(gp)
|
|
318
318
|
DCL.sgpset('lfull', true) # use full area in the window
|
319
319
|
DCL.sgpset('lfprop',true) # use proportional font
|
320
320
|
DCL.uscset('cyspos', 'B' ) # move unit y axis
|
321
|
-
|
321
|
+
|
322
322
|
# viewport size
|
323
323
|
GGraph.set_fig('viewport'=>$VIEWPORT)
|
324
324
|
GGraph.set_fig( 'itr'=>($OPT_itr == nil) ? 1 : $OPT_itr.to_i )
|
325
|
-
GGraph.set_fig("xrev"=>"units:mb,units:hPa,units:millibar,positive:down",
|
326
|
-
"yrev"=>"units:mb,units:hPa,units:millibar,positive:down")
|
325
|
+
GGraph.set_fig("xrev"=>"units:mb,units:hPa,units:millibar,positive:down",
|
326
|
+
"yrev"=>"units:mb,units:hPa,units:millibar,positive:down")
|
327
327
|
|
328
328
|
# set options
|
329
329
|
min_range, max_range = __split_range($OPT_range)
|
330
330
|
min_crange, max_crange = __split_range($OPT_crange)
|
331
331
|
min_srange, max_srange = __split_range($OPT_srange)
|
332
|
+
if ( $OPT_cint || $OPT_interval || $OPT_int )
|
333
|
+
cont_interval = ( $OPT_cint || $OPT_interval || $OPT_int ).to_f
|
334
|
+
else
|
335
|
+
cont_interval = nil
|
336
|
+
end
|
337
|
+
if ( $OPT_sint || $OPT_interval || $OPT_int )
|
338
|
+
tone_interval = ( $OPT_sint || $OPT_interval || $OPT_int ).to_f
|
339
|
+
else
|
340
|
+
tone_interval = nil
|
341
|
+
end
|
332
342
|
GGraph.set_linear_contour_options(
|
333
|
-
'int' =>
|
343
|
+
'int' => cont_interval,
|
334
344
|
'min' => ( min_crange || min_range ),
|
335
345
|
'max' => ( max_crange || max_range )
|
336
346
|
)
|
337
347
|
GGraph.set_linear_tone_options(
|
338
|
-
'int' =>
|
348
|
+
'int' => tone_interval,
|
339
349
|
'min' => ( min_srange || min_range ),
|
340
350
|
'max' => ( max_srange || max_range )
|
341
351
|
)
|
@@ -346,7 +356,6 @@ def draw_setup(gp)
|
|
346
356
|
|
347
357
|
if ( $OPT_slevels || $OPT_levels )
|
348
358
|
$OPT_slevels=($OPT_slevels||$OPT_levels).split(',').map!{|v| v.to_f }
|
349
|
-
p $OPT_slevels
|
350
359
|
end
|
351
360
|
|
352
361
|
if ( $OPT_patterns )
|
@@ -358,8 +367,8 @@ def draw_setup(gp)
|
|
358
367
|
gp_rank = gp_rank - 1 if ( $OPT_animate || $OPT_anim )
|
359
368
|
|
360
369
|
raise "The rank of gphys variables must be >=2 " if (gp_rank < 2)
|
361
|
-
|
362
|
-
if ( $OPT_scalar )
|
370
|
+
|
371
|
+
if ( $OPT_scalar )
|
363
372
|
if ( !$OPT_noshade && $OPT_nocont )
|
364
373
|
draw_flag = "nocont"
|
365
374
|
elsif ( $OPT_noshade && !$OPT_nocont )
|
@@ -369,7 +378,7 @@ def draw_setup(gp)
|
|
369
378
|
end
|
370
379
|
else
|
371
380
|
draw_flag = 'noscalar'
|
372
|
-
end
|
381
|
+
end
|
373
382
|
|
374
383
|
# similar projection
|
375
384
|
if ($OPT_similar)
|
@@ -405,7 +414,7 @@ def draw_setup(gp)
|
|
405
414
|
|
406
415
|
# vector
|
407
416
|
if ($OPT_noflow_vect)
|
408
|
-
$flow_vect = false
|
417
|
+
$flow_vect = false
|
409
418
|
else
|
410
419
|
$flow_vect = true
|
411
420
|
end
|
@@ -413,13 +422,13 @@ def draw_setup(gp)
|
|
413
422
|
if ($OPT_unit_vect)
|
414
423
|
$unit_vect = true
|
415
424
|
else
|
416
|
-
$unit_vect = false
|
425
|
+
$unit_vect = false
|
417
426
|
end
|
418
427
|
|
419
428
|
if ($OPT_max_unit_vect)
|
420
429
|
$max_unit_vect = true
|
421
430
|
else
|
422
|
-
$max_unit_vect = false
|
431
|
+
$max_unit_vect = false
|
423
432
|
end
|
424
433
|
|
425
434
|
if ($OPT_ux_unit)
|
@@ -462,7 +471,7 @@ def draw(gp, gpux, gpuy, draw_flag)
|
|
462
471
|
case draw_flag
|
463
472
|
when "full"
|
464
473
|
GGraph.tone(gp,
|
465
|
-
true,
|
474
|
+
true,
|
466
475
|
"title"=>$OPT_title,
|
467
476
|
"annotate"=>$annotate,
|
468
477
|
"transpose"=>$OPT_exch,
|
@@ -484,7 +493,7 @@ def draw(gp, gpux, gpuy, draw_flag)
|
|
484
493
|
|
485
494
|
when "nocont"
|
486
495
|
GGraph.tone(gp,
|
487
|
-
true,
|
496
|
+
true,
|
488
497
|
"title"=>$OPT_title,
|
489
498
|
"annotate"=>$annotate,
|
490
499
|
"transpose"=>$OPT_exch,
|
@@ -500,8 +509,8 @@ def draw(gp, gpux, gpuy, draw_flag)
|
|
500
509
|
when "noshade"
|
501
510
|
mj = DCL.udpget('indxmj')
|
502
511
|
mn = DCL.udpget('indxmn')
|
503
|
-
GGraph.contour(gp,
|
504
|
-
true,
|
512
|
+
GGraph.contour(gp,
|
513
|
+
true,
|
505
514
|
"title" =>$OPT_title,
|
506
515
|
"label" =>true,
|
507
516
|
"annotate"=>$annotate,
|
@@ -519,7 +528,7 @@ def draw(gp, gpux, gpuy, draw_flag)
|
|
519
528
|
# draw vector
|
520
529
|
|
521
530
|
if ($OPT_itr == '5')
|
522
|
-
GGraph.vector( gpux, gpuy, newframe=vnewframe,
|
531
|
+
GGraph.vector( gpux, gpuy, newframe=vnewframe,
|
523
532
|
"title"=>$OPT_title,
|
524
533
|
"annotate"=>$annotate,
|
525
534
|
"exchange"=>$OPT_exch,
|
@@ -530,7 +539,7 @@ def draw(gp, gpux, gpuy, draw_flag)
|
|
530
539
|
"factor"=>$factor,
|
531
540
|
"unit_vect"=>$unit_vect,
|
532
541
|
"max_unit_vect"=>$max_unit_vect,
|
533
|
-
"ux_unit"=>$ux_unit,
|
542
|
+
"ux_unit"=>$ux_unit,
|
534
543
|
"uy_unit"=>$uy_unit
|
535
544
|
)
|
536
545
|
else
|
@@ -544,7 +553,7 @@ def draw(gp, gpux, gpuy, draw_flag)
|
|
544
553
|
"factor"=>$factor,
|
545
554
|
"unit_vect"=>$unit_vect,
|
546
555
|
"max_unit_vect"=>$max_unit_vect,
|
547
|
-
"ux_unit"=>$ux_unit,
|
556
|
+
"ux_unit"=>$ux_unit,
|
548
557
|
"uy_unit"=>$uy_unit
|
549
558
|
)
|
550
559
|
end
|
@@ -572,17 +581,17 @@ def set_vpsize( default_vp, aspect=2.0 )
|
|
572
581
|
hlength = x1 - x0
|
573
582
|
vlength = y1 - y0
|
574
583
|
# center grid of viewport
|
575
|
-
cen_of_vp = [ x0 + hlength/2.0, y0 + vlength/2.0 ]
|
584
|
+
cen_of_vp = [ x0 + hlength/2.0, y0 + vlength/2.0 ]
|
576
585
|
|
577
586
|
if aspect <= 2.0
|
578
587
|
hlength = vlength * aspect
|
579
588
|
x0 = cen_of_vp[0] - hlength/2.0
|
580
589
|
x1 = cen_of_vp[0] + hlength/2.0
|
581
590
|
else
|
582
|
-
vlength = hlength / aspect
|
591
|
+
vlength = hlength / aspect
|
583
592
|
y0 = cen_of_vp[1] - vlength/2.0
|
584
593
|
y1 = cen_of_vp[1] + vlength/2.0
|
585
|
-
end
|
594
|
+
end
|
586
595
|
|
587
596
|
return [ x0, x1, y0, y1 ]
|
588
597
|
|
@@ -606,7 +615,7 @@ def __split_range(range)
|
|
606
615
|
else
|
607
616
|
raise "invalid range: variable subset specification error. split range with ':'\n\n"
|
608
617
|
end
|
609
|
-
|
618
|
+
|
610
619
|
return min, max
|
611
620
|
end
|
612
621
|
|
@@ -631,7 +640,7 @@ def check_dclopts
|
|
631
640
|
value = opt[4..-1].split('=')[1]
|
632
641
|
dcl_set_params(pkg,name,value)
|
633
642
|
}
|
634
|
-
|
643
|
+
|
635
644
|
end
|
636
645
|
|
637
646
|
def dcl_set_params(pkg,name,value)
|
@@ -655,7 +664,7 @@ def dcl_set_params(pkg,name,value)
|
|
655
664
|
else
|
656
665
|
eval( "DCL.#{pkg}r#{set}(name,value.to_f)" )
|
657
666
|
end
|
658
|
-
|
667
|
+
|
659
668
|
end
|
660
669
|
|
661
670
|
#####################################################
|
@@ -736,7 +745,7 @@ end
|
|
736
745
|
|
737
746
|
## Print out help message
|
738
747
|
if ($OPT_help)
|
739
|
-
help
|
748
|
+
help
|
740
749
|
exit(1)
|
741
750
|
end
|
742
751
|
|
@@ -746,18 +755,18 @@ DCL::swlset('lwait', false) if ($OPT_nowait || $OPT_Gw || $OPT_smooth || $OPT
|
|
746
755
|
DCL::swlset('lalt', true) if ($OPT_alternate || $OPT_Ga || $OPT_smooth || $OPT_Gaw)
|
747
756
|
# set backing store option
|
748
757
|
if ($OPT_noannotate)
|
749
|
-
$annotate = false
|
758
|
+
$annotate = false
|
750
759
|
else
|
751
760
|
$annotate = true
|
752
761
|
end
|
753
762
|
|
754
763
|
if ($OPT_nocolorbar)
|
755
|
-
$colorbar = false
|
764
|
+
$colorbar = false
|
756
765
|
else
|
757
766
|
$colorbar = true
|
758
767
|
end
|
759
768
|
|
760
|
-
if ($OPT_tone)
|
769
|
+
if ($OPT_tone)
|
761
770
|
case $OPT_tone
|
762
771
|
when "a"
|
763
772
|
$auto, $tonf, $tona, $toneb, $tonec = true,false,false,false
|
@@ -787,13 +796,17 @@ udsfmt = ($OPT_udsfmt||DCL.udqfmt())
|
|
787
796
|
DCL.udsfmt(udsfmt)
|
788
797
|
|
789
798
|
## draw figure
|
790
|
-
loopdim = ( $OPT_animate || $OPT_anim )
|
799
|
+
loopdim = ( $OPT_animate || $OPT_anim )
|
791
800
|
loopdim = loopdim.to_i if loopdim.to_i.to_s == loopdim
|
792
801
|
|
793
802
|
## set colormap
|
794
803
|
DCL.sgscmn($OPT_clrmap||1)
|
795
804
|
## open work station
|
796
|
-
DCL.
|
805
|
+
if NumRu::DCL::DCLVERSION.to_f >= 6
|
806
|
+
DCL.gropn($OPT_wsn||1)
|
807
|
+
else
|
808
|
+
DCL.gropn($OPT_wsn||4)
|
809
|
+
end
|
797
810
|
|
798
811
|
## open netcdf variables
|
799
812
|
|
@@ -808,7 +821,7 @@ while ARGV[0] do
|
|
808
821
|
if ( $OPT_scalar )
|
809
822
|
gturlx = ARGV[0]
|
810
823
|
gturlx = gturlx+','+$OPT_slice if $OPT_slice
|
811
|
-
|
824
|
+
|
812
825
|
gpux = GPhys::IO.open_gturl(gturlx)
|
813
826
|
print " Reading #{gturlx}\n"
|
814
827
|
ARGV.shift
|
@@ -877,5 +890,3 @@ while ARGV[0] do
|
|
877
890
|
end
|
878
891
|
|
879
892
|
DCL.grcls
|
880
|
-
|
881
|
-
|