1CPMPXY(3NCARG) NCAR GRAPHICS CPMPXY(3NCARG)
2
3
4
6 CPMPXY - Maps Conpack output from a rectangular coordinate system
7 superimposed on the data grid to some other coordinate system.
8
10 CALL CPMPXY (IMAP, XINP, YINP, XOTP, YOTP)
11
13 IMAP (INTEGER, input) is zero if the object of the call is to
14 ask CPMPXY about its mapping capabilities, greater than
15 zero if the object of the call is to do a forward mapping,
16 and less than zero if the object of the call is to do an
17 inverse mapping. When IMAP is non-zero, its absolute value
18 matches the current value of the parameter 'MAP' and
19 identifies the mapping to be used.
20
21 XINP (REAL, input) is used in one of three ways:
22
23 · When IMAP is zero, the value INT(XINP) is the index of
24 a mapping about which CPMPXY is being asked to supply
25 information.
26
27 · When IMAP is greater than zero, XINP is the X
28 coordinate of a point on the contour plot. If 'XC1' =
29 'XCM' (the default situation), then XINP will lie in
30 the range from 1 to M, where M is the first dimension
31 of the array being contoured (equal to the value of the
32 parameter 'ZDM'); in this case, the X coordinate will
33 have the same range as the first index of the data
34 array. If the user sets 'XC1' unequal to 'XCM', then
35 XINP will lie in the range from 'XC1' (corresponding to
36 an index value of 1) to 'XCM' (corresponding to an
37 index value of M).
38
39 · When IMAP is less than zero, XINP is the X coordinate
40 of a point on the contour plot, in a coordinate system
41 consistent with the current window, as specified by
42 arguments 5 through 8 of the last call to the SPPS
43 routine SET or by the equivalent call to GKS.
44
45 YINP (REAL, input/output) is used in one of three ways:
46
47 · When IMAP is zero, CPMPXY is expected to return one
48 of the following values of YINP: YINP = 0. indicates
49 that neither the forward nor the inverse
50 transformation is defined. YINP = 1. indicates that
51 the forward transformation is defined, but the
52 inverse is not. YINP = 2. indicates that the forward
53 transformation is not defined, but the inverse is.
54 YINP = 3. indicates that both the forward and the
55 inverse transformations are defined.
56
57 · When IMAP is greater than zero, YINP is the Y
58 coordinate of a point on the contour plot. If 'YC1'
59 = 'YCN' (the default situation), then YINP will lie
60 in the range from 1 to N, where N is the second
61 dimension of the array being contoured (equal to the
62 value of the parameter 'ZDN'); in this case, the Y
63 coordinate will have the same range as the second
64 index of the data array. If the user sets 'YC1'
65 unequal to 'YCN', then YINP will lie in the range
66 from 'YC1' (corresponding to an index value of 1) to
67 'YCN' (corresponding to an index value of N).
68
69 · When IMAP is less than zero, YINP is the Y
70 coordinate of a point on the contour plot, in a
71 coordinate system consistent with the current
72 window, as specified by arguments 5 through 8 of the
73 last call to the SPPS routine SET or by the
74 equivalent call to GKS.
75
76 XOTP and YOTP
77 (REAL, output) are used in one of two ways:
78
79 · If IMAP is greater than zero, XOTP and YOTP are the
80 X and Y coordinates of a point on the contour plot,
81 in a coordinate system consistent with the current
82 window, as specified by arguments 5 through 8 of the
83 last call to the SPPS routine SET or by the
84 equivalent call to GKS.
85
86 · When IMAP is less than zero, XOTP and YOTP are the X
87 and Y coordinates of a point on the contour plot. If
88 'XC1' = 'XCM' (the default situation), then XOTP
89 will lie in the range from 1 to M, where M is the
90 first dimension of the array being contoured (equal
91 to the value of the parameter 'ZDM'); in this case,
92 the X coordinate will have the same range as the
93 first index of the data array. If the user sets
94 'XC1' unequal to 'XCM', then XOTP will lie in the
95 range from 'XC1' (corresponding to an index value of
96 1) to 'XCM' (corresponding to an index value of M).
97 Similarly, if 'YC1' = 'YCN' (the default situation),
98 then YOTP will lie in the range from 1 to N, where N
99 is the second dimension of the array being contoured
100 (equal to the value of the parameter 'ZDN'); in this
101 case, the Y coordinate will have the same range as
102 the second index of the data array. If the user sets
103 'YC1' unequal to 'YCN', then YOTP will lie in the
104 range from 'YC1' (corresponding to an index value of
105 1) to 'YCN' (corresponding to an index value of N).
106
107 In any case, if the point (XINP,YINP) cannot be
108 mapped for any reason, some recognizable impossible
109 value should be returned for both of XOTP and YOTP
110 and the internal parameter 'ORV' should be given
111 that value, thereby allowing Conpack routines that
112 call CPMPXY to determine whether or not a point
113 being projected is visible or not. The value used
114 for this purpose by the Ezmap routines MAPTRA and
115 MAPTRI is 1.E12.
116
118 CPMPXY is not to be called by the user. It is called by Conpack when
119 the parameter 'MAP' is non-zero. Each call is intended 1) to inquire
120 whether a given mapping is defined by CPMPXY, or 2) to map the X and Y
121 coordinates of a single point, whose position is known relative to the
122 data grid, to X and Y coordinates in some other coordinate system or 3)
123 (as of version 3.1.3) to do the inverse mapping. The default version of
124 CPMPXY is as follows:
125
126 SUBROUTINE CPMPXY (IMAP,XINP,YINP,XOTP,YOTP)
127 IF (IMAP.EQ.0) THEN
128 IF (INT(XINP).GE.1.AND.INT(XINP).LE.3) THEN
129 YINP=3.
130 ELSE
131 YINP=0.
132 END IF
133 ELSE IF (ABS(IMAP).EQ.1) THEN
134 IF (IMAP.GT.0) THEN
135 CALL MAPTRA (YINP,XINP,XOTP,YOTP)
136 ELSE
137 CALL MAPTRI (XINP,YINP,YOTP,XOTP)
138 END IF
139 ELSE IF (ABS(IMAP).EQ.2) THEN
140 IF (IMAP.GT.0) THEN
141 XOTP=XINP*COS(.017453292519943*YINP)
142 YOTP=XINP*SIN(.017453292519943*YINP)
143 ELSE
144 XOTP=SQRT(XINP*XINP+YINP*YINP)
145 YOTP=57.2957795130823*ATAN2(YINP,XINP)
146 END IF
147 ELSE
148 XOTP=XINP
149 YOTP=YINP
150 END IF
151 RETURN
152 END
153
154 When CPMPXY is called with IMAP = 0, it assumes it is being
155 asked to return information about its mapping capabilities.
156 XINP is assumed to have been given the value REAL(I), where
157 I is the index of a mapping about which information is
158 desired. CPMPXY sets YINP to indicate whether the mapping
159 selected by I is implemented or not and whether its inverse
160 is implemented or not. In the case of the default version
161 of CPMPXY, mappings 1 through 3 are completely implemented
162 (both forward and reverse), so a "3." is returned as the
163 value of YINP; other mappings are not implemented at all,
164 so a "0." is returned as the value of YINP.
165
166 When CPMPXY is called with IMAP = 1, the incoming X and Y
167 coordinates are assumed to represent longitude and
168 latitude, respectively; the Ezmap routine MAPTRA is called
169 to find the X and Y coordinates of the projection of the
170 specified point on the globe, and those coordinates are
171 returned as the outgoing X and Y coordinates. When IMAP =
172 -1, the incoming X and Y coordinates are assumed to be the X
173 and Y coordinates of a projected point; the Ezmap routine
174 MAPTRI is called to find the longitude and latitude of the
175 original point on the globe, and those values are returned
176 as the outgoing X and Y coordinates.
177
178 When IMAP = 2, the incoming X and Y coordinates are assumed
179 to represent rho and theta (in degrees) in polar
180 coordinates; from these are computed the output X and Y
181 coordinates. When IMAP = -2, the incoming X and Y
182 coordinates are used to compute rho and theta and those
183 values are returned.
184
185 If IMAP is anything else, the input X and Y coordinates are
186 simply returned as the output X and Y coordinates.
187
188 A user version of CPMPXY can be made to do any desired
189 mapping. It should also be made, when IMAP = 0, to return
190 correct information about its own capabilities.
191
193 To use CPMPXY, load the NCAR Graphics libraries ncarg, ncarg_gks, and
194 ncarg_c, preferably in that order.
195
197 Online: conpack, cpback, cpchcf, cpchcl, cpchhl, cpchil, cpchll,
198 cpcica, cpclam, cpcldm, cpcldr, cpcltr, cpcnrc, cpdrpl, cpezct, cpgetc,
199 cpgeti, cpgetr, cplbam, cplbdr, cpmviw, cpmvrw, cppkcl, cppklb, cprect,
200 cprset, cpscae, cpsetc, cpseti, cpsetr, cpsps1, cpsps2, ncarg_cbind
201
202 Hardcopy: NCAR Graphics Contouring and Mapping Tutorial
203
205 Copyright (C) 1987-2009
206 University Corporation for Atmospheric Research
207
208 The use of this Software is governed by a License Agreement.
209
210
211
212UNIX March 1993 CPMPXY(3NCARG)