SPPS Functions

The NCAR System Plot Package Simulator (SPPS) was written for two purposes. One was to smooth the transition from the pre-GKS version of NCAR Graphics to the GKS package. Toward this purpose many subroutine entries were implemented by making the appropriate GKS calls.

The second purpose of SPPS was to implement a number of important features which were missing in the GKS standard. In this documentation module are presented some of the helpful features of SPPS that resulted from these two objectives.

SPPS routines that have GKS analogs are repeated here for the sake of convenience. Discussed in the document NCAR Graphics Fundamentals, UNIX Version are the additional SPPS subroutines:

Man pages exist for all of these subroutines. For the C interfaces for SPPS routines, consult the man pages for the equivalent Fortran entry.

Open and Close GKS

The SPPS call CALL OPNGKS is equivalent to the following set of three GKS calls:
      CALL GOPWK(1,2,1)
      CALL GACWK(1)
which open and activate workstation 1, of type 1, on unit 2. This is an NCAR CGM metafile output workstation.

The SPPS subroutine CALL CLSGKS is equivalent to the following set of three GKS calls:

      CALL GDAWK(1)
      CALL GCLWK(1)
which deactivate and close workstation 1 (the CGM), and close GKS.

Normalization Transformations

As discussed in the Coordinate Systems module, NCAR Graphics user coordinates provide two major extensions to GKS world coordinates: mirror imaging and log scaling. The normalization transformations which incorporate these extensions are provided by the SET subroutine of SPPS. A single call to SET allows you to define a window, a viewport, mirror imaging, and log scaling. You are encouraged to use the SET call for establishing normalization transformations. Figure 24 and Figure 25 show log scaling and axis reversal, respectively, with SPPS.
       Argument  |   Type    | Mode  | Dimension  
CALL SET  (XLV,  |   Real    | Input |            
           XRV,  |   Real    | Input |            
           YBV,  |   Real    | Input |            
           YTV,  |   Real    | Input |            
           XLW,  |   Real    | Input |            
           XRW,  |   Real    | Input |            
           YBW,  |   Real    | Input |            
           YTW,  |   Real    | Input |            
           LS)   |   Integer | Input |            
X left, X right, Y bottom, and Y top of the viewport in normalized device coordinates.
X left, X right, Y bottom, and Y top of the window in user coordinates.
Log scaling with options of:
1 - linear X, linear Y
2 - linear X, log Y
3 - log X, linear Y
4 - log X, log Y
The default for LS is 1.
Mirror imaging is determined by the ordering of the range of the user coordinates that define the plotting window. The SET call to establish the normalization transformation shown in Diagram 1 is:
      CALL SET(.15,.95,.10,.90,100.,1000.,100.,1000.,1)
In this case, both X and Y have axes that run from 100. to 1000. units; thus, mirror imaging is not in effect on either axis. The SET call to establish the normalization transformation shown in Diagram 2 is:
      CALL SET(.15,.95,.10,.90,1000.,100.,100.,1000.,2)
In this case, values along the X axis run from max to min due to reverse ordering of the window coordinates. Note that arguments 5 and 6 (X left and X right of the window) are now 1000. and 100., rather than 100. and 1000.; thus, mirror imaging is in effect for the X axis. In addition, logarithmic scaling is in effect for the Y axis by setting the last argument to 2.

Inquiry Functions

Normalization Transformations

SPPS contains an inquiry function that will return the viewport, window, log scaling, and mirror imaging currently in effect.
Argument descriptions are the same as for the SET call defined above. They are all output arguments.

Figure 24 - Log scaling

Figure 25 - Mirror imaging

Links: GKS Index, GKS Home