CMUY(3NCARG)

πŸ“¦ version 6.6.2, in epel 9, fedora 43, fedora 44

πŸ’– CMUY πŸ’– β€” or, the whole spps_converters squad, bestie

okay so. this is the CMUY page from NCAR GRAPHICS, but plot twist: it's actually the manual page for the whole spps_converters friend group, and CMUY is just the one whose name is on the door. CMUY converts from metacode coordinates to user coordinates. that's the whole vibe. πŸ¦‹


✨ NAME ✨

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, and I'm not gatekeeping, literally all of these:

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. yes we're counting. πŸ’…


🚨 STATUS 🚨

ngl, this is the part where I have to be the bearer of bad news.

Plotter Address Units (PAUs) and Metacode Units (MUs) are no longer used in NCAR Graphics. so literally every function with either an M or a P as the second or third letter of the function name is considered obsolete. they're retired. they're living their best life off the grid. don't call them, bestie, they won't answer. πŸ’€

the current recognized coordinate systems are:

  • GKS world coordinates
  • GKS normalized device coordinates
  • NCAR Graphics fractional coordinates
  • NCAR Graphics user coordinates

for descriptions of these coordinate systems, go read the NCAR Graphics document "NCAR Graphics Fundamentals, UNIX Version". it's giving required reading. πŸ“š

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 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 eat):

X = CFUX (RX),  Y = CFUY(RY)
X = CUFX (RX),  Y = CUFY(RY)

Obsolete (the ones we mourn, but respectfully):

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. it's an X coordinate in the coordinate system specified by the second letter of the function name. In a reference to CFUX, RX is a fractional X coordinate; in a reference to CUFX, RX is a user X coordinate. so the name literally tells you the lore. πŸ”₯
  • RY β€” an input expression of type REAL. it's a Y coordinate in the coordinate system specified by the second letter of the function name. In a reference to CFUY, RY is a fractional Y coordinate; in a reference to CUFY, RY is a user Y coordinate.
  • IX and IY β€” these occur as arguments only 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). 🫢

now, the naming scheme, because it's lowkey genius and once you see it you can't unsee it:

  • the first letter of the function name is a C if the result is of type REAL and a K if the result is of type INTEGER (the latter only happens for some of the obsolete ones). this conforms to the usual FORTRAN convention for implicit typing. fr fr, it's not random, it's a whole system.
  • 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 CFUX and CFUY, the result is in the user system; in references to CUFX and CUFY, the result is in the fractional system. see? the name is just the recipe. ✨
  • the fourth letter of the function name is an X or a Y, depending on whether an X or a Y coordinate is being converted. iconic. no notes.

🌸 C-BINDING DESCRIPTION 🌸

The C-binding argument description is the same as the FORTRAN argument description. that's it, that's the whole section, we love an efficient 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. go look at it, bestie, it's educational AND cute. πŸ“–


⭐ 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
  • 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. (yes, the original says "load the load the" β€” I am a professional and I am reproducing it exactly, do not @ me 😭)


πŸ” 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 (C) 1987-2009 University Corporation for Atmospheric Research

The use of this Software is governed by a License Agreement.


🫢 okay so that's the page!! CMUY and the rest of the spps_converters crew, straight from NCAR GRAPHICS, dated March 1993, living under the UNIX banner as SPPS_converters(3NCARG). the M and P girlies are obsolete, the C and K girlies are thriving, and you now know exactly which letter means what. go convert something. slay. πŸ’…βœ¨
πŸ“¦ where this page comes from