| Home | zeGraph lib | Lua lib | Custom lib | Tutorials | Notes | XML Script | C-Talk | Z-Script |
Graph
   axis
   blend
   color
   color bar
   fog
   freetype
   light
   line
   material
   node
   point
   plot
   polygon
   render
   scene
   stencil
   texcoord
   text
   texture
   vertex
Utility
   array
   bio
   hdf
   make
   math
   netcdf
Auxiliary
   curl
   expact
   sqlite
   window

zeBIO

Use .new("bio") to create the object for general binrary intput/output of data. A special functions is included to read the world coastline data (GHSSG); and another to read regular grid GRIB data.

:open(file)

Opens the file for reading.

:open(file, "w")

Opens the file for witing.

:read(bytes)

Reads the specified number of bytes from the file.

:write(ptr, bytes)

Writes the specified number of bytes pointed to by ptr to the file.

:byte(index)

Returns the byte at the index.

:byteswitch(bytes)

Switches byte for every number of specified bytes in the byte-array.

:seek(offset)

Moves the file pointer by the offset from the current position.

:rewind()

Moves the file pointer to the beginning.

:gotoend()

Moves the file pointer to the end.

:tell()

Returns the current position of the file pointer.

:size()

Returns the file size in byte.

:getptr()

Returns the pointer to the byte array, the array size, and the number of bytes read from the file.

:transfer(ptr, nb)

Transfer nb bytes from the object to the lightuserdata ptr. The parameter nb must be less than or equal to the number of bytes already read.

:gshhs(flag, west, east, south, north, arr)

Reads coastline data from a GSHHS files to the array arr. The flag parameter ("land", "lake", "island", or "pond") specifies which dataset to read; the west and east parameters specify the longitude range (0 to 360 degree); and the south and north parameters specify the latitude range (-90 to 90 degree).

:grib()

Displays parameter id, pressure layer, date, and region code in the opened GRIB file.

:grib(id, pressure, year, month, day, hour, arr)

Reads the dataset with the id on the pressure layer at that time. The data will be saved in the array arr.