CFUX(3NCARG)
π NAME π
Bestie. Gather round π«Ά this is the CFUX page from the NCAR GRAPHICS manual, living in the 3NCARG section, and honestly? It does exactly one thing and it does it flawlessly.
CFUX β converts from fractional coordinates to user coordinates. That's the whole plot, no cap β¨
π STATUS π
Okay so first thing: Plotter Address Units (PAUs) and Metacode Units (MUs) are no longer used in NCAR Graphics π periodt. Which means every single function with either an M or a P as the second or third letter of its name is considered obsolete. They're retired. Iconic in their day, but their day is over.
The coordinate systems that are currently recognized 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". It's giving textbook but it's required reading, sorry bestie π
Now, for the purpose of interpreting and converting codes which use PAUs or MUs, here are the definitions:
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 retrieve them by calling GETSI or GETUSV. Look at us, doing configuration π
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. Little history lesson, you're welcome π
β¨ SYNOPSIS β¨
Current, as in, the ones you should actually be using:
X = CFUX (RX), Y = CFUY(RY)
X = CUFX (RX), Y = CUFY(RY)
Obsolete, as in, look but don't touch π:
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 π¦
For the C girlies (me, I'm the C girlies):
#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 πΈ
Let's decode the arguments, because they're all doing something, okay:
RXβ an input expression of typeREAL, and it's an X coordinate in the coordinate system specified by the second letter of the function name. In a reference toCFUX,RXis a fractional X coordinate; in a reference toCUFX,RXis a user X coordinate.RYβ an input expression of typeREAL, and it's 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, 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, iykyk).
Now the naming scheme, because this is genuinely so clever and I need you to appreciate it π
- The first letter is a
Cif the result is of typeREAL, and aKif the result is of typeINTEGER(and the K situation only happens for some of the obsolete ones). This is just the usual FORTRAN convention for implicit typing, keeping it classic. - The second letter tells you the coordinate system of the argument.
- The third letter tells you 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.
It's a whole alphabet soup and every letter eats π₯
π C-BINDING DESCRIPTION π
The C-binding argument description is the same as the FORTRAN argument description. So take everything from DESCRIPTION above, bestie, it still applies. Nothing new, no plot twist π
π EXAMPLES π
Use the ncargex command to see the following relevant examples which use coordinate converters: mpex10, cbex10, sfex02, epltch.
And check this out β running:
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. Free real estate, go look at it π
π ACCESS π
There were 24 conversion functions in the original set. Twenty-four!! These functions (12 for the X coordinate of a point, and 12 for the Y coordinate) let you convert between any combination of PAUs, MUs, fractional coordinates, and user coordinates. A whole era.
But PAUs and MUs are now obsolete, so only four of the conversion functions are still pertinent:
CFUXandCFUYlet you convert the X and Y coordinates of a point from the fractional system to the user system.CUFXandCUFYdo the exact opposite.
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 be chaotic about it π
π₯ SEE ALSO π₯
Online: cfux, cfuy, cmfx, cmfy, cmux, cmuy, cpfx, cpy, 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.
π§ NAME π§ (page two, the spps_converters one, because the manual is giving bonus content)
spps_converters β a set of functions, each of which transforms a coordinate from one of the NCAR Graphics coordinate systems to another. Here's the complete list, and yes, we're listing all of them:
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 functions, one big family reunion π«Ά
And that's the whole thing, bestie π This page comes to you from the UNIX manual, dated March 1993, filed under SPPS_converters(3NCARG). Yes, 1993. Yes, it still slays. No cap πβ¨
π¦ 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