gs2crmod 0.11.41 → 0.11.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/gs2crmod.gemspec +2 -2
- data/lib/gs2crmod/read_netcdf.rb +12 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d47bfd3f6daaad59aa71daa189d30c0e1e548249
|
4
|
+
data.tar.gz: 74da568667cf816e48dc5b841fe6edf0e3fb8abb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ede1341b80bf20b9748fad03729a0334d38524047823847a4bd154b899106c00839f22bde718868b00867902fd2c0e245887759e516376d0dbb86884013218ff
|
7
|
+
data.tar.gz: cf559fa103920112339472b6a0531d3bbdf7204d0be01390c9e4a5051a8c88dc938cdb97a39afaf8394c73928fabfa0570684a7757a2a6a52fe8f8648b361c8c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.11.
|
1
|
+
0.11.42
|
data/gs2crmod.gemspec
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: gs2crmod 0.11.
|
5
|
+
# stub: gs2crmod 0.11.42 ruby lib
|
6
6
|
# stub: ext/extconf.rb
|
7
7
|
|
8
8
|
Gem::Specification.new do |s|
|
9
9
|
s.name = "gs2crmod"
|
10
|
-
s.version = "0.11.
|
10
|
+
s.version = "0.11.42"
|
11
11
|
|
12
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
13
|
s.require_paths = ["lib"]
|
data/lib/gs2crmod/read_netcdf.rb
CHANGED
@@ -53,14 +53,14 @@ class NetcdfSmartReader
|
|
53
53
|
dims = dimensions(varname)
|
54
54
|
narray = @file.var(varname).get('start'=>starts(dims, options), 'end'=>ends(dims, options))
|
55
55
|
if options[:modify_variable]
|
56
|
-
|
56
|
+
hsh = dims.inject({}){|hsh, dim|
|
57
57
|
opts = options.dup
|
58
58
|
opts[:modify_variable] = nil
|
59
59
|
dimval = read_variable(dimension_variable_name(dim.name), opts)
|
60
|
-
|
61
|
-
|
60
|
+
hsh[dim.name] = dimval
|
61
|
+
hsh
|
62
62
|
}
|
63
|
-
narray = options[:modify_variable].call(varname, narray,
|
63
|
+
narray = options[:modify_variable].call(varname, narray, hsh)
|
64
64
|
end
|
65
65
|
shape = narray.shape
|
66
66
|
shape.delete_if{|i| i==1}
|
@@ -197,8 +197,8 @@ def hyperviscosity_graphkit(options)
|
|
197
197
|
raise "This only works for spectrogk" unless spectrogk?
|
198
198
|
options[:modify_variable] = Proc.new do |varname, narray, dimhash|
|
199
199
|
#dimnames = dimhash.keys
|
200
|
-
ky =
|
201
|
-
kx =
|
200
|
+
ky = dimhash['Y'].to_a.to_gslv
|
201
|
+
kx = dimhash['X'].to_a.to_gslv.to_box_order
|
202
202
|
shape = narray.shape
|
203
203
|
if varname == "gnew2_ta"
|
204
204
|
shape = narray.shape
|
@@ -225,8 +225,11 @@ def hypercoll_graphkit(options)
|
|
225
225
|
raise "This only works for spectrogk" unless spectrogk?
|
226
226
|
options[:modify_variable] = Proc.new do |varname, narray, dimhash|
|
227
227
|
#dimnames = dimhash.keys
|
228
|
+
p varname, dimhash
|
228
229
|
if varname == "gnew2_ta"
|
229
230
|
shape = narray.shape
|
231
|
+
m = dimhash['m']
|
232
|
+
mmax = new_netcdf_file.var('hermite').get.to_a.size - 1
|
230
233
|
p 'shape',shape
|
231
234
|
for ig in 0...shape[0]
|
232
235
|
for it in 0...shape[1]
|
@@ -234,7 +237,7 @@ def hypercoll_graphkit(options)
|
|
234
237
|
for il in 0...shape[3]
|
235
238
|
for ie in 0...shape[4]
|
236
239
|
for is in 0...shape[5]
|
237
|
-
narray[ig,it,ik,il,ie,is]*=send(:nu_h_ + (is+1).to_sym)*(il
|
240
|
+
narray[ig,it,ik,il,ie,is]*=send(:nu_h_ + (is+1).to_sym)*(m[il]/mmax)**send(:nexp_h_ + (is+1).to_sym)
|
238
241
|
end
|
239
242
|
end
|
240
243
|
end
|
@@ -252,6 +255,7 @@ def lenardbern_graphkit(options)
|
|
252
255
|
options[:modify_variable] = Proc.new do |varname, narray, dimhash|
|
253
256
|
#dimnames = dimhash.keys
|
254
257
|
if varname == "gnew2_ta"
|
258
|
+
m = dimhash['m']
|
255
259
|
shape = narray.shape
|
256
260
|
for ig in 0...shape[0]
|
257
261
|
for it in 0...shape[1]
|
@@ -259,7 +263,7 @@ def lenardbern_graphkit(options)
|
|
259
263
|
for il in 0...shape[3]
|
260
264
|
for ie in 0...shape[4]
|
261
265
|
for is in 0...shape[5]
|
262
|
-
narray[ig,it,ik,il,ie,is]*=send(:nu_ + (is+1).to_sym)*il
|
266
|
+
narray[ig,it,ik,il,ie,is]*=send(:nu_ + (is+1).to_sym)*m[il]
|
263
267
|
end
|
264
268
|
end
|
265
269
|
end
|