gphys 1.5.1 → 1.5.2
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 +4 -4
- data/ChangeLog +40 -0
- data/lib/numru/dclext.rb +10 -5
- data/lib/numru/ganalysis/covariance.rb +5 -6
- data/lib/numru/ggraph.rb +15 -13
- data/lib/numru/gphys/grib_params.rb +7 -7
- data/lib/numru/gphys/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1921300d74726704bca4bba00ebaa9b46081ae24
|
4
|
+
data.tar.gz: 4c9344000f180c1405877496eb6492304d74b73d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 386eca1431a75db9af349d1739b661b2a59b24df4f8b4f38df8ac9cbb87f27f2960dc944bce3bdb3c88a16d9ba7750cefa5913e363cb576d5ae9f4699e49b1d4
|
7
|
+
data.tar.gz: 4d0a3d04f2312aefd778e68241ee5a0ad323a0488bdfbfd136f0651755c2233a1693ddc2e141e8949bb5e5bd4a679f7ed8197273015207dfc105352bd0174b82
|
data/ChangeLog
CHANGED
@@ -1,3 +1,43 @@
|
|
1
|
+
2017-04-17 Takeshi Horinouchi
|
2
|
+
1.5.1 --> 1.5.2
|
3
|
+
|
4
|
+
M lib/numru/gphys/version.rb
|
5
|
+
|
6
|
+
2017-04-17 Takeshi Horinouchi
|
7
|
+
updated units: "/s" -> "1/s".
|
8
|
+
|
9
|
+
M lib/numru/gphys/grib_params.rb
|
10
|
+
|
11
|
+
2017-04-17 Takeshi Horinouchi
|
12
|
+
treatment based on (but not the same as in) [dennou-ruby:003987]
|
13
|
+
|
14
|
+
M lib/numru/ganalysis/covariance.rb
|
15
|
+
|
16
|
+
2017-04-17 Takeshi Horinouchi
|
17
|
+
Removed the string length limit for slsttl when DCLVERSION >= 7.1
|
18
|
+
|
19
|
+
M lib/numru/ggraph.rb
|
20
|
+
|
21
|
+
2017-04-17 Takeshi Horinouchi
|
22
|
+
a refactoring
|
23
|
+
|
24
|
+
M lib/numru/dclext.rb
|
25
|
+
|
26
|
+
2017-04-17 Takeshi Horinouchi
|
27
|
+
Completed the bug fix intended in c5ace9bf8d81ea738b15ebb35e2c3dc8512997af
|
28
|
+
|
29
|
+
M lib/numru/dclext.rb
|
30
|
+
|
31
|
+
2017-04-17 Takeshi Horinouchi
|
32
|
+
Changed the default param values for GGraph::startup (ifl: 1->nil, colormap: 4->nil) not to impede prior settings.
|
33
|
+
|
34
|
+
M lib/numru/ggraph.rb
|
35
|
+
|
36
|
+
2017-04-11 Takeshi Horinouchi
|
37
|
+
bug fix to avoid zero division (from Kawai & Yashiro: dcdvlop)
|
38
|
+
|
39
|
+
M lib/numru/dclext.rb
|
40
|
+
|
1
41
|
2017-01-24 Takeshi Horinouchi
|
2
42
|
years extended to 2017
|
3
43
|
|
data/lib/numru/dclext.rb
CHANGED
@@ -934,12 +934,17 @@ module NumRu
|
|
934
934
|
dz = DCL.rgnge( (max-min)/nlev.to_f )
|
935
935
|
end
|
936
936
|
|
937
|
-
|
938
|
-
|
939
|
-
|
937
|
+
if dz != 0
|
938
|
+
zmin = DCL.irle(min/dz)*dz
|
939
|
+
zmax = DCL.irge(max/dz)*dz
|
940
|
+
n = ((zmax-zmin)/dz).round
|
941
|
+
else
|
942
|
+
zmin = min
|
943
|
+
n = 0
|
944
|
+
end
|
940
945
|
|
941
|
-
levels =
|
942
|
-
for i in
|
946
|
+
levels = [ zmin ]
|
947
|
+
for i in 1..n
|
943
948
|
x = ((zmin+i*dz)/dz).round * dz
|
944
949
|
levels.push(x)
|
945
950
|
end
|
@@ -48,7 +48,7 @@ module NumRu
|
|
48
48
|
nary /= (ndiv-1)
|
49
49
|
return UNumeric.new(nary, units), ndiv
|
50
50
|
else
|
51
|
-
nary.div!(ndiv-1)
|
51
|
+
nary = nary.div!(ndiv-1)
|
52
52
|
vary = VArray.new(nary,
|
53
53
|
{"long_name"=>"covariance","units"=>units.to_s},
|
54
54
|
"covariance")
|
@@ -57,7 +57,7 @@ module NumRu
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
def
|
60
|
+
def correlation(gphys0, gphys1, *dims)
|
61
61
|
val0 = gphys0.val
|
62
62
|
val1 = gphys1.val
|
63
63
|
if val0.is_a?(NArrayMiss)
|
@@ -80,9 +80,9 @@ module NumRu
|
|
80
80
|
gphys1 = gphys1.copy.replace_val(val1)
|
81
81
|
|
82
82
|
covariance, ndiv = gphys0.covariance(gphys1,*dims)
|
83
|
+
dims = dims.map{|dim| gphys0.dim_index(dim) }
|
83
84
|
return covariance/(gphys0.stddev(*dims)*gphys1.stddev(*dims)), mask.to_type(NArray::LINT).sum(*dims)
|
84
85
|
end
|
85
|
-
alias correlation corelation
|
86
86
|
end
|
87
87
|
|
88
88
|
class GPhys
|
@@ -90,10 +90,9 @@ module NumRu
|
|
90
90
|
GAnalysis.covariance(self, other, *dims)
|
91
91
|
end
|
92
92
|
|
93
|
-
def
|
94
|
-
GAnalysis.
|
93
|
+
def correlation(other, *dims)
|
94
|
+
GAnalysis.correlation(self, other, *dims)
|
95
95
|
end
|
96
|
-
alias correlation corelation
|
97
96
|
end
|
98
97
|
end
|
99
98
|
|
data/lib/numru/ggraph.rb
CHANGED
@@ -127,10 +127,10 @@ library if you like.
|
|
127
127
|
* options (Hash) : options to change the default behavior if specified.
|
128
128
|
option name default value # description:
|
129
129
|
"iws" 1 # DCL sgpack param: Workstation ID (1:display, 2:file
|
130
|
-
# if DCL ver>=6)
|
131
|
-
"ifl"
|
132
|
-
# for iws==2 (1:png,2:eps,3:svg,4:pdf)
|
133
|
-
"colormap"
|
130
|
+
# if DCL ver>=6); DCL's default is 4
|
131
|
+
"ifl" nil # DCL swpack param (for DCL ver.>=6): file format num
|
132
|
+
# for iws==2 (1:png,2:eps,3:svg,4:pdf; DCL's default is 1)
|
133
|
+
"colormap" nil # DCL color map number (Integer)
|
134
134
|
"iwidth" nil # DCL swpack param (Integer): display width
|
135
135
|
# (pixcels)
|
136
136
|
"iheight" nil # DCL swpack param (Integer): display height
|
@@ -1141,8 +1141,8 @@ module NumRu
|
|
1141
1141
|
|
1142
1142
|
@@startup_options = Misc::KeywordOptAutoHelp.new(
|
1143
1143
|
['iws', 1, 'DCL sgpack param: Workstation ID (1:display, 2:file if DCL ver>=6)'],
|
1144
|
-
['ifl',
|
1145
|
-
['colormap',
|
1144
|
+
['ifl', nil, 'DCL swpack param (for DCL ver.>=6): file format num for iws==2 (1:png,2:eps,3:svg,4:pdf); DCL\'s default is 4'],
|
1145
|
+
['colormap', nil, 'DCL color map number (Integer); DCL\'s default is 1'],
|
1146
1146
|
['iwidth', nil, 'DCL swpack param (Integer): display width (pixcels)'],
|
1147
1147
|
['iheight', nil, 'DCL swpack param (Integer): display height (pixcels)'],
|
1148
1148
|
['lwait', true, 'DCL swpack param (true/false): wait mouse click to show next page'],
|
@@ -1156,8 +1156,8 @@ module NumRu
|
|
1156
1156
|
opts = @@startup_options.interpret(options)
|
1157
1157
|
DCL.swpset('iwidth',opts['iwidth']) if opts['iwidth']
|
1158
1158
|
DCL.swpset('iheight',opts['iheight']) if opts['iheight']
|
1159
|
-
DCL.swpset('ifl',opts['ifl']) if DCL::DCLVERSION >= "6"
|
1160
|
-
DCL.sgscmn(opts['colormap'])
|
1159
|
+
DCL.swpset('ifl',opts['ifl']) if opts['ifl'] && DCL::DCLVERSION >= "6"
|
1160
|
+
DCL.sgscmn(opts['colormap']) if opts['colormap']
|
1161
1161
|
DCL.swpset('lwait',opts['lwait'])
|
1162
1162
|
DCL.swpset('lalt',opts['lalt'])
|
1163
1163
|
|
@@ -1183,18 +1183,20 @@ module NumRu
|
|
1183
1183
|
|
1184
1184
|
program = File.expand_path($0) if !program
|
1185
1185
|
if date
|
1186
|
-
program = __shorten_path(program,77)
|
1186
|
+
program = __shorten_path(program,77) if DCL::DCLVERSION < "7.1"
|
1187
|
+
program += ' ' + Date.today.to_s
|
1187
1188
|
else
|
1188
|
-
program = __shorten_path(program,99)
|
1189
|
-
if date.nil?
|
1190
|
-
|
1189
|
+
program = __shorten_path(program,99) if DCL::DCLVERSION < "7.1"
|
1190
|
+
if date.nil? && ## date is not added if false
|
1191
|
+
(DCL::DCLVERSION >= "7.1" || program.length < 77)
|
1192
|
+
program += ' ' + Date.today.to_s
|
1191
1193
|
end
|
1192
1194
|
end
|
1193
1195
|
if !data_source
|
1194
1196
|
data_source = Dir.pwd
|
1195
1197
|
data_source = '' if data_source == program.sub(/\/[^\/]+$/,'')
|
1196
1198
|
end
|
1197
|
-
data_source = __shorten_path(data_source,99)
|
1199
|
+
data_source = __shorten_path(data_source,99) if DCL::DCLVERSION < "7.1"
|
1198
1200
|
sz = 1.0/( program.length + data_source.length )
|
1199
1201
|
char_height = [0.008, sz].min if !char_height
|
1200
1202
|
yb = 2.0 * char_height if !yb
|
@@ -563,12 +563,12 @@ NAMES_UNITS = {
|
|
563
563
|
PARAM_SIG_VEL => ["Sigma coord. vertical velocity", "SGCVV", "s /s", "vertical_air_velocity_expressed_as_tendency_of_sigma"],
|
564
564
|
PARAM_VERT_VEL => ["Pressure Vertical velocity", "VVEL", "Pa/s", "vertical_air_velocity_expressed_as_tendency_of_pressure"],
|
565
565
|
PARAM_GEOM_VEL => ["Geometric Vertical velocity", "DZGT", "m/s", "upward_air_velocity"],
|
566
|
-
PARAM_ABS_VOR => ["Absolute vorticity", "ABSV", "/s", "atmosphere_absolute_vorticity"],
|
567
|
-
PARAM_ABS_DIV => ["Absolute divergence", "ABSD", "/s", ""],
|
568
|
-
PARAM_REL_VOR => ["Relative vorticity", "RELV", "/s", "atmosphere_relative_vorticity"],
|
569
|
-
PARAM_REL_DIV => ["Relative divergence", "RELD", "/s", "divergence_of_wind"],
|
570
|
-
PARAM_U_SHR => ["Vertical u-component shear", "VUCSH", "/s", "eastward_wind_shear"],
|
571
|
-
PARAM_V_SHR => ["Vertical v-component shear", "VVCSH", "/s", "northward_wind_shear"],
|
566
|
+
PARAM_ABS_VOR => ["Absolute vorticity", "ABSV", "1/s", "atmosphere_absolute_vorticity"],
|
567
|
+
PARAM_ABS_DIV => ["Absolute divergence", "ABSD", "1/s", ""],
|
568
|
+
PARAM_REL_VOR => ["Relative vorticity", "RELV", "1/s", "atmosphere_relative_vorticity"],
|
569
|
+
PARAM_REL_DIV => ["Relative divergence", "RELD", "1/s", "divergence_of_wind"],
|
570
|
+
PARAM_U_SHR => ["Vertical u-component shear", "VUCSH", "1/s", "eastward_wind_shear"],
|
571
|
+
PARAM_V_SHR => ["Vertical v-component shear", "VVCSH", "1/s", "northward_wind_shear"],
|
572
572
|
PARAM_CRNT_DIR => ["Direction of current", "DIRC", "Deg. true", "direction_of_sea_water_velocity"],
|
573
573
|
PARAM_CRNT_SPD => ["Speed of current", "SPC", "m/s", "sea_water_speed"],
|
574
574
|
PARAM_U_CRNT => ["u-component of current", "UOGRD", "m/s", "eastward_sea_water_velocity"],
|
@@ -620,7 +620,7 @@ NAMES_UNITS = {
|
|
620
620
|
PARAM_ICE_U => ["u-component of ice drift", "UICE", "m/s", "sea_ice_eastward_velocity"],
|
621
621
|
PARAM_ICE_V => ["v-component of ice drift", "VICE", "m/s", "sea_ice_northward_velocity"],
|
622
622
|
PARAM_ICE_GROWTH => ["Ice growth rate", "ICEG", "m/s", "tendency_of_sea_ice_thickness_due_to_thermodynamics"],
|
623
|
-
PARAM_ICE_DIV => ["Ice divergence", "ICED", "/s", "divergence_of_sea_ice_velocity"],
|
623
|
+
PARAM_ICE_DIV => ["Ice divergence", "ICED", "1/s", "divergence_of_sea_ice_velocity"],
|
624
624
|
PARAM_SNO_M => ["Snow melt", "SNOM", "kg/m2", "surface_snow_melt_amount"],
|
625
625
|
PARAM_WAVE_HGT => ["Significant height of combined", "HTSGW", "wind m", "significant_height_of_wind_and_swell_waves"],
|
626
626
|
PARAM_SEA_DIR => ["Direction of wind waves", "WVDIR", "deg. true", "direction_of_wind_wave_velocity"],
|
data/lib/numru/gphys/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gphys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takeshi Horinouchi
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2017-
|
15
|
+
date: 2017-04-17 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: narray
|