Group K Library
The following is a listing of the entire contents of this library for IDL.
Click on an individual procedure name to view its header and
source code. This listing
is a shortened form of the much longer
entire library help file. This may be handy for
text searchs, be beware that some of these are huge and may take a long
time to load or even crash your browser.
Last modified: Thu Dec 21 21:19:38 2000.
List of Routines
- ACNVRT This function converts the HEAO A-1 quasi-logarithmic numbers to HEAO A-1 Science Data and vice versa.
- ARR2STR Converts an array of numbers to a string of numbers separated
- AVG_LC Plots the average light curves for a source, customized to the HEAO A-1 data.
- BARYCORR FUNCTIONAL DESCRIPTION: Function calculates the satellite's position in barycentric coordinates, then calculates a time correction based no the projection of the satellite's position vector into the source direction (from the Earth). Thus the time is corrected to a fixed point on the Earth-source line, such that the line joining
- CAPTURE Captures the current graphics screen and saves it to an image file.
- CK_VER This function checks the validity of the Version number of a DATA structure created by the FIDUCIAL routine.
- CLEAN_UP Cleans up "garbage" log files created by the NEW_JOURNAL routine.
- CLEAR_SCAN CLEAR_SCAN Resets all the common block structure to 0. CATEGORY: I/O CALLING SEQUENCE: CLEAR_SCAN
- COLLDIRS This procedure determines the viewing direction(s) of one of the HEAO A-1 collimators.
- COLLF Function to return the HEAO A-1 collimator response function, that is, transmission or efficiency, for a given detector module.
- COLLINIT COLLINIT To convert this into IDL code, the COMMON CLLMTR is needed to store these coefficients as static variables. H.C. Wen, 22-JUN-1994 NRLDIR:COLLMAT.INC ==================
- COLLMATR COLLMATR For a given collimator (module) index, and given angle with respect to the collimator axis, calculates the transmission function. See original comments below. CATEGORY: Collimator.
- CTIFMT CTIFMT This routine concatenates and corrects all the data contained in a PTI file (created by HBRFMT). All Adjacent Photon Events (APE) and any photons in BAD minor frames are removed. A BAD minor frame occurs when there are one or more HBRSYNC errors (e.g. missing MNFs, Clock TicTok errors, sync loss, etc). This concatenated and corrected
- CUBIC Solve for the roots of a cubic polynomial OR find the value(s) of a cubic polynomial (INVERSE)
- CUSPOLYN This function returns a "cusp" polynomial determined by a given set of
- DEADCORR This function corrects for dead time in the HEAO A-1 detector. The dead time and collimator response function were fitted for using the data on the Crab from module 3 ONLY.
- DEADINIT This procedures defines the dead times and charged particle rates used to correct HEAO A-1 scanning counts for dead time.
- DEF_HBRDBS This routine defines the HEAO HBR database containing info on each HEAO HBR data file.
- DEF_HBRH This routine defines all the pointers and bits to the Major Frame and Minor Frame headers for the Photon Time Interval (PTI) format.
- DEF_MJF Defines the anonymous major frame data structure appropriate for the given data file.
- DEVICE_MGR DEVICE_MGR Manages the graphics device for two "standard" orientations, LANDSCAPE (default) and PORTRAIT. CATEGORY: I/O. CALLING SEQUENCE:
- DIR_EXIST This function tests for the presence of a directory.
- DTPOIDEV Return an integer random deviate drawn from a dead-time-distorted Poisson distribution with a specified mean. Adapted from POIDEV procedure in "Numerical Recipes" by Press et al. (1986), Section 7.3 and IDL Astronomy User's library routine of the same name by Wayne Landsman.
- EATOM Generate rotation matrix given 3 euler angles
- END_SCAN END_SCAN Closes the data file used by GET_SCAN to extract HEAO A-1 data. CATEGORY: I/O CALLING SEQUENCE:
- EQUIV This procedure equates arrays of different integer types, similar to Fortran's Equivalence function.
- EULER2 Transform between galactic, celestial, and ecliptic coordinates. Use the procedure ASTRO to use this routine interactively
- EXPDEV[1] Returns an exponentially distributed, positive, random deviate using RAN2( seed ) as the source of uniform deviates. The default unit mean and zero offset of the deviates may be modified by setting the appropriate keywords.
- EXPDEV[2] Returns an exponentially distributed, positive, random deviate using RANDOMU( seed ) as the source of uniform deviates. The default unit mean and zero offset of the deviates may be modified by setting the appropriate keywords.
- FACPRIME Factor a number into its prime numbers.
- FASPER Given abscissas x (which need not be equally spaced) and ordinates y, and given a desired oversampling factor ofac (a typical value being 4 or larger). this routine creates an array wk1 with a sequence of nout increasing frequencies (not angular frequencies) up to hifac times the "average" Nyquist frequency, and creates an array wk2 with the values of the Lomb normalized periodogram at those frequencies. The arrays x and y are not altered. This routine also returns jmax such that wk2(jmax) is the maximum element in wk2, and prob, an estimate of the significance of that maximum against the hypothesis of random noise. A small value of prob
- FFINDSRC Interactively finds all x-ray sources around a primary source within the field of view of any HEAO A-1 scan in an IDL data FILE. (FF abbreviation for FILE FIND)
- FIDCUTS1 Applies various fiducial or "quality" cuts on an IDL HEAO A-1 data file, extracts relevant scan characteristics into a data structure and saves this structure to an IDL session file. The USER is able to interactively select which scans to accept or reject, respective or irrespective of the fiducial cuts.
- FIDCUTS2 Apply second round of fiducial cuts to the HEAO A-1 Scanning data.
- FIDUCIAL Applies various fiducial or "quality" cuts on an IDL HEAO A-1 data file, extracts relevant scan characteristics into a data structure and saves this structure to an IDL session file. The USER is able to interactively select which scans to accept or reject, respective or irrespective of the fiducial cuts.
- FINDSRC Interactively finds all x-ray sources around a primary source within the field of view of a HEAO A-1 scan. Uses the XXX database.
- FITSCAN Fits for the source intensities and background in a scan assuming constant intensities and a polynomial background. The method of multiple linear regression is employed.
- FIT_BKD Perform a least-square polynomial fit to the background of a major frame with optional error estimates.
- FOLD_LC Folds the light curves for a source using a USER provided period and plots the resulting folded light curves.
- GET_ASPECTS Subroutine interpolates, or extrapolates, the aspect angles, right ascension and declination (alpha, delta), for the Y- and Z-axes given the initial and final value for these angles. The Z-axis is assumed to be the spin axis.
- GET_DATA This function restores an IDL SAVE Session file created by the FIDUCIAL routine and returns the saved DATA structure.
- GET_FMT This function extracts the name of the format of an IDL data file.
- GET_NSRC This function extracts the number of sources in an IDL data file.
- GET_PEAK Finds the bin(s) where the transmission curves are a maximum.
- GET_SCAN GET_SCAN This function reads in major frame(s) of the HEAO A-1 data from a data file into buffers. Each buffer contains a set of sequential major frames and may be referred to as a "scan". The number of sequential major frames may vary according to the number of sequential major frames found in the data file.
- GET_TRNS Calculates the collimator transmission function given the aspects of the satellite at the beginning of two or more sequential major frames and the aspect of the source.
- GET_XPALETTE This is just XPALETTE modified into a function to return the color index currently selected before the USER selects the
- GLITCH Looks for "glitches" in the data by calculating the changes in count rate across a major frame. When it finds a major frame with a "glitch", its bin number is added to a list.
- GRPKPATH This function returns the path to a Group K library.
- HBREAD HBR digitized 9-track tape read routine (used by HBRFMT) Written by Daryl J. Yentis, Naval Research Laboratory, SSD 02/08/83. Adapted to IDL by H.C. Wen, 4/18/95
- HBRFMT HBRFMT This routine processes and re-formats the raw High-Bit-Rate digitized files into the Photon Time Interval (PTI) format. CATEGORY: HEAO HBR. CALLING SEQUENCE:
- HBRINFO This function returns a structure or an array of structures containing information about the HBR data file(s) the USER has requested.
- HBRSYNC This routine processes the HBRB data (High-Bit-Rate in Bit telemetry mode) and extracts the 128 kbps and 6.4 kbps datastream for a
- HEAO This is the main driver routine for all data analysis routines related to the HEAO A-1 scanning data. From its widget button menu, you may select various types of analysis like looking at light curves, selecting good scans, etc.
- HEAOEFF This function returns the HEAO A-1 detector efficiences for the specified energies.
- HIST1D Returns the weighted histogram of a 1D array.
- HIST2D Return the weighted density function (histogram) of two variables.
- INIT_SCAN INIT_SCAN Initializes all the common block variables to their appropriate values before you run the GET_SCAN routine. CATEGORY: I/O CALLING SEQUENCE:
- INQUIRE This function asks the USER to respond to a question (usually Y/N) and then return the USER's response as a boolean.
- IUPHBR This function extracts the 10 bins of 7.8125 usec High-Bit-Rate data from the input word(s). Starting from the LSB at bit 0, bits 0-5 and 8-11 of the input word(s) are returned as bits 0-9.
- KILLAPE This routine removes Adjacent Photon Events (APEs) from a MJF block of HBR PTI data. An APE is defined as two photons occurring in adjacent 8 usec bins ACROSS sequential HBR data words. Namely, the first photon occurs in time bin 9 and the second photon occurs in time bin 0 of the next word. These events occur in the HBR PTI data for roughly 3-4% of all photons lying in time bin 0 or 9. They are considered UNPHYSICAL due to the deadtime of the detector (>16 usec) and the consistent occurrance of these events ONLY across sequential HBR data words.
- KSTWO Given an array data1, and an array data2, this routine returns the Kolmogorov-Smirnov statistic d, and the significance level prob for the null hypothesis that two given data sets are drawn from the same distribution. Small values of prob show that the cumulative distribution function of data1 is significantly different from that of data2. The arrays data1 and data2 are modified by being sorted into ascending order
- LANDSCAPE Graphics Device Manager for Landscape mode. (see DEVICE_MGR routine)
- LCLEGEND Returns the Standard Light Curve legend.
- LCLOADCT Defines the color palette used by LIGHT_CURVE and other plotting routines.
- LCSUBTITLE Returns the Standard Light Curve subtitle.
- LCTITLE Returns the Standard Light Curve title.
- LCU Interactively displays the light curves of an IDL data file for each scan. Other light curve utilities include: searching for a particular scan; printing the displayed light curves; and creating a list of major frame numbers by individually marking each scan.
- LEGEND2 This procedure makes a legend for a plot. The legend can contain a mixture of symbols, linestyles, Hershey characters (vectorfont), and filled polygons (usersym). A test procedure, legendtest.pro, shows legend's capabilities. Placement of the legend is controlled with keywords like /right, /top, and /center or by using a position keyword for exact placement (position=[x,y]) or via mouse (/position).
- LIGHT_CURVE Generates a light curve of the data along with the transmission function(s) normalized to the area under the light curve.
- LOGREBIN Rebins a XYdY distribution into equal logarithmic (base 10) intervals in X.
- LPGM_LC Calculates the Lomb Normalized Periodogram of the light curves for a source, customized to the HEAO A-1 data.
- MAIN_SCAN This is the main driver routine to loop through the major frame buffers from IDL data files. It serves to take care of the overhead of reading major frames into the buffer and then accessing that buffer; i.e. redundant code which every routine that accesses the data must have. Each major frame buffer consists of a block of sequential major frames.
- MAKEDBS This function extracts the (#MJF header line of each major frame in an IDL data file an writes it out to a "database" file.
- MK_AVGLC Processes the data structure returned by FIDUCIAL to generate plots of the average & weighted average light curves of the HEAO A-1 data.
- MK_FOLDLC Processes the data structure returned by FIDUCIAL to generate plots of the folded light curves of the HEAO A-1 data.
- MK_LPGM Processes the data structure returned by FIDUCIAL to generate plots of the Lomb Normalized Periodogram of the HEAO A-1 data.
- MRG_DATA Merges two or more DATA structures stored in IDL SAVE session files. These files must have been created by FIDCUTS1 version 6.0 or later.
- MRK_LINE Allows the USER to interactively position a line on an existing plot.
- MRK_RECT Allows the USER to interactively position and size a rectangle on an existing plot.
- MTOEA Computes the euler angles to transform body axes to space axes, given the transformation matrix from the body axes to the space axes.
- MULTIPSD Given an array of times, ts divide the data into equal time segments, calculate the FFT power spectra of these segments and average the power spectra.
- NEWLINE Print a blank line or line of a particular ASCII character to screen or other output device.
- NEW_JOURNAL Closes any open journal file and opens a new one.
- NRZUNPAK This function "unpacks" the raw 6.4 kbps NRZ data by extracting its 2.1 kbps HEAO A-1 component and storing it into a structure
- OKCANCEL This function prompts USER with a widget window with OK and Cancel buttons. Use this function to let the USER allow some subsequent action that you are going to take (described by the Msgs parameter) once this widget is destroyed.
- OPENPTI This routine opens a Photon Time Interval (PTI) file.
- OVERLAP This function determines the fraction of transmission function for each source that is overlapping with the sum of the transmission functions from all other sources.
- PAUSE Pauses until the USER presses the ENTER or 'Q' key.
- PERIOD Given data points with abscissas x (which need not be equally spaced) and ordinates y, and given a desired oversampling factor ofac (a typical value being 4 or larger), this routine fills array px with an increasing sequence of frequencies (not angular frequencies) up to hifac times the "average" Nyquist frequency, and fills array py with the values of the Lomb normalized periodogram at those frequencies. The arrays x and y are not altered. The routine also returns jmax such that py(jmax) is the maximum element in py, and prob, an estimate of the significance of that maximum against the hypothesis of random noise. A small value of prob indicates that
- PK_TRNS Extracts the peak transmissions for each scan stored in the DATA
- PLOTSYM2 Define useful plotting symbols not in the standard !PSYM definitions. After symbol has been defined with PLOTSYM, a plotting command should follow with either PSYM = 8 or !P.PSYM = 8 (see USERSYM)
- PLUSMINUS Returns the ASCII plus/minus character.
- POIDEAD This function calculates the probability of detecting N counts in a given measuring time bin for a non-extended dead-time-distorted poisson process. The algorithm uses formulae from Muller, "Some Formulae for a Dead-Time-Distorted Poisson Process", NIM 117
- PORTRAIT Graphics Device Manager for Portrait mode. (see DEVICE_MGR routine)
- PRINTFS Print to multiple devices with multiple formats. This is essentially an extension to the PRINTF routine.
- PRINT_FILE Spawns a print command to print a file.
- RAN0 The RAN0 function returns one or more uniformly- distributed, floating-point, pseudo-random numbers in the range 0 LE Y < 1.0.
- RAN1 The RAN1 function returns one or more uniformly- distributed, floating-point, pseudo-random numbers in the range 0 LE Y < 1.0.
- RAN2 The RAN2 function returns one or more uniformly- distributed, floating-point, pseudo-random numbers in the range 0 LE Y < 1.0.
- READCTI READCTI This routine opens and reads in a Concatenated Time Interval (CTI) file into the structure variable, cat. CATEGORY: HEAO HBR. CALLING SEQUENCE:
- READPTI This routine reads in the next MJF block of Photon Time Interval (PTI) file and supplies it to the USER in a structure variable.
- READ_MJF READ_MJF This function reads in a major frame of HEAO A-1 data from a data file and returns as a keyword a structure containing all the data. CATEGORY: I/O CALLING SEQUENCE:
- REGRESS2 Multiple linear regression fit. Fit the function: Y(i) = A(0)*X(0,i) + A(1)*X(1,i) + ... + A(Nterms-1)*X(Nterms-1,i)
- SCANPHI Finds the scan longitude or PHI corresponding the a response function value, assuming that the scan latitude = 0 by inverting the collimator response function.
- SCANTHT Finds the scan latitude or THETA corresponding the a response function value, assuming that the scan longitude = 0 by inverting the collimator response function.
- SEPANGLE This function calculates the separation angle in RADIANS from a source direction as specified by their RA and DEC.
- SETSYB Set SYSTEM B parameters.
- SFIT This function determines a polynomial fit to a surface.
- SFITCUSP This function determines a "cusp" polynomial weighted fit to a surface.
- SIGN Mimics the intrinsic FORTRAN function, SIGN.
- STRINSERT The STRINSERT procedure inserts the contents of one string into another WITHOUT overwriting any existing characters. The source string, Source is inserted into the destination string, Destination between the given positions, Position-1 and Position. The length of the destination string is increased by the length of the source string, Source. If the insertion position extends beyond the length of Destination, then Source is appended to the end of Destination.
- STRLETTER STRLETTER The STRLETTER function returns a copy of Strings with all non-alphabetical characters completely removed. CATEGORY: String Processing. CALLING SEQUENCE:
- STRPAD This function returns the source string padded with leading and/or trailing white-space characters.
- STRPARSE STRPARSE This function parses a string using the space (' ') token. CATEGORY: String Processing. CALLING SEQUENCE: Result = STRPARSE( String )
- STRREPLACE The STRREPLACE procedure replaces the contents of one string with another. The first occurrence of the search substring, Find within the source string, String is replaced by the string,
- SYSTEM This is an alternative to the SPAWN routine. It is similar in both inputs and keywords as SPAWN, except that it returns ONLY after the spawned process has been completed.
- TAB Returns the ASCII tab character.
- TMPFILE Get the filename and path of a temporary file.
- TOPDRAW Interprets a TOP DRAWER file and makes plots to the display and/or printer output.
- WHEREGION This function returns an array of indices corresponding to the array elements that lie within a region marked interactively
- WIDGET_POSITION Realizes a widget hierachy and displays the top-level base widget at the center or corner of the display.
- WINOPEN This function returns the additional keywords needed to calls to the OPEN procedure in IDL for Windows, version 4.0.1 and later.
- WSHOW_ACTIVE WSHOW_ACTIVE This function exposes or hides the current window if its window index matches the input argument. CATEGORY: Widgets. CALLING SEQUENCE:
- XBUTTON Query the USER via a column or row of widget button(s).
- XHELPMSG This routine displays help messages in a widget format similar to the IDL Help facility.
- XLIST This function returns the value or index of an item from a list that the USER interactively selects from.
- XMSG Displays message(s) in a widget window with an optional OK button.
- XOPLOT This procedure is a "superset" of OPLOT and OPLOTERR with the additional feature of allowing the USER to interactively change many of its settings "on the fly" (e.g. plotting symbol and linestyle) via various widget menus. It accepts ALL of the keywords used by OPLOT and OPLOTERR and some additional keywords described below. The USER may also print the plot directly under the File pulldown menu, (it can handle multiple plots/window).
- XPLOT This procedure is a "superset" of PLOT and PLOTERR with the additional feature of allowing the USER to interactively change many of its settings "on the fly" (e.g. x-axis range, plotting symbol, etc.) via various widget menus. It accepts ALL of the keywords used by PLOT and PLOTERR and some additional keywords described below. The USER may also print the plot directly under the File pulldown menu, (it can handle multiple plots/window).
- XQUERY Reply to a list of questions via a widget window.
- XSURFACE This routine provides a graphical interface to the SURFACE and SHADE_SURFACE commands. Different controls are provided to change the viewing angle and other plot parameters. The command used to generate the resulting surface plot is shown in a text window.
- XXYOUTS This procedure is a "superset" of OPLOT and OPLOTERR with the addtional feature of allowing the USER to interactively change many of its settings "on the fly" (e.g. line style, plotting symbol, etc.) via various widget menus. It accepts ALL of the keywords used by OPLOT and OPLOTERR and some additional keywords described below. The USER may also print the plot directly from the main widget menu, (it can handle multiple plots/window).
- YNCANCEL This function prompts USER with a widget window with Yes, No and Cancel buttons. Use this function to let the USER decide upon some subsequent action that you are going to take (described by the Msgs parameter) once this widget is destroyed.