NCAR Graphics
Contouring and Mapping Tutorial
Tutorial Home Next Chapter
Copyright 1993 University Corporation for Atmospheric Research (UCAR)
All Rights Reserved
This documentation is subject to the terms and conditions specified in a valid, executed License Agreement between Licensee and Licensor.
Published by: National Center for Atmospheric Research, Scientific Computing Division, P.O. Box 3000, Boulder, CO 80307-3000. The National Center for Atmospheric Research is operated by the University Corporation for Atmospheric Research and is sponsored by the National Science Foundation. Any opinions, findings, and conclusions or recommendations expressed in this publication are those of the authors and do not necessarily reflect the views of the National Science Foundation.
Trademarks: All brand and product names are trademarks or registered trademarks of their respective holders. Reference to a company or product name does not imply approval or recommendation of that company or product to the exclusion of others.
Printed on recycled paper (25% post-consumer waste).
Adrianne Middleton-Link
Brian Bevirt
Jacque Marshall
Christine Guzy, coordinator
Jacque Marshall
Ethan Alpert, SCD
Donna Beller, CGD
Michael Böttinger, Deutsches Klimarechenzentrum GMBH
Ginger Caldwell, SCD
Lee Carter, SCD
Diane Chace, Fleet Numerical Oceanography Center
Fred Clare, SCD
Dennis Colarelli, SCD
Nancy Dawson, SCD
Jim Eenigenburg, U.S. Forest Service
Keith Eggleston, Northeast Regional Climate Center
Gabor Fichtinger, Center for High Performance Computing, University of Texas at Austin
Christine Guzy, SCD
Mary Haley, SCD
Ken Hansen, SCD
Evelyn Hesse, Fleet Numerical Oceanography Center
Dave Kennison, SCD
Jeff Kuehn, SCD
Kirk Maasch, Quaternary Institute, University of Maine
Jacque Marshall, SCD
Pete Morreale, SCD
Tom Parker, SCD
Juli Rew, SCD
Tim Scheitlin, SCD
Dennis Shea, CGD
Susan Smith, SCD
Shirley Stephan, Lawrence Livermore National Laboratory
Paula Theophilus, SAIC
Michael Timlin, CIRES
The author especially wants to thank Dave Kennison of NCAR's Scientific Visualization staff. Dave has provided extensive technical support, explanations, and suggestions for this tutorial.
Thanks to Christine Guzy for pioneering many new techniques for electronically producing all the graphics in this book and demonstrating new ways to publish NCAR Graphics output. This work was made possible by ongoing technical support from Fred Clare, Dave Brown, John Clyne, and Dave Kennison of the Scientific Visualization Group. Thanks to Martha Lankton of NCAR Graphic Services for her help in printing this manual.
The instructional design principles used in this manual were planned by Adrianne Middleton-Link, Jeff Kuehn, and Brian Bevirt; the design was executed and refined by Brian Bevirt and Jacque Marshall. This particular design is derived primarily from seminars and books by Edmond H. Weiss, Ph.D.
Special thanks to Jacque Marshall for using Adobe Illustrator to create all the illustrations in this document that were not produced with the NCAR Graphics package. Jacque has also developed and and refined the templates for this design using Microsoft Word and FrameMaker.
Bold type indicates filenames, pathnames, directories, UNIX command names, and UNIX command line options. The files that provide examples for this tutorial are sometimes specified by their exact filename, and other times the usage is more informal. Examples:
- Using ccprwc.f, set RWC=100, then set RWC=250, and compare the plots for differences.
- Using the ccpcit example, set Conpack so that every third contour is labeled.
Italic type indicates a variable where you provide the substitution. For example:
- The example uses "nice" values based on n/3*10k, where 1<=n<=11, and k is any integer.
Fortran code segments and error messages are shown in Courier ("typewriter") font:
CALL GRIDAL (K-1, 0, N-1, 0, 1, 1, 5, 0., 0.)
ERROR 6 IN CPSPS2 - ERROR IN CALL TO MSSRF1
In the synopsis of Fortran code segments, lowercase letters represent a specific value that must be used in the code. These strings conform to the Fortran naming convention for declaring variable types as INTEGER or REAL. Examples:
CALL CPSETI ('PAI', n)
CALL CPSETR ('CIT', cit)
CALL CPGETI ('LIU', liu)
CALL CPSETI ('RWC', irwc)
When a line of Fortran code is longer than the width of the column, the continued line is indicated with a plus sign (+) in Fortran column 6. Example:
4 IF (IDLS .NE. 1 .AND. IDRS .NE. 1 .AND.
+ IDLS .NE. 3 .AND. IDRS .NE. 3 .AND.
+ IDLS .NE. 11 .AND. IDRS .NE. 11 .AND.
+ IDLS .NE. 79 .AND. IDRS .NE. 79 .AND.
+ IDLS .NE. 99 .AND. IDRS .NE. 99 .AND.
+ IDLS .NE. 104 .AND. IDRS .NE. 104 .AND.
+ IDLS .NE. 107 .AND. IDRS .NE. 107 .AND.
+ IDLS .NE. 163 .AND. IDRS .NE. 163) NPTS=0
5 RETURN
6 END
For ordering information, please contact NCAR Graphics ordering information at (303) 497-1201 or scdinfo@ncar.ucar.edu or
University Corporation for Atmospheric Research
SCD/NCAR Graphics Orders
P.O. Box 3000
Boulder, CO 80307-3000 (USA)
If you have questions about using NCAR Graphics, contact your NCAR Graphics site representative. If you do not know who your site representative is and cannot find out from other users or the package installer at your site, you can call the NCAR Graphics Information Line at (303) 497-1201 to obtain the name of your representative. In its sole discretion, NCAR provides limited consulting support on usage and installation on an "as available" basis only. (Please refer to your Software License Agreement for a complete definition of "support.")
- Intro 1. A short introduction 1
- Purpose of this tutorial 1
- Design of this tutorial 1
- Other resources to use with this manual 1
- Intro 1.1 Understanding the layout of tutorial modules 2
- Intro 1.2 Details about how information is presented in this manual 4
- Reference guides throughout 4
- Basic concepts explained first 4
- Instructions for performing tasks 4
- Ar 1. What is Areas? 9
- Ar 1.1 Table of Areas user entry points 10
- Initialization and support routines 10
- Action routines 10
- Query routine 10
- Parameter setting and retrieving routines 10
- Debugging routine 10
- Ar 1.2 Table of Areas parameters 11
- Ar 1.3 Areas definitions: Edges 12
- Ar 1.4 Areas definitions: Groups of edges 14
- Ar 1.5 Areas definitions: Left and right 16
- Ar 1.6 Areas definitions: Areas, area identifiers, and area maps 18
- Ar 1.7 Areas definitions: Masks and areas defined by more than one edge group 20
- Ar 1.8 What calls do I need to get my Areas plot? 22
- Ar 1.9 Areas parameters: What they do and how to use them 23
- Ar 2. Initializing Areas 25
- Ar 2.1 Set up area map 26
- Ar 2.2 Adding edges to an area map 28
- Ar 2.3 Preprocess area map: Overview 30
- Ar 2.3.1 Preprocess area map: Breaking up edges 32
- Ar 2.3.2 Preprocess area map: Removing coincident and dangling edges 34
- Ar 2.3.3 Preprocess area map: Reconciling area information 36
- Ar 3. Producing results using Areas 39
- Ar 3.1 Obtaining area ids and group ids 40
- Ar 3.2 Masking and drawing lines through an area map 42
- Ar 3.3 Writing a masking or line-drawing routine 44
- Ar 3.4 Filling areas 46
- Ar 3.5 Writing an area-fill routine 48
- Ar 4. Debugging Areas 51
- Ar 4.1 Debugging options: Setting parameters 52
- Ar 4.2 Debugging options: Drawing parts of the area map 54
- Ar 5. Areas parameter descriptions 57
- Mp 1. What is Ezmap? 63
- Mp 1.1 Table of Ezmap user entry points 64
- Single-call entry point 64
- Map initialization routines 64
- Latitude, longitude, and limb line drawing routines 64
- Labeling routine 64
- Map drawing and control routines 64
- Positioning routines 64
- Point and line routines 64
- Color function 65
- Inverse transformation routine 65
- Parameter routines 65
- Mp 1.2 Table of Ezmap parameters 66
- Mp 1.3 Table of Ezmap map projections 67
- Mp 1.4 Description of projections: Conic 68
- Mp 1.5 Description of projections: Azimuthal 70
- Mp 1.6 Description of projections: Cylindrical 72
- Mp 1.7 Producing a quick and dirty plot 74
- Mp 1.8 What calls do I need to get my Ezmap plot? 78
- Mp 1.9 Ezmap parameters: What they do and how to use them 79
- Mp 2. Getting set up 81
- Mp 2.1 Positioning the plot in the frame 82
- Mp 2.2 Choosing your map projection 84
- Mp 2.3 Choosing your map projection: Satellite view 86
- Mp 2.4 Choosing map outlines to be drawn 88
- Mp 2.5 Setting limits for the projection 90
- Mp 2.6 Setting map line colors 94
- Mp 2.7 Controlling Ezmap lines 96
- Mp 2.8 Controlling geographic and political outlines 98
- Mp 2.9 Rectangular and elliptical perimeters 100
- Mp 2.10 Saving and retrieving Ezmap parameters 102
- Mp 3. Simple maps 103
- Mp 3.1 Initializing Ezmap 104
- Mp 3.2 Grids: Drawing latitude and longitude lines 106
- Mp 3.3 Grids: Dash patterns 108
- Mp 3.4 Labeling 110
- Mp 3.5 Drawing political and geographic outlines 112
- Mp 3.6 A shortcut 114
- Mp 4. Producing maps with masking or filled areas 117
- Mp 4.1 Color and area identifiers in Ezmap 118
- Mp 4.2 Ezmap group identifiers 120
- Mp 4.3 Initialize Ezmap with Areas 122
- Mp 4.4 Labeling 124
- Mp 4.5 Grid lines with masking 126
- Mp 4.6 Grid lines with masking: Writing a masking routine 128
- Mp 4.7 Filling areas 130
- Mp 4.8 Filling areas: Writing a fill routine 132
- Mp 5. Points, lines, and inverse transformations 135
- Mp 5.1 Projecting a point onto the map 136
- Mp 5.2 Inverse transformations 138
- Mp 5.3 Drawing lines on a simple map 140
- Mp 5.4 Drawing a great circle between two points 142
- Mp 5.5 Adding lines to an area map 144
- Mp 5.6 Drawing lines masked by an area map 148
- Mp 6. Table of Ezmap area identifiers 153
- Mp 7. Ezmap parameter descriptions 169
- Cp 1. What is Conpack? 179
- Cp 1.1 Table of Conpack user entry points 180
- CONREC simulation routines 180
- Conpack initialization and data support routines 180
- Background routine 180
- Labeling routines 180
- Contour line drawing routines 181
- Parameter access routines 181
- Cp 1.2 Table of Conpack parameters 182
- Cp 1.3 Producing a "quick and dirty" plot 190
- Cp 1.4 More complex black and white plots 192
- Cp 1.5 What calls do I need to get my Conpack plot? 196
- Cp 1.6 Conpack parameters: What they do and how to use them 198
- Cp 2. Backgrounds for your plots 201
- Cp 2.1 Generating a background 202
- Cp 2.2 Drawing a contour perimeter 204
- Cp 2.3 Setting X/Y axis values for a contour background 206
- Cp 2.4 Changing perimeter options 208
- Cp 2.5 Labeling X/Y axis values for a contour background 210
- Cp 2.6 Contour perimeter: Size, shape, and location using Conpack 214
- Cp 2.7 Contour perimeter: Size, shape, and location using SET 216
- Cp 3. Initializing Conpack 219
- Cp 3.1 Data types 220
- Dense gridded data 221
- Sparse gridded data 221
- Irregularly spaced gridded data 221
- Nongridded data 221
- Missing data 221
- Non-Cartesian data 221
- Cp 3.2 Dense gridded data 222
- Cp 3.3 Sparse gridded data 224
- Cp 3.4 Irregularly spaced gridded data 226
- Cp 3.5 Nongridded data 230
- Cp 3.6 Missing or special data 234
- Cp 3.7 Non-Cartesian data 236
- Cp 3.8 Non-Cartesian data: Latitude/longitude data 238
- Cp 3.9 Non-Cartesian data: Polar coordinates 242
- Cp 3.10 Non-Cartesian data: Other data types 244
- Cp 3.11 Contouring non-rectangular domains 246
- Cp 3.12 Setting minimal workspace 248
- Cp 4. Contour line basics 251
- Cp 4.1 Contour line basics 252
- Cp 4.2 Drawing contour lines 254
- Cp 4.3 Four methods of contour level selection 256
- Cp 4.4 Default contour level selection 258
- Cp 4.5 Default contour level selection: Default intervals and labels 260
- Cp 4.6 Default contour level selection: Fixed contour intervals and labels 262
- Cp 4.7 Modifying Conpack-chosen levels: Picking levels 264
- Cp 4.8 Modifying Conpack-chosen levels: Changing the levels 266
- Cp 4.9 Setting n equally spaced contour levels 268
- Cp 4.10 Choosing your own contour levels 270
- Cp 4.11 Line attributes: Line dash patterns 272
- Cp 4.12 Line attributes: Line thickness 276
- Cp 4.13 Line attributes: Line color 278
- Cp 4.14 Line attributes: Turning contour line drawing off and on 280
- Cp 5. Filling contour levels 283
- Cp 5.1 Area identifiers in Conpack 284
- Cp 5.2 Group identifiers in Conpack 286
- Cp 5.3 Initialize Conpack with Areas 288
- Cp 5.4 Adding label boxes to the area map 292
- Cp 5.5 Masking areas: Label boxes 294
- Cp 5.6 Masking areas: Box masking routines 298
- Cp 5.7 Filling contour levels 300
- Cp 5.8 Filling contour levels: Writing a fill routine 304
- Cp 6. Contour line labels 307
- Cp 6.1 Annotating your plots 308
- Cp 6.2 Forcing labels to be chosen 310
- Cp 6.3 Selecting lines for labels: Default method 312
- Cp 6.4 Selecting lines for labels: Labeling every nth line 314
- Cp 6.5 Selecting lines for labels: Labeling specific lines 316
- Cp 6.6 Three methods of label placement 318
- Cp 6.7 Label placement: Default method 320
- Cp 6.8 Label placement: Regular scheme 322
- Cp 6.9 Label placement: Penalty scheme 324
- Cp 6.9.1 Label placement: Penalty scheme---Gradient term 326
- Cp 6.9.2 Label placement: Penalty scheme---Crossing contours 328
- Cp 6.9.3 Label placement: Penalty scheme---Tight curves 330
- Cp 6.9.4 Label placement: Penalty scheme---Label spacing 332
- Cp 6.10 Label attributes: Angle and orientation 334
- Cp 6.11 Label attributes: Color 336
- Cp 6.12 Label attributes: Label text options 338
- Cp 7. General labels 341
- Cp 7.1 Overview of labeling in Conpack 342
- Cp 7.2 Titles 344
- Cp 7.3 Numeric control: Significant digits 346
- Cp 7.4 Numeric control: Formatting 348
- Cp 7.5 Numeric control: Exponents 350
- Cp 7.6 Label attributes: Angles 352
- Cp 7.7 Label attributes: Size 354
- Cp 7.8 Label attributes: Constant field and information text 356
- Cp 7.9 Label attributes: High/low text 358
- Cp 7.10 Label attributes: Color 360
- Cp 7.11 Label box attributes: Outline and fill 362
- Cp 7.12 Label box attributes: Line width 364
- Cp 7.13 Label box attributes: Size 366
- Cp 7.14 Label placement: Constant field and information labels 368
- Cp 7.15 Label placement: High/low 370
- Cp 7.16 Constant field found flag 372
- Cp 8. Overlaying filled contours on a map 373
- Cp 8.1 Initialization 374
- Cp 8.2 Masking areas: Label boxes and land masses 376
- Cp 8.3 Filling specific contour and geographic areas 378
- Cp 8.4 Filling areas: Polar projection 380
- Cp 9. Advanced topics 383
- Cp 9.1 Smoothing contours 384
- Cp 9.2 Hachuring: Indicating slope on a contour plot 386
- Cp 9.3 Cell arrays 388
- Cp 9.4 Making a movie 390
- Cp 10. Conpack parameter descriptions 393
Tutorial Home Next Chapter