 # Contents of IDL Group K User's Library

## Math and Statistics

• CUBIC() Determine roots of a cubic polynomial
• CUSPOLYN() Evaluate a cusp-polynomial function of a variable
• DTPOIDEV() Generate a dead-time-distorted Poisson random deviate
• EXPDEV() Generate exponentially distributed, positive, random deviates
• FACPRIME() Factor a number into its prime numbers
• FASPER Fast Lomb normalized periodogram
• FIT2EXP() Fit a distribution of 2 exponential functions
• FIT2WT Fit a waiting time distribution of an observed source 1 and a vetoed source 2
• FITEXP() Fit an exponential distribution
• FITHEXP() Fit a hyperexponential distribution
• HIST1D() Weighted or unweighted histogram of a 1D array
• HIST2D() Weighted or unweighted histogram of a 2D array
• KSTWO Kolmogorov-Smirnov statistics test if two data sets are drawn from same distribution
• LOGREBIN Rebin a XYdY distribution into equal logarithmic intervals in X.
• MULTIPSD() Average FFT power spectras of an array of times divided into equal time segments.
• PERIOD Lomb normalized periodogram
• POIDEAD() Probability of detecting N counts due to a non-extended dead-time-distorted poisson process
• PDF2EXP() Probability density function of waiting times of an observed source 1 and a vetoed source 2
• PROB2EXP() Probability function of binned waiting times of an observed source 1 and a vetoed source 2
• PROBEXP() Probability function of binned waiting times for an offset exponential distribution.
• PROBHEXP() Probability function of binned waiting times for an offset hyperexponential distribution.
• PSDREBIN Calculate the average power spectra from a given array of event times
• RAN0() Generate uniformly-distributed pseudo-random numbers, Numerical Recipes RAN0 algorithm (AIX only)
• RAN1() Generate uniformly-distributed pseudo-random numbers, Numerical Recipes RAN1 algorithm (AIX only)
• RAN2() Generate uniformly-distributed pseudo-random numbers, Numerical Recipes RAN2 algorithm (AIX only)
• REGRESS2() Multiple linear regression fit
• SFITCUSP() Cusp-polynomial weighted fit to a surface
• SHUFFLE() Shuffle the elements of an array
• SIGN() Determine the sign of a number
• SLACC2S SLALIB routine: Direction cosines to spherical coordinates
• SLACS2C SLALIB routine: Spherical coordinates to direction cosines
• SLADEULER SLALIB routine: Form a rotation matrix from the Euler angles
• SLADVDV SLALIB routine: Scalar product of two 3-vectors (double precision)
• SLADVN SLALIB routine: Normalizes a 3-vector also giving the modulus
• SLAEPJ SLALIB routine: Conversion of Modified Julian Date to Julian Epoch
• SLAEVP SLALIB routine: Barycentric and heliocentric velocity and position of the Earth
• SLAPREC SLALIB routine: Form the matrix of precesion between two epochs (IAU 1976, FK5)
• SLAVDV SLALIB routine: Scalar product of two 3-vectors
• SLAVXV SLALIB routine: Vector product of two 3-vectors

## Plotting and Widget Procedures

• GET_XPALETTE() Returns the color index of the USER-selected color palette
• LEGEND2 Create an annotation legend for a plot
• MRK_LINE() Interactively position a line on an existing plot
• MRK_RECT() Interactively position and size a rectangle on an existing plot
• OKCANCEL() Display a message then select an OK or Cancel button to continue
• PLOTSYM2 Define useful plotting symbols not in the standard PSYM definition
• TOPDRAW Interprets TOP DRAWER files and generates plots to display and/or printer
• WHEREGION() Determine points lying within an interactively marked rectangular region
• WIDGET_POSITION Create a widget at the center, corner or random position of the display.
• WSHOW_ACTIVE() Apply WSHOW procedure if there are one or more active windows
• XBUTTON() Display a row or column of specified buttons then select one to continue
• XHELPMSG Display help messages in a widget format similar to the IDL 3.6.1 Help facility
• XLIST() Display a list of items then select one to continue
• XMSG() Display a message then select an OK button to continue
• XOPLOT Interactively overplot data and modify overplot settings
• XPLOT Interactively plot data and modify plot settings
• XQUERY() Display and reply to a list of questions then select Done, Undo or Cancel button to continue
• XSURFACE Display surface plot and change viewing angle and other plot parameters
• YNCANCEL() Display a message then select Yes, No or Cancel button to continue

## Input/Output Device Procedures

• CAPTURE Captures the current graphics screen and saves it to an image file
• CLEANUP Cleans up log files created by the NEW_JOURNAL procedure
• DEVICE_MGR Manages various graphic devices for two orientations: Landscape and Portrait
• DIR_EXIST() Tests for the presence of a directory
• LANDSCAPE Manages various graphic devices for the Landscape orientation
• NEW_JOURNAL Closes any open journal file and creates a new one
• PORTRAIT Manages various graphic devices for the Portrait orientation
• PRINT_FILE Spawns a command to print a file
• PRINTFS Print to multiple devices with multiple formats
• TMPFILE() Get a unique filename and path for a temporary file

## String Processing

• STRINSERT Inserts one string into another string
• STRLETTER() Remove all non-alphabetical characters
• STRPARSE() Parse a string using the white-space character as the token
• STRREPLACE Replace the contents of one string with another

## Miscellaneous

• ARR2STR() Converts an array of numbers to a string of numbers separated by commas
• EQUIV Equates arrays of different integer types, analogous to Fortran equivalence function
• GRPKPATH() Path to a Group K library
• INQUIRE() Respond to a boolean type question
• NEWLINE Print a blank line or line of a particular ASCII character to device
• PAUSE Pause until the ENTER or Q key is pressed (Debugging tool)
• PLUSMINUS() Returns the ASCII plus/minus character
• TAB Returns the ASCII tab character

## XTE/PCA Analysis

• E4US4B01 Extracts the module number and energy channel from the XTE/PCA data in the E_4us_4B_0_1s configuration
• FITSHDR() Extracts the header from a FITS file
• XTETIMES() Extract the photon event times from the XTE/PCA data

## HEAO A-1 Analysis

• ACNVRT() Convert between HEAO A-1 quasi-logarithmic numbers and Science Data
• AVG_LC Plot the average light curves for the HEAO A-1 scan data
• BARYCORR() Barycentric time correction from the aspects of the source and the HEAO A-1 satellite
• COLLDIRS HEAO A-1 collimator viewing direction from the HEAO A-1 satellite aspect
• COLLF() HEAO A-1 collimator response function relative to the source and satellite aspects
• COLLMATR() HEAO A-1 collimator response function relative to the collimator pointing axis
• CTIFMT Process Photon Time Interval (PTI) data to a Concatenated Time Interval (CTI) file
• DEADCORR() Corrects counts for dead time in the HEAO A-1 detector.
• DEF_HBRDBS Define the HEAO A-1 High-Bit-Rate database
• DEF_HBRH Define all pointers and bits for the Photon Time Interval (PTI) format
• DEF_MJF() Define Major Frame data structure associated with the HEAO A-1 scan data
• FFINDSRC Find all sources in the field of view of any HEAO A-1 scan in a data file
• FIDUCIAL Apply fiducial cuts to the HEAO A-1 scan data
• FINDSRC() Find all sources in the field of view of a HEAO A-1 scan
• FIT_BKD() Fit a polynomial to the background of a HEAO A-1 scan
• FITSCAN Fit a HEAO A-1 scan for source intensities and background
• FOLD_LC Generate and plot folded light curves of HEAO A-1 scan data
• GET_ASPECTS Interpolate or extrapolate aspect angles for a HEAO A-1 scan
• GET_DATA() Return the structure from an IDL SAVE session generated by the FIDUCIAL routine
• GET_FMT() Name of the format of a HEAO A-1 scan data file
• GET_NSRC() Number of sources in a HEAO A-1 scan data file with calculated transmissions
• GET_PEAK() Find time bins in a HEAO A-1 scan where the tranmission(s) are a maximum
• GET_SCAN() Read in a scan or a set of sequential Major Frame(s) of HEAO A-1 scan data
• GET_TRNS() Transmission function of a source over a HEAO A-1 scan
• GLITCH() Find time bins in a HEAO A-1 scan where "glitches" occur.
• HBRFMT Process raw High-Bit-Rate data into Photon Time Interval (PTI) format
• HBRINFO() Information about a HEAO A-1 High-Bit-Rate pointed observation
• HBRSYNC Extract the 128 kbps and 6.4 kbps datastream from raw High-Bit-Rate data
• HEAO Menu of all data analysis routines related to the HEAO A-1 scan data
• HEAOEFF() HEAO A-1 detector efficiences
• KILLAPE Eliminate Adjacent Photon Events from the Photon Time Interval (PTI) data
• LCU Display the light curves and source transmissions of all scans in HEAO A-1 data
• LIGHT_CURVE Display the light curve and source transmission of one HEAO A-1 scan
• LPGM_LC Calculate and display the Lomb normalized periodogram of a light curve of HEAO A-1 scan data
• MAIN_SCAN Main driver routine to loop through and extract data from each HEAO A-1 scan
• MAKEDBS Make a database of the Major Frame headers in a HEAO A-1 scan data file
• MK_AVGLC Process the data structure output of FIDUCIAL as input to the AVG_LC routine
• MK_FOLDLC Process the data structure output of FIDUCIAL as input to the FOLD_LC routine
• MK_LPGM Process the data structure output of FIDUCIAL as input to the LPGM_LC routine
• NRZUNPAK() Extracts the 2.1 kbps HEAO A-1 data from the raw 6.4 kbps NRZ data
• OPENPTI Open a Photon Time Interval (PTI) file
• OVERLAP() Determine how much the transmissions from sources in a HEAO A-1 scan are overlapping
• PK_TRNS() Extract the peak transmission for each source in data structure output of FIDUCIAL
• READ_MJF() Read in a Major Frame (40.96 sec) of HEAO A-1 scan data