Overview
Starting with version 2002.04.24,
plotl has the capability to read various data types from
netCDF
formatted files. The supported data types are:
- Character Variables (strings)
- Variables (scalars)
- Vectors (sometimes referred to as columns in plotl commands)
- Arrays (two dimensional arrays)
- Volumes (three dimensional arrays)
Scalars, vectors, arrays, and volumes can be; double (real*8),
float (real*4), int (integer*4), short (integer*2), or byte (integer*1)
values.
Opening the netCDF file
A netCDF file is opened for processing with the "netcdffile filename"
command.
Upon opening, plotl will list character variables, variables, vectors, arrays,
and volumes as they are found in the file. For example,
netcdffile IFM19983550000.NC
will yield the following information:
Version is a character variable. 32
Year is a numeric variable.
Day is a numeric variable.
UT_Seconds is a numeric variable.
Altitudes is a vector. 72
Latitudes is a vector. 60
Longitudes is a vector. 49
TEC is an array. 60 49
Latitudes might work as the x-vector.
Longitudes might work as the y-vector.
Edensity is a volume. 72 60 49
Altitudes might work as the x-vector.
Latitudes might work as the y-vector.
Longitudes might work as the z-vector.
Note that the dimensions of the vectors, arrays, and volumes are given
with their names.
Loading character and numeric variables
Numeric and character variables are loaded from netCDF using the
"netcdfvariable variable_name" command. For example,
netcdfvariable Version
netcdfvariable Year
netcdfvariable Day
will result in the character variable %VERSION, and the numeric variables
$YEAR and $DAY to be loaded and defined. Note that the variable name IS
case sensitive in the netCDF system. However, variable names ARE NOT case
sensitive once within plotl. So, the plotl commands:
echo The year/day is |$year/|$day
echo The model is |%VERSION
will result in the following output:
The year/day is 1998/355
The model is IRI
Loading and using vectors
Vectors are loaded with one or more of the commands:
netcdfToXvector vector_name
netcdfToYvector vector_name
netcdfToZvector vector_name
netcdfToVvector vector_name
For example, the following plotl script:
netcdffile IFM19983550000.NC
netcdfToYvector Latitudes
netcdfToData
xcol 0
ycol 2
xlab Count
ylab Latitude Value
symbols ; symbolnumber 3 ; symbolsize 0.02
noconnect
plot
quit
yields the following graphic:
Note that the "netcdftodata" command is required to move the
Latitudes data from the netCDF into the plotl environment, and should
follow one or more "netcdfto*vector" commands.
Loading and using an array
Arrays are loaded with the "netcdfarray array_name" command.
For example, the following plotl script:
netcdffile IFM19983550000.NC
netcdftoarray TEC
netcdfarrayx Latitudes
netcdfarrayy Longitudes
com /usr/local/lib/plotl/72colortable.plot
xlab Latitude
ylab Longitude
colorcontour
contour
doaxes
quit
yeilds the following graphic:
This graphic has Latitude as the x-axis,
and Longitude as the y-axes--the same order as that found in the netCDF
file. This can be changed with the "3dtransposexy" command, as in:
netcdffile IFM19983550000.NC
netcdftoarray TEC
netcdfarrayx Latitudes
netcdfarrayy Longitudes
com /usr/local/lib/plotl/72colortable.plot
3DTRANSPOSEXY
XLAB Longitude
YLAB Latitude
colorcontour
contour
doaxes
quit
which yields:
Using volumes
Plotl does not generate graphical representations of volumes. However,
volume data can be sliced and diced into arrays or vectors that can
be plotted.
Converting volumes to arrays
Various planes of a netCDF volume can be loaded into a plotl array
using the "netcdfxytoarray", "netcdfxztoarray", and
"netcdfyztoarray" commands. For example, the command
netcdfvolumeyztoarray Edensity 50
instructs plotl to use the 50th Y-Z plane of netCDF volume Edensity
as a plotl array. A complete script like:
netcdffile IFM19983550000.NC
netcdfvolumeyztoarray Edensity 50
netcdfarrayx Latitudes
netcdfarrayy Longitudes
com /usr/local/lib/plotl/72colortable.plot
3dtransposexy
ylab Latitude
xlab Longitude
colorcontour
doaxes
quit
produces a graphic like this:
Frequently one doesn't know the actual index number of the desired plane
(which was 50 in the preceding example). The math operators nxai,
nyai, and nzai are useful in this case. Note that
nxai is an acronym for "nearest x array index". A slight modification
to the previous script:
netcdffile IFM19983550000.NC
netcdfvolumex Altitudes
netcdfvolumey Latitudes
netcdfvolumez Longitudes
netcdfvolumeyztoarray Edensity { 300 nxai }
netcdfarrayx Latitudes
netcdfarrayy Longitudes
com /usr/local/lib/plotl/72colortable.plot
3dtransposexy
ylab Latitude
xlab Longitude
colorcontour
doaxes
quit
will use the plane nearest to the element in Altitudes
with value of 300. In this
case that is plane number 34. Note that the volume x, y, and z vectors
were defined prior to using the nxai operator.
Multiple planes can be displayed as a stack, like this:
netcdffile IFM19983550000.NC
netcdfvolumex Altitudes
netcdfvolumeyztoarray Edensity { 300 nxai }
netcdfarrayx Latitudes
netcdfarrayy Longitudes
com /usr/local/lib/plotl/72colortable.plot
3dtransposexy
ylab Latitude
xlab Longitude
3drotation -70 0 20
colorcontour
ticsize 0
show3dxaxis
show3dyaxis
3dmove $xdim 0 0
text 300 km
netcdfvolumex Altitudes
netcdfvolumeyztoarray Edensity { 400 nxai }
netcdfarrayx Latitudes
netcdfarrayy Longitudes
3dtransposexy
yorigin 1.5
colorcontour
3dmove $xdim 0 0
text 400 km
netcdfvolumex Altitudes
netcdfvolumeyztoarray Edensity { 500 nxai }
netcdfarrayx Latitudes
netcdfarrayy Longitudes
3dtransposexy
yorigin 1.5
colorcontour
3dmove $xdim 0 0
text 500 km
quit
which yields
Converting volumes to vectors
netcdffile IFM19983550000.NC
netcdfvolumex Altitudes
netcdfvolumey Latitudes
netcdfvolumez Longitudes
netcdfvolumetoxvector Edensity {50 nyai} {220 nzai}
netcdftoycol Altitudes
netcdftodata
xlab Electron Density
ylab Altitude
rescale
plot
quit