KFPY(3NCARG)
π KFPY π β from the NCAR GRAPHICS manual, section 3NCARG
okay bestie, buckle up, we're doing the SPPS coordinate converters and honestly? it's giving β¨math girlieβ¨ but it's also giving obsolete, so let's get into it π
πΈ NAME πΈ
KFPY β Converts from fractional coordinates to plotter address unit coordinates. that's it, that's the whole job, she's a converter π
π¦ NAME (yes again, it's a whole family) π¦
spps_converters β A 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 as follows: 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 functions. a whole squad. a friend group, if you will π«Ά
β οΈ STATUS β οΈ
okay so here's the tea and it's slightly sad: 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. bestie they are retired, they are on permanent vacation, do not build new stuff on them π
The current recognized coordinate systems are GKS world coordinates, GKS normalized device coordinates, NCAR Graphics fractional coordinates, and NCAR Graphics user coordinates. See the NCAR Graphics document "NCAR Graphics Fundamentals, UNIX Version" for descriptions of these coordinate systems. (it's the lore doc, go read it π)
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 β so basically, for archaeology πΊ:
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 has a default value of 10. Values of MX and MY can be set by calling the routines SETI or SETUSV and retrieved 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 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 that still slay π ):
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 π
- RX β (an input expression of type
REAL) is 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 type
REAL) 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. - IX and IY β these only show up as arguments in references to some of the obsolete functions; they represent 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).
okay now the naming system, because this is genuinely the cutest part, it's like a little code π§:
- 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.
so like. you can literally read the function name like a sentence. iconic behavior fr fr π
π C-BINDING DESCRIPTION π
The C-binding argument description is the same as the FORTRAN argument description. no notes, copy-paste queen π
π 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. (yes the more command. she's old but she works πΈ)
π 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.
To use any of the conversion routines, load the load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. (order matters bestie, do not freestyle the link order π)
π 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, you ate, go convert some coordinates πβ¨
signing off from the UNIX corner of the NCAR GRAPHICS manual, dated March 1993, filed under SPPS_converters(3NCARG) and KFPY(3NCARG) β mwah, no cap π«ΆπΈ
π¦ 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