if ! 'a'.respond_to?(:ord)
class String def ord self[0] end end
end if ! 'a'.respond_to?(:getbyte)
class String def getbyte(i) self[i] end end
end
def str2uint1(str) return nil if str.length==0 return str.ord end def str2uint2(str) return nil if str.length==0 return (str.ord<<8)+str.getbyte(1) end def str2uint3(str) return nil if str.length==0 return (str.ord<<16)+(str.getbyte(1)<<8)+str.getbyte(2) end
index[1].each{|j| jj = j-index[1].first sb = j*nlon+index[0].first sb = sb-map[true,0..jj-1].count_false if jj>0 sb = sb*nbits_pack eb = sb+mask[true,j].count_true*nbits_pack if sb!=eb var[mask[true,j].where,jj] = get_value(@sgm.file,@pos+8,sb,eb,nbits_pack,nstep) end }
sb = index[1].first*nlon*nbits_pack eb = (index[1].end+1)*nlon*nbits_pack var = get_value(@sgm.file,@pos+8,sb,eb,nbits_pack,nstep) var.reshape!(nlon, var.length/nlon) var = var[index[0],true]
eb = nlen*nbits_pack var = get_value(@sgm.file,@pos+8,0,eb,nbits_pack,nstep) var.reshape!(nlon,nlat)
Grib.new(filename, mode="r")
make a new Grib object.
ARGUMENTS
Grib.open(filename)
Grib.create(filename)
Grib.is_aGrib?(filename)
close
parse
path
var_names
var( name )
def_var( name )
enddef
write
new( vat, name, length )
var
length
name
typecode
get
[indices]
put_att(key,val)
set_att(key,val)
att(key)
att_names
inspect
always_time_seq=(t_or_f)
If true is given, a GribVar will always have a time dimension, even when the time is unique (i.e., length of the time coordinate is 1).
new( file, name, obj, dims )
file
name
rank
total
set_var
set_miss
dim_names
dim( index )
ndims
def_dim(name,index)
put_att( key, value )
set_att( key, value )
att( key )
att_names
shape
typecode
get( indics )
[ indics ]
inspect
if pds1.time_range!=pds2.time_range warn("time range is not same: #{pds1.time_range} != #{pds2.time_range}") return true end