netcdf-nmatrix 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,33 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "netcdf-nmatrix"
8
+ spec.version = Ruby::Netcdf::VERSION
9
+ spec.authors = ["Takeshi Horinouchi", "Tsuyoshi Koshiro",\
10
+ "Shigenori Otsuka", "Seiya Nishizawa", "T Sakakima", "Edmund Highcock"]
11
+ spec.email = ['edmundhighcock@users.sourceforge.net']
12
+
13
+ #if spec.respond_to?(:metadata)
14
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
15
+ #end
16
+
17
+ spec.summary = %q{Ruby interface to NetCDF which uses NMatrix}
18
+ spec.description = %q{A Ruby interface for reading and writing NetCDF files. NetCDF-NMatrix is a rewrite of the previous ruby-netcdf gem which uses NMatrix instead of NArray, and so is compatible with SciRuby.}
19
+
20
+ spec.homepage = 'https://github.com/edmundhighcock/ruby-netcdf'
21
+ spec.licenses = ["GFD Dennou Club"]
22
+
23
+ spec.files = `git ls-files -z`.split("\x0")
24
+ spec.test_files = spec.files.grep(%r{^(test|demo)/})
25
+ #spec.bindir = "exe"
26
+ #spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.required_ruby_version = Gem::Requirement.new(">= 1.6")
30
+ spec.add_runtime_dependency(%q<nmatrix>, [">= 0.2"])
31
+
32
+ spec.extensions << "extconf.rb"
33
+ end
data/test/aref_aset.rb ADDED
@@ -0,0 +1,37 @@
1
+ require 'numru/netcdf'
2
+ include NumRu
3
+ s = 'tmp.nc'
4
+ f = NetCDF.create(s)
5
+ f.redef
6
+ dx = f.def_dim('x',5)
7
+ dy = f.def_dim('y',3)
8
+ v = f.def_var('x','sfloat',[dx])
9
+ v2 = f.def_var('x2',NArray::SFLOAT,[dx])
10
+ vxy = f.def_var('xy','sfloat',[dx,dy])
11
+ f.enddef
12
+ v.put([1,2,3,4,5])
13
+ p 'testing []= ...'
14
+ v[{0..3=>2}]=[100,500]
15
+ v[1]=999
16
+ v[3..4]=[-99,-99]
17
+ v2.put(666)
18
+ v2[0..2]=777
19
+ vxy.put(NArray.sfloat(5,3).indgen!)
20
+ vxy[[2,0],[0,2,1]] = [[1,2],[3,4],[5,6]]
21
+ vxy[1,[2,0,1]] = [10,20,30]
22
+ vxy[[4,3],2] = [100,200]
23
+
24
+ f.close
25
+
26
+ f = NetCDF.open(s)
27
+ v = f.var('x')
28
+ p 'testing [] ...'
29
+ p '*0*',v[{0..3=>2}]
30
+ p '*1*',v[1]
31
+ p '*2*',v[3..4],v.rank
32
+ p '*3*',v[[2,0,0]]
33
+ vxy = f.var('xy')
34
+ p '*4*',vxy[[2,0],[0,2,1]]
35
+ p '*5*',vxy[1,[2,0,1]]
36
+ p '*6*',vxy[[4,3],2]
37
+ f.close
data/test/char_var.rb ADDED
@@ -0,0 +1,25 @@
1
+ ## test of "char" variables
2
+
3
+ require 'numru/netcdf'
4
+ include NumRu
5
+ s = 'tmp.nc'
6
+ f = NetCDF.create(s)
7
+ d = f.def_dim('x',5)
8
+ v = f.def_var('x','char',[d])
9
+ tv = f.def_var('text','char',[d])
10
+ f.enddef
11
+ v.put( NArray.byte(5).indgen! )
12
+ tv.put( NArray.to_na("hello","byte",5) )
13
+ tv.put( NArray.to_na("LO","byte",2), 'start'=>[3] )
14
+ tv.put( NArray.to_na("H","byte",1), 'index'=>[0] )
15
+ f.close
16
+
17
+ f = NetCDF.open(s)
18
+ v = f.var('x')
19
+ p v.get
20
+ tv = f.var('text')
21
+ p tv.get
22
+ p tv.get.to_s
23
+
24
+
25
+
data/test/clone.rb ADDED
@@ -0,0 +1,54 @@
1
+ require 'numru/netcdf'
2
+ include NumRu
3
+ s = 'tmp.nc'
4
+ #f = NetCDF.new(s,'rw')
5
+ f = NetCDF.create(s)
6
+ f.redef
7
+ d = f.def_dim('x',3)
8
+ v = f.def_var('x','sfloat',[d])
9
+ a = f.put_att('long_name','xx')
10
+ f.enddef
11
+ v.put([1,2,3])
12
+ f.taint
13
+ f.freeze
14
+ f2 = f.clone
15
+ p 'netcdf clone'
16
+ p f.path, f2.path
17
+ p f.tainted?, f2.tainted?, f.frozen?, f2.frozen?
18
+
19
+ p 'netcdf dup'
20
+ f3 = f.dup
21
+ p f.tainted?, f3.tainted?, f.frozen?, f3.frozen?
22
+
23
+ p 'netcdfdim'
24
+ d.taint
25
+ d2 = d.clone
26
+ d3 = d.dup
27
+ p d.tainted?, d2.tainted?, d3.tainted?
28
+
29
+ p 'netcdfvar'
30
+ v.taint
31
+ v2 = v.clone
32
+ v3 = v.dup
33
+ p v.tainted?, v2.tainted?, v3.tainted?
34
+
35
+ p 'netcdfatt'
36
+ a.taint
37
+ a2 = a.clone
38
+ a3 = a.dup
39
+ p a.tainted?, a2.tainted?, a3.tainted?
40
+
41
+ f.close
42
+
43
+ p 'narray (for reference)'
44
+ a = NArray.float(3)
45
+ a.taint
46
+ b = a.clone
47
+ p a.tainted?, b.tainted?
48
+ b = a.dup
49
+ p a.tainted?, b.tainted?
50
+
51
+
52
+
53
+
54
+
@@ -0,0 +1,15 @@
1
+ require 'numru/netcdf'
2
+
3
+ $DEBUG = true
4
+ include NumRu
5
+ file = NetCDF.create_tmp
6
+ file.def_dim('x',5)
7
+ file.put_att("history", __FILE__ )
8
+ p file.path
9
+ p file.att("history").get
10
+ print "environment variable TEMP ="+(ENV['TEMP'] || '')+"\n"
11
+ file2=file
12
+ print "000\n"
13
+ file.close
14
+ GC.start
15
+ print "aaa\n"
@@ -0,0 +1,14 @@
1
+ require 'numru/netcdf'
2
+ include NumRu
3
+ file = NetCDF.create("tmp.nc")
4
+ var1 = file.def_var_with_dim("var1","sfloat",[6],["x"])
5
+ var2 = file.def_var_with_dim("var2","sfloat",[6,3],["x","y"])
6
+ var3 = file.def_var_with_dim("var3","sfloat",[3],["y"])
7
+ var3 = file.def_var_with_dim("var4","sfloat",[0],["t"])
8
+ att = var1.put_att("long_name","test")
9
+ file.close
10
+
11
+ p var1 == nil
12
+ p file == nil
13
+ p att == nil
14
+ p att == att, var1 ==var1, file == file
@@ -0,0 +1,53 @@
1
+ require 'numru/netcdf'
2
+ include NumRu
3
+
4
+ s = 'tmp.nc'
5
+ f = NetCDF.create(s)
6
+
7
+ nx = 10
8
+ d = f.def_dim('x',nx)
9
+ v1 = f.def_var('v1','sint',[d])
10
+ v2 = f.def_var('v2','sint',[d])
11
+ v3 = f.def_var('v3','int',[d])
12
+ v1.put_att('scale_factor',0.1,'sfloat')
13
+ v1.put_att('add_offset',100.0,'sfloat')
14
+ v2.put_att('scale_factor',0.1,'sfloat')
15
+ v2.put_att('add_offset',100.0,'sfloat')
16
+ v3.put_att('scale_factor',0.1,'sfloat')
17
+ v3.put_att('add_offset',100.0,'sfloat')
18
+ f.enddef
19
+ v1.put( NArray.sint(nx).indgen!+100 )
20
+ v2.scaled_put( NArray.float(nx).indgen!+100 )
21
+ v3.scaled_put( NArray.float(nx).indgen!+100 )
22
+ f.close
23
+
24
+
25
+ print "** originally unscaled\n"
26
+ f = NetCDF.open(s)
27
+ v1 = f.var('v1')
28
+ v11 = v1.get
29
+ v12 = v1.scaled_get
30
+ p v11
31
+ p v12
32
+
33
+ print "** originally scaled\n"
34
+ v2 = f.var('v2')
35
+ v21 = v2.get
36
+ v22 = v2.scaled_get
37
+ p v21
38
+ p v22
39
+
40
+ print "** originally sclaed (int --> double)\n"
41
+ v3 = f.var('v3')
42
+ v31 = v3.get
43
+ v32 = v3.scaled_get
44
+ p v31
45
+ p v32
46
+
47
+ print "** unpack type fixed to sfloat\n"
48
+ NetCDFVar.unpack_type = NArray::SFLOAT
49
+ v33 = v3.scaled_get
50
+ p v33
51
+ NetCDFVar.unpack_type = NArray::INT
52
+ v33 = v3.scaled_get
53
+ p v33
data/test/putatt.cdl ADDED
@@ -0,0 +1,23 @@
1
+ netcdf tmp {
2
+ dimensions:
3
+ x = 5 ;
4
+ variables:
5
+ float x(x) ;
6
+ x:long_name = "test variable" ;
7
+ x:int_att = 123s ;
8
+ x:float_att = 0.333333333333333 ;
9
+ x:float_array = 0.1, 0.2, 30. ;
10
+ x:sfloat_narray = 0.f, 0.3333333f, 0.6666667f ;
11
+ x:float_narray = 0., 1., 2. ;
12
+ x:sint_narray = 0s, 1s, 2s ;
13
+ x:int2float = 10. ;
14
+ x:changed = "changed to text" ;
15
+
16
+ // global attributes:
17
+ :history = "2001-12-23" ;
18
+ :int_att = 123s ;
19
+ :sfloat_att = 0.3333333f ;
20
+ data:
21
+
22
+ x = _, _, _, _, _ ;
23
+ }
data/test/putatt.rb ADDED
@@ -0,0 +1,56 @@
1
+ require 'numru/netcdf'
2
+ include NumRu
3
+ s = 'tmp.nc'
4
+ f = NetCDF.create(s)
5
+ d = f.def_dim('x',5)
6
+ v = f.def_var('x','sfloat',[d])
7
+
8
+ require 'date'
9
+ att = f.put_att("history", Date.today.to_s )
10
+ p att.get, f.att("history").get
11
+ att = f.put_att("int_att",123)
12
+ att = f.put_att("sfloat_att",1.0/3.0,'sfloat')
13
+ att = f.put_att("sfloat_att2",2.0/3.0,NArray::SFLOAT)
14
+ att = v.put_att("long_name",'test variable')
15
+ att = v.put_att("int_att",123)
16
+ p att.get, v.att("int_att").get
17
+ att = v.put_att("float_att",1.0/3.0)
18
+ att = v.put_att("float_array",[0.1, 0.2, 30])
19
+ att = v.put_att("sfloat_narray",NArray.sfloat(3).indgen!/3)
20
+ att = v.put_att("float_narray",NArray.float(3).indgen!)
21
+ att = v.put_att("sint_narray",NArray.sint(3).indgen!)
22
+ att = v.put_att("int2float",10,'float')
23
+ att = att = v.put_att("dummy",10,'float')
24
+ att.put('changed to text')
25
+ att.name = 'changed'
26
+ begin
27
+ v.put_att("destined_to_fail",9.8,'complex')
28
+ rescue
29
+ print "*1* exception raised as expected -- (",
30
+ __FILE__,":",__LINE__,") ", $!,"\n"
31
+ end
32
+ begin
33
+ v.put_att("destined_to_fail",9.8,'string')
34
+ rescue
35
+ print "*2* exception raised as expected -- (",
36
+ __FILE__,":",__LINE__,") ", $!,"\n"
37
+ end
38
+
39
+ begin
40
+ v.put_att("destined_to_fail",'hello','int')
41
+ rescue
42
+ print "*3* exception raised as expected -- (",
43
+ __FILE__,":",__LINE__,") ", $!,"\n"
44
+ end
45
+
46
+ begin
47
+ v.put_att("destined_to_fail",[10,30,'sss'])
48
+ rescue
49
+ print "*4* exception raised as expected -- (",
50
+ __FILE__,":",__LINE__,") ", $!,"\n"
51
+ end
52
+
53
+
54
+ f.close
55
+
56
+ print `ncdump tmp.nc`
data/test/test.cdl ADDED
@@ -0,0 +1,31 @@
1
+ netcdf test {
2
+ dimensions:
3
+ x = 15 ;
4
+ y = 10 ;
5
+ z = 10 ;
6
+ variables:
7
+ short test_sint(x) ;
8
+ byte test_byte(y) ;
9
+ byte test_byte2(z, y) ;
10
+ int test_int(y) ;
11
+ float test_sfloat(z) ;
12
+ double test_float(y) ;
13
+ byte test_byte_vara(z, y) ;
14
+ test_byte_vara:min to max of byte_vara = 0b, 20b ;
15
+ short test_sint_vara(z, y) ;
16
+ test_sint_vara:string = "%%%%%" ;
17
+ int test_int_vara(z, y) ;
18
+ test_int_vara:min to max of int_vara = 0, 60 ;
19
+ float test_sfloat_vara(z, y) ;
20
+ test_sfloat_vara:min to max of float_vara = 0.01f, 5.5f ;
21
+ double test_float_vara(z, y) ;
22
+ test_float_vara:min_to max of double_vara = 0.0001, 5.5555 ;
23
+
24
+ // global attributes:
25
+ :type_byte = 6b ;
26
+ :type_short = 222s, 333s, 444s ;
27
+ :type_int = 2222s, 3333s, 4444s ;
28
+ :type_float = 2.22f, 3.33f, 4.44f ;
29
+ :type_double = 2.222, 3.333, 4.444 ;
30
+ :string = "netCDF for Ruby" ;
31
+ }
data/test/test.rb ADDED
@@ -0,0 +1,195 @@
1
+ ##require 'numru/netcdf'
2
+ ## // to test before make install -->
3
+ require 'nmatrix'
4
+ require '../netcdfraw'
5
+ require '../lib/netcdf'
6
+ ## <-- to test before make install //
7
+
8
+ include NumRu
9
+
10
+ filename = "test.nc"
11
+ print "creating ",filename,"...\n"
12
+ file=NetCDF.create(filename,false,false)
13
+
14
+ dimx=file.def_dim("x",15)
15
+ dimy=file.def_dim("y",10)
16
+ dimz=file.def_dim("z",10)
17
+
18
+ batt = file.put_att("type_byte",5,"byte")
19
+ file.put_att("type_short",[222,333,444],"int16")
20
+ file.put_att("type_int",[2222,3333,4444])
21
+ file.put_att("type_float",[2.22,3.33,4.44],"float32")
22
+ file.put_att("type_double",[2.222,3.333,4.444])
23
+ string = file.put_attraw("string","netCDF for Ruby","string")
24
+ batt.put(6,"byte")
25
+
26
+ int16_var=file.def_var("test_int16","int16",["x"])
27
+ byte_var=file.def_var("test_byte","byte",["y"])
28
+ byte_var2=file.def_var("test_byte2","byte",[dimy,dimz])
29
+ int_var=file.def_var("test_int","int32",["y"])
30
+ sfloat_var=file.def_var("test_sfloat","float32",["z"])
31
+ float_var=file.def_var("test_float","float64",["y"])
32
+
33
+ a=NMatrix.seq([10], dtype: :int16)
34
+ b=NMatrix.ones([10], dtype: :int16) * 7.0
35
+ c=NMatrix.bindgen([10])
36
+ d=NMatrix.seq([10], dtype: :int32)
37
+ e=NMatrix.ones([10], dtype: :float32) * 1.111
38
+ f=NMatrix.ones([10], dtype: :float64) * 5.5555555
39
+ file.enddef
40
+ file2 = file
41
+ (file2 == file)
42
+
43
+
44
+ byte_var.put_var_byte(c)
45
+ int_var.put_var_int(d)
46
+ sfloat_var.put_var_sfloat(e)
47
+ float_var.put_var_float(f)
48
+
49
+ file.redef
50
+ byte_vara=file.def_var("test_byte_vara","byte",[dimy,dimz]);
51
+ int16_vara=file.def_var("test_int16_vara","int16",["y","z"]);
52
+ int_vara=file.def_var("test_int_vara","int32",["y","z"]);
53
+ sfloat_vara=file.def_var("test_sfloat_vara","float32",["y","z"]);
54
+ float_vara=file.def_var("test_float_vara","float64",["y","z"]);
55
+ file.enddef
56
+
57
+ byte_vara2 = byte_vara
58
+ (byte_vara2 == byte_vara)
59
+
60
+ g=NMatrix.bindgen([10,10])
61
+ h=NMatrix.bindgen([2,3])
62
+ gh=NMatrix.ones([1,1], dtype: :byte) * 33
63
+ k=NMatrix.seq([10,10], dtype: :int16)
64
+ l=NMatrix.seq([2,3], dtype: :int16)
65
+ kl=NMatrix.ones([1,1], dtype: :int16) * 44
66
+ m=NMatrix.seq([10,10], dtype: :int32)
67
+ n=NMatrix.seq([2,3], dtype: :int32)
68
+ mn=NMatrix.ones([1,1], dtype: :int32) * 55
69
+ o=NMatrix.ones([10,10], dtype: :float32) * 1.234567
70
+ p=NMatrix.ones([2,3], dtype: :float32) * 2.345678
71
+ op=NMatrix.ones([1,1], dtype: :float32) * 3.4
72
+ q=NMatrix.ones([10,10], dtype: :float64) * 1.234
73
+ r=NMatrix.ones([2,3], dtype: :float64) * 2.345
74
+ qr=NMatrix.ones([1,1], dtype: :float64) * 4.5
75
+ s=NMatrix.ones([2,2], dtype: :float64) * 10.0
76
+
77
+
78
+
79
+ byte_vara.put(g)
80
+ byte_vara.put(h,{"start"=>[3,5]})
81
+ byte_vara.put(g,{"start"=>[0,0],"end"=>[9,9]})
82
+ byte_vara.put(h,{"start"=>[-8,2]})
83
+ byte_vara.put(h,{"start"=>[0,0],"stride"=>[2,3]})
84
+ byte_vara.put(h,{'start'=>[1,1],"end"=>[3,7],"stride"=>[2,3]})
85
+ byte_vara.put(gh,{"index"=>[4,7]})
86
+
87
+ int16_vara.put(k)
88
+ int16_vara.put(l,{"start"=>[3,5]})
89
+ int16_vara.put(k,{"start"=>[0,0],"end"=>[9,9]})
90
+ int16_vara.put(l,{"start"=>[-8,2]})
91
+ int16_vara.put(l,{"start"=>[0,0],"stride"=>[2,3]})
92
+ int16_vara.put(l,{"start"=>[1,1],"end"=>[3,7],"stride"=>[2,3]})
93
+ int16_vara.put(kl,{"index"=>[4,7]})
94
+
95
+ int_vara.put(m)
96
+ int_vara.put(n,{"start"=>[3,5]})
97
+ int_vara.put(m,{"start"=>[0,0],"end"=>[9,9]})
98
+ int_vara.put(n,{"start"=>[-8,2]})
99
+ int_vara.put(n,{"start"=>[0,0],"stride"=>[2,3]})
100
+ int_vara.put(n,{"start"=>[1,1],"end"=>[3,7],"stride"=>[2,3]})
101
+ int_vara.put(mn,{"index"=>[4,7]})
102
+
103
+ sfloat_vara.put(o)
104
+ sfloat_vara.put(p,{"start"=>[3,5]})
105
+ sfloat_vara.put(o,{"start"=>[0,0],"end"=>[9,9]})
106
+ sfloat_vara.put(p,{"start"=>[-8,2]})
107
+ sfloat_vara.put(p,{"start"=>[0,0],"stride"=>[2,3]})
108
+ sfloat_vara.put(p,{"start"=>[1,1],"end"=>[3,7],"stride"=>[2,3]})
109
+ sfloat_vara.put(op,{"index"=>[4,7]})
110
+
111
+ float_vara.put(q)
112
+ float_vara.put(r,{"start"=>[3,5]})
113
+ float_vara.put(q,{"start"=>[0,0],"end"=>[9,9]})
114
+ float_vara.put(r,{"start"=>[-8,2]})
115
+ float_vara.put(r,{"start"=>[0,0],"stride"=>[2,3]})
116
+ float_vara.put(r,{"start"=>[1,1],"end"=>[3,7],"stride"=>[2,3]})
117
+ float_vara.put(qr,{"index"=>[4,7]})
118
+
119
+ float_vara.dim_names
120
+
121
+
122
+ na_aaa=byte_vara.get({"start"=>[3,5]})
123
+ na_aab=byte_vara.get({"start"=>[0,0],"end"=>[9,9]})
124
+ na_aac=byte_vara.get({"start"=>[-8,2]})
125
+ na_aad=byte_vara.get({"start"=>[0,0],"stride"=>[2,3]})
126
+ na_aae=byte_vara.get({'start'=>[1,1],"end"=>[3,7],"stride"=>[2,3]})
127
+ na_aaf=byte_vara.get({"index"=>[4,7]})
128
+ na_aag=byte_vara.get
129
+
130
+ na_bba=int16_vara.get({"start"=>[3,5]})
131
+ na_bbb=int16_vara.get({"start"=>[0,0],"end"=>[9,9]})
132
+ na_bbc=int16_vara.get({"start"=>[-8,2]})
133
+ na_bbd=int16_vara.get({"start"=>[0,0],"stride"=>[2,3]})
134
+ na_bbf=int16_vara.get({"start"=>[1,1],"end"=>[3,7],"stride"=>[2,3]})
135
+ na_bbg=int16_vara.get({"index"=>[4,7]})
136
+ na_bbh=int16_vara.get
137
+
138
+ na_cca=int_vara.get({"start"=>[3,5]})
139
+ na_ccb=int_vara.get({"start"=>[0,0],"end"=>[9,9]})
140
+ na_ccc=int_vara.get({"start"=>[-8,2]})
141
+ na_ccd=int_vara.get({"start"=>[0,0],"stride"=>[2,3]})
142
+ na_cce=int_vara.get({"start"=>[1,1],"end"=>[3,7],"stride"=>[2,3]})
143
+ na_ccf=int_vara.get({"index"=>[4,7]})
144
+ na_ccg=int_vara.get
145
+
146
+ na_dda=sfloat_vara.get({"start"=>[3,5]})
147
+ na_ddb=sfloat_vara.get({"start"=>[0,0],"end"=>[9,9]})
148
+ na_ddc=sfloat_vara.get({"start"=>[-8,2]})
149
+ na_ddd=sfloat_vara.get({"start"=>[0,0],"stride"=>[2,3]})
150
+ na_dde=sfloat_vara.get({"start"=>[1,1],"end"=>[3,7],"stride"=>[2,3]})
151
+ na_ddf=sfloat_vara.get({"index"=>[4,7]})
152
+ na_ddg=sfloat_vara.get
153
+
154
+ na_eea=float_vara.get({"start"=>[3,5]})
155
+ na_eeb=float_vara.get({"start"=>[0,0],"end"=>[9,9]})
156
+ na_eec=float_vara.get({"start"=>[-8,2]})
157
+ na_eed=float_vara.get({"start"=>[0,0],"stride"=>[2,3]})
158
+ na_eee=float_vara.get({"start"=>[1,1],"end"=>[3,7],"stride"=>[2,3]})
159
+ na_eef=float_vara.get({"index"=>[4,7]})
160
+ na_eeg=float_vara.get
161
+
162
+ file.redef
163
+
164
+ copy_byte = string.copy(byte_vara)
165
+ copy_byte.put([0,20],"byte")
166
+ copy_byte.name="new_name"
167
+
168
+ copy_byte2 = copy_byte
169
+ (copy_byte2 == copy_byte)
170
+
171
+ copy_int16 = string.copy(int16_vara)
172
+ copy_int16.put("%%%%%")
173
+ copy_int = string.copy(int_vara)
174
+ copy_int.put([0,60],"int32")
175
+ copy_sfloat = string.copy(sfloat_vara)
176
+ copy_sfloat.put([0.01,5.5],"float32")
177
+ copy_float = string.copy(float_vara)
178
+ copy_float.put([0.0001,5.5555],"float64")
179
+ file.enddef
180
+ nm = copy_byte.name
181
+ att0 = string.get
182
+ att1 = copy_byte.get
183
+ att2 = copy_int16.get
184
+ att3 = copy_int.get
185
+ att4 = copy_sfloat.get
186
+ att5 = copy_float.get
187
+ file.fill(true)
188
+ file.fill(false)
189
+
190
+ float_vara.dim_names
191
+ float_vara.att_names
192
+
193
+ file.close
194
+ exit(0)
195
+