cdo 1.0.4 → 1.0.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.
Files changed (4) hide show
  1. data/gemspec +1 -1
  2. data/lib/cdo.rb +5 -0
  3. data/test/test_cdo.rb +6 -0
  4. metadata +2 -2
data/gemspec CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  spec = Gem::Specification.new do |s|
4
4
  s.name = "cdo"
5
- s.version = '1.0.4'
5
+ s.version = '1.0.5'
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.files = ["lib/cdo.rb"] + ["gemspec","COPYING","README.rdoc","ChangeLog"]
8
8
  s.test_file = "test/test_cdo.rb"
data/lib/cdo.rb CHANGED
@@ -175,6 +175,11 @@ module Cdo
175
175
  }
176
176
  delta_levels
177
177
  end
178
+
179
+ def Cdo.readCdf(iFile)
180
+ Cdo.loadCdf unless State[:returnArray]
181
+ return NetCDF.open(iFile)
182
+ end
178
183
  end
179
184
 
180
185
  # Helper module for easy temp file handling
data/test/test_cdo.rb CHANGED
@@ -147,6 +147,12 @@ class TestCdo < Test::Unit::TestCase
147
147
  thicknesses = Cdo.thicknessOfLevels(:in => ifile)
148
148
  assert_equal(targetThicknesses,thicknesses)
149
149
  end
150
+ def test_readCdf
151
+ input = "-settunits,days -setyear,2000 -for,1,4"
152
+ cdfFile = Cdo.copy(:options =>"-f nc",:in=>input)
153
+ cdf = Cdo.readCdf(cdfFile)
154
+ assert_equal(['lon','lat','time','for'],cdf.var_names)
155
+ end
150
156
  end
151
157
 
152
158
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cdo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-18 00:00:00.000000000 Z
12
+ date: 2012-01-24 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Easy access to the Climate Data operators
15
15
  email: stark.dreamdetective@gmail.com