Class NumRu::NuSDaS
In: lib/numru/nusdas.rb
nusdas_wrap.c
Parent: Object

Wraper of NuSDaS C library - handling NuSDaS data -

methods are defined as class method

Methods

Included Modules

NuSDaSMod

Constants

N_NUSDAS_VERSION = INT2FIX(N_NUSDAS_VERSION)
N_ON = INT2FIX(N_ON)
N_OFF = INT2FIX(N_OFF)
N_FOPEN_NOT = INT2FIX(N_FOPEN_NOT)   code for nusdas_allfile_close
N_FOPEN_READ = INT2FIX(N_FOPEN_READ)
N_FOPEN_WRITE = INT2FIX(N_FOPEN_WRITE)
N_FOPEN_ALL = INT2FIX(N_FOPEN_ALL)
N_PC_MISSING_UI1 = INT2FIX(N_PC_MISSING_UI1)   code for nusdas_parameter_change
N_PC_MISSING_SI2 = INT2FIX(N_PC_MISSING_SI2)
N_PC_MISSING_SI4 = INT2FIX(N_PC_MISSING_SI4)
N_PC_MISSING_R4 = INT2FIX(N_PC_MISSING_R4)
N_PC_MISSING_R8 = INT2FIX(N_PC_MISSING_R8)
N_PC_MASK_BIT = INT2FIX(N_PC_MASK_BIT)
N_PC_ID_SET = INT2FIX(N_PC_ID_SET)
N_PC_PACKING = INT2FIX(N_PC_PACKING)
N_PC_SIZEX = INT2FIX(N_PC_SIZEX)
N_PC_SIZEY = INT2FIX(N_PC_SIZEY)
N_PC_PANDORA = INT2FIX(N_PC_PANDORA)
N_PC_PANDORA_I1 = INT2FIX(N_PC_PANDORA_I1)
N_IO_MARK_END = INT2FIX(N_IO_MARK_END)   code for nusdas_iocntl
N_IO_W_FCLOSE = INT2FIX(N_IO_W_FCLOSE)
N_IO_WARNING_OUT = INT2FIX(N_IO_WARNING_OUT)
N_IO_R_FCLOSE = INT2FIX(N_IO_R_FCLOSE)
N_IO_PUT = rb_str_new2(N_IO_PUT)
N_IO_GET = rb_str_new2(N_IO_GET)
N_MV_UI1 = INT2FIX(N_MV_UI1)
N_MV_SI2 = INT2FIX(N_MV_SI2)
N_MV_SI4 = INT2FIX(N_MV_SI4)
N_MV_R4 = rb_float_new((double)N_MV_R4)
N_MV_R8 = rb_float_new((double)N_MV_R8)
N_I1 = rb_str_new2(N_I1)   type of array
N_I2 = rb_str_new2(N_I2)
N_I4 = rb_str_new2(N_I4)
N_R4 = rb_str_new2(N_R4)
N_R8 = rb_str_new2(N_R8)
N_NC = rb_str_new2(N_NC)
N_P_1PAC = rb_str_new2(N_P_1PAC)
N_P_2PAC = rb_str_new2(N_P_2PAC)
N_P_4PAC = rb_str_new2(N_P_4PAC)
N_P_R4 = rb_str_new2(N_P_R4)
N_P_R8 = rb_str_new2(N_P_R8)
N_P_I1 = rb_str_new2(N_P_I1)
N_P_I2 = rb_str_new2(N_P_I2)
N_P_I4 = rb_str_new2(N_P_I4)
N_P_N1I2 = rb_str_new2(N_P_N1I2)
N_P_GRIB = rb_str_new2(N_P_GRIB)
N_P_RLEN = rb_str_new2(N_P_RLEN)
N_P_2UPC = rb_str_new2(N_P_2UPC)
N_MEMBER_NUM = INT2FIX(N_MEMBER_NUM)   code for nusdas_inq*
N_MEMBER_LIST = INT2FIX(N_MEMBER_LIST)
N_VALIDTIME_NUM = INT2FIX(N_VALIDTIME_NUM)
N_VALIDTIME_LIST = INT2FIX(N_VALIDTIME_LIST)
N_PLANE_NUM = INT2FIX(N_PLANE_NUM)
N_PLANE_LIST = INT2FIX(N_PLANE_LIST)
N_ELEMENT_NUM = INT2FIX(N_ELEMENT_NUM)
N_ELEMENT_LIST = INT2FIX(N_ELEMENT_LIST)
N_ELEMENT_MAP = INT2FIX(N_ELEMENT_MAP)
N_GRID_SIZE = INT2FIX(N_GRID_SIZE)
N_GRID_DISTANCE = INT2FIX(N_GRID_DISTANCE)
N_GRID_BASEPOINT = INT2FIX(N_GRID_BASEPOINT)
N_VALIDTIME_UNIT = INT2FIX(N_VALIDTIME_UNIT)
N_VALIDTIME2_LIST = INT2FIX(N_VALIDTIME2_LIST)
N_PLANE2_LIST = INT2FIX(N_PLANE2_LIST)
N_BASETIME_NUM = INT2FIX(N_BASETIME_NUM)
N_BASETIME_LIST = INT2FIX(N_BASETIME_LIST)
N_MISSING_MODE = INT2FIX(N_MISSING_MODE)
N_MISSING_VALUE = INT2FIX(N_MISSING_VALUE)
N_PROJECTION = INT2FIX(N_PROJECTION)
N_STAND_LATLON = INT2FIX(N_STAND_LATLON)
N_SPARE_LATLON = INT2FIX(N_SPARE_LATLON)

External Aliases

new -> open

Attributes

root  [R]  NuSDaS root path

Public Class methods

close files

allfile_close(param)

 arguments:
  param: Integer
         NuSDaS::N_FOPEN_READ  : files opened for read
         NuSDaS::N_FOPEN_WRITE : files opened for write
         NuSDaS::N_FOPEN_ALL   : all files
 return: Integer (number of cloesd files) or nil (no files were closed)

access to grid information

grid(type1, type2, type3, basetime, member, validtime, "get")

 arguments:
  type1, type2, type3, member: String
  basetime, validtime: Integer (minuits from 00:00 1 Jan 1801)
 return:
  projection: String
  gridsize: Array[2] (nx,ny)
  gridinfo: Array[14] (basepoint_x, basepoint_y, basepoint_lat, basepoint_lon, distance_x, distance_y, standard_lat, standard_lon, standard2_lat, standard2_lon, other_lat, other_lon, other2_lat, other2_lon)
  value: String

grid(type1, type2, type3, basetime, member, validtime, "put", projection, gridsize, gridinfo, value)

 arguments:
  type1, type2, type3, member: String
  basetime, validtime: Integer (minuits from 00:00 1 Jan 1801)
  projection: String
  gridsize: Array[2] (nx,ny)
  gridinfo: Array[14] (basepoint_x, basepoint_y, basepoint_lat, basepoint_lon, distance_x, distance_y, standard_lat, standard_lon, standard2_lat, standard2_lon, other_lat, other_lon, other2_lat, other2_lon)
  value: String
 return:
  nil

inquire control information

inq_cntl(type1, type2, type3, basetime, member, validtime, param)

 arguments:
  type1, type2, type3, member: String
  basetime, validtime: Integer (minuits from 00:00 1 Jan 1801)
  param: Integer
         NuSDaS::N_MEMBER_NUM      : number of members
         NuSDaS::N_MEMBER_LIST     : list of members
         NuSDaS::N_VALIDTIME_NUM   : number of validtimes
         NuSDaS::N_VALIDTIME_LIST  : list of validtime
         NuSDaS::N_VALIDTIME_LIST2 : list of validtime2
         NuSDaS::N_PLANE_NUM       : number of planes
         NuSDaS::N_PLANE_LIST      : list of planes
         NuSDaS::N_ELEMENT_NUM     : number of elements
         NuSDaS::N_ELEMENT_LIST    : list of elements
         NuSDaS::N_PROJECTION      : projection
 return:
  result

inquire list of basetimes

inq_nrdbtime(type1, type2, type3, pflag=false)

 arguments:
  type1, type2, type3: String
  pflag: true or false, (if true, informations are printed out)
 return:
  btlist: Array

inquire list of validtime

inq_nrdvtime(type1, type2, type3, basetime=-1, pflag=false)

 arguments:
  type1, type2, type3: String
  basetime: Integer (minuits from 00:00 1 Jan 1801) if basetime=-1, returns validtimes for all basetime
  pflag: true or false, (if true, informations are printed out)
 return:
  vtlist: Array

judge that the path is NuSDaS root path

 arguments:
  path: String
 return:
  true or false

create NuSDaS object

 arguments:
  path: String (NuSDaS root directory)
 return:
  NuSDaS

read data

read(type1, type2, type3, basetime, member, validtime, plane, element)

 arguments:
  type1, type2, type3, member, plane, element: String
  basetime, validtime: Integer (minuits from 00:00 1 Jan 1980)
 return:
  NArray

e.g. NuSDaS.read(‘_GSMGSLY’, ‘AASV’, ‘STD1’, 108834840, ’ ’, 108835200, ‘SURF’, ‘TSC’)

get string time

 arguments:
  time: Integer (minuies from 00:00 1 Jan 1801)
 return:
  time_str: String (yyyymmddhhmm)
       e.g. "200712141630" for 16:30 14 Dec 2007

access to parameters of ETA coordinate

subc_eta(type1, type2, type3, basetime, member, validtime, "get")

 arguments:
  type1, type2, type3, member: String
  basetime, validtime: Integer (minuits from 00:00 1 Jan 1801)
 return:
  n_levels: Integer (number of levels)
  a, b: NArray[n_levels+1]
  c: Float

subc_eta(type1, type2, type3, basetime, member, validtime, "put", a, b, c)

 arguments:
  type1, type2, type3, member: String
  basetime, validtime: Integer (minuits from 00:00 1 Jan 1801)
  a, b: NArray[n_levels+1] || Array[n_levels+1]
  c: Float
 return:
  nil

inquire number of vertical levels for ETA, SIGM, and ZHYB coordinats

subc_eta_inq_zn(type1, type2, type3, basetime, member, validtime, group)

 arguments:
  type1, type2, type3, member: String
  basetime, validtime: Integer (minuits from 00:00 1 Jan 1801)
  group: "ETA", "SIGM", or "ZHYB"
 return:
   j_n: Integer

inquire number of south-north grid for RGAU grid

subc_rgau_inq_jn(type1, type2, type3, basetime, member, validtime)

 arguments:
  type1, type2, type3, member: String
  basetime, validtime: Integer (minuits from 00:00 1 Jan 1801)
 return:
   j_n: Integer

access to parameters for sigma coordinate

subc_sigm(type1, type2, type3, basetime, member, validtime, "get")

 arguments:
  type1, type2, type3, member: String
  basetime, validtime: Integer (minuits from 00:00 1 Jan 1801)
 return:
  n_levels: Integer (number of levels)
  a, b: NArray[n_levels+1]
  c: Float

subc_sigm(type1, type2, type3, basetime, member, validtime, "put", a, b, c)

 arguments:
  type1, type2, type3, member: String
  basetime, validtime: Integer (minuits from 00:00 1 Jan 1801)
  a, b: NArray[n_levels+1] || Array[n_levels+1]
  c: Float
 return:
  nil

get integer time (minuies from 00:00 1 Jan 1801)

 arguments:
  time_str: String (yyyymmddhhmm)
       e.g. "200712141630" for 16:30 14 Dec 2007
 return:
  time: Integer

write data

write(type1, type2, type3, basetime, memeber, validtime, plane, element, data)

 arguments:
  type1, type2, type3, member, plane, element: String
  basetime, validtime: Integer (minuits from 00:00 1 Jan 1801)
  data: NArray
 return:
  nil

Public Instance methods

close all files

 return:
  nil

get NuSDaSVar object

 arguments:
  vname: String (variable name)
         "type1/type2/type3/basetime_str/element"
         e.g. "_GSMGSLY/AASV/STD1/200712061800/TSC"
 return:
  var: NuSDaSVar

inquire all variable names

return:

 var_names: Array

[Validate]