HAFTON(3NCARG)

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

πŸ’– HAFTON (from section 3NCARG of the NCAR Graphics manuals) πŸ’–

okay bestie, sit down, we're doing graphics πŸ’… this one lives in the NCAR Graphics man pages, and it's genuinely iconic in a "my grandma's plotter did this" kind of way.


✨ NAME ✨

HAFTON β€” draws a half-tone picture from data stored in a rectangular array, with the intensity in the picture proportional to the data value. that's the whole thing. that's the gig. πŸŽ€


πŸ› οΈ UTILITY πŸ› οΈ

This routine is part of the Halftone utility in NCAR Graphics. wanna see the overview man page for this whole utility? type:

man halftone

and you're in. 🫢


πŸ’€ STATUS πŸ’€

HAFTON is obsolete. not "a little old", not "vintage", obsolete. It has been replaced by the CPCICA entry of the Conpack contouring package.

HAFTON continues to be provided for compatibility of early NCAR Graphics codes. so it's still here, holding the door open for legacy code like the loyal friend it is 😭

If you are writing new code, we suggest that you use CPCICA. fr fr. listen to the manpage on this one. ✨


πŸ“œ SYNOPSIS πŸ“œ

CALL HAFTON (Z,L,M,N,FLO,HI,NLEV,NOPT,NPRM,ISPV,SPVAL)

that's eleven arguments. count them. eleven. she's a lot but she's worth it πŸ’œ


🌈 DESCRIPTION 🌈

okay here's the whole cast of characters, one by one:

  • Z β€” (an input array of type REAL) defining a two-dimensional field to be half-tone plotted. a subset of Z of extent M by N can be plotted. you don't have to give her the whole grid, she'll take a slice πŸ“
  • L β€” (an input parameter of type INTEGER) which is the first dimension of the Z array. just the leading dimension, housekeeping, nbd.
  • M β€” (an input parameter of type INTEGER) which is the extent of the first dimension of array Z to be plotted. This allows for a sub-array of Z to be plotted. M must be less than or equal to L. respect the bound or it's over for you 🫠
  • N β€” (an input parameter of type INTEGER) which is the extent of the second dimension of array Z to be plotted. This allows for a sub-array of Z to be plotted. N must be less than or equal to the second dimension of Z. same energy, other axis. no cap.
  • FLO β€” (an input parameter of type REAL) defining a lowest level for plotting. If FLO = HI = 0., the minimum value of Z will be generated by HAFTON. so if you zero out both ends, she'll go find her own floor πŸ’…
  • HI β€” (an input parameter of type REAL) defining a highest level for plotting. If HI = FLO = 0., the maximum value of Z will be generated by HAFTON. same deal, other end of the elevator πŸŽ€
  • NLEL β€” (an input parameter of type INTEGER) specifying the number of intensity levels desired. 16 maximum. If NLEV = 0 or 1, 16 levels are used.
not me pointing out that the original spells this one NLEL here but NLEV everywhere else including the synopsis πŸ™ˆ i'm not fixing it, i'm just telling you so you don't think you broke something. it's giving typo. it's fine. πŸ’–
  • NOPT β€” (an input parameter of type INTEGER) used to control the mapping of Z onto the intensities. The sign of NOPT controls the directness or inverseness of the mapping. this is the main character of the argument list, buckle up πŸ‘‘
    • NOPT positive yields direct mapping. The largest value of Z produces the most dense dots. On mechanical plotters, large values of Z will produce a dark area on the paper. With the film development methods used at NCAR, large values of Z will produce many (white) dots on the film, also resulting in a dark area on reader-printer paper. so: big number β†’ lots of dots β†’ dark. plotter or film, same destiny, different flavour πŸ–€
    • NOPT negative yields inverse mapping. The smallest values of Z produce the most dense dots resulting in dark areas on the paper. flip it and reverse it πŸ”„
    • The absolute value of NOPT determines the mapping of Z onto the intensities. For IABS(NOPT):
      • = 0 β€” The mapping is linear. For each intensity there is an equal range in Z value.
      • = 1 β€” The mapping is linear. For each intensity there is an equal range in Z value.
      • = 2 β€” The mapping is exponential. For larger values of Z, there is a larger difference in intensity for relatively close values of Z. Details in the larger values of Z are displayed at the expense of the smaller values of Z. big numbers get the spotlight, small ones get cropped out of the group photo 😭
      • = 3 β€” The mapping is logarithmic, so details of smaller values of Z are show at the expense of larger values of Z. (yes, "are show". i said what i said, the manpage said what it said. the small values are the moment now ✨)
      • = 4 β€” Sinusoidal mapping, so mid-range values of Z show details at the expense of extreme values of Z. mid, and i mean that as a compliment this time πŸŽ€
      • = 5 β€” Arcsine mapping, so extreme values of Z are shown at the expense of mid-range
okay so that last one literally just stops mid-sentence in the original. no period. no nothing. she simply walked off stage πŸ’€ i'm leaving it exactly like that because that's canon.
  • NPRM β€” (an input parameter of type INTEGER) used to control the drawing of a perimeter around the half-tone picture.
    • NPRM=0: The perimeter is drawn with ticks pointing at data locations. (Side lengths are proportional to number of data values.) lil tick marks, very cute, very precise πŸ“
    • NPRM positive: No perimeter is drawn. The picture fills the frame. maximalist. she takes up all the space πŸ‘‘
    • NPRM negative: The picture is within the confines of the user's current viewport setting. she knows her lane and stays in it πŸ¦‹
  • ISPV β€” (an input parameter of type INTEGER) used to tell if the special value feature is being used. The special value feature is used to mark areas where the data is not known or holes are wanted in the picture. this is the "idk what's here so i'm not drawing here" feature πŸ™ˆ
    • ISPV = 0: Special value feature not in use. SPVAL is ignored.
    • ISPV non-zero: Special value feature in use. SPVAL defines the special value. Where Z contains the special value, no half-tone is drawn. If ISPV
      • = 0 β€” Special value feature not in use. SPVAL is ignored.
      • = 1 β€” Nothing is drawn in special value area.
      • = 2 β€” Contiguous special value areas are surrounded by a polygonal line.
      • = 3 β€” Special value areas are filled with X(s).
      • = 4 β€” Special value areas are filled in with the highest intensity.
  • SPVAL β€” (an iput parameter of type REAL) used to denote missing values in the Z array. This argument is ignored if ISPV = 0.
"an iput parameter" πŸ’€ one typo, two typos, three typos, honestly she's just like me fr. keeping it. it's part of the lore now.

πŸ”‘ ACCESS πŸ”‘

To use HAFTON, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. in that order. i'm not being dramatic, the manpage said "preferably in that order" and i'm just the messenger 🫢


πŸ‘€ SEE ALSO πŸ‘€

Online: halftone, ezhftn, halftone_params, conpack, conpack_params, cpcica

Hardcopy: NCAR Graphics Contouring and Mapping Tutorial; NCAR Graphics Fundamentals, UNIX Version; User's Guide for NCAR GKS-0A Graphics

(the hardcopies are giving library-core, honestly iconic 🌸)


Copyright (C) 1987-2009
University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.

and that's the page bestie!! this one shipped with UNIX, dated March 1993 β€” so go forth, load those three libraries, and remember: she's obsolete, she knows it, and she still slays πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from