HAFTON(3NCARG)
π 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 π
HAFTONis obsolete. not "a little old", not "vintage", obsolete. It has been replaced by theCPCICAentry 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 typeREAL) defining a two-dimensional field to be half-tone plotted. a subset ofZof 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 typeINTEGER) which is the first dimension of theZarray. just the leading dimension, housekeeping, nbd.Mβ (an input parameter of typeINTEGER) which is the extent of the first dimension of arrayZto be plotted. This allows for a sub-array ofZto be plotted.Mmust be less than or equal toL. respect the bound or it's over for you π«Nβ (an input parameter of typeINTEGER) which is the extent of the second dimension of arrayZto be plotted. This allows for a sub-array ofZto be plotted.Nmust be less than or equal to the second dimension ofZ. same energy, other axis. no cap.FLOβ (an input parameter of typeREAL) defining a lowest level for plotting. IfFLO=HI=0., the minimum value ofZwill be generated byHAFTON. so if you zero out both ends, she'll go find her own floor πHIβ (an input parameter of typeREAL) defining a highest level for plotting. IfHI=FLO=0., the maximum value ofZwill be generated byHAFTON. same deal, other end of the elevator πNLELβ (an input parameter of typeINTEGER) specifying the number of intensity levels desired. 16 maximum. IfNLEV=0or1, 16 levels are used.
not me pointing out that the original spells this oneNLELhere butNLEVeverywhere 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 typeINTEGER) used to control the mapping ofZonto the intensities. The sign ofNOPTcontrols the directness or inverseness of the mapping. this is the main character of the argument list, buckle up πNOPTpositive yields direct mapping. The largest value ofZproduces the most dense dots. On mechanical plotters, large values ofZwill produce a dark area on the paper. With the film development methods used at NCAR, large values ofZwill 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 π€NOPTnegative yields inverse mapping. The smallest values ofZproduce the most dense dots resulting in dark areas on the paper. flip it and reverse it π- The absolute value of
NOPTdetermines the mapping ofZonto the intensities. ForIABS(NOPT):= 0β The mapping is linear. For each intensity there is an equal range inZvalue.= 1β The mapping is linear. For each intensity there is an equal range inZvalue.= 2β The mapping is exponential. For larger values ofZ, there is a larger difference in intensity for relatively close values ofZ. Details in the larger values ofZare displayed at the expense of the smaller values ofZ. big numbers get the spotlight, small ones get cropped out of the group photo π= 3β The mapping is logarithmic, so details of smaller values ofZare show at the expense of larger values ofZ. (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 ofZshow details at the expense of extreme values ofZ. mid, and i mean that as a compliment this time π= 5β Arcsine mapping, so extreme values ofZare 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 typeINTEGER) 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 πNPRMpositive: No perimeter is drawn. The picture fills the frame. maximalist. she takes up all the space πNPRMnegative: 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 typeINTEGER) 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.SPVALis ignored.ISPVnon-zero: Special value feature in use.SPVALdefines the special value. WhereZcontains the special value, no half-tone is drawn. IfISPV= 0β Special value feature not in use.SPVALis 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 withX(s).= 4β Special value areas are filled in with the highest intensity.
SPVALβ (an iput parameter of typeREAL) used to denote missing values in theZarray. This argument is ignored ifISPV=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 Β©οΈ
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
- 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