Click here to load reader
View
226
Download
2
Embed Size (px)
The Grid Analysis and Display System
GrADS
V1.5.1.12
Brian Doty
10 September, 1995
Manual reformatted and updated by:
Tom Holt,Climatic Research Unit,University of East Anglia, Norwich, [email protected]
and
Mike FiorinoProgram for Climate Model Diagnosis and IntercomparisonLawrence Livermore National Laboratory L-264Livermore, CA [email protected]
2
Table of Contents
TABLE OF CONTENTS 2
ABSTRACT 9
SUGGESTIONS 10
HOW TO USE THIS MANUAL 11
INTRODUCTORY GUIDE 12
1.0 STARTING AND QUITTING GrADS 13
Help 13
Diagnostics at startup 13
Startup options 13
Leaving GrADS 14
2.0 BASIC CONCEPT OF OPERATION 15
3.0 TUTORIAL 16
4.0 USING GrADS DATA FILES 21
Default file extension 21
Introduction to GrADS Data Sets 21Gridded Data Sets 22
The options record in the Data Descriptor File 27Station Data Sets 28Station Data Descriptor File 29STNMAP Utility 30
Creating Data Files 30Examples of Creating a Gridded Data Set 30Examples of Creating Station Data Sets 31
5.0 DIMENSION ENVIRONMENT 34
6.0 VARIABLE NAMES 35
3
7.0 EXPRESSIONS 36
8.0 DEFINED VARIABLES 37
Defining new variables 37
Undefining new variables 39
9.0 DISPLAYING DATA PLOTS 40
Displaying your data 40
Clearing the Display 40
10.0 GRAPHICS OUTPUT TYPES 41
11.0 ANIMATION 43
12.0 PAGE CONTROL 44
Real and virtual pages 44
Controlling the plot area 44
13.0 GRAPHICS PRIMITIVES 45
Drawing commands 45
Controlling drawing commands 46
Plot clipping 47
14.0 HARDCOPY OUTPUT 48
Producing a GrADS print file 48
Printing a GrADS print file 48
15.0 EXEC COMMAND 49
16.0 USING STATION DATA 50
Operating on station data 50
Station Models 51
17.0 INTRODUCTION TO GrADS SCRIPTS 52
4
What scripts can do 52
Running scripts 52
Automatic script execution 52
Storing GrADS scripts 53
18.0 ADDITIONAL FACILITIES 54
Shell commands 54
Command line options on GrADS utilities 54
Reinitialisation of GrADS 54
Displaying GrADS Metafiles 55
REFERENCE SECTION 56
19.0 GRAPHICS OPTIONS 57
1-D Graphics 57Line Graphs (gxout = line): 57Bar Graphs (gxout = bar) 57Error Bars (gxout = errbar) 58Line Graph Shading (gxout = linefill) 58
2-D Gridded Graphics 58Line Contour Plots (gxout = contour) 58Shaded or Grid Fill Contour Plots (gxout = shaded or grfill) 60Grid Value Plot (gxout = grid) 61Vector Plot (gxout = vector) 61Wind Barb Plot (gxout = barb) 62Scatter Plot (gxout = scatter) 62Specific Value Grid Fill Plot (gxout = fgrid) 63Streamline Plot (gxout = stream) 63
1-D Station Graphics 64Plot time series of wind barbs at a point (gxout = tserbarb) 64Plot time series of weather symbols at a point (gxout = tserwx) 64
2-D Station Graphics 64Plot station values (gxout = value) 64Plot wind barb at station (gxout = barb) 64Plot weather symbol at station (gxout = wxsym) 65Plot station model (gxout = model) 65
Other Display Options 66Find closest station to x,y point (gxout = findstn) 66Write data to file (gxout = fwrite) 66Display information about data (gxout = stat) 66
5
Set Commands to Control Graphics Display 67Set range for plotting 1-D or scatter plots 67To control log scaling when the Z dimension is plotted on any plot: 67To control axis orientation: 68To control axis labelling 68To control displayed map projections 69To control map drawing: 69To control annotation 70To control console display 70To control the frame 70To control logo display 70
20.0 GrADS FUNCTIONS 71
Averaging Functions 71aave 71amean 72ave 72mean 74vint 74
Filtering Functions 75smth9 75
Finite Difference Functions 75cdiff 75
Grid Functions 76const 76maskout 77skip 78
Math Functions 78abs 78acos 78asin 79atan2 79cos 79exp 79gint 79gint(expr) 79log 79log10 79pow 80sin 80sqrt 80tan 80
Meteorological Functions 80tvrh2q 80tvrh2t 81
Special Purpose Functions 81tloop 81
6
Station Data Functions 83gr2stn 83oacres 83stnave 85stnmin 85stnmax 85
Vector Functions 86hcurl 86hdivg 86mag 86
21.0 USER DEFINED FUNCTIONS (UDFS): 88
Overview of User Defined Functions 88
The user defined function table 88
Format of the function data transfer file 89
Format of the function result file 91
Example: Linear Regression Function 91
22.0 FURTHER FEATURES OF GRADS DATA SETS 94
File and time group headers 94
Variable format/structure control 94
Multiple file time series 99
Enhanced data formats and structures 101
23.0 PROGRAMMING GRADS: USING THE SCRIPTING LANGUAGE 102
Overview of the Scripting Language 102
Elements of the Language 102Variables 103
String variables 103Predefined variables 103Global scripting variables 103Compound scripting variables 103
Operators 104Expressions 105Flow control 106
IF Blocks 106WHILE Blocks 106
Functions 107Assignment 108Standard input/output 108
7
Sending Commands to GrADS 108Intrinsic Functions 109
String functions 109Input/output functions 109
Commands that complement the scripting language 110
Widgets 112On screen buttons 113Rubber banding 113
Examples 114
24.0 USING MAP PROJECTIONS IN GrADS 115
Using Preprojected Grids 115Polar Stereo Preprojected Data (coarse accuracy for NMC Models) 116Lambert Conformal Preprojected Data 117NMC Eta model (unstaggered grids) 120NMC high accuracy polar stereo for SSM/I data 122CSU RAMS Oblique Polar Stereo Grids 124Pitfalls when using preprojected data 128
GrADS Display Projections 128
Summary and Plans 129
APPENDICES 130
APPENDIX A: SUPPLEMENTARY SCRIPTS 131
1) Correlation between two horizontal grids (corr.gs) 131
2) GrADS Color Table Script (cmap.gs) 131
3) Font Display (font.gs) 134
4) Plot a color bar (cbar.gs) 134
5) Stack commands and display on flush (stack.gs) 134
6) Draw all WX Symbols (wxsym.gs) 134
7) (draw.gs) 134
8) (string.gs) 134
9) (loop.gs) 134
10) (bsamp.gs) 135
11) Expanded Color Bar Script (cbarn.gs) 135
8
12) Computing Standard Deviation (sd.gs) 135
13) Draw an x,y Plot (xyplot.gs) 135
APPENDIX B: USING GRIB DATA IN GRADS 136
Gribscan 136File options: 136Processing Options: 136Special note to NMC users 137Display options: 137Some examples: 137
Gribmap 138
APPENDIX C: COMMAND LINE EDITING AND HISTORY UNDER UNIX 142
APPENDIX D: 32-BIT IEEE FLOATS ON A CRAY 144
APPENDIX E: USING GRADS ON THE IBM PC 145
Hardware considerations 145
Some limitations of the PC version: 145
Data sets from other platforms 145
Printing on non-postscript printers 146
Incorporating GrADS pictures into PC software 146
APPENDIX F: GRADS-RELATED NETWORK FACILITIES 147
ftp Sites 147
Listserver 147
WWW Sites 147
9
Abstract
The Grid Analysis and Display System (GrADS) is an interactive desktop tool that is currently in useworldwide for the analysis and display of earth science data. GrADS is implemented on allcommonly available UNIX workstations and DOS based PCs, and is freely distributed over theInternet. GrADS provides an integrated environment for access, manipulation, and display of earthscience data.
GrADS implements a 4-Dimensional data model, where the dimensions are usually latitude,longitude, level, and time. Each data set is located within this 4-Dimensional space by use of a datadescription file. Both gridded and station data may be described. Gridded data may be non-linearlyspaced; Gaussian grids and variable resolution ocean model grids are directly supported. Theinternal data representation in a file may be either binary or GRIB.
Since each data set is located within the 4-D data space, intercomparison of disparate data sets isgreatly facilitated. Operations may be performed between data on different grids, or between griddedand observational data. Data from different data sets may be graphically overlaid, with correct spatialand time registration.
The user accesses data from the perspective of the 4-D data model. A dimension environment isdescribed by the user as a desired subset of the 4-D space. Data is accessed, manipulated, anddisplayed within this subset.
Operations may be performed on the data directly, and interactively, by entering FORTRAN-likeexpressions at the command line. A rich set of built-in functions are provided. In addition, users mayadd their own functions as external routines written in any programming language. The expressionsyntax allows complex operations that range over very large amounts of data to be performed withsimple expressions.
Once the data have been accessed and manipulated, they may be displayed using a variety ofgraphical output techniques, including line, bar, and scatter plots, as well as contour, shaded contour,streamline, wind vector, grid box, shaded grid box, and station model plots. Graphics may also beoutput in PostScript format for printing on monochrome or color PostScript printers. The user haswide control over all aspects of graphics output, or may choose to use the geophysically intuitivedefaults.
A programmable interface is provided in the form of an interpreted scripting language. A script maydisplay widgets as well as graphics, and take actions based on user point-and-clicks. Quitesophisticated data graphical interfaces can, and have, been built. The scripting language can also