                 UTILSUP

            Math and misc. useful utilities


ARSIN    Vax util  Function to return R*4 arc sin.
BATPRT   printer   Printer header/trailer labels batch print jobs
BOUNDS   util      Prints message if value out of range
CATIME   util      Sets times in expanded and compact forms
COMPAR   util      Compare 2 arrays for equality of all elements
COPY     util      Moves one integer array into another
DARSIN   VAX util  Function to return R*8 arc sin.
DAT2JD   util      Converts date & time to Real*8 Julian date
DECONV   Util      Deconvolves a 2-D gaussian from another 2-D gaus.
DFLOAT   MOD util  Floats normal integer*4 to real*8 full accuracy
DIE      File util Close all open files, clear cat. flags, destroy
                   scratch files using common /CFILES/
DIETSK   Task util Close down message, restart AIPS, close accounting
FILL     util      Fills an integer array with a constant
FILZCH   util      Replaces blank chars with '0' chars
FMATCH   util      Finds spec. (sub)array in bigger array
FMAX     util      Find position & valued of maximum array element.
FRMT     util      Encodes floating number, removes trailing zeros
GREG     util      Converts Julian date to civil date in char form
IFPC     util      Function returns # reals to hold n characters
IINITP   util      function returns integer index from F.P. index
IREALP   util      Function returns real index given integer index
IROUND   util      Function returns nearest integer of floating 
ISIGN    util      Function returns abs(ARG1) for ARG2 >= 0 or
                   - abs(ARG1) for ARG2 < 0.
IWPC     util      Function returns # integer words to hold n chars
IWPR     util      Function returns # integer words to hold n reals
JULDAY   util      Converts (char) civil date to Julian date
MATVMU   util      Does vector times matrix multiply
METSCA   plot util Scales data & prefix to nearest metric range
MOM      util      Computes moments of data in array
NAMEST   cat util  Puts compact name.class.seq string in a string
NBYPX    util      Function returns # bytes/pixel from header code #
NMATCH   util      Returns array position of next non-matching word.
OVLIOR   util      Extracts real value from any point in integer array
OVLROI   util      Inserts a real anywhere in an integer array
PLNGET X util      Reads, rotates, zero pads, cat. image to scratch.
PLNPUT X util      Writes sub image from scratch file to catlged file.
RANDIN   util      Initializes common for RANDUM 
RANDUM   util      Computes random numbers from 0.0 to 1.0 
RCOPY    util      Copies one real array to another
RFILL    util      Fills real array with a constant
SPFIL    util      Fills string from null to end with blanks
TIMDAT   util      Converts integer array form of time & date to string
TRIM     util      Trims leading and trailing blanks from a string.
ZDATE    util      Returns current calendar date
ZDCHIN   util      Initializes device characteristics common
ZDELAY   util      Delays calling program for spec. time
ZENDPG   printer   Advances printer at end of printout
ZGTBIT   util      Extracts bits from an integer word
ZMATH4   util      Does arithmetic with pseudo I*4 arguments
ZMOVE    util      General purpose byte movement
ZPTBIT   util      Puts array of bits into integer word
ZR8P4    util      Converts between R*8 and I*4.
ZTIME    util      Returns current time
ZUNADD X util      Adds signed and unsigned integers, unsigned result
ZUNSGN X util      Converts a R*4 value to an unsigned I*2


            Character utilities


CHCOMP   util       Compares two packed character strings
CHCOPY   util       Copies one packed string into another
CHFILL   util       Fills packed string with a character
CHPAC2   util       Packs a string from input in form 2 chars/integer
CHPACK   util       Packs a string from input in form 4 chars/real
CHXPN2   util       Unpacks string to output form 2 chars/integer
CHXPND   util       Unpacks string to output form 4 chars/real
ZGETCH   util       Gets one character from a real -> 0\ch
ZPUTCH   util       Inserts one character into a real


            Position utilities


AXEFND   util      Finds axis number of given type (unif or rand)
COORDD   util      Convert angles between degrees and sexigesimal units
DIRCOS   util      Determinines direction cosines between two points.
DIRDEC   util      Given RA, MM pixel findds Dec and LL pixel
DIRRA    util      Given Dec, LL pixel finds RA and MM pixel
FNDX     util      Using LOCATI, given Y coord value, X pixel pos finds
                   X coord value
FNDY     util      Given X coord value, Y pixel pos finds Y coord value
IMA2MP   TV util   Convert image pixel to map pixel coord using ImCat
MP2IMA   TV util   Convert map pixel to image pixel coord
MP2SKY   Map util  Convert Map pixel to sky coord using cat block
NEWPOS   util      Obtains (ra,dec) from input (ra,dec) and dir. cos.
ROTFND   util      Finds map (or uv data) rotation angle.
SETLOC   util      Inits common LOCATI given map header. IMPORTANT
SKY2MP   Map util  Convert sky coord to map pixel using cat block
SKYFRM   Plot util Formats sky coordinates
XYPIX    util      Determines pixel location corresponding to a coord.
XYVAL    util      Determines coordinate corresponding to a pixel loc.


            Plot utilities: general


GCHAR    Plot util Puts draw char. string command in plot file
GFINIS   Plot util Puts end plot in plot file, closes file
GINIT    Plot util Creates, opens and inits plot file
GINITG   Plot util Puts init for gray scale data in plot file
GINITL   Plot util Puts init for line drawing data in plot file
GMCAT    Plot util Puts image catalogue info in plot file
GPHWRT   Plot util Writes a record into a plot file
GPOS     Plot util Puts a position (dark) vector command in plot file
GRAYPX   Plot util Puts a write gray scale command in plot file
GVEC     Plot util Puts a plot (bright) vector command in plot file
LABINI   Plot util Inits LOCATI common for labeling plots
SLBINI   Plot util Inits LOCATI common for labeling slice plots
TEKFLS   TEK util  Writes and zeros TEK output buffer.
TEKVEC   TEK util  Puts vector control characters into TEK buffer.
ZTKBUF   TEK util  Puts a given byte into the TEK I/O buffer.


            Plot utilities: combined


CLAB1    Plot util Labels axes, calls CTICS for plot files with normal
                   2-D labeling
COMLAB   Plot util Basic plot label control: calls GINITL, does
                   documentary labels incl. LEVS
CONDRW   Contour   Puts commands for a contour plot into plot file
CTICS    Plot util Write tick marks, RA/DEC ("normal") labeling
SCALMM   util      Computes scaling parameters to get arcsec / mm
SKYFRM   Util      Formats sky coordinates
TICCOR   Plot util Converts delta LL,MM ticks to delta RA,DEC


            Parsing utilities (see Popsup.doc also)


GETLOG   util      Get a logical value from input buffer.
GETNUM   Pops util Get a number from input buffer
GETSTR   Pops util Get a char string in 's from input buffer
GETSYM   util      Get a keyword from an input buffer.  For FITS-tape.
KPACK    util      Packs loose char buffer (X\b Y\b -> X\Y)
UNPACK   util      Loosens char buffer (X\Y -> X\b Y\b)


            Less general utilities


CHSTAT   1st I/O   Change read/write status of map file
COMOFF   2nd I/O   Compute block offsets to map subarray
COMPAX   Hdr util  Compares 2 axes of 2 map headers
EXTCOP   Ext util  Copies EXTINI/EXTIO type extension files
EXTINI   Ext util  Creates/inits a generalized type of extension file
EXTIO    Ext util  Does IO for the Extini-type extension files
I2TOR4   util      Copies a catalogued I*2 map to uncat. R*4 map.
MAPCLR   Cat util  Unmarks (READ,WRIT) catalog files.
MAPSIZ   File util Computes # bytes required for a map file
MAPSNC   File util Creates and opens scratch file for maps
MSCALE   2nd I/O   Reads floating pt file, rescales and writes map file
MSCALF   2nd I/O   As MSCALE but for maps with blanking
MSCALI   2nd I/O   Floats an integer map with blanking
PRTMSG * util      Prints message file for spec. user #, min priority
R4TOI2   util      Writes R*4 uncat. map to an I*2 catalogued map.
SNEVAL   Map util  Corrects map row for blanking, substitutes specified
                   value for blanked pixels
SNEVWT   Map util  Corrects map row for blanking, returns weight row
SNRVAL   Map util  Substitutes spec value for blanked floating pixels
STXT     Map util  Convert map status # to char string equivalent
SWAPAX   Hdr util  Swaps two axes in header
WINDOW   2nd I/O   Correct user-supplied window parameters
WRBLNK   I/O util  Fills a plane with blanked pixels
WRPLAN   I/O util  Copies 2-dim map into a plane of a 3-dim map
ZB2ASC   VAX util  MAR routine to convert binary to ASCII
ZC8CL    util      Converts standard ASCII to local characters
ZCLC8    util      Converts local characters to standard ASCII
ZGTBYT   util      Extracts half-integer from word -> 0\val
ZI16IL   util      Converts standard integer buffers to local integers
ZI32IL   util      Converts standard double integer buffers to local,
                   but IBM-ordered, double integer
ZI8L8    util      Converts standard half-integer to local bytes
ZILI16   util      Converts local integer buffer to standard integers
ZITOCH   VAX util  MAR converts integer array to type CHARACTER
ZPTBYT   util      Inserts half-integer into word
ZSETL    VAX util  Set length on VAX character string.
ZTRIM    VAX util  Removes trailing blanks from type CHARACTER


            Math utilities for fitting


COVAR    util      Compute covariance matrix of a matrix
DPMPAR   util      Return computer precision parms
ENORM    util      Compute SQRT(sum(A(i)**2)), care for under/overflows
GETERR   Appl      Gets error of fit parameters
LMDER    util      Minimize sum squares of M non-linear equations
LMDER1   util      Calls LMDER specifying some of the parms
LMSTR    util      See LMDER.  Saves core by using a row
LMSTR1   util      Calls LMSTR specifying some of the parms
LMPAR    util      Solves matrix eq. A * X = B
QRFAC    util      Does "QR" factorization of matrix for QRSOLV
QRSOLV   util      Solves matrix eq. A * X = B
RWUPDT   util      Called by LMSTR for non-linear l.sq. fitting
