Class NumRu::HE5
In: lib/hdfeos5.rb
Parent: Object
HE5Za HE5Gd HE5 HE5ZaField HE5GdField HE5Pt HE5SwField HE5Sw HE5PtField lib/hdfeos5.rb NumRu dot/m_0_0.png

Methods

External Aliases

open -> new

Public Class methods

[Source]

    # File lib/hdfeos5.rb, line 35
35:     def HE5.create(filename)
36:       open(filename,"w")
37:     end

[Source]

    # File lib/hdfeos5.rb, line 9
 9:     def HE5.open(filename,mode="r")
10:       call_create=false              # false-> he5_open; true->he5_create
11:       case(mode)
12:       when "r"                       # read only
13:         mode="H5F_ACC_RDONLY"
14:       when "w","w+"                  # overwrite if exits
15:         call_create=true
16:         mode="H5F_ACC_TRUNC"
17:       when "a","a+","r+"             # append if exits
18:         if( File.exists?(filename))
19:           call_create=true
20:           mode="H5F_ACC_RDWR"
21:         else
22:           call_create=true           #(nonexsitent --> create)
23:           mode="H5F_ACC_CREAT"
24:         end
25:       else
26:         raise HE5Error, "Mode #{mode} is not supported"
27:       end
28:       he5_open(filename,mode)
29:     end

Public Instance methods

create grid file

[Source]

    # File lib/hdfeos5.rb, line 85
85:     def create_grid(gridname, xdimsize, ydimsize, upleftpt, lowrightpt)
86:       gdcreate(gridname, xdimsize, ydimsize, upleftpt, lowrightpt)
87:     end

create point file

[Source]

     # File lib/hdfeos5.rb, line 110
110:     def create_point(pointname)
111:       ptcreate(pointname)
112:     end

create swath file

[Source]

    # File lib/hdfeos5.rb, line 60
60:     def create_swath(swathname)
61:       swcreate(swathname)
62:     end

create zonal file

[Source]

     # File lib/hdfeos5.rb, line 135
135:     def create_zonal(zonalname)
136:       ptcreate(zonalname)
137:     end

check grid name

[Source]

    # File lib/hdfeos5.rb, line 68
68:     def grid(gridname)
69:       gdattach(gridname)
70:     end

list grid name

[Source]

    # File lib/hdfeos5.rb, line 72
72:     def grid_names
73:       rtn_val = chkgridname
74:       if(rtn_val.is_a?(String))
75:         names=[]
76:         rtn_val.split(",").each{|d|
77:           names.push(d)
78:         }
79:         names
80:       else
81:         rtn_val
82:       end
83:     end

check Grid

[Source]

    # File lib/hdfeos5.rb, line 64
64:     def has_grid?
65:       chkgrid
66:     end

check Point

[Source]

    # File lib/hdfeos5.rb, line 89
89:     def has_point?
90:       chkpoint
91:     end

check Swath

[Source]

    # File lib/hdfeos5.rb, line 39
39:     def has_swath?
40:       chkswath
41:     end

check ZonalMean

[Source]

     # File lib/hdfeos5.rb, line 114
114:     def has_za?
115:       chkza
116:     end

return file path

[Source]

     # File lib/hdfeos5.rb, line 139
139:     def inspect
140:       "HE5:"+ path
141:     end

check point name

[Source]

    # File lib/hdfeos5.rb, line 93
93:     def point(pointname)
94:       ptattach(pointname)
95:     end

list point name

[Source]

     # File lib/hdfeos5.rb, line 97
 97:     def point_names
 98:       rtn_val = chkpointname
 99:       if(rtn_val.is_a?(String))
100:         names=[]
101:         rtn_val.split(",").each{|d|
102:           names.push(d)
103:         }
104:         names
105:       else
106:         rtn_val
107:       end
108:     end

check swath name

[Source]

    # File lib/hdfeos5.rb, line 43
43:     def swath(swathname)
44:       swattach(swathname)
45:     end

list swath name

[Source]

    # File lib/hdfeos5.rb, line 47
47:     def swath_names
48:       rtn_val = chkswathname
49:       if(rtn_val.is_a?(String))
50:         names=[]
51:         rtn_val.split(",").each{|d|
52:           names.push(d)
53:         }
54:         names
55:       else
56:         rtn_val
57:       end
58:     end

check zonal name

[Source]

     # File lib/hdfeos5.rb, line 118
118:     def zonal(zonalname)
119:       zaattach(zonalname)
120:     end

list zonal name

[Source]

     # File lib/hdfeos5.rb, line 122
122:     def zonal_names
123:       rtn_val = chkzaname
124:       if(rtn_val.is_a?(String))
125:         names=[]
126:         rtn_val.split(",").each{|d|
127:           names.push(d)
128:         }
129:         names
130:       else
131:         rtn_val
132:       end
133:     end

[Validate]