GPhys : Tutorial for gp commands

Introduction

gp commands can print, draw, and perform other operations NetCDF variables developped with GPhys. You can use them wihtout knowledge about ruby.

Main commands are,

  • gplist : Print information of a NetCDF file.
  • gpprint : Print values of a NetCDF variable.
  • gpview : Draw a NetCDF variable

Usage

NetCDF file using the samples below is here.

Obtain information of a NetCDF file.

% gplist T.nc

T.nc:
  lon   [lon=36]        'Longitude'     (degrees_east)
  lat   [lat=19]        'Latitude'      (degrees_north)
  level [level=9]       'Level' (millibar)
  T     [lon=36,lat=19,level=9] 'Temperature'   (degC)

You can find 3-dim data (lon, lat, level) temperature variable "T" in the NetCDf file

Draw a NetCDF variable

The variable can be specified with the format, "File name"+"@"+"variable name".

% gpview T.nc@T

Temperature at 1000mb is drawn, which is the first cross section of the third axis (level).

Draw a sliced NetCDF file

A slice section is indicated with comma "," and the following description.

% gpview T.nc@T,lon=0

Since slice with longitude and latitude section produces 1-dim data, a line is plotted. "--exch" option exchanges the horizontal and vertical axes.

% gpview T.nc@T,lon=0,lat=0 --exch

Average

The option "--mean" perform averaging for the indcated axes.

% gpview T.nc@T --mean lon

Animation

The option "--anim" produces animation for the indicated axes.

% gpview T.nc@T --anim lon

"--Gaw" option means automatic page feed.

% gpview T.nc@T --anim lon --Gaw

Other commands

  • gpcut : slice a NetCDF variable.
  • gpcat : concatenate two NetCDF variables.
  • gpaop : Arithmetirc operation is performed for two NetCDF variables.

The "--help" option shows simple explanation for each command.