cdo 1.2.3 → 1.2.5
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/{COPYING → LICENSE} +0 -0
- data/gemspec +4 -4
- data/lib/cdo.rb +43 -11
- data/test/test_cdo.rb +114 -26
- metadata +24 -15
- data/ChangeLog +0 -7
- data/README.rdoc +0 -64
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0596d2635271ae69ea1ea758d38f8481c3f04e13
|
4
|
+
data.tar.gz: 3ca1b3a218e5797071abaa01174fc68fb00f8095
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c50745b63ef44962785a3379f1680fbde15fc270b7c7314c6e712bdc92bb8d7e0c0442437e9efa44dee73965c6d20be5fed17b1bfa22ca554ea0a2cf28bfe6d
|
7
|
+
data.tar.gz: f1b5fed0c1909a7ad84ff504b24c76232c78d1d72f741ec76dc73c2b7c4098aae2852942a75f2595c8fef47cfadf5a33244cc484837a2a3288b63d639488a07c
|
data/{COPYING → LICENSE}
RENAMED
File without changes
|
data/gemspec
CHANGED
@@ -3,18 +3,18 @@ $:.unshift File.join(File.dirname(__FILE__),"..","lib")
|
|
3
3
|
|
4
4
|
spec = Gem::Specification.new do |s|
|
5
5
|
s.name = "cdo"
|
6
|
-
s.version = '1.2.
|
6
|
+
s.version = '1.2.5'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
|
-
s.files = ["lib/cdo.rb"] + ["gemspec","
|
8
|
+
s.files = ["lib/cdo.rb"] + ["gemspec","LICENSE"]
|
9
9
|
s.test_file = "test/test_cdo.rb"
|
10
10
|
s.description = "Easy access to the Climate Data operators"
|
11
11
|
s.summary = "Easy access to the Climate Data operators"
|
12
12
|
s.author = "Ralf Mueller"
|
13
13
|
s.email = "stark.dreamdetective@gmail.com"
|
14
14
|
s.homepage = "https://code.zmaw.de/projects/cdo/wiki/Cdo%7Brbpy%7D"
|
15
|
-
s.extra_rdoc_files = ["README.rdoc","COPYING"]
|
16
15
|
s.license = "GPLv2"
|
17
|
-
s.required_ruby_version = ">=
|
16
|
+
s.required_ruby_version = ">= 2.0"
|
17
|
+
s.add_development_dependency('unifiedPlot')
|
18
18
|
end
|
19
19
|
|
20
20
|
# vim:ft=ruby
|
data/lib/cdo.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'pp'
|
2
2
|
require 'open3'
|
3
|
+
require 'logger'
|
4
|
+
require 'stringio'
|
3
5
|
|
4
|
-
# Copyright (C) 2011-
|
6
|
+
# Copyright (C) 2011-2013 Ralf Mueller, ralf.mueller@zmaw.de
|
5
7
|
# See COPYING file for copying and redistribution conditions.
|
6
8
|
#
|
7
9
|
# This program is free software; you can redistribute it and/or modify
|
@@ -17,15 +19,22 @@ require 'open3'
|
|
17
19
|
# CDO calling mechnism
|
18
20
|
module Cdo
|
19
21
|
|
20
|
-
VERSION = "1.2.
|
22
|
+
VERSION = "1.2.5"
|
23
|
+
@@file = StringIO.new
|
21
24
|
|
22
25
|
State = {
|
23
26
|
:debug => false,
|
24
27
|
:returnCdf => false,
|
25
28
|
:operators => [],
|
26
|
-
:forceOutput => true
|
29
|
+
:forceOutput => true,
|
30
|
+
:env => {},
|
31
|
+
:log => false,
|
32
|
+
:logger => Logger.new(@@file),
|
27
33
|
}
|
28
|
-
State[:debug] =
|
34
|
+
State[:debug] = ENV.has_key?('DEBUG')
|
35
|
+
State[:logger].formatter = proc do |serverity, time, progname, msg|
|
36
|
+
msg
|
37
|
+
end
|
29
38
|
|
30
39
|
@@CDO = ENV['CDO'].nil? ? 'cdo' : ENV['CDO']
|
31
40
|
|
@@ -89,17 +98,24 @@ module Cdo
|
|
89
98
|
end
|
90
99
|
end
|
91
100
|
|
101
|
+
def Cdo.env=(envHash)
|
102
|
+
State[:env] = envHash
|
103
|
+
end
|
104
|
+
def Cdo.env; State[:env]; end
|
105
|
+
|
92
106
|
def Cdo.call(cmd)
|
93
107
|
if (State[:debug])
|
94
108
|
puts '# DEBUG ====================================================================='
|
109
|
+
pp Cdo.env unless Cdo.env.empty?
|
110
|
+
puts 'CMD: '
|
95
111
|
puts cmd
|
96
112
|
puts '# DEBUG ====================================================================='
|
97
113
|
end
|
98
|
-
stdin, stdout, stderr, wait_thr = Open3.popen3(cmd)
|
114
|
+
stdin, stdout, stderr, wait_thr = Open3.popen3(Cdo.env,cmd)
|
99
115
|
|
100
116
|
{
|
101
|
-
:stdout
|
102
|
-
:stderr
|
117
|
+
:stdout => stdout.read,
|
118
|
+
:stderr => stderr.read,
|
103
119
|
:returncode => wait_thr.value.exitstatus
|
104
120
|
}
|
105
121
|
end
|
@@ -109,6 +125,7 @@ module Cdo
|
|
109
125
|
case ofile
|
110
126
|
when $stdout
|
111
127
|
retvals = Cdo.call(cmd)
|
128
|
+
State[:logger].info(cmd+"\n") if State[:log]
|
112
129
|
unless hasError(cmd,retvals)
|
113
130
|
return retvals[:stdout].split($/).map {|l| l.chomp.strip}
|
114
131
|
else
|
@@ -120,6 +137,7 @@ module Cdo
|
|
120
137
|
ofile = MyTempfile.path if ofile.nil?
|
121
138
|
cmd << "#{ofile}"
|
122
139
|
retvals = call(cmd)
|
140
|
+
State[:logger].info(cmd+"\n") if State[:log]
|
123
141
|
if hasError(cmd,retvals)
|
124
142
|
raise ArgumentError,"CDO did NOT run successfully!"
|
125
143
|
end
|
@@ -155,7 +173,7 @@ module Cdo
|
|
155
173
|
# iStream could be another CDO call (timmax(selname(Temp,U,V,ifile.nc))
|
156
174
|
puts "Operator #{sym.to_s} is called" if State[:debug]
|
157
175
|
if getOperators.include?(sym.to_s)
|
158
|
-
io,opts = Cdo.parseArgs(args)
|
176
|
+
io, opts = Cdo.parseArgs(args)
|
159
177
|
if @@outputOperatorsPattern.match(sym)
|
160
178
|
run(" -#{sym.to_s}#{opts} #{io[:input]} ",$stdout)
|
161
179
|
else
|
@@ -195,18 +213,22 @@ module Cdo
|
|
195
213
|
def Cdo.debug=(value)
|
196
214
|
State[:debug] = value
|
197
215
|
end
|
198
|
-
|
199
216
|
def Cdo.debug
|
200
217
|
State[:debug]
|
201
218
|
end
|
202
|
-
|
203
219
|
def Cdo.forceOutput=(value)
|
204
220
|
State[:forceOutput] = value
|
205
221
|
end
|
206
|
-
|
207
222
|
def Cdo.forceOutput
|
208
223
|
State[:forceOutput]
|
209
224
|
end
|
225
|
+
def Cdo.log=(value)
|
226
|
+
State[:log] = value
|
227
|
+
end
|
228
|
+
|
229
|
+
def Cdo.log
|
230
|
+
State[:log]
|
231
|
+
end
|
210
232
|
|
211
233
|
def Cdo.version
|
212
234
|
cmd = @@CDO + ' 2>&1'
|
@@ -289,6 +311,11 @@ module Cdo
|
|
289
311
|
end
|
290
312
|
end
|
291
313
|
|
314
|
+
def Cdo.showlog
|
315
|
+
@@file.rewind
|
316
|
+
puts @@file.read
|
317
|
+
end
|
318
|
+
|
292
319
|
#==================================================================
|
293
320
|
# Addional operotors:
|
294
321
|
#------------------------------------------------------------------
|
@@ -317,6 +344,11 @@ module Cdo
|
|
317
344
|
NetCDF.open(iFile)
|
318
345
|
end
|
319
346
|
|
347
|
+
def Cdo.openCdf(iFile)
|
348
|
+
Cdo.loadCdf unless State[:returnCdf]
|
349
|
+
NetCDF.open(iFile,'r+')
|
350
|
+
end
|
351
|
+
|
320
352
|
def Cdo.readArray(iFile,varname)
|
321
353
|
filehandle = Cdo.readCdf(iFile)
|
322
354
|
if filehandle.var_names.include?(varname)
|
data/test/test_cdo.rb
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__),"..","lib")
|
2
|
-
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
3
4
|
require 'cdo'
|
5
|
+
require 'unifiedPlot'
|
4
6
|
require 'pp'
|
5
7
|
|
6
|
-
|
8
|
+
|
9
|
+
#===============================================================================
|
10
|
+
def rm(files); files.each {|f| FileUtils.rm(f) if File.exists?(f)};end
|
11
|
+
|
12
|
+
class TestCdo < Minitest::Test
|
7
13
|
|
8
14
|
DEFAULT_CDO_PATH = 'cdo'
|
9
15
|
|
@@ -14,7 +20,7 @@ class TestCdo < Test::Unit::TestCase
|
|
14
20
|
else
|
15
21
|
assert_equal(DEFAULT_CDO_PATH,Cdo.getCdo)
|
16
22
|
end
|
17
|
-
newCDO="#{ENV['HOME']}/bin/cdo"
|
23
|
+
newCDO="#{ENV['HOME']}/local/bin/cdo"
|
18
24
|
if File.exist?(newCDO) then
|
19
25
|
Cdo.setCdo(newCDO)
|
20
26
|
assert_equal(true,Cdo.checkCdo)
|
@@ -29,6 +35,7 @@ class TestCdo < Test::Unit::TestCase
|
|
29
35
|
assert(Cdo.getOperators.include?(op),"Operator '#{op}' not found")
|
30
36
|
end
|
31
37
|
}
|
38
|
+
assert(Cdo.respond_to?('diff')) # an alias
|
32
39
|
end
|
33
40
|
def test_listAllOperators
|
34
41
|
print Cdo.operators.join("\n")
|
@@ -53,16 +60,10 @@ class TestCdo < Test::Unit::TestCase
|
|
53
60
|
assert("1.4.3.1" < Cdo.version,"Version to low: #{Cdo.version}")
|
54
61
|
end
|
55
62
|
def test_args
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
ofile2 = MyTempfile.path
|
61
|
-
ofile3 = MyTempfile.path
|
62
|
-
Cdo.stdatm(0,20,40,80,200,230,400,600,1100,:output => ofile0)
|
63
|
-
Cdo.intlevel(0,10,50,100,500,1000, :input => ofile0,:output => ofile1)
|
64
|
-
Cdo.intlevel([0,10,50,100,500,1000],:input => ofile0,:output => ofile2)
|
65
|
-
Cdo.sub(:input => [ofile1,ofile2].join(' '),:output => ofile3)
|
63
|
+
ofile0 = Cdo.stdatm(0,20,40,80,200,230,400,600,1100)
|
64
|
+
ofile1 = Cdo.intlevel(0,10,50,100,500,1000, :input => ofile0)
|
65
|
+
ofile2 = Cdo.intlevel([0,10,50,100,500,1000],:input => ofile0)
|
66
|
+
ofile3 = Cdo.sub(:input => [ofile1,ofile2].join(' '))
|
66
67
|
info = Cdo.infon(:input => ofile3)
|
67
68
|
(1...info.size).each {|i| assert_equal(0.0,info[i].split[-1].to_f)}
|
68
69
|
end
|
@@ -79,6 +80,9 @@ class TestCdo < Test::Unit::TestCase
|
|
79
80
|
if Cdo.hasLib?("sz")
|
80
81
|
ofile = Cdo.topo(:output => ofile,:options => "-z szip")
|
81
82
|
assert_equal(["GRIB SZIP"],Cdo.showformat(:input => ofile))
|
83
|
+
else
|
84
|
+
ofile = Cdo.topo
|
85
|
+
assert_equal(["GRIB"],Cdo.showformat(:input => ofile))
|
82
86
|
end
|
83
87
|
end
|
84
88
|
def test_chain
|
@@ -88,11 +92,13 @@ class TestCdo < Test::Unit::TestCase
|
|
88
92
|
end
|
89
93
|
|
90
94
|
def test_diff
|
91
|
-
Cdo.
|
92
|
-
|
95
|
+
diffv_ = Cdo.diffn(:input => "-random,r1x1 -random,r1x1")
|
96
|
+
diff_ = Cdo.diffv(:input => "-random,r1x1 -random,r1x1")
|
97
|
+
return
|
98
|
+
|
93
99
|
assert_equal(diffv[1].split(' ')[-1],"random")
|
94
100
|
assert_equal(diffv[1].split(' ')[-3],"0.53060")
|
95
|
-
|
101
|
+
pp diff
|
96
102
|
assert_equal(diff[1].split(' ')[-3],"0.53060")
|
97
103
|
end
|
98
104
|
|
@@ -291,11 +297,11 @@ class TestCdo < Test::Unit::TestCase
|
|
291
297
|
files = [fileA,fileB]
|
292
298
|
assert_equal(Cdo.diffv(:input => files.join(' ')),
|
293
299
|
Cdo.diffv(:input => files))
|
294
|
-
|
300
|
+
assert_nil(Cdo.diffv(:input => files).last)
|
295
301
|
# check for operator input
|
296
|
-
|
302
|
+
assert_nil(Cdo.diffv(:input => ["-stdatm,0","-stdatm,0"]).last)
|
297
303
|
# check for operator input and files
|
298
|
-
|
304
|
+
assert_nil(Cdo.diffv(:input => ["-stdatm,0",fileB]).last)
|
299
305
|
end
|
300
306
|
|
301
307
|
def test_libs
|
@@ -303,13 +309,13 @@ class TestCdo < Test::Unit::TestCase
|
|
303
309
|
assert(Cdo.hasLib?("nc4"),"netcdf4 support missing")
|
304
310
|
assert(Cdo.hasLib?("netcdf"),"netcdf support missing")
|
305
311
|
assert_equal(false,Cdo.hasLib?("boost"))
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
312
|
+
#if 'thingol' == `hostname`.chomp
|
313
|
+
# assert_equal('1.10.0',Cdo.libsVersion("grib_api")) if Cdo.hasLib?("grib_api")
|
314
|
+
# Cdo.debug = true
|
315
|
+
# warn "Found magics support" if Cdo.libs.has_key?('magics')
|
316
|
+
# Cdo.setCdo('../../src/cdo')
|
317
|
+
# assert(Cdo.libs.has_key?('magics'),"Magics support is expected in the local development binary")
|
318
|
+
#end
|
313
319
|
assert_raise ArgumentError do
|
314
320
|
Cdo.libsVersion("foo")
|
315
321
|
end
|
@@ -342,10 +348,92 @@ class TestCdo < Test::Unit::TestCase
|
|
342
348
|
Cdo.help(:notDefinedOP)
|
343
349
|
Cdo.help
|
344
350
|
end
|
351
|
+
def test_fillmiss
|
352
|
+
Cdo.debug = true
|
353
|
+
# check up-down replacement
|
354
|
+
rand = Cdo.setname('v',:input => '-random,r1x10 ', :options => ' -f nc',:output => '/tmp/rand.nc')
|
355
|
+
cdf = Cdo.openCdf(rand)
|
356
|
+
vals = cdf.var('v').get
|
357
|
+
cdf.var('v').put(vals.sort)
|
358
|
+
cdf.sync
|
359
|
+
cdf.close
|
345
360
|
|
361
|
+
missRange = '0.3,0.8'
|
362
|
+
arOrg = Cdo.setrtomiss(missRange,:input => cdf.path,:returnMaArray => 'v')
|
363
|
+
arFm = Cdo.fillmiss(:input => "-setrtomiss,#{missRange} #{cdf.path}",:returnMaArray => 'v')
|
364
|
+
arFm1s= Cdo.fillmiss2(:input => "-setrtomiss,#{missRange} #{cdf.path}",:returnMaArray => 'v')
|
365
|
+
vOrg = arOrg[0,0..-1]
|
366
|
+
vFm = arFm[0,0..-1]
|
367
|
+
vFm1s = arFm1s[0,0..-1]
|
368
|
+
UnifiedPlot.linePlot([{:y => vOrg, :style => 'line',:title => 'org'},
|
369
|
+
{:y => vFm, :style => 'points',:title => 'fillmiss'},
|
370
|
+
{:y => vFm1s,:style => 'points',:title => 'fillmiss2'}],
|
371
|
+
plotConf: {:yrange => '[0:1]'},title: 'r1x10')
|
372
|
+
# check left-right replacement
|
373
|
+
rand = Cdo.setname('v',:input => '-random,r10x1 ', :options => ' -f nc',:output => '/tmp/rand.nc')
|
374
|
+
cdf = Cdo.openCdf(rand)
|
375
|
+
vals = cdf.var('v').get
|
376
|
+
cdf.var('v').put(vals.sort)
|
377
|
+
cdf.sync
|
378
|
+
cdf.close
|
346
379
|
|
380
|
+
missRange = '0.3,0.8'
|
381
|
+
arOrg = Cdo.setrtomiss(missRange,:input => cdf.path,:returnMaArray => 'v')
|
382
|
+
arFm = Cdo.fillmiss(:input => "-setrtomiss,#{missRange} #{cdf.path}",:returnMaArray => 'v')
|
383
|
+
arFm1s= Cdo.fillmiss2(:input => "-setrtomiss,#{missRange} #{cdf.path}",:returnMaArray => 'v')
|
384
|
+
vOrg = arOrg[0..-1,0]
|
385
|
+
vFm = arFm[0..-1,0]
|
386
|
+
vFm1s = arFm1s[0..-1,0]
|
387
|
+
UnifiedPlot.linePlot([{:y => vOrg, :style => 'line',:title => 'org'},
|
388
|
+
{:y => vFm, :style => 'points',:title => 'fillmiss'},
|
389
|
+
{:y => vFm1s,:style => 'points',:title => 'fillmiss2'}],
|
390
|
+
plotConf: {:yrange => '[0:1]'},title: 'r10x1')
|
391
|
+
end
|
347
392
|
end
|
348
393
|
|
394
|
+
def test_env
|
395
|
+
oTag = 'test_env_with_splitlevel_'
|
396
|
+
levels = [0,10,100]
|
397
|
+
expected = levels.map {|l| "test_env_with_splitlevel_000#{l.to_s.rjust(3,'0')}"}
|
398
|
+
# clean up first
|
399
|
+
rm(Dir.glob(oTag+'*'))
|
400
|
+
|
401
|
+
# oType = grb (default)
|
402
|
+
ofiles = expected.map {|f| f += '.grb'}
|
403
|
+
Cdo.splitlevel(input: "-stdatm,0,10,100",output: oTag)
|
404
|
+
assert_equal(ofiles,Dir.glob(oTag+'*').sort)
|
405
|
+
rm(ofiles)
|
406
|
+
|
407
|
+
# oType = nc, from cdo options
|
408
|
+
ofiles = expected.map {|f| f += '.nc'}
|
409
|
+
Cdo.splitlevel(input: "-stdatm,0,10,100",output: oTag,options: '-f nc')
|
410
|
+
assert_equal(ofiles,Dir.glob(oTag+'*').sort)
|
411
|
+
rm(ofiles)
|
412
|
+
|
413
|
+
# oType = nc, from input type
|
414
|
+
ofiles = expected.map {|f| f += '.nc'}
|
415
|
+
Cdo.splitlevel(input: Cdo.stdatm(0,10,100,options: '-f nc'),output: oTag)
|
416
|
+
assert_equal(ofiles,Dir.glob(oTag+'*').sort)
|
417
|
+
rm(ofiles)
|
418
|
+
|
419
|
+
# oType = nc, from input ENV
|
420
|
+
ofiles = expected.map {|f| f += '.nc2'}
|
421
|
+
Cdo.env = {'CDO_FILE_SUFFIX' => '.nc2'}
|
422
|
+
Cdo.splitlevel(input: Cdo.stdatm(0,10,100,options: '-f nc'),output: oTag)
|
423
|
+
assert_equal(ofiles,Dir.glob(oTag+'*').sort)
|
424
|
+
rm(ofiles)
|
425
|
+
|
426
|
+
# oType = nc, from input ENV setting for each call
|
427
|
+
ofiles = expected.map {|f| f += '.nc2'}
|
428
|
+
Cdo.splitlevel(input: Cdo.stdatm(0,10,100,options: '-f nc'),output: oTag,env: {'CDO_FILE_SUFFIX' => '.nc2'})
|
429
|
+
assert_equal(ofiles,Dir.glob(oTag+'*').sort)
|
430
|
+
rm(ofiles)
|
431
|
+
end
|
432
|
+
def test_log
|
433
|
+
Cdo.log = true
|
434
|
+
Cdo.topo
|
435
|
+
Cdo.showlog
|
436
|
+
end
|
349
437
|
end
|
350
438
|
|
351
439
|
# # Calling simple operators
|
metadata
CHANGED
@@ -1,28 +1,38 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cdo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ralf Mueller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
11
|
+
date: 2015-06-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: unifiedPlot
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
description: Easy access to the Climate Data operators
|
14
28
|
email: stark.dreamdetective@gmail.com
|
15
29
|
executables: []
|
16
30
|
extensions: []
|
17
|
-
extra_rdoc_files:
|
18
|
-
- README.rdoc
|
19
|
-
- COPYING
|
31
|
+
extra_rdoc_files: []
|
20
32
|
files:
|
21
|
-
-
|
33
|
+
- LICENSE
|
22
34
|
- gemspec
|
23
|
-
-
|
24
|
-
- README.rdoc
|
25
|
-
- ChangeLog
|
35
|
+
- lib/cdo.rb
|
26
36
|
- test/test_cdo.rb
|
27
37
|
homepage: https://code.zmaw.de/projects/cdo/wiki/Cdo%7Brbpy%7D
|
28
38
|
licenses:
|
@@ -34,20 +44,19 @@ require_paths:
|
|
34
44
|
- lib
|
35
45
|
required_ruby_version: !ruby/object:Gem::Requirement
|
36
46
|
requirements:
|
37
|
-
- -
|
47
|
+
- - ">="
|
38
48
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
49
|
+
version: '2.0'
|
40
50
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
51
|
requirements:
|
42
|
-
- -
|
52
|
+
- - ">="
|
43
53
|
- !ruby/object:Gem::Version
|
44
54
|
version: '0'
|
45
55
|
requirements: []
|
46
56
|
rubyforge_project:
|
47
|
-
rubygems_version: 2.
|
57
|
+
rubygems_version: 2.4.5
|
48
58
|
signing_key:
|
49
59
|
specification_version: 4
|
50
60
|
summary: Easy access to the Climate Data operators
|
51
61
|
test_files:
|
52
62
|
- test/test_cdo.rb
|
53
|
-
has_rdoc:
|
data/ChangeLog
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
1.0.0 2011-12-14: initial version
|
2
|
-
1.0.1 2011-12-15: bugix release
|
3
|
-
1.0.2 2012-01-11: return NetCDF/NArray (optional)
|
4
|
-
1.0.3 2012-01-17: bugfix for NArray return values
|
5
|
-
remove chainCall method - can be replaced by setting :in
|
6
|
-
speed up by reuse operator list instead of computing it
|
7
|
-
every time
|
data/README.rdoc
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
= Cdo.rb - Use Ruby to access the power of CDO
|
2
|
-
|
3
|
-
This package contains the module Cdo, which implements a ruby style access to
|
4
|
-
the Climate Data operators CDO. CDO is a command line tool for processing
|
5
|
-
gridded data. Its main focus if climate data, but it can by used for other
|
6
|
-
purposes to. It accepts input formats GRIB1, GRIB2, NetCDF and several Fortran
|
7
|
-
binary formats.
|
8
|
-
|
9
|
-
== Installation
|
10
|
-
|
11
|
-
=== Gem Installation
|
12
|
-
|
13
|
-
Download and installCdo with the following:
|
14
|
-
|
15
|
-
gem install cdo
|
16
|
-
|
17
|
-
=== Requirements
|
18
|
-
|
19
|
-
Cdo.rb requires a working CDO binary, but has not special requirement to Ruby
|
20
|
-
|
21
|
-
== Usage
|
22
|
-
|
23
|
-
=== Run operators
|
24
|
-
|
25
|
-
* File information
|
26
|
-
|
27
|
-
Cdo.infov(:input => ifile)
|
28
|
-
Cdo.showlevels(:input => ifile)
|
29
|
-
|
30
|
-
* Operators with regular output files
|
31
|
-
|
32
|
-
Cdo.timmin(:input => ifile,:output => ofile)
|
33
|
-
|
34
|
-
* Operators with options
|
35
|
-
|
36
|
-
Cdo.remap([gridfile,weightfile],:input => ifile, :output => ofile)
|
37
|
-
|
38
|
-
* Set global CDO options
|
39
|
-
|
40
|
-
Cdo.copy(:input => ifile, :output => ofile,:options => "-f nc4")
|
41
|
-
|
42
|
-
More examples can be found in test/cdo-examples.rb.
|
43
|
-
|
44
|
-
=== Tempfile helpers
|
45
|
-
|
46
|
-
Cdo.rb includes a simple tempfile wrapperm, which make live easier, when write your own scripts with Cdo.rb,m
|
47
|
-
|
48
|
-
== Support, Issues, Bugs, ...
|
49
|
-
|
50
|
-
Please use the forum or ticket system of CDOs official web page: http://code.zmaw.de/projects/cdo
|
51
|
-
|
52
|
-
== License
|
53
|
-
|
54
|
-
Cdo.rb makes use of the GPLv2D License, see COPYING
|
55
|
-
|
56
|
-
---
|
57
|
-
|
58
|
-
= Other stuff
|
59
|
-
|
60
|
-
Author:: Ralf Mueller <stark.dreamdetective@gmail.com>
|
61
|
-
Requires:: CDO version 1.5.x
|
62
|
-
License:: Copyright 2011-2012 by Ralf Mueller
|
63
|
-
Released under GPLv2 license. See the COPYING
|
64
|
-
file included in the distribution.
|