KFMY(3NCARG)
β¨ KFMY β¨ β a lil NCAR Graphics page, bestie edition π
okay so real quick, this whole thing lives in the NCAR Graphics manual (the 3NCARG section, if you're keeping score), and it's technically filed under KFMY but honestly it's also the family portrait for a whole squad of coordinate-converter functions called SPPS_converters. Grab a strawberry π and let's get into it.
π NAME π
KFMY β she converts from fractional coordinates to metacode coordinates. that's the whole job. that's her whole thing. periodt. π
And the group name? spps_converters β it's a set of functions, each one transforming a coordinate from one NCAR Graphics coordinate system to another. The full roster is, deep breath:
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.
that's 24 besties. no cap. π
β οΈ STATUS β οΈ
Plotter Address Units (PAUs) and Metacode Units (MUs) are no longer used in NCAR Graphics. so literally every function with anMor aPas the second or third letter of the name is considered obsolete. it's giving legacy code. π
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 lore on those, go read the NCAR Graphics document "NCAR Graphics Fundamentals, UNIX Version". π
Now, because some of y'all are still out here reading old code, here are the definitions of the PAU and MU coordinate systems, provided for the purpose of interpreting and converting codes which use 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, and each one has a default value of 10. You can set MX and MY by calling the routines SETI or SETUSV, and you can 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's 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 β¨
The ones you should actually be using:
Current:
X = CFUX (RX), Y = CFUY(RY)
X = CUFX (RX), Y = CUFY(RY)
The ones that are, respectfully, obsolete:
Obsolete:
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 π
yes bestie, there's a C binding too, she's bilingual π
#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 here's the decoding ring for the argument names, because these are positional meanings, not vibes:
RXβ an input expression of typeREAL, 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, a Y coordinate in the coordinate system specified by the second letter of the function name. So 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, specifying the X and Y coordinates of a point in either PAUs or MUs β which one depends on the second letter of the function name. π«
Now the naming scheme, and honestly? it ate. every letter is load-bearing:
- The first letter is a
Cif the result is of typeREAL, and aKif the result is of typeINTEGER(which only happens for some of the obsolete ones). This conforms to the usual FORTRAN convention for implicit typing. π - The second letter specifies the coordinate system of the argument.
- The third letter 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 is an
Xor aY, depending on whether an X or a Y coordinate is being converted.
likeβ¦ four letters, four jobs. iconic. π
π C-BINDING DESCRIPTION π
The C-binding argument description is the same as the FORTRAN argument description. same energy, different syntax, we love a consistent queen. π
π§ EXAMPLES π§
Use the ncargex command to see the following relevant examples which use coordinate converters: mpex10, cbex10, sfex02, epltch. π₯
And fr fr, this one is 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.
so you can literally just pull the driver down and read it with more. no gatekeeping. πΈ
π«Ά 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. iconic range, truly.
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. that's it. four girls carrying the whole legacy. π
To use any of the conversion routines, load the load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. (yes, the original says "load the load the" β I'm not touching it, that's canon, we respect the text π)
β 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 π go forth and convert those coordinates, you absolute main character. stay fractional, stay iconic, and remember: the Ms and the Ps are obsolete, so don't let anyone catch you using them in 2025. π¦β¨
this lil walkthrough was brought to you by the SPPS_converters page, straight outta the NCAR Graphics collection, dated March 1993, living under the UNIX banner. 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