CPMPXY(3NCARG) | NCAR GRAPHICS | CPMPXY(3NCARG) |
CPMPXY - Maps Conpack output from a rectangular coordinate system superimposed on the data grid to some other coordinate system.
CALL CPMPXY (IMAP, XINP, YINP, XOTP, YOTP)
In any case, if the point (XINP,YINP) cannot be mapped for any reason, some recognizable impossible value should be returned for both of XOTP and YOTP and the internal parameter 'ORV' should be given that value, thereby allowing Conpack routines that call CPMPXY to determine whether or not a point being projected is visible or not. The value used for this purpose by the Ezmap routines MAPTRA and MAPTRI is 1.E12.
CPMPXY is not to be called by the user. It is called by Conpack when the parameter 'MAP' is non-zero. Each call is intended 1) to inquire whether a given mapping is defined by CPMPXY, or 2) to map the X and Y coordinates of a single point, whose position is known relative to the data grid, to X and Y coordinates in some other coordinate system or 3) (as of version 3.1.3) to do the inverse mapping. The default version of CPMPXY is as follows:
SUBROUTINE CPMPXY (IMAP,XINP,YINP,XOTP,YOTP)
IF (IMAP.EQ.0) THEN
IF (INT(XINP).GE.1.AND.INT(XINP).LE.3) THEN
YINP=3.
ELSE
YINP=0.
END IF
ELSE IF (ABS(IMAP).EQ.1) THEN
IF (IMAP.GT.0) THEN
CALL MAPTRA (YINP,XINP,XOTP,YOTP)
ELSE
CALL MAPTRI (XINP,YINP,YOTP,XOTP)
END IF
ELSE IF (ABS(IMAP).EQ.2) THEN
IF (IMAP.GT.0) THEN
XOTP=XINP*COS(.017453292519943*YINP)
YOTP=XINP*SIN(.017453292519943*YINP)
ELSE
XOTP=SQRT(XINP*XINP+YINP*YINP)
YOTP=57.2957795130823*ATAN2(YINP,XINP)
END IF
ELSE
XOTP=XINP
YOTP=YINP
END IF
RETURN END
When CPMPXY is called with IMAP = 0, it assumes it is being asked to return information about its mapping capabilities. XINP is assumed to have been given the value REAL(I), where I is the index of a mapping about which information is desired. CPMPXY sets YINP to indicate whether the mapping selected by I is implemented or not and whether its inverse is implemented or not. In the case of the default version of CPMPXY, mappings 1 through 3 are completely implemented (both forward and reverse), so a "3." is returned as the value of YINP; other mappings are not implemented at all, so a "0." is returned as the value of YINP. When CPMPXY is called with IMAP = 1, the incoming X and Y coordinates are assumed to represent longitude and latitude, respectively; the Ezmap routine MAPTRA is called to find the X and Y coordinates of the projection of the specified point on the globe, and those coordinates are returned as the outgoing X and Y coordinates. When IMAP = -1, the incoming X and Y coordinates are assumed to be the X and Y coordinates of a projected point; the Ezmap routine MAPTRI is called to find the longitude and latitude of the original point on the globe, and those values are returned as the outgoing X and Y coordinates. When IMAP = 2, the incoming X and Y coordinates are assumed to represent rho and theta (in degrees) in polar coordinates; from these are computed the output X and Y coordinates. When IMAP = -2, the incoming X and Y coordinates are used to compute rho and theta and those values are returned. If IMAP is anything else, the input X and Y coordinates are simply returned as the output X and Y coordinates. A user version of CPMPXY can be made to do any desired mapping. It should also be made, when IMAP = 0, to return correct information about its own capabilities.
To use CPMPXY, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order.
Online: conpack, cpback, cpchcf, cpchcl, cpchhl, cpchil, cpchll, cpcica, cpclam, cpcldm, cpcldr, cpcltr, cpcnrc, cpdrpl, cpezct, cpgetc, cpgeti, cpgetr, cplbam, cplbdr, cpmviw, cpmvrw, cppkcl, cppklb, cprect, cprset, cpscae, cpsetc, cpseti, cpsetr, cpsps1, cpsps2, ncarg_cbind
Hardcopy: NCAR Graphics Contouring and Mapping Tutorial
Copyright (C) 1987-2009
University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
March 1993 | UNIX |