KMPY(3NCARG)
π NAME π
KMPY β bestie, this one converts from metacode coordinates to plotter address unit coordinates. That's it. That's the whole job. β¨
πΈ NAME (yes again, it's a two-for-one page, don't @ me) πΈ
spps_converters β it's giving a whole squad of functions, each one transforming a coordinate from one NCAR Graphics coordinate system into another. The complete list of functions is, and I quote:
CFUX, CFUY, CMFX, CMFY, CMUX, CMUY, CPFX, CPFY, CPUX, CPUY, CUFX, CUFY, KFMX, KFMY, KFPX, KFPY, KMPX, KMPY, KPMX, KPMY, KUMX, KUMY, KUPX, and KUPY.
Twenty-four icons. Periodt. π
π STATUS π
Okay so, real talk, this is the part where the plot twists:
- Plotter Address Units (PAUs) and Metacode Units (MUs) are no longer used in NCAR Graphics. So literally every function with either an
Mor aPas the second or third letter of the function name is considered obsolete. Gone. Retired. Living its best life in the archives. πͺ¦
The coordinate systems that actually count rn are:
- GKS world coordinates
- GKS normalized device coordinates
- NCAR Graphics fractional coordinates
- NCAR Graphics user coordinates
If you want the full descriptions of these coordinate systems, go read the NCAR Graphics document "NCAR Graphics Fundamentals, UNIX Version". It's giving required reading, ngl.
Now β the following definitions of the PAU coordinate system and the MU coordinate system are provided for the purpose of interpreting and converting codes which use PAUs or MUs, so listen up:
The plotter coordinates of a point are integers IPX and IPY, where IPX is between 1 and 2**MX and IPY is between 1 and 2**MY. MX and MY are internal parameters of SPPS, and each one has a default value of 10. You can set values of MX and MY by calling the routines SETI or SETUSV, and retrieve them by calling the routines GETSI or GETUSV.
The metacode coordinates of a point are integers IMX and IMY between 0 and 32767 inclusive. The area addressed is a square in a "metacode space" that is usually mapped into a square subset of the addressable area of the plotting device. Metacode coordinates were used in calls to the routine PLOTIT and are returned in calls to FL2INT. That's the lore. π
β¨ SYNOPSIS β¨
Current (the ones that still slap):
X = CFUX (RX), Y = CFUY(RY)
X = CUFX (RX), Y = CUFY(RY)
Obsolete (vintage, collector's edition):
X = CMUX (IX), Y = CMUY(IY)
X = CPUX (IX), Y = CPUY(IY)
X = CMFX (IX), Y = CMFY(IY)
X = CPFX (IX), Y = CPFY(IY)
I = KFMX (RX), J = KFMY(RY)
I = KUMX (RX), J = KUMY(RY)
I = KFPX (RX), J = KFPY(RY)
I = KUPX (RX), J = KUPY(RY)
I = KPMX (IX), J = KPMY(IY)
I = KMPX (IX), J = KMPY(IY)
π¦ C-BINDING SYNOPSIS π¦
#include <ncarg/ncargC.h>
float c_cfux (float rx)
float c_cfuy (float ry)
float c_cufx (float rx)
float c_cufy (float ry)
π DESCRIPTION π
RXβ an input expression of type REAL, and it's an X coordinate in the coordinate system specified by the second letter of the function name. So when you're referencingCFUX,RXis a fractional X coordinate; when you're referencingCUFX,RXis a user X coordinate. Second letter tells you where you're coming from. π«ΆRYβ an input expression of type REAL, a Y coordinate in the coordinate system specified by the second letter of the function name. In a reference toCFUY,RYis a fractional Y coordinate; in a reference toCUFY,RYis a user Y coordinate.IXandIYβ these only show up as arguments in references to some of the obsolete functions. They represent input expressions of type INTEGER, specifying the X and Y coordinates of a point in either PAUs or MUs (depending on the second letter of the function name, obviously).
Now the naming scheme, because it's actually so clever once it clicks:
- The first letter of the function name is a
Cif the result is of type REAL, and aKif the result is of type INTEGER (and theKsituation only happens for some of the obsolete ones). This conforms to the usual FORTRAN convention for implicit typing. Respect the classics. π - The second letter of the function name specifies the coordinate system of the argument.
- The third letter of the function name specifies the coordinate system of the functional result. In references to
CFUXandCFUY, the result is in the user system; in references toCUFXandCUFY, the result is in the fractional system. - The fourth letter of the function name is an
Xor aY, depending on whether an X or a Y coordinate is being converted. No mystery there, bestie.
π C-BINDING DESCRIPTION π
The C-binding argument description is the same as the FORTRAN argument description. Same facts, different font. Iconic behaviour, honestly. π
π₯ EXAMPLES π₯
Use the ncargex command to see the following relevant examples which use coordinate converters: mpex10, cbex10, sfex02, epltch.
And specifically β this command right here:
ncargex -n mpex10
...will load the driver mpex10.f into your current working directory, where you can examine the file using a local editor, or the UNIX more command. Go look at it. Be nosy. It's good for you. π
π ACCESS π
There were 24 conversion functions in the original set. These functions (12 for the X coordinate of a point, and 12 for the Y coordinate) allowed one to convert between any combination of PAUs, MUs, fractional coordinates, and user coordinates. That's the full rainbow. π
But PAUs and MUs are now obsolete, so only four of the conversion functions are still pertinent:
CFUXandCFUYβ these let you convert the X and Y coordinates of a point from the fractional system to the user systemCUFXandCUFYβ these do the opposite
That's the whole roster now. Four functions carrying the entire legacy on their backs. Main character energy fr fr. π
To use any of the conversion routines, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. Order matters, don't fight it.
π SEE ALSO π
Online: cfux, cfuy, cmfx, cmfy, cmux, cmuy, cpfx, cpfy, cpux, cpuy, cufx, cufy, kfmx, kfmy, kfpx, kfpy, kmpx, kmpy, kpmx, kpmy, kumx, kumy, kupx, kupy, spps, ncarg_cbind
Hardcopy: NCAR Graphics Fundamentals, UNIX Version; User's Guide for NCAR GKS-0A Graphics
πΈ COPYRIGHT πΈ
Copyright (C) 1987-2009 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
okay bestie that's the whole page, you ate it, no crumbs left π
β¨ this little love letter lives in the NCAR GRAPHICS manual as KMPY(3NCARG), it came from SPPS_converters(3NCARG) on UNIX, and it's dated March 1993 β vintage, iconic, and still slaying. bye mwah π«Άπ
π¦ where this page comes from
- epel 9: ncl-devel 6.6.2-59.el9 Β· LicenseRef-Callaway-BSD
- fedora 43: ncl-devel 6.6.2-58.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: ncl-devel 6.6.2-62.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms