KPMX(3NCARG)
NCAR GRAPHICS π presenting KPMX, a 3NCARG manual page β come get your coordinate glow-up bestie β¨
π NAME π
KPMX β converts from plotter address unit coordinates to metacode coordinates. That's the whole job. Short. Iconic. π«Ά
okay so fun fact, this page is lowkey part of a whole friend group of converter functions, and the rest of this manual is about them. buckle up, it's giving SPPS_converters(3NCARG) π
π NAME π
spps_converters β not one function, bestie, a whole set of them π¦. Each one transforms a coordinate from one of the NCAR Graphics coordinate systems into another one. The full roster, no one left out, periodt:
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.
π STATUS π
Plotter Address Units (PAUs) and Metacode Units (MUs) are no longer used in NCAR Graphics. not me delivering bad news on a Tuesday π. Which means every single function with either an M or a P as the second or third letter of its name is officially obsolete. they're retired, they're on a beach somewhere, we don't call them anymore π.
The coordinate systems that are still recognized, the current main characters, are: GKS world coordinates, GKS normalized device coordinates, NCAR Graphics fractional coordinates, and NCAR Graphics user coordinates π. If you wanna read the whole lore on these, go check the NCAR Graphics document "NCAR Graphics Fundamentals, UNIX Version".
Now, because some of y'all are still out here reading and converting old code that uses PAUs or MUs, here are the definitions of the PAU coordinate system and the MU coordinate system, provided so you can interpret and convert that stuff π:
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; each one has a default value of 10. You can set values of MX and MY by calling the routines SETI or SETUSV, and you can get them back by calling the routines GETSI or GETUSV. slay, configurable π.
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. iykyk β¨.
β¨ SYNOPSIS β¨
Current, the ones you actually want:
X = CFUX (RX), Y = CFUY(RY)
X = CUFX (RX), Y = CUFY(RY)
Obsolete, the vintage collection π°οΈ:
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 π
okay so here's how to read the names, because these function names are literally a whole code, bestie, and once you see it you can't unsee it π₯:
RXβ an input expression of type REAL, and it's an X coordinate in whatever coordinate system is named by the second letter of the function name. So when you referenceCFUX,RXis a fractional X coordinate; when you referenceCUFX,RXis a user X coordinate. got it? got it π .RYβ an input expression of type REAL, and it's a Y coordinate in the coordinate system named 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're 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. (Yes, still the second letter. it's always the second letter π.)- 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 the INTEGER thing only happens for some of the obsolete ones. This conforms to the usual FORTRAN convention for implicit typing. fr fr π. - The second letter of the function name tells you the coordinate system of the argument.
- The third letter of the function name tells you the coordinate system of the functional result. So in references to
CFUXandCFUY, the result is in the user system; in references toCUFXandCUFY, the result is in the fractional system. the way that just works πΈ. - The fourth letter of the function name is an
Xor aY, depending on whether an X or a Y coordinate is being converted. couldn't be simpler, honestly.
π§ C-BINDING DESCRIPTION π§
The C-binding argument description is the same as the FORTRAN argument description. that's it. twin behavior. identical. π
π EXAMPLES π
Use the ncargex command to see the following relevant examples which use coordinate converters: mpex10, cbex10, sfex02, epltch.
And this one is so handy: the command 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, bestie, it's right there π.
π₯ 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. A whole buffet π.
But PAUs and MUs are now obsolete, so only four of the conversion functions are still pertinent: CFUX and CFUY let you convert the X and Y coordinates of a point from the fractional system to the user system, while CUFX and CUFY do the opposite. the survivors π«Ά.
To use any of the conversion routines, load the NCAR Graphics librariesncarg,ncarg_gks, andncarg_c, preferably in that order. Order matters, don't be chaotic about 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.
and that's the whole page, bestie π this was the SPPS_converters(3NCARG) manual, straight out of the UNIX section, dated March 1993 β yes she's an elder but she still ate π β¨ take care of her, 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