SUN/238.9

Starlink Project
Starlink User Note 238.9

D.S. Berry
Malcolm J. Currie

2022 January 18


KAPLIBS – Internal subroutines used within the KAPPA package.

Version 3.5

Programmer’s Reference



Abstract

KAPLIBS is a package of Fortran subroutine libraries which were originally written as part of the KAPPA package (a package of general-purpose image-processing and visualization tools). KAPLIBS provides software developers with access to many of the internal KAPPA routines, so that KAPPA-like applications can be written and built independently of KAPPA.

Contents

1 Introduction
 1.1 Stability of the KAPLIBS Interface
 1.2 The Scope of this Document
2 Naming Conventions
3 Compiling and Linking
 3.1 Linking with Native PGPLOT
A Changes in Version 3.5
B Changes in Version 3.4
C Changes in Version 3.3
D Changes in Version 3.2
E Changes in Version 3.1
F Changes in Version 3.0
G Changes in Version 2.8
H Changes in Version 2.7
I Changes in Version 2.6
J Changes in Version 2.5
K Changes in Version 2.4
L Changes in Version 2.3
M Changes in Version 2.2
N Changes in Version 2.1
O Changes in Version 2.0
P Routine Descriptions
AIF_ANTMP – Annuls a locator to a temporary object, thereby erasing the object
AIF_ASFIO – Opens a sequential file via a parameter
AIF_FLNAM – Returns the name of a file as a character string given its parameter name
AIF_GETVM – Obtains a pointer and a locator to mapped HDS workspace
AIF_OPFIO – Opens a Fortran sequential file by name
AIF_PTFNM – Writes the name of an HDS file to a parameter
AIF_TEMP – Create a temporary HDS object
CCG_AD1x – Combines data lines using absolute deviations from an unweighted mean
CCG_AD3x – Combines data lines using absolute deviations from an unweighted mean
CCG_BM1x – Combines data lines using a broadened median
CCG_BM3x – Combines data lines using a broadened median
CCG_CLIPx – Sets any data outside a given value range BAD
CCG_CNT1x – Combines data lines by counting pixels
CCG_CNT3x – Combines data lines by counting pixels
CCG_COMB1x – Combines a stack of array lines into one line, using a variety of methods
CCG_COMB3x – Combines a stack of array lines into one line, using a variety of methods
CCG_CS1x – Combines data lines using a sigma-clipped standard deviation
CCG_CS3x – Combines data lines using a sigma-clipped standard deviation
CCG_FLX1x – Combines data lines using the integrated value
CCG_FLX3x – Combines data lines using the integrated value
CCG_FM1x – Combines data lines using a fast median
CCG_FM3x – Combines data lines using a fast median
CCG_FRC1x – Combines data lines by counting pixels
CCG_FRC3x – Combines data lines by counting pixels
CCG_I2WCx – Assigns world co-ordinates to an output array from an input list of indices
CCG_IS2x – Sorts a list of data into increasing order, and applies the corresponding shuffle to an ancillary list
CCG_IS3x – Sorts a list of data into increasing order, and applies the corresponding shuffle to two ancillary lists
CCG_IWC1x – Combines data lines using the intensity-weighted co-ordinate
CCG_IWC3x – Combines data lines using the intensity-weighted co-ordinate
CCG_IWD1x – Combines data lines using the dispersion of the intensity-weighted co-ordinate
CCG_IWD3x – Combines data lines using the dispersion of the intensity-weighted co-ordinate
CCG_KTHx – Returns the Kth smallest value in an array
CCG_MD1x – Combines data lines using a weighted median
CCG_MD3x – Combines data lines using a weighted median
CCG_ME1x – Combines data lines using a weighted mean
CCG_ME3x – Combines data lines using a weighted mean
CCG_MM1x – Combines data lines using a min-max exclusion trimmed mean
CCG_MM3x – Combines data lines using a min-max exclusion trimmed mean
CCG_MN1x – Combines data lines using the minimum value
CCG_MN3x – Combines data lines using the minimum value
CCG_MO1x – Combines data lines using a mode
CCG_MO3x – Combines data lines using a mode
CCG_MX1x – Combines data lines using the maximum value
CCG_MX3x – Combines data lines using the maximum value
CCG_ORVAR – Returns the variances and covariances of the order statistics from n to 1, assuming an initially normal distribution
CCG_RMS1x – Combines data lines using the root mean square
CCG_RMS3x – Combines data lines using the root mean square
CCG_SCR1 – Combines data lines using a sigma-clipped mean
CCG_SC3x – Combines data lines using a sigma-clipped mean
CCG_SD1x – Combines data lines using an unweighted standard deviation
CCG_SD3x – Combines data lines using an unweighted standard deviation
CCG_SM1x – Combines data lines using a sigma-clipped median
CCG_SM3x – Combines data lines using a sigma clipped median
CCG_SUM1x – Combines data lines using the sum of values
CCG_SUM3x – Combines data lines using the sum of values
CCG_TC1x – Combines data lines using a threshold-clipped mean
CCG_TC3x – Combines data lines using a threshold-clipped mean
CCG_TM1x – Combines data lines using a trimmed mean
CCG_TM3x – Combines data lines using a trimmed mean
CCG_TMN2x – Forms the n-trimmed mean of the given set of ordered data
CCG_TMN3x – Forms the n-trimmed mean of the given set of ordered data. This variant does not process variances
CCG_TRM2x – Forms the trimmed mean of the given set of ordered data, returning flags showing which values are used
CCG_TRM3x – Forms the trimmed mean of the given set of ordered data, returning flags showing which values are used. This variant does not process variances
CCG_UM1x – Combines data lines using an unweighted mean
CCG_UM3x – Combines data lines using an unweighted mean
CCG_WCWIx – Creates a channel-width array from the channel co-ordinates
CCG_WMD2x – Estimates the mean of a number of normally distributed data values, some of which may be corrupt
CCG_WMD3x – Estimates the mean of a number of normally distributed data values, some of which may be corrupt
CCG_WTM2x – Forms the weighted median of a list of ordered data values. Incrementing the contributing pixel buffers
CCG_WTM3x – Forms the weighted median of a list of ordered data values. Incrementing the contributing pixel buffers and estimating the variance change
CCG_WTM4x – Forms the weighted median of a list of ordered data values. Incrementing the contributing pixel buffers and estimating the variance change
FTS1_ASTWN – Displays any AST warning messages stored in the supplied FitsChan
FTS1_AXIS – Creates an axis structure within an NDF from FITS header information
FTS1_BLCAR – Determines whether or not the first card in a FITS record has a blank keyword
FTS1_BLVAL – Blanks out the value from a FITS-header card
FTS1_BSWAP – Swaps adjacent bytes in an array of bytes
FTS1_CHVAx – Replaces all occurrences of a value in an array with another value
FTS1_COMNT – Gets the value of a FITS COMMENT card from a buffer of cards
FTS1_CRNDF – Creates an NDF for a FITS data array, generating the NDF s name in some circumstances
FTS1_DREAD – Obtains a FITS record from a disk file
FTS1_DTYPE – Obtains the input data type, scales and offsets for a FITS file
FTS1_EDFEX – Edits non-reserved keyword cards in a FITS extension of an NDF
FTS1_EDKEY – Edits keywords in a FITS card array
FTS1_EVKEY – Extracts a keyword and occurrence, and validates the keyword
FTS1_FNDFS – Reads the first FrameSet from the supplied FitsChan
FTS1_FRMT – Obtains the input and output data format for a FITS file
FTS1_FTWCS – Uses co-ordinate system information in the supplied FITS headers to create WCS and AXIS components in an NDF
FTS1_GKEYC – Gets the value and comment of a named header of type CHARACTER from a buffer of FITS-header card images
FTS1_GKEYx – Gets the value and comment of a named header from a buffer of FITS-header card images
FTS1_GPARM – Adds the group parameters to the FITS header records
FTS1_GVALC – Extracts a string value from a FITS header
FTS1_HDLOG – Outputs the FITS header cards to an ASCII file
FTS1_I2VXD – Converts a vector of 64-bit IEEE floating-point numbers to Vax-D format
FTS1_I2VXR – Converts a vector of 32-bit IEEE floating-point numbers to Vax-F format
FTS1_INKEY – Inserts keywords to a FITS card array
FTS1_ISKEY – Inquires whether or not a string is a valid FITS keyword
FTS1_LOKEY – Locates an occurrence of a keyword in a FITS header
FTS1_MANDH – Obtains the values of the mandatory headers in a FITS file
FTS1_NDFCM – Creates the title, units, axes, WCS, and FITS extension in an NDF from the FITS headers
FTS1_NDF – Makes an NDF from a simple or group-format FITS file
FTS1_PHEAD – Processes the headers in a FITS file on tape or disk
FTS1_PRVAL – Prints the value of a specified card in an array of FITS headers
FTS1_PTKEY – Puts non-reserved keyword cards into the FITS extension of an NDF file
FTS1_QTYPE – Determines the data type of a FITS header value
FTS1_RDATA – Reads the data of a FITS file on disk or tape
FTS1_RFMOD – Reads a text file containing instructions for editing an NDF s FITS extension
FTS1_RGRDA – Reads the data of a FITS file in group format from disk or tape
FTS1_RNAND – Replaces NaN values with bad values in a vector of 64-bit IEEE floating-point numbers
FTS1_RNANR – Replaces NaN values with bad values in a vector of 32-bit IEEE floating-point numbers
FTS1_ROOTN – Creates the rootname for an NDF
FTS1_RSTAB – Reads the table format from a FITS file and write to a text file
FTS1_SCOFB – Applies scale and zero to a REAL data vector, and substitutes magic values for blank FITS data
FTS1_SCTAB – Creates an ASCII catalogue and description file in SCAR format from a FITS tape or disk file
FTS1_SDSCF – Creates a SCAR description file from a FITS table-format headers
FTS1_SKIP – Skips over the data of a FITS file
FTS1_UKEYC – Writes the value of type CHARACTER to a keyword from a buffer of FITS-header card images
FTS1_UKEYx – Writes the value to the specified keyword from a buffer of FITS-header card images
FTS1_VHEAD – Validates a FITS header card and reconstitutes to the standard
FTS1_WCSAX – Re-creates AXIS structures from a WCS component FrameSet
FTS1_WCSDF – Sees if two FrameSets are different after being written to a FitsChan
FTS1_WCSIM – Imports WCS information from the supplied FitsChan into the supplied NDF
FTS1_WCSUT – Removes the spurious copy of the AXIS Frame which is left in WCS component when using non-Native encodings
FTS1_WKEYC – Writes a FITS-header card for a CHARACTER value or a comment
FTS1_WKEYx – Writes a FITS-header card
IRA_ANNUL – Annuls an IRA identifier
IRA_CLOSE – Closes down the IRA astrometry package
IRA_CONVT – Converts sky co-ordinates from one system to another
IRA_CREAT – Create an identifier for specified astrometry information
IRA_CTOD1 – Converts a single formatted sky co-ordinate value into a double-precision value
IRA_CTOD – Converts formatted sky co-ordinate values into double-precision values
IRA_DTOC1 – Convert a single floating=point sky co-ordinate value to character form
IRA_DTOC – Converts a pair of double-precision sky co-ordinate values to character form
IRA_EXPRT – Stores astrometry information in an NDF
IRA_FIND – Finds an astrometry structure within an NDF
IRA_GETCO – Obtains a pair of sky co-ordinates from the ADAM environment
IRA_GETEQ – Extracts the epoch of the reference equinox from a string specifying a Sky Co-ordinate System
IRA_GTCO1 – Obtains a single sky co-ordinate value from the ADAM environment
IRA_GTSCS – Gets the full name of a Sky Co-ordinate System (with equinox specifier) from the environment
IRA_IDEPOCH – Gets the epoch associated with an IRA identifier
IRA_IDPROJN – Gets the projection name associated with an IRA identifier
IRA_IDPROJP – Get a projection parameter value associated with an IRA identifier
IRA_IDSCS – Gets the Sky Co-ordinate System associated with an IRA identifier
IRA_INIT – Initialises the IRA astrometry package
IRA_IPROJ – Returns a list of supported projection names
IRA_ISCS – Return a list of supported sky coordinate systems
IRA_LOCAT – Sets the location for new IRA astrometry structures
IRA_NORM – Converts sky co-ordinate values to the equivalent first-order values
IRA_READ – Gets an identifier for astrometry information stored in an HDS astrometry structure
IRA_SETEQ – Encodes the epoch of a reference equinox within an SCS name
IRA_TRANS – Transforms co-ordinate data
IRA_WRITE – Writes astrometry information into an HDS object
KPG1_ABSET – Separates a list of items into a character array
KPG1_AGATC – Reports the character attributes of the current picture in the graphics database
KPG1_AGFND – Selects the highest picture of a given name within the current AGI picture
KPG1_AGREF – Obtains a name of or a locator to an object referenced in the graphics database
KPG1_AINBx – Obtains for an axis the equivalent index co-ordinates given axis values
KPG1_AINDx – Obtains for an axis the equivalent index co-ordinates given axis values
KPG1_AKERx – Smooths a two-dimensional array using an arbitrary rectangular kernel
KPG1_ALIGN – Align a pair of 2-dimensional arrays using a least squares fit
KPG1_ALSYS – Allows the user to change the AlignSystem attribute in a Frame
KPG1_ARCOG – Allows the user to select an array component in a supplied NDF
KPG1_ARCOL – Forms a list of the available array components in an NDF
KPG1_ASAGD – Transforms AGI world co-ordinates to AGI data co-ordinates
KPG1_ASALN – Set Alignment attributes for a Frame to mimic a second frame
KPG1_ASAPA – Determines which pixel axis is most closely aligned with a WCS axis
KPG1_ASCRV – Draws a polyline using AST
KPG1_ASDIS – Finds the distance between two points
KPG1_ASDSV – Finds the distances between a set of points
KPG1_ASFFR – Finds an Frame with a given Domain within a FrameSet
KPG1_ASFGT – Creates a new Frame specified through the environment
KPG1_ASFIL – Reads spatial positions from a text file
KPG1_ASFIX – Modifies the WCS FrameSet of an NDF to take account of re-gridding the pixel array
KPG1_ASFRM – Sets the current Frame in a FrameSet to a Frame specified through the environment
KPG1_ASGDP – Finds a position with good output co-ordinates within a given input region of a supplied Mapping
KPG1_ASGET – Gets an AST FrameSet from the WCS component of an NDF
KPG1_ASGFR – Reads a line of an AST Object description from a GRP group
KPG1_ASGFW – Writes a line of an AST Object description to a GRP group
KPG1_ASGRD – Draws a border or an annotated co-ordinate grid over an AST Plot
KPG1_ASGRP – Reads spatial positions from a GRP group
KPG1_ASIRA – Creates an AST FrameSet from an IRAS90 astrometry structure
KPG1_ASLOG – Takes log base 10 of each axis value (an AST IntraMap routine)
KPG1_ASMRG – Merges two FrameSets by aligning them in a common Frame
KPG1_ASNDF – Creates a FrameSet containing NDF-special Frames with given bounds
KPG1_ASOFF – Finds a position offset by a given distance from one position towards another position
KPG1_ASPCL – Applies clipping to a Plot so that border and co-ordinate grid are restricted to the well bahaved regions
KPG1_ASPLG – Stores a given KeyMap for future use by KPG1_ASPLN
KPG1_ASPLN – Draws a line for an AST Plot and log it at the same time
KPG1_ASPLT – Creates an AST Plot covering the current PGPLOT viewport
KPG1_ASPRP – Propagates the WCS component from one NDF to another with the same number of axes, allowing for a linear mapping of the pixel co-ordinates
KPG1_ASPSY – Establishes synonyms for AST attribute names
KPG1_ASPTP – Puts a formatted AST position into a string
KPG1_ASREF – Associates an NDF optionally from a reference name or locator
KPG1_ASREG – Registers all AST IntraMaps known by KAPPA
KPG1_ASRGG – Registers all graphical AST IntraMaps known by KAPPA
KPG1_ASRGN – Registers all non-graphical AST IntraMaps known by KAPPA
KPG1_ASSET – Allows the specification of attribute values for an AST Object
KPG1_ASSHR – Shrinks a Plot so that it covers an area which allows all annotation to fit within the specified area
KPG1_ASSIG – Ensures that the Current Frame from an NDF WCS FrameSet has no insignificant axes
KPG1_ASSIM – Simplifies a FrameSet
KPG1_ASSIR – Sets the attributes of a SkyFrame to match an IRAS90 SCS
KPG1_ASSMP – Returns co-ordinates at evenly spaces positions along a given poly-line
KPG1_ASSPL – Gets a set of one-dimensional Mappings for each axis in a FrameSet
KPG1_ASSTS – Applies an attribute setting to a Plot
KPG1_ASSTY – Checks for synonyms and colour names in AST attribute settings
KPG1_AST2H – Copies AST_ data to an HDS object
KPG_ASTCMN – Defines functional accessor/setter interface to KPG_AST common block
KPG1_ASTRM – Trims axes from the current Frame of a FrameSet
KPG1_ASTTL – Sets the Title attribute of a Plot
KPG1_AVLUT – Associates, validates and maps an lookup table stored in an NDF
KPG1_AXANO – Generates an axis annotation from the NDF s axis label and units
KPG1_AXBNx – Finds the bounds of an NDF s axis centre co-ordinates
KPG1_AXCOx – Obtains for an axis the axis indices given their values
KPG1_AXEXx – Calculates the extent of an NDF along an axis
KPG1_AXGVx – Finds the first axis centre co-ordinate of an NDF above a threshold
KPG1_AXLIx – Determines whether an array s values are equally spaced
KPG1_AXLVx – Finds the first axis centre co-ordinate of an NDF below a threshold
KPG1_AXRNG – Calculates the extent of an NDF along an axis
KPG1_AXTYP – Determines the implementation type for NDF axis arrays
KPG1_AXVLx – Obtains the axis-array values given their corresponding pixel co-ordinates
KPG1_BADBX – Obtains an NDF section containing all good data in the supplied NDF
KPG1_BBOXx – Determines the bounding box of selected pixels in an n-dimensional array
KPG1_BILNR – Performs bi-linear interpolation checking for bad values
KPG1_BL1Dx – Smooths a one-dimensional vector using a block-average filter
KPG1_BLOCx – Smooths a two-dimensional image using a rectangular box filter
KPG1_BOR2x – Places a border of constant values at the edges of a two-dimensional array
KPG1_CADDx – Adds a constant to each element of a vectorised array
KPG1_CCPRO – Gets a character component for an output NDF with optional propagation from another NDF
KPG1_CEIL – Returns the smallest integer larger than or equal to a supplied value
KPG1_CGET – Obtains an NDF character component, removing escape sequences
KPG1_CH2PM – Creates an AST PolyMap describing a Starlink POLYNOMIAL HDS structure
KPG1_CHAXx – Checks for usable AXIS structures
KPG1_CHE2X – Evaluates a two-dimensional Chebyshev polynomial
KPG1_CHELx – Replaces the value of an array element with a specified value
KPG1_CHEPx – Evaluates a Chebyshev polynomial
KPG1_CHEVx – Evaluates a one-dimensional Chebyshev polynomial
KPG1_CHVAx – Replaces all occurrences of a value in an array with another value
KPG1_CMADx – Compresses an n-dimensional array by summing in ‘rectangular boxes
KPG1_CMAVx – Compresses an n-dimensional array by averaging in ‘rectangular boxes
KPG1_CMPKx – Compresses an n-dimensional array by picking value at equally spaced intervals
KPG1_CMULD – Multiplies each element of a vectorised double precision array by a constant
KPG1_CMULx – Multiplies each element of a vectorised array by a constant
KPG1_CMULK – Multiplies each element of a vectorised 64-bit integer array by a constant
KPG1_CMVDx – Compresses n-dimensional data and variance arrays by summing in ‘rectangular boxes
KPG1_CMVVx – Compresses n-dimensional data and variance arrays by averaging in ‘rectangular boxes
KPG1_CNLIM – Parses a character string into integer bounds
KPG1_COLNM – Finds the named colour nearest to an RGB triple
KPG1_COPYC – Copies a one-dimensional array of character strings
KPG1_COPY – Copies an array of a given type to another array of the same type
KPG1_CORRx – Calculates the correlation coefficient between two arrays
KPG1_CPBDx – Copies bad pixels
KPG1_CPNTx – Creates a primitive NDF with a title via the parameter system
KPG1_CPSTY – Copies the plotting style for an AST element to another AST element
KPG1_CROUT – Creates and returns locators to the top-level and data-array of an NDF-type structure
KPG1_CSHFT – Shifts the characters left or right in a string
KPG1_CSUBx – Subtracts a constant from each element of a vectorised array
KPG1_CTCKM – Copies values from catalogue columns to an AST KeyMap
KPG1_CTCPC – Copies string values from a catalogue column to a GRP group
KPG1_CTCPx – Copies values from catalogue columns to an array
KPG1_D2W2x – Converts linear data co-ordinates to world co-ordinates
KPG1_DANOT – Generates an annotation from the NDF s label and units
KPG1_DARAx – Determines the data limits for an array using a variety of methods
KPG1_DATCP – Gets an AST FrameSet from an NDF
KPG1_DAUNI – Generates a string containing the units of an NDF s data or variance component allowing for truncation
KPG1_DCLIx – Determines a linear transformation from pixel to NDF-axis co-ordinates
KPG1_DEBUG – Determines whether the specified package should report debug diagnostics
KPG1_DIVx – Divides two vectorised arrays with optional variance information
KPG1_DNAG2R – Converts an NAG Hermitian Fourier transform array into an array usable by FFTPACK routine KPG1_DRFFTB
KPG1_DR2NAG – Converts an FFTPACK Hermitian Fourier transform array into the equivalent NAG array
KPG1_DSFR1 – Displays a textual description of the Current Frame in a FrameSet
KPG1_DSFRM – Displays a textual description of the Current Frame in a FrameSet
KPG1_DSSFM – Displays information about the storage form of an NDF array
KPG1_DWSOx – Obtains for the scale and offset for a linear transformation from world to data co-ordinates
KPG1_ELGAU – Calculates the axis ratio, inclination and minor-axis width of a star image, given the Gaussian widths of marginal profiles at 45-degree intervals
KPG1_ELNMx – Writes a range of element numbers into an array
KPG1_ENV0x – Reads a numerical value from an environment variable
KPG1_ENVDF – Sees if an environment variable is defined
KPG1_EXPOx – Takes the exponential to an arbitrary base of an array and its variance
KPG1_FFRx – Reads free-format floating-point data from a string
KPG1_FFTBD – Takes the inverse (Backward) FFT of a real image
KPG1_FFTBR – Takes the inverse (Backward) FFT of a real image
KPG1_FFTFx – Takes the forward FFT of a real image
KPG1_FHDAT – Converts the NDF history date into a more-pleasing format
KPG1_FIGRx – Sets each element in a n-dimensional array to its grid co-ordinate
KPG1_FILLx – Sets all elements in a vectorised array to a specified value
KPG1_FLASx – Flashes image into a cell array
KPG1_FLCOx – Obtains a list of co-ordinates from a text file
KPG1_FLIPx – Reverses the pixels in an n-dimensional array along a specified dimension
KPG1_FLOOR – Returns the largest integer smaller than or equal to a supplied value
KPG1_FLPTH – Gets the full path to a file given relative to a specified root directory
KPG1_FMEDx – Derives the unweighted fast median of a vector
KPG1_FRACx – Finds values corresponding to specified fractions of an array’ s ordered distribution
KPG1_GAUFx – Fits a Gaussian to a one-dimensional array of data
KPG1_GAUSx – Smooths a two-dimensional array using a symmetrical Gaussian PSF
KPG1_GAXLB – Obtains an axis annotation for an NDF axis
KPG1_GTCHV – Obtains a vector of choices from the environment
KPG1_GDARE – Defines a region within the current PGPLOT window
KPG1_GDBND – Gets the bounds of a new PGPLOT window from the environment
KPG1_GDFND – Selects the highest picture of a given name with WCS within the current AGI picture
KPG1_GDFNP – Selects the highest picture of a given name that embraces a position and has WCS
KPG1_GDGET – Gets the AST Plot associated with a graphics-database picture
KPG1_GDNEW – Creates a new DATA picture with ancillary pictures
KPG1_GDOLD – Creates a new DATA picture with ancillary pictures aligned with an existing DATA picture
KPG1_GDPUT – Saves an AST Plot with a graphics-database picture
KPG1_GDQPC – Returns the extent of the current picture
KPG1_GDWIN – Sets PGPLOT world co-ordinates to be the world co-ordinates of the specified AGI picture
KPG1_GETIM – Gets locators to an IMAGE-type structure and structure holding the data array for data input
KPG1_GETOUTLINE – Retrieve an STC polygon describing the spatial extent of an NDF
KPG1_GETYP – Obtains a valid HDS primitive data type via a parameter
KPG1_GHSTx – Calculates the histogram of an array of data
KPG1_GILST – Selects integers within a range of values
KPG1_GNDFP – Gets an NDF or NDF section with a specified number of significant dimensions, but also may select one further significant iteration dimension
KPG1_GNLBU – Obtains an axis annotation for NDF data or variance
KPG1_GNTIT – Obtains a title using the NDF title as the suggested default
KPG1_GPCOL – Obtains the red, green and blue intensities of a colour by value or by name for the standard colour set
KPG1_GRAPH – Draws a line graph
KPG1_GRLM1 – Finds the default limits for a graph axis
KPG1_GRLM2 – Finds the default limits for a graph axis
KPG1_GRLM3 – Finds the default limits for a graph axis (single precision)
KPG1_GRPHW – Draws a line graph, using supplied work arrays
KPG1_GTAXI – Selects Frame axes using an environment parameter
KPG1_GTAXM – Selects Frame axes using an environment parameter
KPG1_GTAXV – Gets one or more formatted axis values from the environment
KPG1_GTCHV – Obtains a vector of choices from the environment
KPG1_GTGPT – Obtains a group of strings from the environment including some that are transient
KPG1_GTGRP – Obtains a group of strings from the environment
KPG1_GTMOR – Creates an HDS structure holding a user-supplied set of keyword=value strings
KPG1_GTNDF – Gets an NDF or NDF section with a specified number of significant dimensions
KPG1_GTOBJ – Gets an AST Object using an environment parameter
KPG1_GTPLR – Gets a spatial position from the environment as polar co-ordinates
KPG1_GTPOS – Gets a spatial position from the environment
KPG1_GTWCS – Gets an AST FrameSet from an NDF
KPG1_H2AST – Copies AST_ data from an HDS object
KPG1_HCONx – Takes the complex conjugate of an Hermitian image
KPG1_HDSKY – Appends a primitive HDS object to an AST KeyMap
KPG1_HMLTx – Multiplies two Hermitian images
KPG1_HMSG – Assigns the name of an HDS object to a message token
KPG1_HRCPx – Finds the reciprocal of a purely real Hermitian image
KPG1_HSDSx – Tabulates an histogram
KPG1_HSECT – Copy a section from an HDS array to a new component
KPG1_HSFLx – Writes an histogram to a Fortran formatted file
KPG1_HSSTP – Calculates statistics from an histogram
KPG1_HSTAx – Computes simple ordered statistics for an array via an histogram
KPG1_HSTFx – Finds values corresponding to specified fractions of an histogram
KPG1_HSTLO – Computes the values to display for a histogram
KPG1_HSTQx – Equalises the histogram of an array
KPG1_IMPRG – Propagates NDF information for IMAGE-format applications
KPG1_INCOx – Obtains a list of co-ordinates from the environment
KPG1_IS3x – Sorts an array of data into increasing order, also shuffling two ancillary arrays correspondingly
KPG1_ISCLx – Scales image between limits
KPG1_ISSCS – Extracts the epoch of the reference equinox from a string specifying an IRAS90 Sky Co-ordinate System
KPG1_KER1x – Smooths an n-dimensional array using a specified one-dimensional kernel
KPG1_KGODx – Sorts through a dataset and throw away bad values
KPG1_KYGRP – Creates an GRP group holding keyword/value pairs read from an AST KeyMap
KPG1_KYHDS – Copies values from an AST KeyMap to a primitive HDS object
KPG1_KYMAP – Creates an AST KeyMap holding keyword/value pairs read from a GRP group
KPG1_LGTRN – Saves a transformation for a base-10 logarithmic plot in the AGI database
KPG1_LIKE – Creates a section from an NDF that matches the area of another NDF
KPG1_LINTD – Obtains a linear transformation between two sets of x,y positions with least squared error
KPG1_LISTC – Lists a character array to an ASCII file or reports it to the user
KPG1_LITNx – Creates linear transformation expressions between two n-dimensional co-ordinate systems
KPG1_LITRx – Saves a transformation for a linear plot in the AGI database
KPG1_LLTRx – Saves a transformation for a data co-ordinate linear or logarithmic plot in the AGI database
KPG1_LOCTx – Locates the centroid of a blob image feature in an n-dimensional array
KPG1_LOGAx – Takes the logarithm to an arbitrary base of an array and its variance
KPG1_LSTAR – Writes a section of a two-dimensional array to a text file
KPG1_LTGET – Obtains a locator to an array holding a colour table for the currently opened graphics device
KPG1_LTLOD – Loads the colour table for the currently open graphics device
KPG1_LTSAV – Saves the colour table for the currently open graphics device
KPG1_LUDCx – Performs an LU decomposition of a square matrix
KPG1_LUTIN – Transfers a lookup table between arrays that have different numbers of colour indices
KPG1_LUTK2 – Sets up the pixel colour indices which form a LUT key
KPG1_LUTK3 – Produces a GRAPH colour table key for KPG1_LUTKY
KPG1_LUTK4 – Produces an AST Mapping from pen number to RGB intensity
KPG1_LUTKY – Draws a key showing a colour table
KPG1_MANIx – Copies a data array with axis permutation and expansion
KPG1_MAP – Obtains mapped access to an array component of an NDF
KPG1_MDETx – Computes the determinant of a matrix
KPG1_MEANx – Finds the mean of the good data values in an array
KPG1_MEDUx – Derives the unweighted median of a vector
kpg1_memry – Returns memory currently being used by the current process
KPG1_MIXVx – Obtains from a parameter character values from either a menu of options or within a numeric range
KPG1_MKLUT – Creates a Mapping to connect two one-dimensional array of values
KPG1_MKPOS – Marks a position on a graphics device
KPG1_MMTHx – Returns the maximum and minimum values of an array within thresholds
KPG1_MODEx – Estimates the mean of a number of normally distributed data values, some of which may be corrupt
KPG1_MONOx – Determines whether an array s values increase or decrease monotonically
KPG1_MTHEx – Evaluates a mathematical expression for a set of data and variance arrays
KPG1_MULx – Multiplies two vectorised arrays with optional variance information
KPG1_MVBDx – Moves bad data values to the end of an index of array values
KPG1_MXMEx – Returns the maximum and minimum values between thresholds of an array including its errors
KPG1_MXMNx – Returns the maximum and minimum values of an array
KPG1_MXMNX – Returns the maximum and minimum values of an array
KPG1_NACVT – Converts an HDS object hierarchy to native data representation
KPG1_NAG2R – Converts an NAG Hermitian Fourier transform array into an array usable by FFTPACK routine KPG1_RFFTB
KPG1_NAGTC – Swaps argument order when getting a mapped character array from an HDS object
KPG1_NAPTC – Swaps argument order when putting a mapped character array into an HDS object
KPG1_NBADx – Finds the number of bad values in an array
KPG1_NDFNM – Returns the name of an NDF without a directory path (Unix only)
KPG1_NMCOL – Finds the RGB intensities of a named colour
KPG1_NOISx – Adds random Normal noise to a one-dimensional array
KPG_NTHMx – Returns the n smallest values in an array
KPG1_NUMBx – Counts the number of elements with values or absolute values above or below a limit
KPG1_NUMFL – Counts the number of lines in a text file
KPG1_OPGRD – Gets the parameters of an optimal projection for a given set of sky positions
KPG1_ORVAR – Returns the variances and covariances of the order statistics from n to 1, assuming an initially normal distribution
KPG1_PACOL – Obtains a marker colour
KPG1_PASTx – Pastes an array on to another
KPG1_PGCLR – Clears current PGPLOT viewport
KPG1_PGCLS – Closes down the AGI database and PGPLOT workstation
KPG1_PGCOL – Obtains a marker colour, given a colour specification
KPG1_PGCUR – Uses the cursor to get a set of points
KPG1_PGCUT – Cuts a section out of the current PGPLOT window
KPG1_PGESC – Removes PGPLOT escape sequences from a text string
KPG1_PGHNM – Returns an HDS name describing the current PGPLOT graphics device
KPG1_PGLOC – Locates a component of an HDS structure relating to the currently opened PGPLOT device
KPG1_PGLUT – Uses an array of colour representations to set up the PGPLOT colour table
KPG1_PGOPN – Opens the AGI database and activate a PGPLOT workstation
KPG1_PGPIX – Displays an image using PGPLOT
KPG1_PGSHT – Sets the PGPLOT character size in world co-ordinates
KPG1_PGSTY – Establishes values for graphics attributes
KPG1_PGTXT – Draws text using PGPLOT and return concatenation point
KPG1_PIXSC – Determines formatted pixel scales at a given grid position
KPG1_PL2GE – Reads two-dimensional polynomial information from a POLYNOMIAL structure
KPG1_PL2PU – Writes two-dimensional polynomial information to a POLYNOMIAL structure
KPG1_PLCIP – Finds the nearest colour in the palette to a named colour (PGPLOT version of KPG1_PALCI)
KPG1_PLGET – Gets the colour palette for the currently open graphics device from a supplied array
KPG1_PLLOD – Loads the colour palette for the currently open graphics device
KPG1_PLOTA – Opens the graphics device and see if there is an existing DATA picture with which the new DATA picture could be aligned
KPG1_PLOT – Prepares for graphics output
KPG1_PLOTN – Creates a new DATA picture and ensure there is an AST Plot for it
KPG1_PLOTP – Creates a new DATA picture, with optionally ancillary pictures
KPG1_PLOTS – Saves an AST Plot with an AGI DATA picture
KPG1_PLPUT – Puts a section of the current colour palette into the supplied array
KPG1_PLSAV – Saves the colour palette for the currently open graphics device
KPG1_PLTLN – Produces a graphical representation of a set of points in two dimensions
KPG1_POISx – Takes values and returns them with Poisson noise added
KPG1_POWx – Raises each element of a vectorised array to a specified power
KPG1_PQVID – Tests whether the current graphics device has suitable image-display characteristics
KPG1_PRCVT – Converts an HDS primitive to a native data representation
KPG1_PRNTH – Locates the outer-most pair of parenthesis in a string
KPG1_PROWx – Puts values into a row of a two-dimensional array
KPG1_PRSAx – Extracts a list of numerical values from a string
KPG1_PSEED – Sets the PDA Random number seed
KPG1_PSFSx – Finds the approximate size of a two-dimensional PSF
KPG1_PVERS – Parses a package version string
KPG1_PX2AX – Converts a pixel s indices into WCS or axis co-ordinates
KPG1_PXDPx – Expands an n-dimensional array by pixel duplication
KPG1_PXSCL – Determines pixel scales at a given grid position
KPG1_QNTLx – Finds a quantile in a (possibly weighted) set of data
KPG1_QSRTX – Sorts a vector via the Quicksort algorithm
KPG1_QUOTE – Quote a supplied string
KPG1_R2NAG – Converts an FFTPACK Hermitian Fourier transform array into the equivalent NAG array
KPG1_RCATW – Attempts to read an AST Object from a catalogue
KPG1_RDAST – Reads AST_ data as text from an HDS object
KPG1_RDCAT – Reads a set of positions with labels from a CAT catalogue
KPG1_RDLST – Reads a set of positions from a CAT catalogue
KPG1_RDTAB – Reads a set of positions with labels from a CAT catalogue
KPG1_REPRT – Reports a MSG message to user and also optionally write it to a file
KPG1_RETRx – Retrieves a value from an array
KPG1_RETVx – Retrieves values specified by index from a vector
KPG1_RFCOx – Reads co-ordinate data from a text free-format file
KPG1_RGLMT – Gets the range limits of a range specification
KPG1_RGNDF – Gets a group of existing NDFs
KPG1_RMAPx – Remaps an array s values according to an histogram key
KPG1_RMSx – Finds the RMS of the good data values in an array
KPG1_RNORM – Returns a set of random samples from a normal distribution
KPG1_SATKC – Substitutes alphabetic (TRANSFORM) character tokens into a string
KPG1_SATKD – Substitutes alphabetic (TRANSFORM) numeric tokens into a string
KPG1_SAXAT – Sets attributes of a Frame axis to describe an NDF array component
KPG1_SCALE – Determines nominal WCS axis scales in an array
KPG1_SCALX – Copies array values into another array, scaling them in the process
KPG1_SCLBx – Copies array values into a BYTE array, scaling them in the process
KPG1_SCLIx – Copies array values into a INTEGER array, scaling them in the process
KPG1_SCLKx – Copies array values into a INTEGER8 array, scaling them in the process
KPG1_SCLOF – Applies a simple scaling and base-line shift to the values contained in the input vector
KPG1_SCLUBx – Copies array values into a BYTE array, scaling them in the process
KPG1_SCLUWx – Copies array values into a INTEGER2 array, scaling them in the process
KPG1_SCLWx – Copies array values into a INTEGER2 array, scaling them in the process
KPG1_SDIMP – Obtains up to a number of significant dimensions of an NDF
KPG1_SECSH – Shifts bounds of upper dimensions that have one element to index one
KPG1_SEED – Obtains a semi-random seed for random-number generation
KPG1_SGDIG – Determines the number of significant digits in a number
KPG1_SGDIM – Determines the number of significant dimensions in an NDF
KPG1_SHORT – Checks whether a string matches a supplied abbreviation template
KPG1_SLICE – Finds and removes any NDF slice specification from a name
KPG1_SNKTA – Writes AST_ data as text to a GRP group
KPG1_SQSUx – Finds the sum of the squares of an array
KPG1_SRCTA – Reads AST_ data as text from a GRP group
KPG1_SSAZx – Applies a simple scaling and base-line shift to create the output vector
KPG1_SSCOF – Applies a simple scaling and base-line shift to create the output vector
KPG1_STATx – Computes simple statistics for an array
KPG1_STDSx – Displays statistics generated by KPG1_STATx, KPG_OSTAx, and KPG1_HSTAx
KPG1_STFLx – Writes statistics generated by KPG1_STATx, KPG_OSTAx, and KPG1_HSTAx to a text file
KPG1_STORx – Stores a value in an array
KPG1_TDLIx – Applies a constant-determinant transformation to an array by linear interpolation
KPG1_THRSx – Sets pixels in array to defined new values outside limits
KPG1_TRALx – Finds the extreme co-ordinates of an n-d array after being transformed
KPG1_TRBOx – Finds the extreme co-ordinates of an n-d array after being transformed
KPG1_TRIGx – Applies a trigonometric function to each element of a vectorised array
KPG1_TRLIx – Applies a constant-determinant transformation to an array by linear interpolation
KPG1_TRPIx – Finds vectorised pixel indices after applying a transformation to an array s pixel co-ordinates
KPG1_TRSPx – Transposes a two-dimensional array
KPG1_UNZ2x – Unzips a two-dimensional co-ordinate array into two one-dimensional arrays
KPG1_VASVx – Assigns values to an output array from an input array using a list of indices
KPG1_VEC2N – Converts vectorised array indices into n-dimensional form
KPG1_VERB – Determines whether the specified package should report verbose messages
KPG1_WCATW – Writes an AST Object to a catalogue
KPG1_WCAXC – Obtains co-ordinates for an axis from a WCS component FrameSet
KPG1_WCFAX – Obtains the co-ordinate of an axis in the current WCS Frame at every pixel centre in an NDF
KPG1_WGNDF – Gets a group of output NDF names
KPG1_WMODx – Estimates the mean of a number of normally distributed data values, some of which may be corrupt
KPG1_WRAST – Writes AST_ data as text to an HDS object
KPG1_WRCAT – Writes a set of positions to a text file as a CAT catalogue
KPG1_WREAD – Reads an AST Object from an HDS object
KPG1_WRLST – Writes a set of positions to a text file as a CAT catalogue
KPG1_WRTA2 – Puts a set of positions into a text file as a CAT catalogue
KPG1_WRTAB – Writes a set of positions to a text file as a CAT catalogue
KPG1_WTM3D – Forms the weighted median of a list of ordered data values. Incrementing the contributing pixel buffers and estimating the variance change
KPG1_WTM3R – Forms the weighted median of a list of ordered data values
KPG1_WWRT – Writes WCS information to an HDS object
KPG1_XYD2W – Converts linear data co-ordinates to world co-ordinates
KPG1_XYZWx – Converts a two-dimensional array into a list of x-y co-ordinates, values and weights
KPG_BLONx – Smooths an n-dimensional image using box filter
KPG_DIMLS – Writes the dimensions of an array in standard notation
KPG_ENV0C – Reads a string value from an environment variable, using a default value if the variable is undefined
KPG_FISEx – Substitutes a constant value in a defined section of an array
KPG_GTFTS – Obtains FITS header information from an NDF
KPG_IMMMx – Finds the mean, median and mode iteratively using the Chauvenet rejection criterion
KPG_ISEQN – Increments a sequence string
KPG_LD2Ax – Converts a sparse form of a two-dimensional array into its two-dimensional counterpart
KPG_LR2Ax – Converts a sparse form of a two-dimensional array into its two-dimensional counterpart
KPG_NORVx – Returns a supplied value with normally distributed noise added
KPG_NXWRD – Finds the next word in a string
KPG_OSTAx – Computes simple statistics for an array
KPG_PTFTS – Stores FITS header information into an NDF
KPG_STOCx – Calculates accurate order statistics by sorting an array
KPG_STOSx – Calculates accurate order statistics by sorting an array
KPG_TYPSZ – Returns the number of bytes used to store an item of any of the HDS primitive data types

Q C-only Routine Descriptions
kpg1Axcpy – Copies an NDF AXIS structure from one NDF to another
kpg1Config – Creates an AST KeyMap holding a set of configuration parameter values
kpg1Kygp1 – Creates a GRP group holding keyword/value pairs read from an AST KeyMap
kpg1Kymp1 – Creates an AST KeyMap holding keyword/value pairs read from a GRP group
kpg1Kymp2 – Parses a " keyword = value" string for kpg1Kymp1 and add to a KeyMap
kpgGetOutline – Retrieve an STC polygon describing the spatial extent of an NDF
kpgGtfts – Obtains FITS header information from an NDF
kpgPtfts – Stores FITS header information into an NDF
kpgPutOutline – Create and store an STC polygon describing the spatial extent of an NDF