STUMTA(3NCARG)

๐Ÿ’– NAME ๐Ÿ’–

okay bestie, so STUMTA is a user-modifiable routine from NCAR Graphics (yes, the 3NCARG girlies โœจ). You hand it the coordinates of a point on a streamline in data, user, AND NDC space, plus the interpolated, normalized components of the vector at that point relative to data coordinate space โ€” and it finds the directional angle of the streamline relative to NDC space at that point. it's giving geometry, it's giving mapping internals ๐Ÿ’…


โœจ SYNOPSIS โœจ

CALL STUMTA (XDA,YDA,XUS,YUS,XND,YND,DU,DV,TA,IST)

๐Ÿ“– DESCRIPTION ๐Ÿ“–

here's the full cast of characters, no skips, no skips, we love every single one ๐Ÿซถ

  • XDA (REAL, input) โ€” the X coordinate of a point on the streamline, in the data coordinate system. ๐Ÿ’™
  • YDA (REAL, input) โ€” the Y coordinate of a point on the streamline, in the data coordinate system. ๐Ÿ’™
  • XUS (REAL, input) โ€” the X coordinate of the point, in the user coordinate system. ๐ŸŒฑ
  • YUS (REAL, input) โ€” the Y coordinate of the point, in the user coordinate system. ๐ŸŒฑ
  • XND (REAL, input) โ€” the X coordinate of the point, in NDC space. ๐Ÿ”ฎ
  • YND (REAL, input) โ€” the Y coordinate of the point, in NDC space. ๐Ÿ”ฎ
  • DU (REAL, input) โ€” the interpolated value of the normalized component of the vector at the point, with direction parallel to the X axis of the data coordinate system. โญ
  • DV (REAL, input) โ€” the interpolated value of the normalized component of the vector at the point, with direction parallel to the Y axis of the data coordinate system. โญ
  • TA (REAL, output) โ€” THE MOMENT. ๐Ÿ‘‘ the directional angle of the streamline at the point, relative to NDC space. this is the whole point of the function, she's the main character.
  • IST (REAL, output) โ€” status of the mapping operation, and listen, the values matter:
    • 0 โ€” success ๐ŸŽ‰
    • negative values โ€” the mapping failed ๐Ÿ˜ญ
    • positive values โ€” reserved, so do NOT use them if you're implementing a mapping routine. hands off, bestie, those aren't yours.

๐Ÿ› ๏ธ USAGE ๐Ÿ› ๏ธ

so here's the tea โ˜• โ€” STUMTA is a user-modifiable routine, provided to support custom mappings of the data coordinate space. You do not call it directly. ever. nope. not you. ๐Ÿ™ˆ

Instead: whenever the parameter MAP specifies a mapping that Streamlines doesn't handle internally โ€” i.e. when MAP is set to a value other than 0, 1, or 2 โ€” Streamlines calls STUMTA once for each incremental step in the creation of a streamline. so it's like, every little baby step along the curve, it's checking in. obsessed. ๐Ÿฆ‹

The default version of STUMTA is lowkey simple: it just returns the angle implied by the incremental vector components passed to it โ€” that is, it returns ATAN2(DV,DU). slay, queen, no notes. โœจ

Now, to implement a custom mapping, you have to:

  1. pick a unique mapping code โ€” a positive integer greater than 2 ๐Ÿ”ข
  2. modify each of the three routines โ€” STUMXY, STUIXY, and STUMTA โ€” so they recognize and respond consistently to the chosen code. all three. together. friendship bracelet energy. ๐Ÿซถ

In the standard distribution of NCAR Graphics, these three routines live together in a single file, stumxy.f ๐Ÿ 

  • STUMXY maps a point from data to user coordinate space.
  • STUIXY inversely maps a point from user to data coordinate space.
  • STUMTA โ€” which is likely to be the most difficult to implement ๐Ÿ˜ฎโ€๐Ÿ’จ โ€” finds the tangent angle of the streamline at a point in NDC space.

๐Ÿซง the common block situation ๐Ÿซง

STUMTA has access to a common block called STMAP, which contains a bunch of variables used to record the current transformation state. ๐Ÿ“ฆ

To accommodate a variety of mapping implementations, STMAP provides more information than is normally required. And bestie, listen closely:

Consider the values stored in STMAP as strictly read-only. do not touch. look with your eyes only. ๐Ÿ‘€๐Ÿšซ

One essential member of this common block is IMAP, which contains the value currently assigned to the MAP parameter. โญ


๐ŸŒ€ implementing a non-linear mapping ๐ŸŒ€

ngl, when you're implementing a non-linear mapping, an iterative differential technique will most likely be required. ๐Ÿ˜ฎโ€๐Ÿ’จ

Go look at the routine STMPTA in stmpxy.f, which handles the pre-defined mappings, for examples of the method. ๐Ÿ“š

Both of these use such a technique:

  • the default transformation (MAP set to 0) โ€” this one does it in order to account for possible log scaling of the user coordinate axes ๐Ÿ“
  • the Ezmap projection (MAP set to 1) ๐Ÿ—บ๏ธ

Basically the idea is this: the vector components must be proportionally reduced in size enough that an effectively "instantaneous" angle can be calculated. but โ€” and this is the important but โ€” they must not become so small that the calculation is adversely affected by the floating point precision available for the machine. tiny little numbers = chaos. ๐Ÿ’€

Additionally, checks must be put in place to prevent the increment from stepping off the edge of the coordinate system space. ๐Ÿšง

And the pre-defined mappings? they step in the opposite direction to find the angle whenever an increment in the original direction would fall off the edge. iconic problem-solving honestly ๐Ÿ‘‘


๐Ÿ”‘ ACCESS ๐Ÿ”‘

To use STUMTA, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c โ€” preferably in that order. order matters, bestie, we're not animals ๐ŸŽ€


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

Online: stgetc, stgeti, stgetr, stinit, stream, streamlines, streamlines_params, strset, stsetc, stseti, stsetr, stuixy, stumsl, stumxy, ncarg_cbind

Hardcopy: NCAR Graphics Fundamentals, UNIX Version ๐Ÿ“–


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!! ๐Ÿ’œ this one's from the NCAR GRAPHICS manual set โ€” the UNIX flavor โ€” dated April 1993 (a vintage queen ๐Ÿ‘‘), and the page name is STUMTA(3NCARG) if you ever need to pull it back up. go forth and compute those tangent angles, you've got this fr fr ๐ŸŒˆโœจ๐Ÿฆ‹