KPMY(3NCARG)
π KPMY(3NCARG) β the spps_converters glow-up π
okay bestie, welcome to the NCAR GRAPHICS corner of the manual, this is the page for KPMY and also for the whole spps_converters squad, and yes they share a page, it's giving group project but make it iconic. β¨
πΈ NAME πΈ
KPMY β converts from plotter address unit coordinates to metacode coordinates. (yes babe, that's the plotter β metacode pipeline, we'll get there.)
spps_converters β a whole set of functions, each one transforms a coordinate from one of the NCAR Graphics coordinate systems into another. The complete list of functions is, and I need you to breathe, this is a lot:
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 of them. twenty-four. π
π¨ STATUS π¨
Plotter Address Units (PAUs) and Metacode Units (MUs) are no longer used in NCAR Graphics. So literally every function that has either anMor aPas the second or third letter of its name is considered obsolete. retired. on the shelf. collecting dust. π«Ά
The coordinate systems that are still recognized today are:
- GKS world coordinates
- GKS normalized device coordinates
- NCAR Graphics fractional coordinates
- NCAR Graphics user coordinates
If you want the full description of those, go read the NCAR Graphics document "NCAR Graphics Fundamentals, UNIX Version". it's giving required reading, ngl.
Now, because old code exists and we are not monsters, here are the definitions of the PAU system and the MU system, so you can interpret and convert code that still uses PAUs or MUs:
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 MX and MY by calling SETI or SETUSV, and you can get them back by calling 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. π
β¨ SYNOPSIS β¨
Current, the ones you actually want:
X = CFUX (RX), Y = CFUY(RY)
X = CUFX (RX), Y = CUFY(RY)
Obsolete, the ones we still list out of respect:
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 the whole naming scheme is a little poem, let me read it to you:
RXβ (an input expression of typeREAL) is an X coordinate in the coordinate system specified by the second letter of the function name. So in a reference toCFUX,RXis a fractional X coordinate; in a reference toCUFX,RXis a user X coordinate.RYβ (an input expression of typeREAL) is 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're input expressions of typeINTEGER, and they specify the X and Y coordinates of a point in either PAUs or MUs, depending on the second letter of the function name.
and now the letters themselves, the alphabet lore:
- The first letter of the function name is a
Cif the result is of typeREAL, and aKif the result is of typeINTEGER(theKthing only happens for some of the obsolete ones). This conforms to the usual FORTRAN convention for implicit typing. iconic, honestly. - 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. So 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.
π¦ C-BINDING DESCRIPTION π¦
The C-binding argument description is the same as the FORTRAN argument description. same vibe, same facts, we're not retyping it. π
π EXAMPLES π
Use the ncargex command to see the following relevant examples which use coordinate converters: mpex10, cbex10, sfex02, epltch.
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, 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. absolutely unhinged combinatorics, we love her.
But PAUs and MUs are now obsolete, so only four of the conversion functions are still pertinent:
CFUXandCFUYβ convert the X and Y coordinates of a point from the fractional system to the user system.CUFXandCUFYβ do the opposite. π
To use any of the conversion routines, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. (the original page genuinely says "load the load the" and honestly? relatable, we've all been there, but you only need to do it once.) π
π SEE ALSO π
Online: cfux, cfuy, cmfx, cmfy, cmux, cmuy, cpfx, cpy... no wait, bestie, let me be careful: 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 that's the whole page, you ate it, no cap. this one came out of the UNIX manual, March 1993, filed under SPPS_converters(3NCARG) β mwah, go convert something. πβ¨ππ¦
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms