CPUY(3NCARG)
π CPUY(3NCARG) β NCAR GRAPHICS π
okay bestie, welcome to the CPUY page from the NCAR GRAPHICS manual β¨ this one's a coordinate-converter situation and it comes bundled with its whole little family, SPPS_converters(3NCARG), so buckle up π
πΈ NAME πΈ
CPUY β converts from plotter address unit coordinates to user coordinates.
and also, because this page is a two-for-one deal:
spps_converters β a whole set of functions, each of which transforms a coordinate from one of the NCAR Graphics coordinate systems to another. the complete list of functions is, and I quote, literally this: 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 π
ngl this is the part where you find out half of these are giving β¨ vintage β¨ in the "we don't do that anymore" way.
Plotter Address Units (PAUs) and Metacode Units (MUs) are no longer used in NCAR Graphics; thus, all functions with either an M or a P as the second or third letter of the function name are considered obsolete. π«
The current recognized coordinate systems are:
- GKS world coordinates
- GKS normalized device coordinates
- NCAR Graphics fractional coordinates
- NCAR Graphics user coordinates
See the NCAR Graphics document NCAR Graphics Fundamentals, UNIX Version for descriptions of these coordinate systems. π
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:
- The plotter coordinates of a point are integers
IPXandIPY, whereIPXis between1and2**MXandIPYis between1and2**MY.MXandMYare internal parameters of SPPS; each has a default value of10. Values ofMXandMYcan be set by calling the routinesSETIorSETUSVand retrieved by calling the routinesGETSIorGETUSV. - The metacode coordinates of a point are integers
IMXandIMYbetween0and32767inclusive. 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 routinePLOTITand are returned in calls toFL2INT.
β¨ SYNOPSIS β¨
Current (the ones that actually still slay):
X = CFUX (RX), Y = CFUY(RY)
X = CUFX (RX), Y = CUFY(RY)
Obsolete (respectfully, these are the ancestors πͺ¦):
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 the naming scheme works, and honestly it's giving cryptic-cipher-but-make-it-elegant π₯
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.IXandIYoccur as arguments only in references to some of the obsolete functions; they represent input expressions of typeINTEGER, specifying the X and Y coordinates of a point in either PAUs or MUs (depending on the second letter of the function name).- The first letter of the function name is a
Cif the result is of typeREALand aKif the result is of typeINTEGER(the latter only happens for some of the obsolete ones). This conforms to the usual FORTRAN convention for implicit typing. - 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.
π C-BINDING DESCRIPTION π
The C-binding argument description is the same as the FORTRAN argument description. no notes, it's just identical, periodt π
π 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 peek 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. PAUs and MUs are now obsolete; thus, only four of the conversion functions are still pertinent: CFUX and CFUY allow one to convert the X and Y coordinates of a point from the fractional system to the user system, while CUFX and CUFY do the opposite. β¨ 24 in, 4 standing, that's the vibe check β¨
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 really does say "load the load the" β I'm keeping it, character for character, that's canon π«Ά)
π§ 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 π₯Ή the version of this one is SPPS_converters(3NCARG), it came out of the UNIX manual, and it's dated March 1993 β so if you're reading this, you're reading certified vintage NCAR lore ππ« slay, bye π
π¦ 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