File: xsections.html

package info (click to toggle)
grads 3%3A2.2.1-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,396 kB
  • sloc: ansic: 61,645; sh: 10,612; makefile: 206; python: 3
file content (130 lines) | stat: -rw-r--r-- 4,352 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!--Copyright (C) 1988-2005 by the Institute of Global Environment and Society (IGES). See file COPYRIGHT for more information.-->

<html>
<head>
<title>Cross Sections</title>
</head>
<body text="#000000" bgcolor="e0f0ff">

<h2>Drawing Arbitrary Cross Sections</h2>
<p>
Drawing arbitrary vertical cross sections based on a collection of
station data profiles involves transforming station data (scattered
observations) into gridded data so as to take advantage of the GrADS
grid display and analysis features.

<p>
The first step is to form a collection of 1-D data (Z or T
varying). The <a href="gradcomdcollect.html"><code>collect</code></a>
command saves station data profiles or time series in memory as a
set. The 1-D data may be either real station data or
gridded data converted to station data using 
<a href="gradfuncgr2stn.html"><code>gr2stn</code></a>. 

<p> 
The second stop is to convert the collection of station data into
a grid for display or analysis purposes. This is accomplished by
the new function <a href="gradfunccoll2gr.html"><code>coll2gr</code></a>. 
 

<p>
<a href="gradfunccoll2gr.html"><code>coll2gr</code></a> does not yet
support time slices; currently, it will only work when the collection
of stations is a collection of vertical profiles.

<p>
<a href="gradfunccoll2gr.html"><code>coll2gr</code></a> produces an
output grid that varies in X and Z; the dimension environment used
when <a href="gradfunccoll2gr.html"><code>coll2gr</code></a> is
invoked must also be X and Z varying. The X axis of the output grid
will contain the equally spaced station profiles and will span the
range of the current X dimension environment. The Z axis of the output
grid will span the range of the current Z dimension environment and
will have either the specified number of levels or a union of the
levels. Data points outside of the range of levels will be used for
interpolating to within the range if appropriate.

<p>
The X axis of the output grid from <a
href="gradfunccoll2gr.html"><code>coll2gr</code></a> is artificial in
terms of the world coordinates -- it doesn't really represent
longitudes. A way to completely control the labelling of the display
output is provided:

<p>
<ul>
<code>
<a href="gradcomdsetxlabs.html">set xlabs</a> lab1 | lab2 | lab3 ...<br>
<a href="gradcomdsetylabs.html">set ylabs</a> lab1 | lab2 | lab3 ...<br>
</code>
</ul>

<p>
Each label string may include blanks. The labels will be plotted
equally spaced along the indicated axis. Spacing can be
modified by adding blank strings:
<p>
<ul>
<code><a href="gradcomdsetxlabs.html">set xlabs</a> | | | | lab1 | ...<br>
</code>
</ul>

<p>
Here is a sample script written by M. Fiorino that uses these features:
<p>
<code>
*********************************************************************<br>
* The following lines will display an arbitrary X section<br>
* from one specified point to another.  <br>
*<br>
* lon1 is the westernmost longitude point<br>
* lon2 is the easternmost longitude point<br>
* lat1 is the latitude that corresponds to lon1<br>
* lat2 is the latitude that corresponds to lon2<br>
*<br>
* The loop is used to interpolate between points in<br>
* the arbitrary cross section.  This code will plot<br>
* any cross section as long as you specify the points. <br> 
* My code plots cross sections of PV after I calculated<br>
* PV on 11 pressure surfaces.  I have another script<br>
* that plots cross sections of potential temperature, and<br>
* the code is very similar to this, except theta is substituted<br>
* for PV.<br>
*<br>
* Many thanks to Brian Doty at COLA for his help with this code.<br>
*<br>
********************************************************************<br>
<br>
'open pv.ctl'<br>
'set grads off'<br>
'set zlog on'<br>
'set x 1'<br>
'set y 1'<br>
'set lev 1000 100'<br>
lon1 = -95.0<br>
lon2 = -90.0<br>
lat1 =  55.0<br>
lat2 =  15.0<br>
lon = lon1<br>
'collect 1 free'<br>
while (lon <= lon2)<br>
&nbsp;&nbsp;lat = lat1 + (lat2-lat1)*(lon-lon1) / (lon2-lon1)<br>
&nbsp;&nbsp;'collect 1 gr2stn(pv,'lon','lat')'<br>
&nbsp;&nbsp;lon = lon + 1<br>
endwhile<br>
<br>
'set x 14 16'<br>
'set xaxis 'lon1' 'lon2<br>
'set clab on'<br>
'set gxout shaded'<br>
'set clevs 0 .5 15'<br>
'set ccols 0 0 7 0'<br>
'd coll2gr(1,-u)'<br>
'set gxout contour' <br>
'set cint .5'<br>
'd coll2gr(1,-u)'<br>
</code>

</body>
</html>