next up previous contents
Next: Executing cplot Up: Graphics Post-Processors Previous: Executing mplot

   
cplot

cplot is the standard script for producing contour plots generated by SAFARI, OASES or SNAP. However, cplot is available for more general use, provided the data to be contoured and the plot lay-out parameters are file-structured as described below.

The plot lay-out parameters are transferred to cplot in a file with extension .cdr , whereas the actual contour data are transferred in a file with extension .bdr . The data file is allowed to be in both ASCII or binary format, but in computational environments with different types of hardware platforms, it is most convenient to use ASCII format.

The cdr file can be edited for changing the layout of the contour plot. As a typical example, the cdr file used to create the contour plot in Fig. 14b of the SAFARI User's Guide is as follows:

CONDR,FIP,FMT,CPX,UNI,TEK 	
SAFARI-FIP case 5.  
saffip5.bdr          
Range (m)         	
          0.0000    RMIN
        299.8535    RMAX
          0.0000    XLEFT	
        300.0000    XRIGHT	
         15.0000    XSCALE	
         50.0000    XINC	
Depth (m)         	
         50.0000    YUP	
        125.0000    YDOWN	
          6.2500    YSCALE	
         25.0000    YINC	
        141.0000    DATA POINTS ALONG X AXIS	
         51.0000    DATA POINTS ALONG Y AXIS	
          1.0000    DIVX 	
          1.0000    DIVY 	
          0.0000    FLAGRC 	
         50.0000    RDUP 	
        125.0000    RDLO 	
         50.0000    SOURCE DEPTH (M)
        141.0000    GRID POINTS ALONG X AXIS 
         51.0000    GRID POINTS ALONG Y AXIS 
       1000.0000    FREQUENCY (HZ)	
          0.0000    DUMMY 
          5.0000    CAY 	
          5.0000    NRNG 	
         21.0000    ZMIN 	
         54.0000    ZMAX 	
          3.0000    ZINC 	
          2.0000    X ORIGIN OF PLOT IN INCHES
          0.0000    DUMMY 	
          2.0000    Y ORIGIN OF PLOT IN INCHES
          0.0000    NSM   	
          0.1000    HGTPT 	
          0.1400    HGTC 	
         -3.0000    LABPT 	
          1.0000    NDIV 	
          5.0000    NARC 	
         -1.0000    LABC 	
         -1.0000    LWGT 	
BOTTOM  1
  0.0 100.0
300.0 100.0
300.0 120.0
  0.0 120.0
BOTTOM  3
  0.0 120.0
300.0 120.0
300.0 125.0
  0.0 125.0

The first record specifies one 5-character option (CONDR) followed by a series of 3-letter options. The CONDR option indicates that the actual contour plot is of the depth-range type and cplot will interpret the parameters accordingly. This option should therefore never be changed. The first 3-letter option (FIP) is purely for identification and has no further effect. The FMT option indicates that the bdr data file is ASCII formatted (BIN for binary format). These first 3 options should always be present in the specified order, but the options following are optional and can be given in any order. The implemented options are as follows:

DUP
The DUPLEX character generator will be used for MINDIS plots instead of the default SIMPLEX.
CPX
The COMPLEX character generator is selected for MINDIS plots.
ITA
The ITALIC character generator will be used by MINDIS.
MIN
The MINDIS plot package will be used to produce line contour plots.
MTV
The PLOTMTV plot package will be used to generate a colour or greytone contour plot. MINDIS is the default plot package.
UNI
The UNIRAS plot package will be used to generate a colour or greytone contour plot. MINDIS is the default plot package.
X11
The raster plot will be produced on the X-windows display defined by the current setting of the DISPLAY environmental variable. (UNIRAS only).
TEK
The raster plot will be produced on the Tektronix 4691 ink jet plotter (UNIRAS only).
LAS
The raster plot will be produced on the default laser printer (UNIRAS only).
CLA
A Colour-Postscript file is created which may be printed on a colour laser printer (UNIRAS only).
PSP
A Grey-tone Postscript file in portrait mode is created for later printing or inclusion in LaTeX documents.
PSL
A Grey-tone Postscript file in landscape mode is created for later printing or inclusion in LaTeX documents.
COL
If the options MTV or UNI has been selected, a colour raster plot using an inbuilt colour scale will be generated. By default greytone scale is applied (UNIRAS and PLOTMTV).
REV
Reverses the default colour or grey-tone scales (UNIRAS only).
ROT
UNIRAS plots will be rotated 90 degrees. On most graphics devices the default is landscape mode.
NCL
By default the raster plots will have the contour lines separating the levels plotted as well. This option disables this feature.
NCS
By default a colour scale will be produced to the right of the contour map. This option disables this feature.

If you are using cplot through X-Windows, UNIRAS or PLOTMTV plots may alternatively be generated interactively after the default MINDIS plot is produced. The default graphics package may be changed by setting environmental parameters. Thus, to change the default to PLOTMTV color in X-windows, use the following definitions in your .login file:

 setenv CON_BWCOL COL
 setenv CON_PACKGE MTV
 setenv CON_DEVICE X11

PLOTMTV is available in public domain, and is easily installed, as described inSection 2.3. After the option record there is a record containing the title of the plot and a record containing the name of the file containing the data, i.e. the bdr file. Except for 2 records containing the x-axis and y-axis labels, the rest of the records contain numerical parameters, all supplied with a descriptive label. In general only a few of these parameters should be changed. The most important ones are described below.

The lengths of the x- and y-axes are controlled by the parameters XSCALE and YSCALE, respectively. cplot requires these parameters to be specified in coordinate units per cm. ZMIN and ZMAX specify the limits of the contouring interval, whereas ZINC is the associated increment. If UNIRAS is selected, areas with small data values will be filled with magenta colour or black in the greytone mode. The colour scale then moves through different red tones into blue (white in the greytone mode). If the default MINDIS package is selected, only contour lines with identifying numbers are plotted.

Another important parameter is NSM, which controls the amount of smoothing applied to the calculated contours. This parameter can be set to any value between 0 and 10, with 0 corresponding to no smoothing. It is obvious that this parameter should be used with extreme care.

At the end of the file, any number of blocks - identified by the keyword BOTTOM - can be specified, creating a shaded polygon in one of 4 grey-tones as specified by the number following the keyword BOTTOM (1 is light grey and 4 black). Each line following states the x- and y-coordinates of the corners of the polygon.

The top of the corresponding bdr file looks as follows:

    141.00    51.00  0.0E+00   1.0000  0.0E+00  0.0E+00
   0.0E+00  0.0E+00  0.0E+00  0.0E+00  0.0E+00  0.0E+00
   0.0E+00  0.0E+00  0.0E+00  0.0E+00  0.0E+00  0.0E+00
   0.0E+00  0.0E+00  0.0E+00  0.0E+00  0.0E+00  0.0E+00
   0.0E+00  0.0E+00  0.0E+00  0.0E+00  
    25.866   22.212   20.700   20.726   21.781   23.280    
    24.908   26.937   29.723   33.102   36.234   38.500    
    40.540   43.220   45.981   47.238   48.749   52.225    
    55.318   56.159   59.268   64.670   65.453   67.815    
    75.660   77.704   79.630   90.666   109.52   91.888    
    89.072   87.422   83.239   85.975   85.229   81.266    
    84.744   85.196   81.190   84.615   86.690   82.392    
      :        :        :        :        :        :
      :        :        :        :        :        :

The bdr file must have a header with 28 real numbers. Only the first 4 numbers are of significance. The first is the number of columns (or x-values) in the data matrix, with the second similarly giving the number of rows (or y-values). These numbers must be identical to the corresponding number of data points specified in the cdr file. The third and fourth numbers must be specified as 0.0 and 1.0, respectively. After the header the data to be contoured follow row by row in free format. Alternatively, the data may be specified column-wise, provided the parameter FLAGRC is set to 1.0 in the cdr file.



 
next up previous contents
Next: Executing cplot Up: Graphics Post-Processors Previous: Executing mplot
henrik schmidt
1999-08-25