carray-netcdf 1.0.13 → 2.0.0

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.
data/Rakefile DELETED
@@ -1,12 +0,0 @@
1
-
2
- GEMSPEC = "carray-netcdf.gemspec"
3
-
4
- task :install do
5
- spec = eval File.read(GEMSPEC)
6
- system %{
7
- gem build #{GEMSPEC}; gem install #{spec.full_name}.gem
8
- }
9
- end
10
-
11
- require 'rspec/core/rake_task'
12
- RSpec::Core::RakeTask.new
data/bin/ncdef2yaml DELETED
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "carray-netcdf"
4
- require "yaml"
5
-
6
- NC_DATA_TYPES = ["char","byte","short","int","float","double"]
7
-
8
- module Psych
9
- module Visitors
10
- class YAMLTree < Psych::Visitors::Visitor
11
- alias_method :emit_coder_orig, :emit_coder
12
- def emit_coder c, o
13
- case c.type
14
- when :seq
15
- @emitter.start_sequence nil, c.tag, c.tag.nil?, c.style
16
- c.seq.each do |thing|
17
- accept thing
18
- end
19
- @emitter.end_sequence
20
- else
21
- emit_coder_orig c, o
22
- end
23
- end
24
- end
25
- end
26
- end
27
-
28
- class Hash
29
- def encode_with(coder)
30
- if NC_DATA_TYPES.include?(self.first[0])
31
- coder.style = Psych::Nodes::Mapping::FLOW
32
- end
33
- coder.tag = nil
34
- coder.map = self
35
- end
36
- end
37
-
38
- class Array
39
-
40
- def encode_with (coder)
41
- if self.all?{|v| Numeric===v or String===v}
42
- coder.style = Psych::Nodes::Mapping::FLOW
43
- end
44
- coder.tag = nil
45
- coder.seq = self
46
- end
47
-
48
- end
49
-
50
- class String
51
-
52
- def to_yaml
53
- return self
54
- end
55
-
56
- end
57
-
58
- nc = NCFile.open(ARGV[0])
59
-
60
- puts nc.definition.to_yaml
data/examples/test.nc DELETED
Binary file
data/examples/test.rb DELETED
@@ -1,41 +0,0 @@
1
- require "carray"
2
- require "time"
3
- require "yaml"
4
- require "carray-netcdf"
5
-
6
- metadata = YAML.load %{
7
- dimensions:
8
- time: 1440
9
- variables:
10
- time:
11
- type: float
12
- dim: [time]
13
- standard_name: time
14
- long_name: time
15
- units: minutes since 2018-01-01 00:00:00 +09:00
16
- }
17
-
18
- out = NCFileWriter.new("test.nc", compression: 1)
19
- out.define metadata
20
-
21
- out["time"] = CArray.float(1440).seq(1)
22
-
23
- out.close
24
-
25
- nc = NCFile.open("test.nc")
26
-
27
- time = nc["time"].to_time
28
-
29
- p time[0].to_s
30
-
31
- y = CArray.float(1440).seq(0,4*Math::PI/1440).sin
32
-
33
- #timezone = "UTC"
34
- timezone = ""
35
-
36
- CA.gnuplot {
37
- plot [time(time,"UTC"), y],
38
- xtime: true,
39
- x: ["Time (UTC)", nil, "%H:%M"]
40
- }
41
-
data/examples/time.rb DELETED
@@ -1,11 +0,0 @@
1
- require "time"
2
- require "date"
3
-
4
- t1 = Time.parse("2018-01-01 00:00:00 +08")
5
- t2 = Time.parse("2018-01-01 00:00:00 UTC")
6
- t3 = DateTime.parse("2018-01-01 00:00:00 ADT")
7
-
8
- p t1.zone
9
- p t2
10
- p t3.to_time.gmt_offset
11
-
data/ext/extconf.rb DELETED
@@ -1,11 +0,0 @@
1
- require "mkmf"
2
- require "carray/mkmf"
3
-
4
- $CFLAGS += " -Wall"
5
-
6
- dir_config("netcdf", possible_includes("netcdf","netcdf3","netcdf-3"), possible_libs)
7
-
8
- if have_carray() and have_header("netcdf.h") and have_library("netcdf")
9
- create_makefile("carray/netcdflib")
10
- end
11
-