This page was created by the IDL library routine
mk_html_help
. For more information on
this routine, refer to the IDL Online Help Navigator
or type:
? mk_html_help
at the IDL command line prompt.
Last modified: Mon Nov 07 19:23:00 2011.
NAME: PURPOSE: CATEGORY: Compound widgets. CALLING SEQUENCE: widget = CW_TMPL(parent) INPUTS: PARENT - The ID of the parent widget. KEYWORD PARAMETERS: UVALUE - Supplies the user value for the widget. OUTPUTS: The ID of the created widget is returned. COMMON BLOCKS: None. SIDE EFFECTS: PROCEDURE: WIDGET_CONTROL, id, SET_VALUE=value can be used to change the current value displayed by the widget. WIDGET_CONTROL, id, GET_VALUE=var can be used to obtain the current value displayed by the widget. MODIFICATION HISTORY:
(See C:\RSI\IDL52\lib\cw_tmpl.pro)
NAME: ADDSYSVAR PURPOSE: ADDSYSVAR allows the user to define new system variables. It was a built in procedure under version 1 VMS, and is superceeded by DEFSYSV. It is provided in this form to help users of that version adapt to version 2. CALLING SEQUENCE: ADDSYSVAR, Name, Type [, String_length] INPUTS: Name: The name of the system variable. This variable must be a scalar string starting with the "!" character. Type: The type of the system variable expressed as a one character string. The following values are valid: 'B' for byte, 'I' for integer, 'L' for longword, 'F' for floating-point, 'D' for double-precision floating-point, and 'S' for string. String_length: This parameter is ignored. OUTPUT: A new system variable is created, if possible. RESTRICTIONS: DEFSYSV is a much better interface for creating system variables, and should be used instead. REVISION HISTORY: 10 January 1990
(See C:\RSI\IDL52\lib\obsolete\addsysvar.pro)
NAME: ADJCT PURPOSE: Interactively adjust color tables using mouse input. CATEGORY: Image display. CALLING SEQUENCE: ADJCT INPUTS: No explicit inputs. OUTPUTS: No explicit outputs. COMMON BLOCKS: COLORS: The color table common block. SIDE EFFECTS: Color tables are modified. RESTRICTIONS: None. PROCEDURE: A new window is created and a graph of the color output value versus pixel value is created. The user can adjust this function a number of ways using the mouse. MODIFICATION HISTORY: DMS, March, 1988, written. DMS, April, 1989, modified cursor handling to use less CPU.
(See C:\RSI\IDL52\lib\obsolete\adjct.pro)
NAME: ALIAS_OBJ PURPOSE: This procedure serves as an example of using the ALIAS keyword to allow the programmer to add an object to more than one Model object. This procedure demonstrates how space can be saved by referencing a single large object from several views. Without ALIAS view -> model -> graphics atom / scene \ view -> model -> graphics atom With ALIAS view -> model / \ scene graphics atom \ / view -> model CATEGORY: Object graphics. CALLING SEQUENCE: ALIAS_OBJ, [zData] OPTIONAL INPUTS: zData: A two-dimensional floating point array representing the data to be displayed as a surface. By default, the Maroon Bells example data is displayed. MODIFICATION HISTORY: Written by: DD, June 1996 ALIAS added by : KWS, Oct 1998
(See C:\RSI\IDL52\examples\object\alias_obj.pro)
NAME: AMOEBA PURPOSE: Multidimensional minimization of a function FUNC(X), where X is an N-dimensional vector, using the downhill simplex method of Nelder and Mead, 1965, Computer Journal, Vol 7, pp 308-313. This routine is based on the AMOEBA routine, Numerical Recipes in C: The Art of Scientific Computing (Second Edition), Page 411, and is used by permission. CATEGORY: Function minimization/maximization. Simplex method. CALLING SEQUENCE: Result = AMOEBA(Ftol, ....) INPUTS: FTOL: the fractional tolerance to be achieved in the function value. e.g. the fractional decrease in the function value in the terminating step. This should never be less than the machine's single or double precision. KEYWORD PARAMETERS: FUNCTION_NAME: a string containing the name of the function to be minimized. If omitted, the function FUNC is minimized. This function must accept an Ndim vector as its only parameter and return a scalar single or double precision floating point value as its result. FUNCTION_VALUE: (output) on exit, an Ndim+1 element vector containing the function values at the simplex points. The first element contains the function minimum. NCALLS: (output) the of times the function was evaluated. NMAX: the maximum number of function evaluations allowed before terminating. Default = 5000. P0: Initial starting point, an Ndim element vector. The starting point must be specified using either the keyword SIMPLEX, or P0 and SCALE. P0 may be either single or double precision floating. For example, in a 3-dimensional problem, if the initial guess is the point [0,0,0], and it is known that the function's minimum value occurs in the interval: -10 < X(0) < 10, -100 < X(1) < 100, -200 < X(2) < 200, specify: P0=[0,0,0], SCALE=[10, 100, 200]. SCALE: a scalar or Ndim element vector contaiing the problem's characteristic length scale for each dimension. SCALE is used with P0 to form an initial (Ndim+1) point simplex. If all dimensions have the same scale, specify a scalar. SIMPLEX: (output and/or optional input) On input, if P0 and SCALE are not set, SIMPLEX contains the Ndim+1 vertices, each of Ndim elements, of starting simplex, in either single or double precision floating point, in an (Ndim, Ndim+1) array. On output, SIMPLEX contains the simplex, of dimensions (Ndim, Ndim+1), enclosing the function minimum. The first point, Simplex(*,0), corresponds to the function's minimum. OUTPUTS: Result: If the minimum is found, an Ndim vector, corresponding to the Function's minimum value is returned. If a function minimum within the given tolerance, is NOT found in the given number of evaluations, a scalar value of -1 is returned. COMMON BLOCKS: None. SIDE EFFECTS: None. PROCEDURE: This procedure implements the Simplex method, described in Numerical Recipes, Section 10.4. See also the POWELL procedure. Advantages: requires only function evaluations, not derivatives, may be more reliable than the POWELL method. Disadvantages: not as efficient as Powell's method, and usually requires more function evaluations. Results are performed in the mode (single or double precision) returned by the user-supplied function. The mode of the inputs P0, SCALE, or SIMPLEX, should match that returned by the function. The mode of the input vector supplied to the user-written function, is determined by P0, SCALE, or SIMPLEX. EXAMPLE: Use Amoeba to find the slope and intercept of a straight line fitting a given set of points minimizing the maximum error: The function to be minimized returns the maximum error, given p(0) = intercept, and p(1) = slope: FUNCTION FUNC, p COMMON FUNC_XY, x, y RETURN, MAX(ABS(y - (p(0) + p(1) * x))) END Put the data points into a common block so they are accessible to the function: COMMON FUNC_XY, x, y Define the data points: x = findgen(17)*5 y = [ 12.0, 24.3, 39.6, 51.0, 66.5, 78.4, 92.7, 107.8, 120.0, $ 135.5, 147.5, 161.0, 175.4, 187.4, 202.5, 215.4, 229.9] Call the function. Fractional tolerance = 1 part in 10^5, Initial guess = [0,0], and the minimum should be found within a distance of 100 of that point: r = AMOEBA(1.0e-5, SCALE=1.0e2, P0 = [0, 0], FUNCTION_VALUE=fval) Check for convergence: if n_elements(r) eq 1 then message,'AMOEBA failed to converge' Print results. print, 'Intercept, Slope:', r, 'Function value (max error): ', fval(0) Intercept, Slope: 11.4100 2.72800 Function value: 1.33000 MODIFICATION HISTORY: DMS, May, 1996. Written.
(See C:\RSI\IDL52\lib\amoeba.pro)
NAME: ANNOTATE PURPOSE: This procedure is a general purpose drawing program/widget to annotate displays. Drawing objects include text, lines, arrows, polygons, rectangles, circles, and ellipses. CATEGORY: Widgets. Will also work with plain windows. CALLING SEQUENCE: ANNOTATE INPUTS: No required inputs. KEYWORD PARAMETERS: COLOR_INDICES: an array of color indices from which the user can choose colors. For example, to allow the user to choose 10 colors, spread evenly over the available indices, set the keyword as folows: COLOR_INDICES = INDGEN(10) * (!D.N_COLORS-1) / 9 DRAWABLE: the widget ID of the draw widget for the annotations. This is mutually exclusive with WINDOW. LOAD_FILE: the name of an annotation format file to load after initialization. TEK_COLORS: if set, the Tektronix color table is loaded starting at color index TEK_COLORS(0), with TEK_COLORS(1) color indices. The Tektronix color table contains up to 32 distinct colors suitable for graphics. WINDOW: the window index number of the window to receive the annotations. OUTPUTS: This procedure has no explicit outputs. Menu choices exist to write TIFF, GIF, or PostScript bitmap files. Encapsulated or standalone PostScript files may also be created. SIDE EFFECTS: Annotations are made in the designated window or draw widget. RESTRICTIONS: This is a simple drawing program. PROCEDURE: If neither TEK_COLORS or COLOR_INDICES are specified, the default is to load 10 colors, evenly distributed over those available. If neither WINDOW or DRAWABLE are specified, the current window is used. EXAMPLE: TVSCL, HANNING(300,200) ;Output an image in the current window ANNOTATE ;Annotate it MODIFICATION HISTORY: DMS, RSI, July, 1993. Original version.
(See C:\RSI\IDL52\lib\annotate.pro)
NAME: ANOVA PURPOSE: Perform one-way analysis of variance with equal and unequal sample size, two-way analysis of variance with and without interactions. CATEGORY: Statistics. CALLING SEQUENCE: ANOVA, X INPUTS: X: An array of experimental data. For one-way and two-way analysis of variance without interactions, X must be dimensioned (Treatment#,B), where B is the maximum sample size (one-way anova) or number of blocks (two-way analysis). With interactions, X is dimensioned (Treatment#,I,B), where I is the number of iterates in each cell. OUTPUT: Anova table displaying Sum of Squares, Mean Squares, and F Ratio for sources of variation. KEYWORDS: FCTest = if present and set, returns the value of F for treatment or column variation. FRTest if present and set, returns value of F for row or block variation. FRCTest if present and set, returns value of F for column variation. DFE if present and set, returns denominator degrees of freedom for FCTest,FRTest,FRCTest. DFC if present and set, returns numerator degrees of for FCTest DFR if present and set, returns numerator degrees of for FRTest. DFRC if present and set, returns numerator degrees of for FRCTest. Missing missing data value. If undefined, assume no missing data.If unequal sample sizes, set M to place holding value. List_Name: name of output file. Default is to the screen. Type of design structure. Options a ONE_WAY = if set, perform 1-way anova. Unequal_ONE_WAY = if set, perform 1-way ANOVA with unequal sample sizes. TWO_WAY = if set, perform a 2-way ANOVA. Interactions_TWO_WAY = if set, perform a 2-way ANOVA with interactions. One and Only one of the options above must be set. TContrast: 1- or 2- dimensional array of treatment contrasts. Each row of TC represents a contrast. TC(i,j) = the coefficient of the mean of the ith treatment in the jth contrast. BContrast: 1- or 2- dimensional array of block contrasts. Each row of BC represents a contrast. BC(i,j) = the coefficient of the mean of the ith block in the jth contrast. IContrast: 1- or 2- dimensional array of interaction contrasts. Each row of TC represents a contrast. IC(i,j) = the coefficient of the mean of the ith treatment in the jth contrast. TName: name to be used in the output for treatment type. BName: name to be used in the output for block type. TCName: vector of names to be used in the output to identify treatment contrasts. BCName: vector of names to be used in the output to identify block contrasts. ICName: vector of names to be used in the output to identify interaction contrasts. No_Printout: flag, when set, to suppress printing of output. RESTRICTIONS: NONE. SIDE EFFECTS: None. PROCEDURE: Calculation of standard formulas for sum of squares, mean squares and F ratios.
(See C:\RSI\IDL52\lib\obsolete\anova.pro)
NAME: ANOVA_UNEQUAL PURPOSE: Perform two way analysis of variance with interactions and unequal cell sizes - that is, not every treatment / block combination has the same number of iterations. CATEGORY: Statistics. CALLING SEQUENCE: ANOVA_UNEQUAL, Data, FT_Test, FB_Test, FI_Test INPUTS: Data: Array of experimental data, dimensioned (Treatment#, I, B), where I is the number of repetitions in each cell. OUTPUT: Anova table displaying Sum of Squares, Mean Squares, and F Ratio for sources of variation. OPTIONAL OUTPUT PARAMETERS: FC_Test: value of F for treatment or column variation. FB_Test: value of F for row or block variation. FI_Test: value of F for column variation. KEYWORDS: MISSING: missing data value. If undefined, assume no missing data. If unequal sample sizes, set M to place holding value. LIST_NAME: name of output file. Default is to the screen. TNAME: name to be used in the output for treatment type. BNAME: name to be used in the output for block type. INAME: name to be used in the output for interaction type NO_PRINTOUT: flag , when set, to suppress printing of output RESTRICTIONS: Each treatment/block combination must have at least 1 observation. SIDE EFFECTS: None. PROCEDURE: Overparameterized least squares procedure with sum to zero restrictions.
(See C:\RSI\IDL52\lib\obsolete\anova_unequal.pro)
NAME: ARROW PURPOSE: Draw a vector(s) with an arrow head CATEGORY: Graphics CALLING SEQUENCE: ARROW, x0, y0, x1, y1 INPUTS: (x0, y0) = coordinates of beginning of vector(s). May be arrays or scalars. Coordinates are in DEVICE coordinates unless otherwise specified. (x1, y1) = coordinates of endpoint (head) of vector. x0, y0, x1, y1 must all have the same number of elements. KEYWORD PARAMETERS: DATA - if set, implies that coordinates are in data coords. NORMALIZED - if set, coordinates are specified in normalized coords. HSIZE = size of arrowhead. Default = 1/64th the width of the device, (!D.X_SIZE / 64.). If the size is positive, it is assumed to be in device coordinate units. If it is NEGATIVE, then the head length is set to the vector length * abs(hsize), giving heads proportional in size to the bodies. The size is defined as the length of each of the lines (separated by 60 degrees) that make the head. COLOR = drawing color. Default = highest color index. HTHICK = thickness of heads. Default = 1.0. SOLID = if set, make a solid arrow, using polygon fills, looks better for thick arrows. THICK = thickness of body. Default = 1.0. OUTPUTS: No explicit outputs. SIDE EFFECTS: RESTRICTIONS: PROCEDURE: Straightforward. Examples: Draw an arrow from (100,150) to (300,350) in DEVICE units. ARROW, 100, 150, 300, 350 Draw a sine wave with arrows from the line Y=0 to sin(x/4). X = FINDGEN(50) Y = SIN(x/4) ;Make sin wave PLOT, X, Y ARROW, X, REPLICATE(0,50), X, Y, /DATA MODIFICATION HISTORY: DMS, Feb, 1992. DMS, Sept, 1992. Added /SOLID.
(See C:\RSI\IDL52\lib\arrow.pro)
NAME: ASCII_TEMPLATE PURPOSE: Generate a template that defines an ASCII file format. CATEGORY: Input/Output. CALLING SEQUENCE: template = ASCII_TEMPLATE( [file] ) INPUTS: file - Name of file to base the template on. Default = use DIALOG_PICKFILE to get the file. INPUT KEYWORD PARAMETERS: browse_lines - Number of lines to read in at a time via the GUI's browse button. Default = 50. OUTPUT KEYWORD PARAMETERS: cancel - Boolean indicating if the user canceled out of the interface (1B = canceled). OUTPUTS: The function returns a template (structure) defining ASCII files of the input file's format. Such templates may be used as inputs to function READ_ASCII. (0 is returned if the user canceled.) COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: See DESCRIPTION. DESCRIPTION: This routine presents a graphical user interface (GUI) that assists the user in defining a template. ASCII files handled by this routine consist of an optional header of a fixed number of lines, followed by columnar data. Files may also contain comments, which exist between a user-specified comment string and the corresponding end-of-line. One or more rows of data constitute a "record." Each data element within a record is considered to be in a different column, or "field." Adjacent fields may be "grouped" into multi-column fields. The data in one field must be of, or promotable to, a single type (e.g., FLOAT). EXAMPLES: ; Generating a template to be used later, maybe on a set of files. template = ASCII_TEMPLATE() ; Same as above, but immediately specifying which file to use. template = ASCII_TEMPLATE(file) ; Same as above, but returning flag if the user canceled. template = ASCII_TEMPLATE(file, CANCEL=cancel) ; Generating and using a template in place for reading data. data = READ_ASCII(file, TEMPLATE=ASCII_TEMPLATE(file)) DEVELOPMENT NOTES: - see ???,!!!,xxx in the code - errors preserving state when switch pages with 'back/next' - make NaN default missing value as in reader ? MODIFICATION HISTORY: AL & RPM, 8/96 - Written.
(See C:\RSI\IDL52\lib\ascii_template.pro)
NAME: A_CORRELATE PURPOSE: This function computes the autocorrelation Px(L) or autocovariance Rx(L) of a sample population X as a function of the lag (L). CATEGORY: Statistics. CALLING SEQUENCE: Result = A_correlate(X, Lag) INPUTS: X: An n-element vector of type integer, float or double. LAG: A scalar or n-element vector, in the interval [-(n-2), (n-2)], of type integer that specifies the absolute distance(s) between indexed elements of X. KEYWORD PARAMETERS: COVARIANCE: If set to a non-zero value, the sample autocovariance is computed. DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE Define an n-element sample population. x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57] Compute the autocorrelation of X for LAG = -3, 0, 1, 3, 4, 8 lag = [-3, 0, 1, 3, 4, 8] result = a_correlate(x, lag) The result should be: [0.0146185, 1.00000, 0.810879, 0.0146185, -0.325279, -0.151684] PROCEDURE: See computational formula published in IDL manual. REFERENCE: INTRODUCTION TO STATISTICAL TIME SERIES Wayne A. Fuller ISBN 0-471-28715-6 MODIFICATION HISTORY: Written by: GGS, RSI, October 1994 Modified: GGS, RSI, August 1995 Corrected a condition which excluded the last term of the time-series. Modified: GGS, RSI, April 1996 Simplified AUTO_COV function. Added DOUBLE keyword. Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\a_correlate.pro)
NAME: BAR_PLOT PURPOSE: Create a bar graph, or overplot on an existing one. CATEGORY: Graphics. CALLING SEQUENCE: BAR_PLOT, Values INPUTS: Values: A vector containing the values to be represented by the bars. Each element in VALUES corresponds to a single bar in the output. KEYWORD PARAMETERS: BASELINES: A vector, the same size as VALUES, that contains the base value associated with each bar. If not specified, a base value of zero is used for all bars. COLORS: A vector, the same size as VALUES, containing the color index to be used for each bar. If not specified, the colors are selected based on spacing the color indices as widely as possible within the available colors (specified by D.N_COLORS). BARNAMES: A string array, containing one string label per bar. If the bars are vertical, the labels are placed beneath them. If horizontal (rotated) bars are specified, the labels are placed to the left of the bars. TITLE: A string containing the main title to for the bar plot. XTITLE: A string containing the title for the X axis. YTITLE: A string containing the title for the Y axis. BASERANGE: A floating-point scalar in the range 0.0 to 1.0, that determines the fraction of the total available plotting area (in the direction perpendicular to the bars) to be used. If not specified, the full available area is used. BARWIDTH: A floating-point value that specifies the width of the bars in units of "nominal bar width". The nominal bar width is computed so that all the bars (and the space between them, set by default to 20% of the width of the bars) will fill the available space (optionally controlled with the BASERANGE keyword). BARSPACE: A scalar that specifies, in units of "nominal bar width", the spacing between bars. For example, if BARSPACE is 1.0, then all bars will have one bar-width of space between them. If not specified, the bars are spaced apart by 20% of the bar width. BAROFFSET: A scalar that specifies the offset to be applied to the first bar, in units of "nominal bar width". This keyword allows, for example, different groups of bars to be overplotted on the same graph. If not specified, the default offset is equal to BARSPACE. OUTLINE: If set, this keyword specifies that an outline should be drawn around each bar. OVERPLOT: If set, this keyword specifies that the bar plot should be overplotted on an existing graph. BACKGROUND: A scalar that specifies the color index to be used for the background color. By default, the normal IDL background color is used. ROTATE: If set, this keyword indicates that horizontal rather than vertical bars should be drawn. The bases of horizontal bars are on the left, "Y" axis and the bars extend to the right. OUTPUTS: A bar plot is created, or an existing one is overplotted. EXAMPLE: By using the overplotting capability, it is relatively easy to create stacked bar charts, or different groups of bars on the same graph. For example, if ARRAY is a two-dimensional array of 5 columns and 8 rows, it is natural to make a plot with 5 bars, each of which is a "stacked" composite of 8 sections. First, create a 2D COLORS array, equal in size to ARRAY, that has identical color index values across each row to ensure that the same item is represented by the same color in all bars. With ARRAYS and COLORS defined, the following code fragment illustrates the creation of stacked bars (note that the number of rows and columns is arbitrary): !Y.RANGE = [0,ymax] ; Scale range to accommodate the total bar lengths. BASE = INTARR(NROWS) FOR I = 0, NROWS-1 DO BEGIN BAR_PLOT, ARRAY(*,I), COLORS=COLORS(*,I), BASELINES=BASE, $ BARWIDTH=0.75, BARSPACE=0.25, OVER=(I GT 0) BASE = BASE + ARRAY(*,I) ENDFOR To plot each row of ARRAY as a clustered group of bars within the same graph, use the BASERANGE keyword to restrict the available plotting region for each set of bars. The sample code fragment below illustrates this method: FOR I = 0, NROWS-1 DO $ BAR_PLOT, ARRAY(*,I), COLORS=COLORVECT, BARWIDTH=0.8,BARSPACE=0.2, $ BAROFFSET=I*((1.0+BARSPACE)*NCOLS), OVER=(I GT 0), BASERANGE=0.19 where NCOLS is the number of columns in ARRAY, and COLORVECT is a vector containing the color indices to be used for each group of bars. (In this example, each group uses the same set of colors, but this could easily be changed.) MODIFICATION HISTORY: August 1990, T.J. Armitage, RSI, initial programming. Replacement for PLOTBAR and OPLOTBAR routines written by William Thompson. September 1990, Steve Richards, RSI, changed defaults to improve the appearance of the bar plots in the default mode. Included spacing the bars slightly.
(See C:\RSI\IDL52\lib\bar_plot.pro)
NAME: BETA PURPOSE: The introduction of the BETA function as a built in system routine in IDL 4.0 caused inconvenience to customers with existing code in which BETA had been used as a variable, because IDL system routines have precedence over variable names. To minimize this problem, RSI has renamed BETA back to NR_BETA (its old name). This wrapper serves to make NR_BETA available under the name BETA as documented in the IDL Reference Manual. However, since IDL library routines have lower precedence than variables, programs that use BETA as a variable name will work as before. See the documentation for BETA in the IDL Reference manual for details on arguments, keywords, and results. MODIFICATION HISTORY: 3 July 1995, AB, RSI.
(See C:\RSI\IDL52\lib\beta.pro)
NAME: BILINEAR PURPOSE: Bilinearly interpolate a set of reference points. CALLING SEQUENCE: Result = BILINEAR(P, IX, JY) INPUTS: P: A two-dimensional data array. IX and JY: The "virtual subscripts" of P to look up values for the output. IX can be one of two types: 1) A one-dimensional, floating-point array of subscripts to look up in P. The same set of subscripts is used for all rows in the output array. 2) A two-dimensional, floating-point array that contains both "x-axis" and "y-axis" subscripts specified for all points in the output array. In either case, IX must satisfy the expression, 0 <= MIN(IX) < N0 and 0 < MAX(IX) <= N0 where N0 is the total number of subscripts in the first dimension of P. JY can be one of two types: 1) A one-dimensional, floating-point array of subscripts to look up in P. The same set of subscripts is used for all rows in the output array. 2) A two-dimensional, floating-point array that contains both "x-axis" and "y-axis" subscripts specified for all points in the output array. In either case JY must satisfy the expression, 0 <= MIN(JY) < M0 and 0 < MAX(JY) <= M0 where M0 is the total number of subscripts in the second dimension of P. It is better to use two-dimensional arrays for IX and JY when calling BILINEAR because the algorithm is somewhat faster. If IX and JY are one-dimensional, they are converted to two-dimensional arrays on return from the function. The new IX and JY can be re-used on subsequent calls to take advantage of the faster, 2D algorithm. The 2D array P is unchanged upon return. OUTPUT: The two-dimensional, floating-point, interpolated array. SIDE EFFECTS: This function can take a long time to execute. RESTRICTIONS: None. EXAMPLE: Suppose P = FLTARR(3,3), IX = [.1, .2], and JY = [.6, 2.1] then the result of the command: Z = BILINEAR(P, IX, JY) Z(0,0) will be returned as though it where equal to P(.1,.6) interpolated from the nearest neighbors at P(0,0), P(1,0), P(1,1) and P(0,1). PROCEDURE: Uses bilinear interpolation algorithm to evaluate each element in the result at virtual coordinates contained in IX and JY with the data in P. REVISION HISTORY: Nov. 1985 Written by L. Kramer (U. of Maryland/U. Res. Found.) Aug. 1990 TJA simple bug fix, contributed by Marion Legg of NASA Ames Sep. 1992 DMS, Scrapped the interpolat part and now use INTERPOLATE
(See C:\RSI\IDL52\lib\bilinear.pro)
NAME: BINOMIAL PURPOSE: This function computes the probabilty (bp) such that: Probability(X => v) = bp where X is a random variable from the cumulative binomial distribution (Bernouli distribution). CATEGORY: Statistics. CALLING SEQUENCE: Result = Binomial(V, N, P) INPUTS: V: A non-negative integer specifying the minimal number of times an event E occurs in (N) independent performances. N: A non-negative integer specifying the number of performances. If the number of performances exceeds 25, the Gaussian distribution is used to approximate the cumulative binomial distribution. P: A non-negative scalar, in the interval [0.0, 1.0], of type float or double that specifies the probability of occurance or success of a single independent performance. EXAMPLES: Compute the probability of obtaining at least two 6s in rolling a die four times. The result should be 0.131944 result = binomial(2, 4, 1./6.) Compute the probability of obtaining exactly two 6s in rolling a die four times. The result should be 0.115741 result = binomial(2, 4, 1./6.) - binomial(3, 4, 1./6.) Compute the probability of obtaining three or fewer 6s in rolling a die four times. The result should be 0.999228 result = (binomial(0, 4, 1./6.) - binomial(1, 4, 1./6.)) + $ (binomial(1, 4, 1./6.) - binomial(2, 4, 1./6.)) + $ (binomial(2, 4, 1./6.) - binomial(3, 4, 1./6.)) + $ (binomial(3, 4, 1./6.) - binomial(4, 4, 1./6.)) PROCEDURE: BINOMIAL computes the probability that an event E occurs at least (V) times in (N) independent performances. The event E is assumed to have a probability of occurance or success (P) in a single performance. REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Modified by: GGS, RSI, July 1994 Minor changes to code. Rewrote documentation header.
(See C:\RSI\IDL52\lib\binomial.pro)
NAME: BIN_DATE PURPOSE: This function converts a standard form ascii date/time string to a binary string. CATEGORY: Date/time functions. CALLING SEQUENCE: Result = BIN_DATE(Asc_time) INPUTS: Asc_time: the date/time to convert in standard ascii format. If omitted, use the current date/time. Standard form is a 24 character string: DOW MON DD HH:MM:SS YYYY where: DOW = day of week, MON = month, DD=day of month, HH:MM:SS = hour/minute/second, YYYY = year. OUTPUTS: This function returns a 6 element integer array containing: Element 0 = year e.g. 1992 1 = month 1-12 2 = day 1-31 3 = hour 0-23 4 = minute 0-59 5 = second 0-59 SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Straightforward. MODIFICATION HISTORY: Written by: DMS /RSI, Jul, 1992. Modified to use STR_SEP function, DMS, Dec. 1995. Fixed bug when passed single digit dates KDB, Nov, 01 1996
(See C:\RSI\IDL52\lib\bin_date.pro)
NAME: BISECT_PDF PURPOSE: This function computes the cutoff value x such that the probabilty of an observation from the given distribution, less than x, is a(0). u and l are the upper and lower limits for x, respectively. a(1) and a(2) are degrees of freedom, if appropriate. funct is a string specifying the probability density function. BISECT_PDF is not intended to be a user-callable function.
(See C:\RSI\IDL52\lib\bisect_pdf.pro)
NAME: BLK_CON PURPOSE: This function computes a "fast convolution" of a digital signal and an impulse-response sequence. CATEGORY: Digital Signal Processing CALLING SEQUENCE: Result = BLK_CON(Filter, Signal, B_length = B_length) INPUTS: Filter = A P-element floating-point vector containing the impulse- response sequence of the digital filter. Signal = An N-element floating-point vector containing the discrete signal samples. KEYWORD PARAMETERS: B_length = (Block Length) An integer specifying the length of the subdivided signal segments. If this paramter is not specified, a near-optimal value is chosen by the algorithm based upon the length of the impulse-response sequence, P. If P is a value less than 11 or greater than 377, then B_length must be specified. RESTRICTIONS: 1) The block length must be greater than the filter length. B_length > P 2) The block length must be less than the number of signal samples. B_length < N_elements(Signal) EXAMPLE: Create an impulse-response sequence of length P = 32. filter = replicate(1.0, 32) ;Set all points to 1.0 filter(2*indgen(16)) = 0.5 ;Set even points to 0.5 Create a sampled signal with random noise. signal = sin((findgen(1000)/35.0)^2.5) noise = (randomu(SEED,1000)-0.5)/2 signal = signal + noise Convolve the filter and signal using block convolution. result = BLK_CON(filter, signal) PROCEDURE: Implementation of the "overlap-save" method in the frequency domain. The discrete signal samples are divided into overlapping segments of a length specified by the parameter B_length. B_length may be supplied by the user as an optional keyword parameter or determined by the algorithm to a near-optimal value. Each input segment consists of P-1 samples from the previous input segment and (B_length-P+1) new signal samples, where P is the length of the filter. Each of these segments is processed in the frequency domain and then 'reassembled' in the time domain. The first and last input segments are handled differently. The result is an N-element floating-point vector containing the filtered signal. REFERENCE: Oppenheim, A.V. and Schafer, R.W. DIGITAL SIGNAL PROCESSING Prentice-Hall, 1975 MODIFICATION HISTORY: Written by: GGS, RSI, May 1993 Modified: GGS, RSI, June 1994 Added long indexing into vectors. Minor changes in the use of intermediate variables reduces memory allocation in certain instances. Made slight changes to the documentation header.
(See C:\RSI\IDL52\lib\blk_con.pro)
NAME: BOX_CURSOR PURPOSE: Emulate the operation of a variable-sized box cursor (also known as a "marquee" selector). CATEGORY: Interactive graphics. CALLING SEQUENCE: BOX_CURSOR, x0, y0, nx, ny [, INIT = init] [, FIXED_SIZE = fixed_size] INPUTS: No required input parameters. OPTIONAL INPUT PARAMETERS: x0, y0, nx, and ny give the initial location (x0, y0) and size (nx, ny) of the box if the keyword INIT is set. Otherwise, the box is initially drawn in the center of the screen. KEYWORD PARAMETERS: INIT: If this keyword is set, x0, y0, nx, and ny contain the initial parameters for the box. FIXED_SIZE: If this keyword is set, nx and ny contain the initial size of the box. This size may not be changed by the user. MESSAGE: If this keyword is set, print a short message describing operation of the cursor. OUTPUTS: x0: X value of lower left corner of box. y0: Y value of lower left corner of box. nx: width of box in pixels. ny: height of box in pixels. The box is also constrained to lie entirely within the window. COMMON BLOCKS: None. SIDE EFFECTS: A box is drawn in the currently active window. It is erased on exit. RESTRICTIONS: Works only with window system drivers. PROCEDURE: The graphics function is set to 6 for eXclusive OR. This allows the box to be drawn and erased without disturbing the contents of the window. Operation is as follows: Left mouse button: Move the box by dragging. Middle mouse button: Resize the box by dragging. The corner nearest the initial mouse position is moved. Right mouse button: Exit this procedure, returning the current box parameters. MODIFICATION HISTORY: DMS, April, 1990. DMS, April, 1992. Made dragging more intutitive. June, 1993 - Bill Thompson prevented the box from having a negative size. SJL, Nov, 1997. Formatted, conform to IDL style guide. Prevented crash from unitialized corner. RJF, Feb, 1998. Replaced !ERROR_STATE.CODE w/ !MOUSE.BUTTON and fixed some problems w/sizing when a corner might swap.
(See C:\RSI\IDL52\lib\box_cursor.pro)
NAME: CALDAT PURPOSE: Return the calendar date and time given julian date. This is the inverse of the function JULDAY. CATEGORY: Misc. CALLING SEQUENCE: CALDAT, Julian, Month, Day, Year, Hour, Minute, Second See also: julday, the inverse of this function. INPUTS: JULIAN contains the Julian Day Number (which begins at noon) of the specified calendar date. It should be a long integer. OUTPUTS: (Trailing parameters may be omitted if not required.) MONTH: Number of the desired month (1 = January, ..., 12 = December). DAY: Number of day of the month. YEAR: Number of the desired year. HOUR: Hour of the day Minute: Minute of the day Second: Second (and fractions) of the day. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Accuracy using IEEE double precision numbers is approximately 1/10000th of a second. MODIFICATION HISTORY: Translated from "Numerical Recipies in C", by William H. Press, Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. Cambridge University Press, 1988 (second printing). DMS, July 1992. DMS, April 1996, Added HOUR, MINUTE and SECOND keyword AB, 7 December 1997, Generalized to handle array input.
(See C:\RSI\IDL52\lib\caldat.pro)
NAME: CALENDAR PURPOSE: Display a calandar for a month or an entire year using IDL's plotting subsystem. This IDL routine imitates the Unix cal command. CATEGORY: Misc. CALLING SEQUENCE: CALENDAR CALENDAR, YEAR CALENDAR, MONTH, YEAR INPUTS: If called without arguments, CALENDAR draws a calendar for the current month. MONTH: The number of the month for which a calandar is desired (1 is January, 2 is February, ..., 12 is December). YEAR: The number of the year for which a calendar should be drawn. If YEAR is provided without MONTH, a calendar for the entire year is drawn. OPTIONAL INPUT PARAMETERS: None. OUTPUTS: The specified calandar is drawn on the current graphics device. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. MODIFICATION HISTORY: AB, September, 1988
(See C:\RSI\IDL52\lib\calendar.pro)
NAME: CDF_EXISTS PURPOSE: Test for the existence of the CDF library CATEGORY: File Formats CALLING SEQUENCE: Result = CDF_EXISTS() INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: Returns TRUE (1) if the CDF data format library is supported. Returns FALSE(0) if it is not. EXAMPLE: IF cdf_exists() EQ 0 THEN Fail,"CDF not supported on this machine" MODIFICATION HISTORY Written by: Joshua Goldstein, 12/8/92
(See C:\RSI\IDL52\lib\cdf_exists.pro)
NAME: CHEBYSHEV PURPOSE: Implements forward and reverse Chebyshev polynomial expansion of a set of data. CATAGORY: Mathematics. CALLING SEQUENCE: Result = CHEBYSHEV(D, N) INPUT: D: A vector containing the values at the zeros of Chebyshev polynomial. N: A flag that, if set to -1, returns a set of Chebyshev polynomials. If set to +1, the original data is returned. OUTPUT: Returns either the set of Chebyshev polynomials or the original data depending on the value of N. COMMON BLOCKS: None. SIDE EFFECTS: Results from this function are subject to roundoff error given discontinuous data. RESTRICTIONS: Unknown. PROCEDURE: Straightforward implementation of recursion formula. REVISION HISTORY: Jan, 1986 Written by Leonard Kramer, U. of Maryland University Research Foundation
(See C:\RSI\IDL52\lib\chebyshev.pro)
NAME: CHISQR_CVF PURPOSE: This function computes the cutoff value (v) such that: Probability(X > v) = p where X is a random variable from the Chi-square distribution with (df) degrees of freedom. CATEGORY: Statistics. CALLING SEQUENCE: Result = chisqr_cvf(P, DF) INPUTS: P: A non-negative scalar, in the interval [0.0, 1.0], of type float or double that specifies the probability of occurance or success. DF: A positive scalar of type integer, float or double that specifies the degrees of freedom of the Chi-square distribution. EXAMPLE: Compute the cutoff value (v) such that Probability(X > v) = 0.100 from the Chi-square distribution with (DF = 3) degrees of freedom. The result should be 6.25139 result = chisqr_cvf(0.100, 3) REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Modified by: GGS, RSI, July 1994 Minor changes to code. New documentation header.
(See C:\RSI\IDL52\lib\chisqr_cvf.pro)
NAME: CHISQR_PDF PURPOSE: This function computes the probabilty (p) such that: Probability(X <= v) = p where X is a random variable from the Chi-square distribution with (df) degrees of freedom. CATEGORY: Statistics. CALLING SEQUENCE: Result = chisqr_pdf(V, DF) INPUTS: V: A scalar of type integer, float or double that specifies the cutoff value. DF: A positive scalar of type integer, float or double that specifies the degrees of freedom of the Chi-square distribution. EXAMPLES: Compute the probability that a random variable X, from the Chi-square distribution with (DF = 3) degrees of freedom, is less than or equal to 6.25. The result should be 0.899939 result = chisqr_pdf(6.25, 3) Compute the probability that a random variable X, from the Chi-square distribution with (DF = 3) degrees of freedom, is greater than 6.25. The result should be 0.100061 result = 1 - chisqr_pdf(6.25, 3) REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Modified by: GGS, RSI, July 1994 Minor changes to code. New documentation header.
(See C:\RSI\IDL52\lib\chisqr_pdf.pro)
NAME: CHI_SQR PURPOSE: CHI_SQR returns the cutoff value v such that Probability(X > v) = a where X is a random variable from the chi_sqr distribution with v degrees of freedom. CATEGORY: Statistics. CALLING SEQUENCE: Result = CHI_SQR(A, DF) INPUT: A: probability DF: degrees of freedom OUTPUT: If a is between 0 and 1, then the cutoff value is returned. Otherwise, -1 is returned to indicate an error.
(See C:\RSI\IDL52\lib\obsolete\chi_sqr.pro)
NAME: CHI_SQR1 PURPOSE: CHI_SQR1 returns the probabilty of observing X or something smaller from a chi square distribution with DF degrees of freedom. CATEGORY: Statistics. CALLING SEQUENCE: PROB = CHI_SQR1(X,DF) INPUTS: X: the cut off point DF: the degrees of freedom
(See C:\RSI\IDL52\lib\obsolete\chi_sqr1.pro)
NAME: CIR_3PNT PURPOSE: This procedure returns the radius and center of a circle, given 3 points on the circle. This is analogous to finding the circumradius and circumcircle of a triangle; the center of the circumcircle is the point at which the three perpendicular bisectors of the triangle formed by the points meet. CATEGORY: Analytical geometry. CALLING SEQUENCE: CIR_3PNT, X, Y, R, X0, Y0 INPUTS: X: A three-element vector containing the X-coordinates of the points. Y: A three-element vector containing the Y-coordinates of the points. OUTPUTS: R: The radius of the circle. The procedure returns 0.0 if the points are co-linear. X0, Y0: The coordinates of the center of the circle. The procedure returns 0.0 if the points are co-linear. PROCEDURE: Derived from Glasser, ed. Graphics Gems, Volume 1, Page 22. EXAMPLE: X = [1.0, 2.0, 3.0] Y = [1.0, 2.0, 1.0] CIR_3PNT, X, Y, R, X0, Y0 Print, 'The radius is: ', R Print, 'The center of the circle is at: ', X0, Y0 MODIFICATION HISTORY: Written by: DMS, RSI, Nov, 1992. SJL, Nov, 1997. - Formatting.
(See C:\RSI\IDL52\lib\cir_3pnt.pro)
NAME: COLORMAP_APPLICABLE PURPOSE: Determine whether the current visual class supports the use of a colormap, and if so, whether colormap changes affect pre-displayed Direct Graphics or if the graphics must be redrawn to pick up colormap changes. CATEGORY: Direct Graphics, Color. CALLING SEQUENCE: result = COLORMAP_APPLICABLE(redrawRequired) INPUTS: None. Keyword Inputs: None. OUTPUTS: The function returns a long value of 1 if the current visual class allows modification of the color table, and 0 otherwise. redrawRequired: Set this to a named variable to retrieve a value indicating whether the visual class supports automatic updating of graphics. The value will be 0 if the graphics are updated automatically or 1 if the graphics must be redrawn to pick up changes to the colormap. EXAMPLE: To determine whether to redisplay an image after a colormap change: result = COLORMAP_APPLICABLE(redrawRequired) IF ((result GT 0) AND (redrawRequired GT 0)) THEN BEGIN my_redraw ENDIF MODIFICATION HISTORY: Written August 1998, ACY
(See C:\RSI\IDL52\lib\colormap_applicable.pro)
NAME: COLOR_EDIT PURPOSE: Interactively create color tables based on the HLS or the HSV color systems using the mouse and a color wheel. CATEGORY: Color tables. CALLING SEQUENCE: COLOR_EDIT [, Colors_Out] [, HSV = hsv] [, HLS = hls] INPUTS: None. KEYWORD PARAMETERS: HLS: If this keyword is set, use the Hue Lightness Saturation system. HSV: If this keyword is set, use the Hue Saturation Value system (the default). OUTPUTS: Colors_Out: If supplied, this variable contains the final color table triples as an array of the form (number_colors, 3). COMMON BLOCKS: COLORS: Contains the current RGB color tables. SIDE EFFECTS: Color tables are modified, values in COLORS common are changed. A temporary window is used. RESTRICTIONS: Only works with window systems. PROCEDURE: A window is created with: 1) A color bar centered at the top. 2) A color wheel for the hue (azimuth of mouse from the center) and saturation (distance from the center). 3) Two "slider bars", the top one for the Value (HSV) or Lightness (HLS), and the other for the pixel value. 4) 3 graphs showing the current values of the three parameters versus pixel value. Operation: The left mouse button is used to mark values on the sliders and in the color wheel. The middle button is used to erase marked pixel values (tie points) in the Pixel Value slider. The right button updates the color tables and exits the procedure. To use: Move the mouse into the circle or middle slider and depress the left button to select a Hue/Saturation or a Value/Lightness. Move the mouse with the left button depressed to interactively alter a color (shown in the color wheel. When you have created a color, move the mouse to the bottom "Pixel Value" slider and select a pixel value. The three color parameters are interpolated between pixel values that have been marked (called tie points). Tie points are shown as small vertical lines beneath the "Pixel Value" slider. Press the middle button with the cursor over the Pixel Value slider to delete the nearest tie point. Note that in the HSV system, a Value of 1.0 represents the maximum brightness of the selected hue. In the HLS system, a Lightness of 0.5 is the maximum brightness of a chromatic hue, 0.0 is black, and 1.0 is bright white. In the HLS color space, modeled as a double-ended cone, the Saturation value has no effect at the extreme ends of the cone (i.e., lightness = 0 or 1). You can access the new color tables by declaring the common block COLORS as follows: COMMON COLORS, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr MODIFICATION HISTORY: DMS, July, 1988. SNG, December, 1990 - Added support for DOS version. Does not support resolutions lower than 640x480.
(See C:\RSI\IDL52\lib\obsolete\color_edit.pro)
NAME: COMFIT PURPOSE: This function fits the paired data {X(i), Y(i)} to one of six common types of appoximating models using a gradient-expansion least-squares method. The result is a vector containing the model parameters. CATEGORY: Statistics. CALLING SEQUENCE: Result = COMFIT(X, Y, A) INPUTS: X: An n-element vector of type integer, float or double. Y: An n-element vector of type integer, float or double. A: A vector of initial estimates for each model parameter. The length of this vector depends upon the type of model selected. KEYWORD PARAMETERS: EXPONENTIAL: If set to a non-zero value, the parameters of the exponential model are computed. Y = a0 * a1^x + a2. GEOMETRIC: If set to a non-zero value, the parameters of the geometric model are computed. Y = a0 * x^a1 + a2. GOMPERTZ: If set to a non-zero value, the parameters of the Gompertz model are computed. Y = a0 * a1^(a2*x) + a3. HYPERBOLIC: If set to a non-zero value, the parameters of the hyperbolic model are computed. Y = 1./(a0 + a1*x) LOGISTIC: If set to a non-zero value, the parameters of the logistic model are computed. Y = 1./(a0 * a1^x + a2) LOGSQUARE: If set to a non-zero value, the parameters of the logsquare model are computed. Y = a0 + a1*alog10(x) + a2 * alog10(x)^2 SIGMA: Use this keyword to specify a named variable which returns a vector of standard deviations for the computed model parameters. WEIGHTS: An n-element vector of weights. If the WEIGHTS vector is not specified, an n-element vector of 1.0s is used. YFIT: Use this keyword to specify a named variable which returns n-element vector of y-data corresponding to the computed model parameters. EXAMPLE: Define two n-element vectors of paired data. x = [2.27, 15.01, 34.74, 36.01, 43.65, 50.02, 53.84, 58.30, 62.12, $ 64.66, 71.66, 79.94, 85.67, 114.95] y = [5.16, 22.63, 34.36, 34.92, 37.98, 40.22, 41.46, 42.81, 43.91, $ 44.62, 46.44, 48.43, 49.70, 55.31] Define a 3-element vector of initial estimates for the logsquare model. a = [1.5, 1.5, 1.5] Compute the model parameters of the logsquare model, a(0), a(1), & a(2). result = comfit(x, y, a, sigma = sigma, yfit = yfit, /logsquare) The result should be the 3-element vector: [1.42494, 7.21900, 9.18794] REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Written by: GGS, RSI, September 1994
(See C:\RSI\IDL52\lib\comfit.pro)
NAME: COMPLEXROUND PURPOSE: This function rounds a complex scalar or array. CATEGORY: Numerical Analysis. CALLING SEQUENCE: Result = Complexround(z) INPUTS: Z: A complex scalar or array. RESTRICTIONS: The input argument must be complex. PROCEDURE: This function rounds the real and imaginary components of the complex input argument. EXAMPLE: ;Define a complex array. z = [[complex(1.245, 3.880), complex( 1.245, -3.880)], $ [complex(1.499, 5.501), complex(-1.355, -2.115)]] ;Round it. result = complexround(z) MODIFICATION HISTORY: Written by: GGS, RSI, September 1992 Modified: GGS, RSI, September 1994 Added support for double-precision complex inputs. Uses IDL's intrinsic ROUND function.
(See C:\RSI\IDL52\lib\complexround.pro)
NAME: COND PURPOSE: This function computes the condition number of an N by N array. CATEGORY: Complex Linear Algebra. CALLING SEQUENCE: Result = COND(A) INPUTS: A: An N by N real or complex array. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE: Define a complex array (a). a = [[complex(1, 0), complex(2,-2), complex(-3,1)], $ [complex(1,-2), complex(2, 2), complex(1, 0)], $ [complex(1, 1), complex(0, 1), complex(1, 5)]] Compute the condition number of the complex array (a) using double-precision complex arithmetic. result = cond(a, /double) PROCEDURE: This function returns the condition number of an N x N real or complex array (A) by explicitly computing, norm(A)*norm(A_inverse). If A is real and A_inverse is invalid (due to the singularity of A or floating-point errors in the nr_invert function), the condition number is returned as a -1. If A is complex and A_inverse is invalid (due to the singularity of A), calling COND.PRO results in floating- point errors. REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Written by: GGS, RSI, April 1992 Modified: GGS, RSI, February 1994 Accepts complex inputs. Added DOUBLE keyword. Modified: GGS, RSI, November 1994 Added support for double-precision complex inputs. Changed NR_INVERT to INVERT. Modified: GGS, RSI, April 1996 Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\cond.pro)
NAME: CONGRID PURPOSE: Shrink or expand the size of an array by an arbitrary amount. This IDL procedure simulates the action of the VAX/VMS CONGRID/CONGRIDI function. This function is similar to "REBIN" in that it can resize a one, two, or three dimensional array. "REBIN", however, requires that the new array size must be an integer multiple of the original size. CONGRID will resize an array to any arbitrary size (REBIN is somewhat faster, however). REBIN averages multiple points when shrinking an array, while CONGRID just resamples the array. CATEGORY: Array Manipulation. CALLING SEQUENCE: array = CONGRID(array, x, y, z) INPUTS: array: A 1, 2, or 3 dimensional array to resize. Data Type : Any type except string or structure. x: The new X dimension of the resized array. Data Type : Int or Long (greater than or equal to 2). OPTIONAL INPUTS: y: The new Y dimension of the resized array. If the original array has only 1 dimension then y is ignored. If the original array has 2 or 3 dimensions then y MUST be present. z: The new Z dimension of the resized array. If the original array has only 1 or 2 dimensions then z is ignored. If the original array has 3 dimensions then z MUST be present. KEYWORD PARAMETERS: INTERP: If set, causes linear interpolation to be used. Otherwise, the nearest-neighbor method is used. CUBIC: If specified and non-zero, "Cubic convolution" interpolation is used. This is a more accurate, but more time-consuming, form of interpolation. CUBIC has no effect when used with 3 dimensional arrays. If this parameter is negative and non-zero, it specifies the value of the cubic interpolation parameter as described in the INTERPOLATE function. Valid ranges are -1 <= Cubic < 0. Positive non-zero values of CUBIC (e.g. specifying /CUBIC) produce the default value of the interpolation parameter which is -1.0. MINUS_ONE: If set, will prevent CONGRID from extrapolating one row or column beyond the bounds of the input array. For example, If the input array has the dimensions (i, j) and the output array has the dimensions (x, y), then by default the array is resampled by a factor of (i/x) in the X direction and (j/y) in the Y direction. If MINUS_ONE is present (AND IS NON-ZERO) then the array will be resampled by the factors (i-1)/(x-1) and (j-1)/(y-1). OUTPUTS: The returned array has the same number of dimensions as the original array and is of the same data type. The returned array will have the dimensions (x), (x, y), or (x, y, z) depending on how many dimensions the input array had. PROCEDURE: IF the input array has three dimensions, or if INTERP is set, then the IDL interpolate function is used to interpolate the data values. If the input array has two dimensions, and INTERP is NOT set, then the IDL POLY_2D function is used for nearest neighbor sampling. If the input array has one dimension, and INTERP is NOT set, then nearest neighbor sampling is used. EXAMPLE: ; vol is a 3-D array with the dimensions (80, 100, 57) ; Resize vol to be a (90, 90, 80) array vol = CONGRID(vol, 90, 90, 80) MODIFICATION HISTORY: DMS, Sept. 1988. DMS, Added the MINUS_ONE keyword, Sept. 1992. Daniel Carr. Re-wrote to handle one and three dimensional arrays using INTERPOLATE function. DMS, RSI, Nov, 1993. Added CUBIC keyword. SJL, Nov, 1997. Formatting, conform to IDL style guide.
(See C:\RSI\IDL52\lib\congrid.pro)
NAME: CONTINGENT PURPOSE: Construct a two-way contingency table from the count data in X and test for independence between two factors represented by the rows and columns of X. CATEGORY: Statistics. CALLING SEQUENCE: Contingent, X, ChiSqr, Prob, DF INPUTS: X: input array of count data. X(i,j) is the number of observations at level i and j of the column and row factors respectively. OUTPUT: Contingency table writtem to the screen. OPTIONAL OUTPUT PARAMETERS: ChiSqr: the statistic to test for factor independence. Prob: the probability of ChiSqr or something larger from a chi square distribution. DF: degrees of freedom KEYWORDS: COLNAMES: vector of names to label table columns. ROWNAMES: vector of names to label table rows. LIST_NAME: name of output file. default is to the screen. RESTRICTIONS: None. COMMON BLOCKS: None. SIDE EFFECTS: None. PROCEDURE: Calculation of standard formulas to compute ChiSqr.
(See C:\RSI\IDL52\lib\obsolete\contingent.pro)
NAME: COORD2TO3 PURPOSE: Return 3D data coordinates given the normalized X and Y screen coordinates and one of the three data coordinates. CATEGORY: Geometry / Graphics. CALLING SEQUENCE: Result = COORD2TO3(Mx, My, Dim, D0 [, PTI]) INPUTS: Mx, My: The normalized X and Y screen coordinates. Dim: A parameter used to specify which data coordinate is fixed. Use 0 for a fixed X data coordinate, 1 for a fixed Y data coordinate, or 2 for a fixed Z data coordinate. D0: The value of the fixed data coordinate. OPTIONAL INPUT PARAMETERS: PTI: The inverse of !P.T. If this parameter is not supplied, or set to 0, COORD2TO3 computes the inverse. If this routine is to be used in a loop, the caller should supply PTI for highest efficiency. KEYWORD PARAMETERS: None. OUTPUTS: Returns a 3-element vector containing the 3D data coordinates. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: A valid 3D transform must exist in !P.T or PTI. The axis scaling variables, !X.S, !Y.S and !Z.S must be valid. PROCEDURE: The intersection of the plane determined by data coordinates Dim and D0 and the screen coordinate line (Mx, My, 0), (Mx, My, 1) is computed. EXAMPLE: To return the data coordinates of the mouse, fixing the data Z value at 10, enter the commands: CURSOR, X, Y, /NORM ;Get the normalized mouse coords. P = COORD2TO3(X, Y, 2, 10.0) MODIFICATION HISTORY: DMS, 9/91.
(See C:\RSI\IDL52\lib\coord2to3.pro)
NAME: CORRELATE PURPOSE: This function computes the linear Pearson correlation coefficient of two vectors or the Correlation Matrix of an M x N array. Alternatively, this function computes the covariance of two vectors or the Covariance Matrix of an M x N array. CATEGORY: Statistics. CALLING SEQUENCE: Result = Correlate(X [,Y]) INPUTS: X: A vector or an M x N array of type integer, float or double. Y: A vector of type integer, float or double. If X is an M x N array, this parameter should not be supplied. KEYWORD PARAMETERS: COVARIANCE: If set to a non-zero value, the sample covariance is computed. DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. RESTRICTIONS: If X is an M x N array, then Y should not be supplied; Result = Correlate(X) EXAMPLES: Define the data vectors. x = [65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71] y = [68, 66, 68, 65, 69, 66, 68, 65, 71, 67, 68, 70] Compute the linear Pearson correlation coefficient of x and y. result = correlate(x, y) The result should be 0.702652 Compute the covariance of x and y. result = correlate(x, y, /covariance) The result should be 3.66667 Define an array with x and y as its columns. a = [transpose(x), transpose(y)] Compute the correlation matrix. result = correlate(a) The result should be [[1.000000, 0.702652] [0.702652, 1.000000]] Compute the covariance matrix. result = correlate(a, /covariance) The result should be [[7.69697, 3.66667] [3.66667, 3.53788]] PROCEDURE: CORRELATE computes the linear Pearson correlation coefficient of two vectors. If the vectors are of unequal length, the longer vector is truncated to the length of the shorter vector. If X is an M x N array, M-columns by N-rows, the result will be an M x M array of linear Pearson correlation coefficients with the iTH column and jTH row element corresponding to the correlation of the iTH and jTH columns of the M x N array. The M x M array of linear Pearson correlation coefficients (also known as the Correlation Matrix) is always symmetric and contains 1s on the main diagonal. The Covariance Matrix is also symmetric, but is not restricted to 1s on the main diagonal. REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Written by: DMS, RSI, Sept 1983 Modified: GGS, RSI, July 1994 Added COVARIANCE keyword. Included support for matrix input. New documentation header. Modified: GGS, RSI, April 1996 Included support for scalar and unequal length vector inputs. Added checking for undefined correlations and support of IEEE NaN (Not a Number). Added DOUBLE keyword. Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\correlate.pro)
NAME: CORREL_MATRIX PURPOSE: To compute correlation coefficients of pairs of columns of X. CATEGORY: Statistics. CALLING SEQUENCE: Result = CORREL_MATRIX(X) INPUTS: X: Matrix of experimental data. X(i,j) = the value of the ith variable in the jth observation. OUTPUT: CORREL_MATRIX returns a matrix M, where M(i,j) = the simple Pearson correlation coefficient between the ith and jth variable.
(See C:\RSI\IDL52\lib\obsolete\correl_matrix.pro)
NAME: COSINES PURPOSE: Example of a function to be used by SVDFIT. Returns cos(i*cos(x(j)). CATEGORY: Curve fitting. CALLING SEQUENCE: Result = COSINES(X, M) INPUTS: X: A vector of data values with N elements. M: The order, or number of terms. OUTPUTS: Function result = (N,M) array, where N is the number of points in X, and M is the order. R(I,J) = cos(J * X(I)) MODIFICATION HISTORY: DMS, Nov, 1987.
(See C:\RSI\IDL52\lib\obsolete\cosines.pro)
NAME: CRAMER PURPOSE: This function solves an n by n linear system of equations using Cramer's rule. CATEGORY: Linear Algebra. CALLING SEQUENCE: Result = CRAMER(A, B) INPUTS: A: An N by N array of type: float, or double. B: An N-element vector of type: float, or double. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. ZERO: Use this keyword to set the value of floating-point zero. A floating-point zero on the main diagonal of a triangular matrix results in a zero determinant. A zero determinant results in a 'Singular matrix' error and stops the execution of CRAMER.PRO. For single-precision inputs, the default value is 1.0e-6. For double-precision inputs, the default value is 1.0e-12. EXAMPLE: Define an array (a). a = [[ 2.0, 1.0, 1.0], $ [ 4.0, -6.0, 0.0], $ [-2.0, 7.0, 2.0]] And right-side vector (b). b = [3.0, 10.0, -5.0] Compute the solution of the system, ax = b. result = cramer(a, b) PROCEDURE: CRAMER.PRO uses ratios of column-wise permutations of the array (a) to calculate the solution vector (x) of the linear system, ax = b. REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Written by: GGS, RSI, February 1994 Modified: GGS, RSI, November 1994 Added support for double precision results. Modified: GGS, RSI, April 1996 Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\cramer.pro)
NAME: CREATE_VIEW PURPOSE: This procedure sets the various system variables required to define a coordinate system and a 3-D view. This procedure builds the system viewing matrix (!P.T) in such a way that the correct aspect ratio of the data is maintained even if the display window is not square. CREATE_VIEW also sets the "Data" to "Normal" coordinate conversion factors (!X.S, !Y.S, and !Z.S) so that center of the unit cube will be located at the center of the display window. CATEGORY: Viewing. CALLING SEQUENCE: CREATE_VIEW INPUTS: None. KEYWORD PARAMETERS: XMIN: The minimum data value on the X axis. The default is (0.0). Data type : Any scalar numeric value. XMAX: The maximum data value on the X axis. The default is (1.0). Data type : Any scalar numeric value. YMIN: The minimum data value on the Y axis. The default is (0.0). Data type : Any scalar numeric value. YMAX: The maximum data value on the Y axis. Data type : Any scalar numeric value. The default is (1.0). ZMIN: The minimum data value on the Z axis. The default is (0.0). Data type : Any scalar numeric value. ZMAX: The maximum data value on the Z axis. The default is (1.0). Data type : Any scalar numeric value. AX: The orientation (X rotation) of the view. The default is (0.0). Data type : Float. AY: The orientation (Y rotation) of the view. The default is (0.0). Data type : Float. AZ: The orientation (Z rotation) of the view. The default is (0.0). Data type : Float. WINX: The X size, in pixels, of the window that the view is being set up for. The default is (640). Data type : Long. WINY: The Y size, in pixels, of the window that the view is being set up for. The default is (512). Data type : Long. ZOOM: The view zoom factor. If zoom is a single value then the view will be zoomed equally in all 3 dimensions. If zoom is a 3 element vector then the view will be scaled zoom(0) in X, zoom(1) in Y, and zoom(2) in Z. The default is (1.0). Data type : Float or Fltarr(3). ZFAC: Use this keyword to expand or contract the view in the Z dimension. The default is (1.0). Data type : Float. PERSP: The perspective projection distance. A value of (0.0) indicates an isometric projection (NO per- spective). The default is (0.0). Data type : Float. RADIANS: Set this keyword to a non-zero value if the values passed to AX, AY, and AZ are in radians. The default is degrees. Data type : Int. SIDE EFFECTS: This procedure sets the following IDL system variables : !P.T, !P.T3D, !P.Position, !P.Clip, !P.Region !X.S, !X.Style, !X.Range, !X.Margin !Y.S, !Y.Style, !Y.Range, !Y.Margin !Z.S, !Z.Style, !Z.Range, !Z.Margin PROCEDURE: This procedure sets the 4x4 system viewing matrix (!P.T) by calling T3D with the following parameters : ; Reset (!P.T) to the identity matrix. T3D, /RESET ; Translate the center of the unit cube to the origin. T3D, TRANSLATE=[(-0.5), (-0.5), (-0.5)] ; Zoom the view. T3D, SCALE=ZOOM ; Scale the view to preserve the correct aspect ratio. xrange = xmax - xmin yrange = ymax - ymin zrange = (zmax - zmin) * zfac max_range = xrange > yrange > zrange T3D, SCALE=([xrange, yrange, zrange] / max_range) ; Rotate the view. T3D, ROTATE=[0.0, 0.0, AZ] T3D, ROTATE=[0.0, AY, 0.0] T3D, ROTATE=[AX, 0.0, 0.0] ; Define a perspective projection (if any). IF (p_proj) THEN T3D, PERSPECTIVE=PERSP ; Compensate for the aspect ratio of the display window. T3D, SCALE=[xfac, yfac, 1.0] ; Translate the unit cube back to its starting point. T3D, TRANSLATE=[(0.5), (0.5), (0.5)] EXAMPLE: Set up a view to display an iso-surface from volumetric data. ; Create some data. vol = FLTARR(40, 50, 30) vol(3:36, 3:46, 3:26) = RANDOMU(s, 34, 44, 24) FOR i=0, 10 DO vol = SMOOTH(vol, 3) ; Generate the iso-surface. SHADE_VOLUME, vol, 0.2, polygon_list, vertex_list, /LOW ; Set up the view. ; Note that the subscripts into the Vol array range from ; 0 to 39 in X, 0 to 49 in Y, and 0 to 29 in Z. As such, ; the 3-D coordinates of the iso-surface (vertex_list) may ; range from 0.0 to 39.0 in X, 0.0 to 49.0 in Y, ; and 0.0 to 29.0 in Z. Set XMIN, YMIN, and ZMIN to ; zero (the default), and set XMAX=39, YMAX=49, and ZMAX=29. WINDOW, XSIZE=600, YSIZE=400 CREATE_VIEW, XMAX=39, YMAX=49, ZMAX=29, AX=(-60.0), AZ=(30.0), $ WINX=600, WINY=400, ZOOM=(0.7), PERSP=(1.0) ; Display the iso surface in the specified view. img = POLYSHADE(polygon_list, vertex_list, /DATA, /T3D) TVSCL, img MODIFICATION HISTORY: Written by: Daniel Carr. Wed Sep 2 16:40:47 MDT 1992 Modified the way the view is compensated for the data aspect ratio. Daniel Carr. Tue Dec 8 17:53:54 MST 1992
(See C:\RSI\IDL52\lib\create_view.pro)
NAME: CROSSP PURPOSE: Evaluate the vector or cross-product of vectors v1 and v2. CATEGORY: Vector mathematics. CALLING SEQUENCE: Result = CROSSP(v1, v2) INPUTS: v1, v2: Three-element vectors. OUTPUTS: Returns a 3-element, floating-point vector. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Vectors must have 3 elements. PROCEDURE: v1 X v2 = | i j k | = (b1c2 - b2c1)i + (c1a2-c2a1)j + (a1b2-a2b1)k | a1 b1 c1 | | a2 b2 c2 | MODIFICATION HISTORY: Written, DMS, Aug, 1983;
(See C:\RSI\IDL52\lib\crossp.pro)
NAME: CRVLENGTH PURPOSE: This function computes the length of a curve with a tabular representation, y(i) = F(x(i)). CATEGORY: Numerical Analysis CALLING SEQUENCE: Result = Crvlength(X, Y) INPUTS: X: An N-element vector (N >= 3) of type float or double. These values must be specified in ascending order. Duplicate x values will result in a warning message. Y: An N-element vector of type float or double. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. RESTRICTIONS: Data that is highly oscillatory requires a sufficient number of samples for an accurate curve length computation. EXAMPLE: Define a 21-element vector of X-values. x = [-2.00, -1.50, -1.00, -0.50, 0.00, 0.50, 1.00, 1.50, 2.00, $ 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 5.50, 6.00, 6.50, $ 7.00, 7.50, 8.00] Define a 21-element vector of Y-values. y = [-2.99, -2.37, -1.64, -0.84, 0.00, 0.84, 1.64, 2.37, 2.99, $ 3.48, 3.86, 4.14, 4.33, 4.49, 4.65, 4.85, 5.13, 5.51, $ 6.02, 6.64, 7.37] Compute the length of the curve. result = CRVLENGTH(x, y) The result should be: 14.8115 MODIFICATION HISTORY: Written by: GGS, RSI, March 1996
(See C:\RSI\IDL52\lib\crvlength.pro)
NAME: CTI_TEST PURPOSE: This function constructs a "contingency table" from an array of observed frequencies and tests the hypothesis that the rows and columns are independent using an extension of the chi-squared goodness-of-fit test. The result is a two-element vector contain- ing the chi-squared test statistic X2 and probability of obtaining a value of X2 or greater. CATEGORY: Statistics. CALLING SEQUENCE: Result = CTI_TEST(OBFREQ) INPUTS: OBFREQ: An array of c-columns and r-rows of type integer, float or double containing observed frequencies. KEYWORD PARAMETERS: COEFF: Use this keyword to specify a named variable which returns the Coefficient of Contingency. A non-negative scalar, in the interval [0.0, 1.0], which measures the degree of dependence within a contingency table. The larger the value of COEFF, the greater the degree of dependence. CORRECTED: If set to a nonzero value, the "Yate's Correction for Continuity" is used to compute the chi-squared test statistic, X2. The Yate's correction always decreases the magnitude of the chi-squared test statistic, X2. In general, this keyword should be set for small sample sizes. CRAMV: Use this keyword to specify a named variable which returns Cramer's V. A non-negative scalar, in the interval [0.0, 1.0], which measures the degree of dependence within a contingency table. DF: Use this keyword to specify a named variable which returns the degrees of freedom used to compute the probability of obtaining the value of the chi-squared test statistic or greater. DF = (r - 1) * (c - 1) where r and c are the number of rows and columns of the contingency table, respectively. EXFREQ: Use this keyword to specify a named variable which returns an array of c-columns and r-rows containing expected frequencies. The elements of this array are often refered to as the "cells" of the expected frequencies. The expected frequency of each cell is computed as the product of row and column marginal frequencies divided by the overall total of observed frequencies. RESIDUAL: Use this keyword to specify a named variable which returns an array of c-columns and r-rows containing signed differences between corresponding cells of observed frequencies and expected frequencies. EXAMPLE: Define the 5-column and 4-row array of observed frequencies. obfreq = [[748, 821, 786, 720, 672], $ [ 74, 60, 51, 66, 50], $ [ 31, 25, 22, 16, 15], $ [ 9, 10, 6, 5, 7]] Test the hypothesis that the rows and columns of "obfreq" contain independent data at the 0.05 significance level. result = cti_test(obfreq, coeff = coeff) The result should be the two-element vector [14.3953, 0.276181]. The computed value of 0.276181 indicates that there is no reason to reject the proposed hypothesis at the 0.05 significance level. The Coefficient of Contingency returned in the parameter "coeff" (coeff = 0.0584860) also indicates the lack of dependence between the rows and columns of the observed frequencies. Setting the CORRECTED keyword returns the two-element vector [12.0032, 0.445420] and (coeff = 0.0534213) resulting in the same conclusion of independence. PROCEDURE: CTI_TEST constructs a "contingency table" from a 2-dimensional input array of observed frequencies and applies the principles of the chi-squared goodness-of-fit test to determine the independence of the rows and columns. For small sample sizes, a correction for absolute differences between observed and expected frequencies may be applied by setting the CORRECTED keyword. REFERENCE: PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition) Ronald E. Walpole & Raymond H. Myers ISBN 0-02-424170-9 MODIFICATION HISTORY: Written by: GGS, RSI, August 1994
(See C:\RSI\IDL52\lib\cti_test.pro)
NAME: CT_LUMINANCE PURPOSE: Calculate the luminance of colors. CATEGORY: Color tables CALLING SEQUENCE: L = CT_LUMINANCE(R, G, B) INPUTS: R = Red color table. If omitted, use the color values from either the COLORS common block, or the current color table. G = Green color table, optional parameter. B = Blue color table, optional parameter. KEYWORD PARAMETERS: BRIGHT=var - Stores the index of the brightest color in the current colortable into var. DARK=var - Stores the index of the darkest color in the current colortable into var. READ_TABLES = if set and parameters are not specified, read directly from color tables, using TVLCT, /GET. Do not use the COLORS common block. OUTPUTS: This function returns an array containing the luminance values of the specified colors. If the R,G,B parameters are not specified, or if R is of integer, byte or long type, the result is a longword array. Otherwise, the result is a floating point array. COMMON BLOCKS: COLORS: Contains the current RGB color tables. MODIFICATION HISTORY: April 1, 1992, AB When splitting XPALETTE into widget clusters, this code became necessary in multiple places. This routine encapsulates it. May 15, 1994, DMS Process colors from parameters or current color table.
(See C:\RSI\IDL52\lib\ct_luminance.pro)
NAME: CURVEFIT PURPOSE: Non-linear least squares fit to a function of an arbitrary number of parameters. The function may be any non-linear function. If available, partial derivatives can be calculated by the user function, else this routine will estimate partial derivatives with a forward difference approximation. CATEGORY: E2 - Curve and Surface Fitting. CALLING SEQUENCE: Result = CURVEFIT(X, Y, Weights, A, SIGMA, FUNCTION_NAME = name, $ ITMAX=ITMAX, ITER=ITER, TOL=TOL, /NODERIVATIVE) INPUTS: X: A row vector of independent variables. This routine does not manipulate or use values in X, it simply passes X to the user-written function. Y: A row vector containing the dependent variable. Weights: A row vector of weights, the same length as Y. For no weighting, Weights(i) = 1.0. For instrumental (Gaussian) weighting, Weights(i)=1.0/sigma(i)^2 For statistical (Poisson) weighting, Weights(i) = 1.0/y(i), etc. A: A vector, with as many elements as the number of terms, that contains the initial estimate for each parameter. IF A is double- precision, calculations are performed in double precision, otherwise they are performed in single precision. Fitted parameters are returned in A. KEYWORDS: FUNCTION_NAME: The name of the function (actually, a procedure) to fit. IF omitted, "FUNCT" is used. The procedure must be written as described under RESTRICTIONS, below. ITMAX: Maximum number of iterations. Default = 20. ITER: The actual number of iterations which were performed TOL: The convergence tolerance. The routine returns when the relative decrease in chi-squared is less than TOL in an interation. Default = 1.e-3. CHI2: The value of chi-squared on exit (obselete) CHISQ: The value of reduced chi-squared on exit NODERIVATIVE: IF this keyword is set THEN the user procedure will not be requested to provide partial derivatives. The partial derivatives will be estimated in CURVEFIT using forward differences. IF analytical derivatives are available they should always be used. OUTPUTS: Returns a vector of calculated values. A: A vector of parameters containing fit. OPTIONAL OUTPUT PARAMETERS: Sigma: A vector of standard deviations for the parameters in A. COMMON BLOCKS: NONE. SIDE EFFECTS: None. RESTRICTIONS: The function to be fit must be defined and called FUNCT, unless the FUNCTION_NAME keyword is supplied. This function, (actually written as a procedure) must accept values of X (the independent variable), and A (the fitted function's parameter values), and return F (the function's value at X), and PDER (a 2D array of partial derivatives). For an example, see FUNCT in the IDL User's Libaray. A call to FUNCT is entered as: FUNCT, X, A, F, PDER where: X = Variable passed into CURVEFIT. It is the job of the user-written function to interpret this variable. A = Vector of NTERMS function parameters, input. F = Vector of NPOINT values of function, y(i) = funct(x), output. PDER = Array, (NPOINT, NTERMS), of partial derivatives of funct. PDER(I,J) = DErivative of function at ith point with respect to jth parameter. Optional output parameter. PDER should not be calculated IF the parameter is not supplied in call. IF the /NODERIVATIVE keyword is set in the call to CURVEFIT THEN the user routine will never need to calculate PDER. PROCEDURE: Copied from "CURFIT", least squares fit to a non-linear function, pages 237-239, Bevington, Data Reduction and Error Analysis for the Physical Sciences. This is adapted from: Marquardt, "An Algorithm for Least-Squares Estimation of Nonlinear Parameters", J. Soc. Ind. Appl. Math., Vol 11, no. 2, pp. 431-441, June, 1963. "This method is the Gradient-expansion algorithm which combines the best features of the gradient search with the method of linearizing the fitting function." Iterations are performed until the chi square changes by only TOL or until ITMAX iterations have been performed. The initial guess of the parameter values should be as close to the actual values as possible or the solution may not converge. EXAMPLE: Fit a function of the form f(x) = a * exp(b*x) + c to sample pairs contained in x and y. In this example, a=a(0), b=a(1) and c=a(2). The partials are easily computed symbolicaly: df/da = exp(b*x), df/db = a * x * exp(b*x), and df/dc = 1.0 Here is the user-written procedure to return F(x) and the partials, given x: pro gfunct, x, a, f, pder ; Function + partials bx = exp(a(1) * x) f= a(0) * bx + a(2) ;Evaluate the function IF N_PARAMS() ge 4 THEN $ ;Return partials? pder= [[bx], [a(0) * x * bx], [replicate(1.0, N_ELEMENTS(f))]] end x=findgen(10) ;Define indep & dep variables. y=[12.0, 11.0,10.2,9.4,8.7,8.1,7.5,6.9,6.5,6.1] Weights=1.0/y ;Weights a=[10.0,-0.1,2.0] ;Initial guess yfit=curvefit(x,y,Weights,a,sigma,function_name='gfunct') print, 'Function parameters: ', a print, yfit end MODIFICATION HISTORY: Written, DMS, RSI, September, 1982. Does not iterate IF the first guess is good. DMS, Oct, 1990. Added CALL_PROCEDURE to make the function's name a parameter. (Nov 1990) 12/14/92 - modified to reflect the changes in the 1991 edition of Bevington (eq. II-27) (jiy-suggested by CreaSo) Mark Rivers, U of Chicago, Feb. 12, 1995 - Added following keywords: ITMAX, ITER, TOL, CHI2, NODERIVATIVE These make the routine much more generally useful. - Removed Oct. 1990 modification so the routine does one iteration even IF first guess is good. Required to get meaningful output for errors. - Added forward difference derivative calculations required for NODERIVATIVE keyword. - Fixed a bug: PDER was passed to user's procedure on first call, but was not defined. Thus, user's procedure might not calculate it, but the result was THEN used. Steve Penton, RSI, June 1996. - Changed SIGMAA to SIGMA to be consistant with other fitting routines. - Changed CHI2 to CHISQ to be consistant with other fitting routines. - Changed W to Weights to be consistant with other fitting routines. _ Updated docs regarding weighing.
(See C:\RSI\IDL52\lib\curvefit.pro)
NAME: Cvttobm PURPOSE: Converts a byte array in which each byte represents one pixel into a bitmap byte array in which each bit represents one pixel. This is useful when creating bitmap labels for buttons created with the WIDGET_BUTTON function. Bitmap byte arrays are monochrome; by default, CVTTOBM converts pixels that are darker than the median value to black and pixels that are lighter than the median value to white. You can supply a different threshold value via the THRESHOLD keyword. Most of IDL's image file format reading functions (READ_BMP, READ_PICT, etc.) return a byte array which must be converted before use as a button label. Note that there is one exception to this rule; the READ_X11_BITMAP routine returns a bitmap byte array that needs no conversion before use. CATEGORY: Widgets, button bitmaps CALLING SEQUENCE: bitmap = Cvttobm(array [,THRESHOLD = Threshold]) INPUTS: array - A 2-dimensional pixel array, one byte per pixel OPTIONAL INPUTS: None KEYWORD PARAMETERS: THRESHOLD - A byte value (or an integer value between 0 and 255) to be used as a threshold value when determining if a particular pixel is black or white. If not specified, the threshold is calculated to be the average of the input array. OUTPUTS: bitmap - bitmap byte array, in which each bit represents one pixel OPTIONAL OUTPUTS: None COMMON BLOCKS: None SIDE EFFECTS: None RESTRICTIONS: None PROCEDURE: 1. Creates mask from input array, where values are 0/1 based on threshold. 2. Calculates the size of the output array. 3. Calculates the bitmap array from byte array based on mask. EXAMPLE: IDL> image=bytscl(dist(100)) IDL> base=widget_base(/column) IDL> button=widget_button(base,value=Cvttobm(image)) IDL> widget_control,base,/realize MODIFICATION HISTORY: Created: Mark Rehder, 10/96 Modified: Lubos Pochman, 10/96
(See C:\RSI\IDL52\lib\cvttobm.pro)
NAME: CV_COORD PURPOSE: Converts 2-D and 3-D coordinates between the RECTANGULAR, POLAR, CYLINDRICAL, and SPHERICAL coordinate systems. CATEGORY: Graphics CALLING SEQUENCE: Coord = CV_COORD() KEYWORD PARAMETERS: FROM_RECT: A vector of the form [x, y] or [x, y, z], or a (2, n) or (3, n) array containing rectangular coordinates to convert. FROM_POLAR: A vector of the form [angle, radius], or a (2, n) array of polar coordinates to convert. FROM_CYLIN: A vector of the form [angle, radius, z], or a (3, n) array of cylindrical coordinates to convert. FROM_SPHERE: A vector of the form [longitude, latitude, radius], or a (3, n) array of spherical coordinates to convert. TO_RECT: If set, then rectangular coordinates are returned. TO_POLAR: If set, then polar coordinates are returned. TO_CYLIN: If set, then cylindrical coordinates are returned. TO_SPHERE: If set, then spherical coordinates are returned. DEGREES: If set, then the input (and output) coordinates are in degrees (where applicable). Otherwise, the angles are in radians. OUTPUTS: This function returns the converted coordinate(s) based on which of the "TO_" keywords is used : TO_RECT : If the input coordinates were polar, then a vector of the form [x, y] or a (2, n) array is returned. Otherwise, a vector of the form [x, y, z], or a (3, n) array is returned. TO_POLAR : A vector of the form [angle, radius], or a (2, n) array is returned. TO_CYLIN : A vector of the form [angle, radius, z], or a (3, n) array is returned. TO_SPHERE : A vector of the form [longitude, latitude, radius], or a (3, n) array is returned. If the value passed to the "FROM_" keyword is double precision, then all calculations are performed in double precision and the returned value is double precision. Otherwise, single precision is used. If none of the "FROM_" keywords are specified then 0 is returned. If none of the "TO_" keywords are specified then the input coordinates are returned. PROCEDURE: When converting from spherical to polar coordinates, the points are first projected along the z axis to the x-y plane to get 2-D rectangular coordinates. The 2-D rectangular coordinates are then converted to polar. EXAMPLE: ; Convert from spherical to cylindrical coordinates. sphere_coord = [[45.0, -60.0, 10.0], [0.0, 0.0, 0.0]] rect_coord = CV_COORD(From_Sphere=sphere_coord, /To_Cylin, /Degrees) ; Convert from rectangular to polar coordinates. rect_coord = [10.0, 10.0] polar_coord = CV_COORD(From_Rect=rect_coord, /To_Polar) MODIFICATION HISTORY: Written by: Daniel Carr, Thu Mar 31 14:42:58 MST 1994
(See C:\RSI\IDL52\lib\cv_coord.pro)
NAME: CW_ANIMATE PURPOSE: This widget displays an animated sequence of images using X-windows Pixmaps. This is a compound widget, based on the XINTERANIMATE procedure, with the following advantages: - It can be included in other applications. - Multiple copies can be run simultaneously. The speed and direction of the display can be adjusted using the widget interface. CATEGORY: Image display, compound widgets. CALLING SEQUENCE: To initially create: widget = CW_ANIMATE(PARENT, SIZEX, SIZEY, NFRAMES) To reinitialize when another animation is loaded: CW_ANIMATE_INIT, ANIMATEBASE, SIZEX, SIZEY, NFRAMES To load a single image: CW_ANIMATE_LOAD, WIDGET, IMAGE = IMAGE, FRAME = FRAME_INDEX To load a single image that is already displayed in an existing window: CW_ANIMATE_LOAD, WIDGET, FRAME = FRAME_INDEX, $ WINDOW = [WINDOW_NUMBER [, X0, Y0, SX, SY]] (This technique is much faster than reading back from the window.) To display the animation after all the images have been loaded: CW_ANIMATE, WIDGET [, RATE] To get a copy of the vector of Pixmaps being used by the widget. If this routine is called, the widget does not destroy the pixmaps when it is destroyed. The user can then provide them to a later call to CW_ANIMATE to re-use them while skipping the Pixmap creation and rendering step: CW_ANIMATE_GETP, widget, PIXMAPS INPUTS: CW_ANIMATE: PARENT: The ID of the parent widget. SIZEX: The width of the displayed image. SIZEY: The height of the displayed image. NFRAMES: The number of frames in the animation sequence. CW_ANIMATE_INIT: ANIMATEBASE: The ID of the base animation widget. SIZEX: The width of the displayed image. SIZEY: The height of the displayed image. NFRAMES: The number of frames in the animation sequence. CW_ANIMATE_LOAD: WIDGET: The ID of the widget (as created with CW_ANIMATE) into which the image should be loaded. CW_ANIMATE_RUN: WIDGET: The ID of the widget (as created with CW_ANIMATE) into which the image should be loaded. RATE: A value between 0 and 100 that represents the speed of the animation as a percentage of the maximum display rate. The fastest animation has a value of 100 and the slowest has a value of 0. The default animation rate is 100. STOP: If this keyword is set, the animation is stopped. NFRAMES: Specifies the number of frames to animate, must <= the number specified in CW_ANIMATE(). KEYWORD PARAMETERS: CW_ANIMATE: PIXMAPS: This keyword provides the new widget with a vector of pre-existing pixmap (off screen window) IDs. This vector is usually obtained from a call to CW_ANIMATE_GETP applied to a previous animation widget. UVALUE: A user supplied value to be stored in the widget's user value field. NO_KILL: If NOT set, an "End Animation" button is added to the animation base. If set the button is not added. OPEN_FUNC: A user supplied string that specifies a callback function name. When a value is specified for this keyword, an "Open..." pushbutton is added to the window. When the "Open..." pushbutton is clicked the OPEN_FUNC function is called to load new animation data. INFO_FILE: A filename containing text to be displayed by XDISPLAYFILE when user selects the help button. CW_ANIMATE_INIT: PIXMAPS: This keyword provides the new widget with a vector of pre-existing pixmap (off screen window) IDs. This vector is usually obtained from a call to CW_ANIMATE_GETP applied to a previous animation widget. CW_ANIMATE_LOAD: CYCLE: If set, cycle. Normally, frames are displayed going either forward or backwards. If CYCLE is set, reverse direction after the last frame in either direction is displayed. FRAME: The frame number to be loaded. This is a value between 0 and NFRAMES. If not supplied, frame 0 is loaded. IMAGE: The image to be loaded. ORDER: Set this keyword to display images from the top down instead of the default bottom up. This keyword is only used when loading images with the IMAGE keyword. TRACK: If set, the frame slider tracks the current frame. Default is not to track. WINDOW: When this keyword is specified, an image is copied from an existing window to the animation pixmap. When using X windows, this technique is much faster than reading from the display and then loading with the IMAGE keyword. The value of this parameter is either an IDL window number (in which case the entire window is copied), or a vector containing the window index and the rectangular bounds of the area to be copied. For example: WINDOW = [Window_Number, X0, Y0, Sx, Sy] XOFFSET: The horizontal offset, in pixels from the left of the frame, of the image in the destination window. YOFFSET: The vertical offset, in pixels from the bottom of the frame, of the image in the destination window. OUTPUTS: No explicit outputs. SIDE EFFECTS: If the widget is realized before calls to CW_ANIMATE_LOAD, the frames are displayed as they are loaded. This provides the user with an indication of how things are progressing. When the widget is destroyed, it destroys the pixmaps used in the animation, unless they were previously obtained via CW_ANIMATE_GETP and the KILL_ANYWAY keyword was not set. The only event returned by this widget indicates that the user has pressed the DONE button. The parent application should use this as a signal to kill the animation widget via WIDGET_CONTROL. RESTRICTIONS: If more than one animation widget is running at a time, they will fight for resources and run slower. PROCEDURE: When initialized, this procedure creates pixmaps containing the frames of the animation sequence. Once the images are loaded, they are displayed by copying the images from the pixmap or buffer to the visible draw widget. EXAMPLE: Assume the following event handler procedure exists: PRO EHANDLER, EV WIDGET_CONTROL, /DESTROY, EV.TOP end Enter the following commands to open the file ABNORM.DAT (a series of images of a human heart) and load the images it contains into an array H: OPENR, 1, FILEPATH('abnorm.dat', SUBDIR = 'images') H = BYTARR(64, 64, 16) READU, 1, H CLOSE, 1 H = REBIN(H, 128, 128, 16) Create an instance of the animation widget at load the frames: base = widget_base() animate = CW_ANIMATE(base, 128, 128, 16) WIDGET_CONTROL, /REALIZE, base for i=0,15 do CW_ANIMATE_LOAD, animate, FRAME=i, IMAGE=H(*,*,I) Start the animation: CW_ANIMATE_RUN, animate XMANAGER, "CW_ANIMATE Demo", base, EVENT_HANDLER = "EHANDLER" Pressing the DONE button kills the application. MODIFICATION HISTORY: AB, June 1992 Heavily based on the XINTERANIMATE procedure. SR, September 1992 Fixed a problem when a paused animation's frame selection was moved and the resulting frame change ended up in another animation. SR, November 1992 Fixed a problem when a single paused animation would fail when the frame selection slider event tried to set do a bad drawing window. DMS/AB, March, 1993 Got rid of state caching. Got rid of XMANAGER background tasks in favor of new "WIDGET_CONTROL,timer=" feature. ACY, October 1993 Set RETAIN=2 for draw widget to prevent clipping by an overlapping window when loading frames. DMS, Dec, 1993 Added STOP and NFRAMES keywords to CW_ANIMATE_RUN. Added KILL_ANYWAY keyword to CW_ANIMATE_GETP. WSO, Jan, 1995 Added OPEN_FUNC keyword and updated UI. ACY, Jan, 1997 Added INFO_FILE keyword to allow user-supplied files for help text
(See C:\RSI\IDL52\lib\cw_animate.pro)
NAME: CW_ARCBALL PURPOSE: CW_ARCBALL is a compound widget for intuitively specifying three-dimensional orientations. CATEGORY: Widget, 3d graphics CALLING SEQUENCE: Widget_id = CW_ARCBALL(Parent) INPUTS: PARENT: The ID of the parent widget. KEYWORD PARAMETERS: FRAME: If set, draws a frame around the widget. The default is FRAME=0. LABEL: A string containing the widget's label. VALUE: An initial value for the 3 x 3 rotation matrix. This must be a valid rotation matrix (no translation or perspective) where: transpose(value) = inverse(value). This can be the upper-left corner of !P.T after executing the command T3D, /RESET, ROTATE=[x,y,z]. The default is the identity matrix. UVALUE: The initial user value for the widget. SIZE: The size of the square drawable area containing the arcball, in pixels. Default size = 192. UPDATE: If set, the widget will send an event each time the mouse button is released after a drag operation. Otherwise, an event is only sent when the Update button is pressed. COLORS: A 6-element array containing the color indices to be used. Colors(0) = View axis color Colors(1) = object axis color, Colors(2) = XZ plane +Y side (body top) color, Colors(3) = YZ plane (fin) color, Colors(4) = XZ plane -Y side (body bottom), Colors(5) = background color. Default value = [ 1,7,2,3,7,0], which yields good colors with the TEK_COLOR table. (white, yellow, red, green, yellow, black). RETAIN: Retain parameter for window, 0 = none, 1 = server's default, 2 = use backing store. default = 1. OUTPUTS: The ID of the widget is returned. SIDE EFFECTS: Events are generated as described above. The current graphics window is changed. RESTRICTIONS: This widget can generate any rotation about any axis. Not all rotations are compatible with the IDL SURFACE procedure, which is restricted to rotations that project the object Z axis parallel to the view Y axis. PROCEDURE: This widget is based on "ARCBALL: A User Interface for Specifying Three-Dimensional Orientation Using a Mouse", by Ken Shoemake, Computer Graphics Laboratory, University of Pennsylvania, Philadelphia, PA 19104. "In Arcball, human factors and mathematical fundamentals come together exceptionally well." The user drags a simulated track-ball with the mouse to interactively obtain arbitrary rotations. Sequences of rotations may be cascaded. The rotations may be unconstrained (about any axis), constrained to the view X, Y, or Z axes, or to the object's X, Y, or Z axis. Use the call: WIDGET_CONTROL, id, /SET_VALUE to draw the arcball after the widget is initially realized. Also, the SET_VALUE entry will set the widget's value to the given 3x3 rotation matrix and redraw the widget. The WIDGET_CONTROL, id, GET_VALUE=v call returns the current 3x3 rotation matrix. EXAMPLE: See the procedure ARCBALL_TEST, contained in this file. To test CW_ARCBALL: .RUN cw_arcball ARCBALL_TEST MODIFICATION HISTORY: DMS, RSI, September, 1993. Written ACY, RSI, January, 1994. Correct test on initial value.
(See C:\RSI\IDL52\lib\cw_arcball.pro)
NAME: CW_BGROUP PURPOSE: CW_BGROUP is a compound widget that simplifies creating a base of buttons. It handles the details of creating the proper base (standard, exclusive, or non-exclusive) and filling in the desired buttons. Events for the individual buttons are handled transparently, and a CW_BGROUP event returned. This event can return any one of the following: - The Index of the button within the base. - The widget ID of the button. - The name of the button. - An arbitrary value taken from an array of User values. CATEGORY: Compound widgets. CALLING SEQUENCE: Widget = CW_BGROUP(Parent, Names) To get or set the value of a CW_BGROUP, use the GET_VALUE and SET_VALUE keywords to WIDGET_CONTROL. The value of a CW_BGROUP is: ----------------------------------------------- Type Value ----------------------------------------------- normal None exclusive Index of currently set button non-exclusive Vector indicating the position of each button (1-set, 0-unset) ----------------------------------------------- INPUTS: Parent: The ID of the parent widget. Names: A string array, containing one string per button, giving the name of each button. KEYWORD PARAMETERS: BUTTON_UVALUE: An array of user values to be associated with each button and returned in the event structure. COLUMN: Buttons will be arranged in the number of columns specified by this keyword. EVENT_FUNCT: The name of an optional user-supplied event function for buttons. This function is called with the return value structure whenever a button is pressed, and follows the conventions for user-written event functions. EXCLUSIVE: Buttons will be placed in an exclusive base, with only one button allowed to be selected at a time. FONT: The name of the font to be used for the button titles. If this keyword is not specified, the default font is used. FRAME: Specifies the width of the frame to be drawn around the base. IDS: A named variable into which the button IDs will be stored, as a longword vector. LABEL_LEFT: Creates a text label to the left of the buttons. LABEL_TOP: Creates a text label above the buttons. MAP: If set, the base will be mapped when the widget is realized (the default). NONEXCLUSIVE: Buttons will be placed in an non-exclusive base. The buttons will be independent. NO_RELEASE: If set, button release events will not be returned. RETURN_ID: If set, the VALUE field of returned events will be the widget ID of the button. RETURN_INDEX: If set, the VALUE field of returned events will be the zero-based index of the button within the base. THIS IS THE DEFAULT. RETURN_NAME: If set, the VALUE field of returned events will be the name of the button within the base. ROW: Buttons will be arranged in the number of rows specified by this keyword. SCROLL: If set, the base will include scroll bars to allow viewing a large base through a smaller viewport. SET_VALUE: The initial value of the buttons. This is equivalent to the later statement: WIDGET_CONTROL, widget, set_value=value SPACE: The space, in pixels, to be left around the edges of a row or column major base. This keyword is ignored if EXCLUSIVE or NONEXCLUSIVE are specified. UVALUE: The user value to be associated with the widget. XOFFSET: The X offset of the widget relative to its parent. XPAD: The horizontal space, in pixels, between children of a row or column major base. Ignored if EXCLUSIVE or NONEXCLUSIVE are specified. XSIZE: The width of the base. X_SCROLL_SIZE: The width of the viewport if SCROLL is specified. YOFFSET: The Y offset of the widget relative to its parent. YPAD: The vertical space, in pixels, between children of a row or column major base. Ignored if EXCLUSIVE or NONEXCLUSIVE are specified. YSIZE: The height of the base. Y_SCROLL_SIZE: The height of the viewport if SCROLL is specified. OUTPUTS: The ID of the created widget is returned. SIDE EFFECTS: This widget generates event structures with the following definition: event = { ID:0L, TOP:0L, HANDLER:0L, SELECT:0, VALUE:0 } The SELECT field is passed through from the button event. VALUE is either the INDEX, ID, NAME, or BUTTON_UVALUE of the button, depending on how the widget was created. RESTRICTIONS: Only buttons with textual names are handled by this widget. Bitmaps are not understood. MODIFICATION HISTORY: 15 June 1992, AB 7 April 1993, AB, Removed state caching. 6 Oct. 1994, KDB, Font keyword is not applied to the label. 10 FEB 1995, DJC fixed bad bug in event procedure, getting id of stash widget. 11 April 1995, AB Removed Motif special cases.
(See C:\RSI\IDL52\lib\cw_bgroup.pro)
NOTE: This routine has been made obsolete because it has been replaced by WIDGET_DROPLIST. NAME: CW_BSELECTOR PURPOSE: CW_BSELECTOR is a compound widget that appears as a pull-down menu whose label shows the widget's current value. When the button is pressed, the menu appears and the newly selected value becomes the new title of the pull-down menu. CATEGORY: Compound widgets. CALLING SEQUENCE: widget = CW_BSELECTOR(Parent, Names) To get or set the value of a CW_BSELECTOR, use the GET_VALUE and SET_VALUE keywords to WIDGET_CONTROL. The value of a CW_BSELECTOR is the index of the selected item. INPUTS: Parent: The ID of the parent widget. Names: A string array, containing one string per button, giving the name of each button. KEYWORD PARAMETERS: EVENT_FUNCT: The name of an optional user-supplied event function for buttons. This function is called with the return value structure whenever a button is pressed, and follows the conventions for user-written event functions. FONT: The name of the font to be used for the button titles. If this keyword is not specified, the default font is used. FRAME: Specifies the width of the frame to be drawn around the base. IDS: A named variable into which the button IDs will be stored, as a longword vector. LABEL_LEFT: Creates a text label to the left of the buttons. LABEL_TOP: Creates a text label above the buttons. MAP: If set, the base will be mapped when the widget is realized (the default). RETURN_ID: If set, the VALUE field of returned events will be the widget ID of the button. RETURN_INDEX: If set, the VALUE field of returned events will be the zero-based index of the button within the base. THIS IS THE DEFAULT. RETURN_NAME: If set, the VALUE field of returned events will be the name of the button within the base. RETURN_UVALUE: An array of user values to be associated with each button. Selecting the button sets the uvalue of the CW_BSELECTOR to the button's uvalue and returns the uvalue in the value field of the event structure. If this keyword isn't specified, the CW_BSELECTOR's uvalue remains unchanged. SET_VALUE: The initial value of the buttons. This keyword is set to the index of the Names array element desired. So if it is desired that the initial value be the second element of the Names array, SET_VALUE would be set equal to 1. This is equivalent to the later statement: WIDGET_CONTROL, widget, set_value=value UVALUE: The user value to be associated with the widget. XOFFSET: The X offset of the widget relative to its parent. YOFFSET: The Y offset of the widget relative to its parent. OUTPUTS: The ID of the created widget is returned. SIDE EFFECTS: This widget generates event structures with the following definition: event = { ID:0L, TOP:0L, HANDLER:0L, INDEX:0, VALUE:0 } The INDEX field is the index (0 based) of the menu choice. VALUE is either the INDEX, ID, NAME, or BUTTON_UVALUE of the button, depending on how the widget was created. RESTRICTIONS: Only buttons with textual names are handled by this widget. Bitmaps are not understood. MODIFICATION HISTORY: 1 April 1993, DMS, Adapted from CW_BGROUP. 22 Dec. 1993, KDB, Corrected documentation for keyword SET_VALUE.
(See C:\RSI\IDL52\lib\obsolete\cw_bselector.pro)
NAME: CW_CLR_INDEX PURPOSE: CW_CLR_INDEX is a compound widget for the selection of a color index. A horizontal color bar is displayed. Clicking on the bar sets the color index. CATEGORY: Compound Widgets CALLING SEQUENCE: Widget = CW_CLR_INDEX(Parent) INPUTS: Parent: ID of the parent widget. KEYWORD PARAMETERS: COLOR_VALUES: A vector of color indices containing the colors to be displayed in the color bar. If omitted, NCOLORS and START_COLOR specify the range of color indices. EVENT_FUNCT: The name of an optional user-supplied event function. This function is called with the return value structure whenever a button is pressed, and follows the conventions ; for user-written event functions. FRAME: If set, a frame will be drawn around the widget. LABEL: A text label that appears to the left of the color bar. NCOLORS: The number of colors to place in the color bar. The default = !D.N_COLORS. START_COLOR: The starting color index, placed at the left of the bar. UVALUE: The user value to be associated with the widget. XSIZE: The width of the color bar in pixels. The default =192. YSIZE: The height of the color bar in pixels. The default = 12. OUTPUTS: The ID of the created widget is returned. SIDE EFFECTS: This widget generates event structures with the following definition: Event = { CW_COLOR_INDEX, ID: base, TOP: ev.top, HANDLER: 0L, VALUE: c} Value is the color index selected. PROCEDURE: Standard Compound widget. Use WIDGET_CONTROL, SET_VALUE and GET_VALUE to change/read the widget's value. EXAMPLE: A = WIDGET_BASE(TITLE='Example', /COLUMN) B = CW_CLR_INDEX(A, LABEL='Color:') MODIFICATION HISTORY: DMS, June, 1993. Written. TAC, Oct, 1993. Changed name to cw_clr_index
(See C:\RSI\IDL52\lib\cw_clr_index.pro)
NAME: CW_COLORSEL PURPOSE: CW_COLORSEL is a compound widget that displays all the colors in the current colormap and allows the user to select the color indices via the mouse or with sliders. CATEGORY: Compund widgets. CALLING SEQUENCE: widget = CW_COLORSEL(Parent) INPUTS: Parent: The ID of the parent widget. KEYWORD PARAMETERS: FRAME: If set, a frame is drawn around the widget. UVALUE: The user value for the widget. XOFFSET: The X offset position YOFFSET: The Y offset position OUTPUTS: The ID of the created widget is returned. SIDE EFFECTS: This widget generates event structures containing a field named VALUE, which contains the colormap index selected by the user. PROCEDURE: The COLORSEL widget displays all the colors in the current colormap in a 16x16 (320x320 pixels) grid. To select a color index, the user moves the mouse pointer over the desired color square and presses any mouse button. Alternatively, the color index can be selected by moving one of the three sliders provided around the grid. WIDGET_CONTROL, SET_VALUE=index can be used to set the current color index. WIDGET_CONTROL, SET_VALUE=-1 informs the widget to initialize itself and redraw. It should be called when any of the following happen: - The widget needs redrawing. - The brightest or darkest color has changed. WIDGET_CONTROL, GET_VALUE=var can be used to retrieve the current color index. MODIFICATION HISTORY: March 30, 1992, AB Removed the relevant code from XPALETTE.PRO and modified it to create this reusable widget cluster. September 4, 1992, SR Fixed a bug where the value of the xslider was calculated as negative and WIDGET_CONTROL, SET_VALUE failed. 7 April 1993, AB, Removed state caching. October 20, 1993, KDB Changed return value in function CSEL_GET_VALUE from state.cur_idx to ret 23 May 1994, AB Added NOTIFY_REALIZE routine to eliminate the need to call "WIDGET_CONTROL, SET_VALUE=-1" when the widget is realized.
(See C:\RSI\IDL52\lib\cw_colorsel.pro)
NAME: CW_DEFROI PURPOSE: Widget to define a region of interest within a widget drawable. CATEGORY: Regions of interest, graphics. CALLING SEQUENCE: Result = CW_DEFROI(draw) INPUTS: Draw = id of drawable to draw the region. The drawable should have both MOTION and BUTTON events enabled. KEYWORD PARAMETERS: IMAGE_SIZE = the size of the underlying array, expressed as a two element vector: [columns, rows]. Default = drawable size / zoom. OFFSET = offset of lower left corner of image within the drawable. Default = [0,0]. ORDER = if set, return inverted subscripts, as if the array were output from top to bottom. RESTORE = Set to restore the drawable to its previous appearance on exit. Otherwise, the regions remain on the drawable. ZOOM = if the image array was expanded (via REBIN for example) specify this two element vector containing the expansion factor in X and Y. Default = [1,1]. Must be integer. OUTPUTS: Result = subscripts of points within the region[s] defined. If no region was defined, a scalar -1 is returned. COMMON BLOCKS: None. SIDE EFFECTS: The regions are drawn within the drawable. Set the RESTORE keyword to undo the damage. RESTRICTIONS: This is a MODAL widget. No other widget applications will be responsive while this widget is in use. PROCEDURE: Complicated. EXAMPLE: To obtain the average of the counts of a region within a drawable: Assume A = the array of interest, n columns, m rows, and that it is displayed in drawable D, at offset X=20, Y=100, and zoomed with a factor of 2: TV, REBIN(A, M*2, N*2), 20, 100 ;Display the image q = CW_DEFROI(D, ZOOM=[2,2], OFFSET=[20,100], IMAGE_SIZE=[m,n]) if q(0) ne -1 then print,'Average = ', total(a(q))/n_elements(q) MODIFICATION HISTORY: DMS, RSI, December, 1993. Written.
(See C:\RSI\IDL52\lib\cw_defroi.pro)
NAME: CW_DICE PURPOSE: CW_DICE is a compound widget that implements a single die. This widget uses a button with a bitmap label. The primary purpose of this compound widget is to serve as a full example of a realistic compound widget for the IDL User's Guide. CATEGORY: Compound widgets. CALLING SEQUENCE: Widget = CW_DICE(Parent) INPUTS: Parent: The ID of the parent widget. KEYWORD PARAMETERS: TUMBLE_CNT: The widget simulates the tumbling of a dice by changing the bitmap on the dice several times before settling down to a final value. The number of "tumbles" is specified by the TUMBLE_CNT keyword. The default is 10. TUMBLE_PERIOD: The amount of time in seconds between each tumble of the dice. The default is .05 seconds. UVALUE: The user value for the widget. OUTPUTS: The ID of the created widget is returned. COMMON BLOCKS CW_DICE_BLK: Used to store dice faces, and the current random number generator seed for the CW_DICE class. SIDE EFFECTS: This widget generates event structures containing an extra field named VALUE giving the final value resulting from a dice roll. Such events are only sent when the user presses the dice button. PROCEDURE: The CW_DICE widget consists of a single pushbutton that displays its current dice value as a bitmask. If the user presses the button, it tumbles for a moment and then the new value is displayed and an event is issued. The current value of the dice is available via the WIDGET_CONTROL,GET_VALUE command. The current value can be set by issuing the WIDGET_CONTROL, SET_VALUE command. If the requested value is outside the range [1,6], then the dice tumbles to a new value as if the user had pressed the button, but no event is issued. MODIFICATION HISTORY: 24 October 1993, AB, RSI 16 April 1996, RPM, RSI - Fixed name of WIDGET_TIMER event. Fixed check of dice value range.
(See C:\RSI\IDL52\lib\cw_dice.pro)
NAME: CW_FIELD PURPOSE: This widget cluster function manages a data entry field widget. The field consists of a label and a text widget. CW_FIELD's can be string fields, integer fields or floating-point fields. The default is an editable string field. CATEGORY: Widget Clusters. CALLING SEQUENCE: Result = CW_FIELD(Parent) INPUTS: Parent: The widget ID of the widget to be the field's parent. KEYWORD PARAMETERS: TITLE: A string containing the text to be used as the label for the field. The default is "Input Field:". VALUE: The initial value in the text widget. This value is automatically converted to the type set by the STRING, INTEGER, and FLOATING keywords described below. UVALUE: A user value to assign to the field cluster. This value can be of any type. FRAME: The width, in pixels, of a frame to be drawn around the entire field cluster. The default is no frame. RETURN_EVENTS: Set this keyword to make cluster return an event when ais pressed in a text field. The default is not to return events. Note that the value of the text field is always returned when the WIDGET_CONTROL, field, GET_VALUE=X command is used. ALL_EVENTS: Like RETURN_EVENTS but return an event whenever the contents of a text field have changed. COLUMN: Set this keyword to center the label above the text field. The default is to position the label to the left of the text field. ROW: Set this keyword to position the label to the left of the text field. This is the default. XSIZE: An explicit horizontal size (in characters) for the text input area. The default is to let the window manager size the widget. Using the XSIZE keyword is not recommended. YSIZE: An explicit vertical size (in lines) for the text input area. The default is 1. STRING: Set this keyword to have the field accept only string values. Numbers entered in the field are converted to their string equivalents. This is the default. FLOATING: Set this keyword to have the field accept only floating-point values. Any number or string entered is converted to its floating-point equivalent. INTEGER: Set this keyword to have the field accept only integer values. Any number or string entered is converted to its integer equivalent (using FIX). For example, if 12.5 is entered in this type of field, it is converted to 12. LONG: Set this keyword to have the field accept only long integer values. Any number or string entered is converted to its long integer equivalent (using LONG). FONT: A string containing the name of the X Windows font to use for the TITLE of the field. FIELDFONT: A string containing the name of the X Windows font to use for the TEXT part of the field. NOEDIT: Normally, the value in the text field can be edited. Set this keyword to make the field non-editable. OUTPUTS: This function returns the widget ID of the newly-created cluster. COMMON BLOCKS: None. PROCEDURE: Create the widgets, set up the appropriate event handlers, and return the widget ID of the newly-created cluster. EXAMPLE: The code below creates a main base with a field cluster attached to it. The cluster accepts string input, has the title "Name:", and has a frame around it: base = WIDGET_BASE() field = CW_FIELD(base, TITLE="Name:", /FRAME) WIDGET_CONTROL, base, /REALIZE MODIFICATION HISTORY: Written by: Keith R. Crosley June 1992 KRC, January 1993 -- Added support for LONG integers. AB, 7 April 1993, Removed state caching. JWG, August 1993, Completely rewritten to make use of improved TEXT widget functionality ACY, 25 March, 1994, fix usage of FRAME keyword KDB, May 1994, Initial value =0 would result in a null text field. Fixed keyword check.
(See C:\RSI\IDL52\lib\cw_field.pro)
NAME: CW_FORM PURPOSE: CW_FORM is a compound widget that simplifies creating small forms which contain text, numeric fields, buttons, lists and droplists. Event handling is also simplified. CATEGORY: Compound widgets. CALLING SEQUENCE: widget = CW_FORM([Parent,] Desc) INPUTS: Parent: The ID of the parent widget. Omitted for a top level modal widget. Desc: A string array describing the form. Each element of the string array contains two or more comma-delimited fields. The character '\' may be used to escape commas that appear within fields. To include the backslash character, escape it with a second backslash. Field names are case insensitive. The fields are defined as follows: Field 1: Depth: the digit 0, 1, 2, or 3. 0 continues the current level, 1 begins a new level, 2 denotes the last element of the current level, and 3 both begins a new level and is the last entry of the current level. Nesting is used primarily with row or column bases for layout. See the example below. Field 2: Item type: BASE, BUTTON, DROPLIST, FLOAT, INTEGER, LABEL, LIST, or TEXT. The items return the following value types: BUTTON - For single buttons, 0 if clear, 1 if set. For multiple buttons, also called button groups, that are exclusive, the index of the currently set button is returned. For non-exclusive button groups, the value is an array with an element for each button, containing 1 if the button is set, 0 otherwise. DROPLIST, LIST - a 0 based index indicating which item is selected. FLOAT, INTEGER, TEXT - return their respective data type. Field 3: Initial value. Omitted for bases. For BUTTON and DROPLIST items, the value field contains one or more item names, delimited by the | character. For FLOAT, INTEGER, LABEL, and TEXT items the value field contains the initial value of the field. Fields 4 and following: Keywords or Keyword=value pairs that specify optional attributes or options. Keywords are case insensitive and an optional leading '/' character is discarded. Possibilities include: COLUMN If present, specifies column layout for bases or multiple buttons. EXCLUSIVE If present makes an exclusive set of buttons. The default is nonexclusive. EVENT=specifies the name of a user-written event function that is called whenever the element is changed. The function is called with one parameter, the event structure. It may return an event structure or zero to indicate that no further event processing is desired. FONT= If present, the font for the item is specified. FRAME: If present, a frame is drawn around the item. May be used with all items. LABEL_LEFT=
(See C:\RSI\IDL52\lib\cw_form.pro)
NAME: CW_FSLIDER PURPOSE: The standard slider provided by the WIDGET_SLIDER() function is integer only. This compound widget provides a floating point slider. CATEGORY: Compound widgets. CALLING SEQUENCE: widget = CW_FSLIDER(Parent) INPUTS: Parent: The ID of the parent widget. KEYWORD PARAMETERS: DRAG: Set this keyword to zero if events should only be generated when the mouse is released. If it is non-zero, events will be generated continuously when the slider is adjusted. Note: On slow systems, /DRAG performance can be inadequate. The default is DRAG=0. EDIT: Set this keyword to make the slider label be editable. The default is EDIT=0. FORMAT: Provides the format in which the slider value is displayed. This should be a format as accepted by the STRING procedure. The default is FORMAT='(G13.6)' FRAME: Set this keyword to have a frame drawn around the widget. The default is FRAME=0. MAXIMUM: The maximum value of the slider. The default is MAXIMUM=100. MINIMUM: The minimum value of the slider. The default is MINIMUM=0. SCROLL Sets the SCROLL keyword to the WIDGET_SLIDER underlying this compound widget. Unlike WIDGET_SLIDER, the value given to SCROLL is taken in the floating units established by MAXIMUM and MINIMUM, and not in pixels. SUPPRESS_VALUE: If true, the current slider value is not displayed. The default is SUPPRESS_VALUE=0. TITLE: The title of slider. (The default is no title.) UVALUE: The user value for the widget. VALUE: The initial value of the slider VERTICAL: If set, the slider will be oriented vertically. The default is horizontal. XSIZE: For horizontal sliders, sets the length. YSIZE: For vertical sliders, sets the height. OUTPUTS: The ID of the created widget is returned. SIDE EFFECTS: This widget generates event structures containing a field named value when its selection thumb is moved. This is a floating point value. PROCEDURE: WIDGET_CONTROL, id, SET_VALUE=value can be used to change the current value displayed by the widget. Optionally, the value supplied to the SET_VALUE keyword can be a three element vector consisting of [value, minimum, maximum] in order to change the minimum and maximum values as well as the slider value itself. WIDGET_CONTROL, id, GET_VALUE=var can be used to obtain the current value displayed by the widget. The maximum and minimum values of the slider can also be obtained by calling the FSLIDER_GET_VALUE function directly (rather than the standard usage through the WIDGET_CONTROL interface) with the optional keyword MINMAX: sliderVals = FSLIDER_GET_VALUE(id, /MINMAX) When called directly with the MINMAX keyword, the return value of FSLIDER_GET_VALUE is a three element vector containing [value, minimum, maximum]. MODIFICATION HISTORY: April 2, 1992, SMR and AB Based on the RGB code from XPALETTE.PRO, but extended to support color systems other than RGB. 5 January 1993, Mark Rivers, Brookhaven National Labs Added EDIT keyword. 7 April 1993, AB, Removed state caching. 28 July 1993, ACY, set_value: check labelid before setting text. 3 October 1995, AB, Added SCROLL keyword. 15 July 1998, ACY, Added ability to set and get minimum and maximum.
(See C:\RSI\IDL52\lib\cw_fslider.pro)
NAME: CW_LOADSTATE PURPOSE: -------------------------------------------------------------- | This is an obsolete routine. New applications should | | be written to use the NO_COPY keyword to WIDGET_CONTROL to | | efficiently maintain widget state in a UVALUE.) | -------------------------------------------------------------- See the description of CW_SAVESTATE. CATEGORY: Compound widgets. MODIFICATION HISTORY: AB, June 1992
(See C:\RSI\IDL52\lib\obsolete\cw_loadstate.pro)
NAME: CW_ORIENT PURPOSE: This compound widget provides a means to interactively adjust the three dimensional drawing transformation (!P.T). The compound widget only returns events when !P.T has been altered. CATEGORY: Compound widgets. CALLING SEQUENCE: widget = CW_ORIENT(Parent) INPUTS: Parent: The ID of the parent widget. KEYWORD PARAMETERS: AX: The initial rotation in the X direction. If not set, the default is 30 degrees. AZ: The initial rotation in the Z direction. If not set, the default is 30 degrees. FRAME: If set, a frame will be drawn around the widget. The default is FRAME=0. TITLE: The title of the widget. (Default is no title.) UVALUE: The user value of the widget. XSIZE: Determines the width of the widget. The default is 100. YSIZE: Determines the height of the widget. The default is 100. OUTPUTS: The ID of the created widget is returned. COMMON BLOCKS: CW_OR_PRIVATE: Private to this module. SIDE EFFECTS: This widget generates event structures each time a modification to the orientation is made. This widget also resets !P.T to reflect the changed orientation. MODIFICATION HISTORY: August 7, 1992, SMR 7 April 1993, AB, Removed state caching.
(See C:\RSI\IDL52\lib\cw_orient.pro)
NAME: CW_PDMENU PURPOSE: CW_PDMENU is a compound widget that simplifies creating pulldown menus. It has a simpler interface than the XPDMENU procedure, which it is intended to replace. Events for the individual buttons are handled transparently, and a CW_PDMENU event returned. This event can return any one of the following: - The Index of the button within the base. - The widget ID of the button. - The name of the button. - The fully qualified name of the button. This allows different sub-menus to contain buttons with the same name in an unambiguous way. CATEGORY: Compound widgets. CALLING SEQUENCE: widget = CW_PDMENU(Parent, Desc) INPUTS: Parent: The ID of the parent widget. Desc: An array of strings or structures. Each element contains a menu description with two fields, a flag field, and the name of the item. If a structure, each element is defined as follows: { CW_PDMENU_S, flags:0, name:'' } The name tag gives the name of button. The flags field is a two-bit bitmask that controls how the button is interpreted: Value Meaning ------------------------------------------- 0 This button is neither the beginning nor the end of a pulldown level. 1 This button is the root of a sub-pulldown menu. The sub-buttons start with the next button. 2 This button is the last button at the current pulldown level. The next button belongs to the same level as the current parent button. If none or empty string is specified as a the name, the button is not created, but the next button belongs to the upward level. 3 This button is the root of a sub-pulldown menu, but it is also the last entry of the current level. 4 Same as 0, above, except that this button will be preceeded by a separator as with the SEPARATOR keyword to WIDGET_BUTTON. 5 Same as 1, above, except that this button will be preceeded by a separator. 6 Same as 2, above, except that this button will be preceeded by a separator. 7 Same as 3, above, except that this button will be preceeded by a separator. If Desc is a string, each element contains the flag field followed by a backslash character, followed by the menu item's contents. See the example below. EVENT PROCEDURES: An event procedure may be specified for an element and all its children, by including a third field in Desc, if Desc is a string array. Events for buttons without an event procedure, are dispatched normally. See the example below. KEYWORD PARAMETERS: DELIMITER: The character used to separate the parts of a fully qualified name in returned events. The default is to use the '.' character. FONT: The name of the font to be used for the button titles. If this keyword is not specified, the default font is used. HELP: If MBAR is specified and one of the buttons on the menubar has the label "help" (case insensitive) then that button is created with the /HELP keyword to give it any special appearance it is supposed to have on a menubar. For example, Motif expects help buttons to be on the right. IDS: A named variable into which the button IDs will be stored as a longword vector. MBAR: if constructing a menu-bar pulldown, set this keyword. In this case, the parent must be the widget id of the menu bar of a top-level base, returned by WIDGET_BASE(..., MBAR=mbar). RETURN_ID: If present and non-zero, the VALUE field of returned events will be the widget ID of the button. RETURN_INDEX: If present and non-zero, the VALUE field of returned events will be the zero-based index of the button within the base. THIS IS THE DEFAULT. RETURN_NAME: If present and non-zero, the VALUE field of returned events will be the name of the selected button. RETURN_FULL_NAME: If present and non-zero, the VALUE field of returned events will be the fully qualified name of the selected button. This means that the names of all the buttons from the topmost button of the pulldown menu to the selected one are concatenated with the delimiter specified by the DELIMITER keyword. For example, if the top button was named COLORS, the second level button was named BLUE, and the selected button was named LIGHT, the returned value would be COLORS.BLUE.LIGHT This allows different submenus to have buttons with the same name (e.g. COLORS.RED.LIGHT). UVALUE: The user value to be associated with the widget. XOFFSET: The X offset of the widget relative to its parent. YOFFSET: The Y offset of the widget relative to its parent. OUTPUTS: The ID of the top level button is returned. SIDE EFFECTS: This widget generates event structures with the following definition: event = { ID:0L, TOP:0L, HANDLER:0L, VALUE:0 } VALUE is either the INDEX, ID, NAME, or FULL_NAME of the button, depending on how the widget was created. RESTRICTIONS: Only buttons with textual names are handled by this widget. Bitmaps are not understood. EXAMPLE: The following is the description of a menu bar with two buttons, "Colors" and "Quit". Colors is a pulldown containing the colors "Red", "Green", Blue", "Cyan", and "Magenta". Blue is a sub-pulldown containing "Light", "Medium", "Dark", "Navy", and "Royal": ; Make sure CW_PDMENU_S is defined junk = { CW_PDMENU_S, flags:0, name:'' } ; The description desc = [ { CW_PDMENU_S, 1, 'Colors' }, $ { CW_PDMENU_S, 0, 'Red' }, $ { CW_PDMENU_S, 0, 'Green' }, $ { CW_PDMENU_S, 5, 'Blue\BLUE_EVENT_PROC' }, $ { CW_PDMENU_S, 0, 'Light' }, $ { CW_PDMENU_S, 0, 'Medium' }, $ { CW_PDMENU_S, 0, 'Dark' }, $ { CW_PDMENU_S, 0, 'Navy' }, $ { CW_PDMENU_S, 2, 'Royal' }, $ { CW_PDMENU_S, 4, 'Cyan' }, $ { CW_PDMENU_S, 2, 'Magenta\MAGENTA_EVENT_PROC' }, $ { CW_PDMENU_S, 2, 'Quit' } ] The same menu may be defined as a string by equating the Desc parameter to the following string array: desc =[ '1\Colors' , $ '0\Red' , $ '0\Green' , $ '5\Blue\BLUE_EVENT_PROC' , $ '0\Light' , $ '0\Medium' , $ '0\Dark' , $ '0\Navy' , $ '2\Royal' , $ '4\Cyan' , $ '2\Magenta\MAGENTA_EVENT_PROC' , $ '2\Quit' ] The following small program can be used with the above description to create the specified menu: base = widget_base() menu = cw_pdmenu(base, desc, /RETURN_FULL_NAME) WIDGET_CONTROL, /REALIZE, base repeat begin ev = WIDGET_EVENT(base) print, ev.value end until ev.value eq 'Quit' WIDGET_CONTROL, /DESTROY, base end Note that independent event procedures were specified for the multiple Blue buttons (blue_event_proc), and the Magenta button (magenta_event_proc). MODIFICATION HISTORY: 18 June 1992, AB 16 Jan 1995, DMS, Added MBAR keyword, event procedures, and menu descriptor strings. 2 July 1995, AB, Added HELP keyword. 3 September 1996, LP, Added button-less end of current level
(See C:\RSI\IDL52\lib\cw_pdmenu.pro)
NAME: CW_RGBSLIDER PURPOSE: CW_RGBSLIDER is a compund widget that provides three sliders for adjusting color values. The RGB, CMY, HSV, and HLS color systems can all be used. No matter which color system is in use, the resulting color is always supplied in RGB, which is the base system for IDL. CATEGORY: Compound widgets. CALLING SEQUENCE: Widget = CW_RGBSLIDER(Parent) INPUTS: Parent: The ID of the parent widget. KEYWORD PARAMETERS: CMY: If set, the initial color system used is CMY. DRAG: Set to zero if events should only be generated when the mouse button is released. If this keyword is set, events will be generated continuously when the sliders are adjusted. Note: On slow systems, /DRAG performance can be inadequate. The default is DRAG=0. FRAME: If set, a frame will be drawn around the widget. The default is FRAME=0 (no frame drawn). HSV: If set, the initial color system used is HSV. HLS: If set, the initial color system used is HLS. LENGTH: The length of the sliders. The default = 256. RGB: If set, the initial color system used is RGB. This is the default. UVALUE: The user value for the widget. VERTICAL: If set, the sliders will be oriented vertically. The default is VERTICAL=0 (horizontal sliders). COLOR_INDEX: If set, display a small rectangle with the selected color, using the given index. The color is updated as the values are changed. OUTPUTS: The ID of the created widget is returned. SIDE EFFECTS: This widget generates event structures containing a three fields named 'R', 'G', and 'B' containing the Red, Green, and Blue components of the selected color. PROCEDURE: The CW_RGBSLIDER widget has the following controls: Color System Selection: A pulldown menu which allows the user to change between the supported color systems. Color adjustment sliders: Allow the user to select a new color value. By adjusting these controls, the user selects color values which are reported via the widget event mechanism. MODIFICATION HISTORY: April 1, 1992, AB Based on the RGB code from XPALETTE.PRO, but extended to support color systems other than RGB. 7 April 1993, AB, Removed state caching. 10 May 1994, DMS, Added Color_index param to display color.
(See C:\RSI\IDL52\lib\cw_rgbslider.pro)
NAME: CW_SAVESTATE PURPOSE: -------------------------------------------------------------- | This is an obsolete routine. New applications should | | be written to use the NO_COPY keyword to WIDGET_CONTROL to | | efficiently maintain widget state in a UVALUE.) | -------------------------------------------------------------- Compound widgets cannot use a COMMON block to keep their state information in because that would preclude having more than one at a time. One solution is to keep their state as a structure in the UVALUE of one of the widgets in the cluster. Once this is done, it is then possible to use a COMMON block to cache the most recently used state. This is the scheme implemented by the CW_SAVESTATE and CW_LOADSTATE procedures. CW_LOADSTATE is called by the main compound widget function that creates the widgets. It stores the state in the UVALUE of the first child. Other functions that require the state call CW_LOADSTATE to ensure that the correct state is present. CATEGORY: Compound widgets. CALLING SEQUENCE: Creation function: COMMON CW_XYZ_BLK, state_base, state_stash, state CW_SAVESTATE, base, state_base, new_state Other routines: COMMON CW_XYZ_BLK, state_base, state_stash, state CW_LOADSTATE, base, state_base, state_stash, state If the other routines are called heavily, the following is a more efficient way to call CW_LOADSTATE: COMMON CW_XYZ_BLK, state_base, state_stash, state if (base ne state_base) then $ CW_LOADSTATE, base, state_base, state_stash, state Note that the COMMON block must be defined in every routine that calls these procedures. The name of the COMMON block is unique to each compound widget, but the names of the variables inside the COMMON must be as shown. INPUTS: CW_SAVESTATE: BASE - The ID of the base widget of the cluster. STATE_BASE - The state_base variable from the COMMON block. NEW_STATE - The new state that should be saved in the UVALUE. NOTE: This is not the same as the STATE variable from the COMMON block. Confusing them can result in corrupting the state of an already existing instance of the compound widget. CW_LOADSTATE: BASE - The ID of the base widget of the cluster. STATE_BASE - The STATE_BASE variable from the COMMON block. STATE_STASH - The STATE_STASH variable from the COMMON block. STATE - The STATE variable from the COMMON block. KEYWORD PARAMETERS: None. OUTPUTS: No explicit outputs. COMMON BLOCKS: None in these routines, but the calling routines must have the per compound widget class COMMON discussed above. SIDE EFFECTS: CW_SAVESTATE saves the new state for a freshly created compound widget. CW_LOADSTATE flushes the current state from the compound widget COMMON block and loads the state for the specified widget. RESTRICTIONS: -------------------------------------------------------------- | This is an obsolete routine. New applications should | | be written to use the NO_COPY keyword to WIDGET_CONTROL to | | efficiently maintain widget state in a UVALUE.) | -------------------------------------------------------------- These routines use the UVALUE of the first child of the compound widget base. Hence, the compound widget should not make use of this UVALUE or confusion will result. One solution to this problem is to include an extra base between the top base and the rest of the widgets. For example: OUTER_BASE = WIDGET_BASE() INNER_BASE = WIDGET_BASE(OUTER_BASE) OTHER_WIDGET = WIDGET_BUTTON(INNER_BASE) ... PROCEDURE: Every compound widget that uses these procedures keeps the most recently accessed state in the UVALUE of the first child of the compound widget base. These procedures load and unload the states for each instance of compound widget as needed. EXAMPLE: Here is the framework for a compound widget at its event function function CW_XYZ_EVENT, ev COMMON CW_XYZ_BLK, state_base, state_stash, state CW_LOADSTATE, ev.handler, state_base, state_stash, state ; Event processing goes here. The widget state is ; contained in the variable state. end function CW_XYZ, parent COMMON CW_XYZ_BLK, state_base, state_stash, state ; base = widget_base() ; Other widgets are created here new_state = ... ; The new state is widget dependent CW_SAVESTATE, base, state_base, new_state return, base end MODIFICATION HISTORY: AB, June 1992
(See C:\RSI\IDL52\lib\obsolete\cw_savestate.pro)
NAME: CW_ZOOM PURPOSE: This compound widget displays two images: an original image in one window and a portion of the original image in another. The user may select the center of the zoom region, the zoom scale, the interpolation style, and the method of indicating the zoom center. CATEGORY: Compound widgets. CALLING SEQUENCE: Widget = CW_ZOOM(Parent) INPUTS: Parent: The ID of the parent widget. KEYWORD PARAMETERS: FRAME: If set, a frame will be drawn around the widget. The default is FRAME=0 (no frame). MAX: The maximum zoom scale, which must be greater than or equal to 1. The default = 20. MIN: The minimum zoom scale, which must be greater than or equal to 1. The default = 1. RETAIN: Controls the setting for backing store for both windows. If backing store is provided, a window which was obscured will be redrawn when it becomes exposed. Set RETAIN=0 for no backing store. Set RETAIN=1 to "request backing store from server" (this is the default). Set RETAIN=2 for IDL to provide backing store. SAMPLE: Set to zero for bilinear interpolation, or to a non-zero value for nearest neighbor interpolation. Bilinear interpolation gives higher quality results, but requires more time. The default is SAMPLE=0 (bilinear interpolation). SCALE: The initial integer scale factor to use for the zoomed image. The default is SCALE=4. The scale must be greater than or equal to 1. TRACK: Set to zero if the zoom window should be updated only when the mouse button is pressed. Set to a non-zero value if the zoom window should be updated continuously as the cursor is moved across the original image. Note: On slow systems, /TRACK performance can be inadequate. The default is TRACK=0. UVALUE: The user value for the widget. XSIZE: The width of the window (in pixels) for the original image. The default is 500. YSIZE: The height of the window (in pixels) for the original image. The default is 500. X_SCROLL_SIZE: The width of the visible part of the original image. This may be smaller than the actual width controlled by the XSIZE keyword. The default is 0, for no scroll bar. Y_SCROLL_SIZE: The height of the visible part of the original image. This may be smaller than the actual height controlled by the YSIZE keyword. The default is 0, for no scroll bar. X_ZSIZE: The width of the window for the zoomed image. The default is 250. Y_ZSIZE: The height of the window for the zoomed image. The default is 250. OUTPUTS: The ID of the created widget is returned. SIDE EFFECTS: When the "Report Zoom to Parent" button is pressed, this widget will generate an event structure containing several data fields. x_zsize, y_zsize: size of the zoomed image x0, y0: lower left corner in original image x1, y1: upper right corner in original image This event is a report to the parent that allows retrieval of the zoomed image using WIDGET_CONTROL. PROCEDURE: WIDGET_CONTROL, id, SET_VALUE=value can be used to change the original, unzoomed image displayed by the widget. The value may not be set until the widget has been realized. WIDGET_CONTROL, id, GET_VALUE=var can be used to obtain the current zoomed image displayed by the widget. MODIFICATION HISTORY: June 30, 1992, ACY 7 April 1993, AB, Removed state caching. 13 June, 1994, ACY, Save window and set to zoom prior to erase Add byte conversion in set_value 23 November, 1994, ACY, add code to handle cases in which the set_value image is larger or smaller than the original image. Also remove scaling on display operation (only scale the image when it is set.)
(See C:\RSI\IDL52\lib\cw_zoom.pro)
NAME: C_CORRELATE PURPOSE: This function computes the cross correlation Pxy(L) or cross covariance Rxy(L) of two sample populations X and Y as a function of the lag (L). CATEGORY: Statistics. CALLING SEQUENCE: Result = C_correlate(X, Y, Lag) INPUTS: X: An n-element vector of type integer, float or double. Y: An n-element vector of type integer, float or double. LAG: A scalar or n-element vector, in the interval [-(n-2), (n-2)], of type integer that specifies the absolute distance(s) between indexed elements of X. KEYWORD PARAMETERS: COVARIANCE: If set to a non-zero value, the sample cross covariance is computed. DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE Define two n-element sample populations. x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57] y = [2.31, 2.76, 3.02, 3.13, 3.72, 3.88, 3.97, 4.39, 4.34, 3.95] Compute the cross correlation of X and Y for LAG = -5, 0, 1, 5, 6, 7 lag = [-5, 0, 1, 5, 6, 7] result = c_correlate(x, y, lag) The result should be: [-0.428246, 0.914755, 0.674547, -0.405140, -0.403100, -0.339685] PROCEDURE: See computational formula published in IDL manual. REFERENCE: INTRODUCTION TO STATISTICAL TIME SERIES Wayne A. Fuller ISBN 0-471-28715-6 MODIFICATION HISTORY: Written by: GGS, RSI, October 1994 Modified: GGS, RSI, August 1995 Corrected a condition which excluded the last term of the time-series. Modified: GGS, RSI, April 1996 Simplified CROSS_COV function. Added DOUBLE keyword. Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\c_correlate.pro)
NAME: C_EDIT PURPOSE: Interactive creation of color tables based on the HLS or the HSV color systems using the mouse and three sliders. Similar to COLOR_EDIT but two sliders replace the color wheel. The sliders allow better control of HSV colors near 0% saturation, but the interface is less intuitive. CATEGORY: Color tables. CALLING SEQUENCE: C_EDIT [,COLORS_OUT] [, HSV = hsv] [, HLS = hls] INPUTS: None. KEYWORD PARAMETERS: HLS: If this keyword is set, use the Hue Lightness Saturation system. HSV: If this keyword is set, use the Hue Saturation Value system (the default). OUTPUTS: COLORS_OUT: If supplied, this variable contains the final color table triples as an array of the form (number_colors, 3). COMMON BLOCKS: COLORS: Contains the current RGB color tables. SIDE EFFECTS: Color tables are modified and values in COLORS common block are changed. A temporary window is used. RESTRICTIONS: Works only with window systems. PROCEDURE: A window is created with a color bar centered at top and four sliders along the left side. The four sliders are labeled: 1) Pixel Value (from 0 to the number of available colors -1 ) 2) Value (for HSV) or Lightness (HLS) can have values from 0 to 1. 3) Saturation can have values from 0 to 1. 4) Hue (0 to 360): Red is 0 degrees, green is 120 degrees, and blue is 240 degrees. Three graphs on the right show the current values of the three parameters versus pixel value. Operation: The left mouse button is used to mark values on the sliders. The middle button is used to erase marked pixel values (tie points) in the Pixel Value slider. The right button updates the color tables and exits the procedure. . To use: Move the mouse into the slider whose value you want to change and press the left button to select a Value/Lightness, Saturation, or Hue. Move the mouse with the left button depressed to interactively alter a color. When you have created a color, move the mouse to the top slider and select a pixel value. The three color parameters are interpolated between pixel values that have been marked (called tie points). Tie points are shown as small vertical lines beneath the "Pixel Value" slider. Press the middle button with the cursor over the Pixel Value slider to delete the nearest tie point. Note that in the HSV system, a Value of 1.0 represents the maximum brightness of the selected hue. In the HLS system, a Lightness of 0.5 is the maximum brightness of a chromatic hue, 0.0 is black, and 1.0 is bright white. In the HLS color space, modeled as a double-ended cone, the Saturation value has no effect at the extreme ends of the cone (i.e., lightness = 0 or 1). You can access the new color tables by declaring the common block COLORS as follows: COMMON COLORS, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr MODIFICATION HISTORY: DMS, July, 1988. SNG, December, 1990 - For MSDOS only: c_edit does not support resolutions lower than 640x480.
(See C:\RSI\IDL52\lib\obsolete\c_edit.pro)
NAME: DEFROI PURPOSE: Define an irregular region of interest of an image using the image display system and the cursor/mouse. CATEGORY: Image processing. CALLING SEQUENCE: R = Defroi(Sx, Sy, X0, Y0) INPUTS: Sx, Sy = Size of image, in pixels. Optional Inputs: X0, Y0 = Coordinate of Lower left corner of image on display. If omitted, (0,0) is assumed. Screen device coordinates. ZOOM = zoom factor, if omitted, 1 is assumed. OUTPUTS: Function result = vector of subscripts of pixels inside the region. Side effect: The lowest bit in which the write mask is enabled is changed. OPTIONAL OUTPUTS: Xverts, Yverts = Optional output parameters which will contain the vertices enclosing the region. KEYWORD Parameters: NOREGION = Setting NOREGION inhibits the return of the pixel subscripts. NOFILL = if set, inhibits filling of irregular region on completion. RESTORE = if set, original image on display is restored to its original state on completion. COMMON BLOCKS: None. SIDE EFFECTS: Display is changed if RESTORE is not set. RESTRICTIONS: Only works for interactive, pixel oriented devices with a cursor and an exclusive or writing mode. A region may have at most 1000 vertices. If this is not enough edit the line setting MAXPNTS. PROCEDURE: The exclusive or drawing mode is used to allow drawing and erasing objects over the original object. The operator marks the vertices of the region, either by dragging the mouse with the left button depressed or by marking vertices of an irregular polygon by clicking the left mouse button, or with a combination of both. The center button removes the most recently drawn points. Press the right mouse button when finished. When the operator is finished, the region is filled using the polyfill function, and the polyfillv function is used to compute the subscripts within the region. MODIFICATION HISTORY: DMS, March, 1987. Revised for SunView, DMS, Nov, 1987. Added additional argument checking, SNG April, 1991 Modified for devices without write masks: DMS, March, 1992. Uses exclusive or mode rather than write masks. Modified to preserve device mode, RJF, Nov 1997.
(See C:\RSI\IDL52\lib\defroi.pro)
FILE: demo.pro CALLING SEQUENCE: demo PURPOSE: Main demo shell. MAJOR TOPICS: All topics in IDL. CATEGORY: IDL demo system. INTERNAL FUNCTIONS and PROCEDURES: func demoTempMsg - Display a temporary message pro demoTimer - Print times & update current time pro demoDoAScreen - Write image to gif file pro demoSaveScreens - Write images to save file pro demoWriteScreen - Create gif file from .sav file func demoOpenScreens - Open the screens file func demoPReadScreen - Return a pointer to an image pro demoSplashStart - Set up the splash screen pro demoSplashEnd - Take down the splash screen pro demoResetSysVars - Reset system variables pro demoButtonGroup - Build demo buttons pro demoButtonDef - Define demo buttons pro demoMenuDef - Define demo menus func demoXFindFont - Look for a font pro demoButtonCreate - Create the buttons pro demoShowScreen - Display a screen pro demoStartInsight - Start the Insight Application pro demoStartHelp - Start the Online Help system pro demoStartApp - Start a demo application func demoFuncsumCleanup - Cleanup func demoFuncsumEvent - Event handler func demoFuncsum - Display IDL functional summary text func demoGetScreenSize - Get the screen size func demoInit - Set up the demo system pro demoCleanup - Cleanup pro demoEvent - Event handler pro demo - Main routine EXTERNAL FUNCTIONS, PROCEDURES, and FILES: REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 3/97, ACY - Modified
(See C:\RSI\IDL52\examples\demo\demosrc\demo.pro)
NAME: DEMO_FILEPATH PURPOSE: Given the name of a file, DEMO_FILEPATH returns the fully-qualified path to use in opening the file. Unlike the standard FILEPATH routine, DEMO_FILEPATH looks first in the local directory for the file. If the file is found there, DEMO_FILEPATH returns the local name. This is useful if the demo routine is to be run with local data files, allowing a user to supply a file without having to place it in the IDL distribution. CATEGORY: Demo System, File Management. CALLING SEQUENCE: Result = DEMO_FILEPATH('filename') INPUTS: filename: The name of the file to be opened. No device or directory information should be included. KEYWORDS: ROOT_DIR: The name of the directory from which the resulting path should be based. If not present, and if the supplied filename is not found in the current directory, the value of !DIR is used. If the input filename is found in the current directory, then keyword ROOT_DIR is ignored. SUBDIRECTORY: The name of the subdirectory in which the file should be found. This variable can be either a scalar string or a string array with the name of each level of subdirectory depth represented as an element of the array. If the input filename is found in the current directory, then keyword SUBDIRECTORY is ignored. OUTPUTS: The fully-qualified file path is returned. COMMON BLOCKS: None. EXAMPLE: To get a path to the file cities.dat in the "examples/demo/demodata" subdirectory of the IDL directory, enter: path = DEMO_FILEPATH("cities.dat", $ SUBDIRECTORY = ["examples", "demo", "demodata"]) The variable "path" contains a string that is the fully-qualified file path for the file cities.dat. Note that if the specified filename is found in the current directory the full path to it will be returned. MODIFICATION HISTORY: January, 1998, ACY and PCS, New for 5.1 demo system.
(See C:\RSI\IDL52\examples\demo\demosrc\demo_filepath.pro)
NAME: demo_getdata PURPOSE: Retrieves a data file from the examples/data directory in the main IDL directory. The file can be specified when calling the routine or the file can be chosen by the user with a widget that lets them make the selection. CATEGORY: Widgets CALLING SEQUENCE: demo_getdata, NEWDATA KEYWORD PARAMETERS: ASSOC_IT = When set, this keyword forces the routine to return an associated variable instead of a standard IDL variable. This is more efficient when loading animations for instance as it removes the need to create two copies of the data in memory (one for the animation, one for the load data). DESCRIPTION = This keyword returns the description of the data selected by the GetData routine (NEWDATA). DIMENSIONS = This keyword returns the dimensions of the data selected by the GetData routine. These dimensions are the dimensions of the NEWDATA variable. FILENAME = The name of the file that is to be selected from the images subdirectory. If this keyword is set, no user selection widget is created. OFILENAME = name of file selected. ONE_DIM = This keyword is set when the routine is to consider one dimensional data from the data contained in the images subdirectory. TWO_DIM = This keyword is set when the routine is to consider two dimensional data from the data contained in the images subdirectory. When searching for two dimensional data, this routine will use the first slice of any three dimensional data that it encounters. THREE_DIM = This keyword is set when the routine is to consider three dimensional data from the data contained in the images subdirectory. TITLE = The string that will appear in the title portion of the data selection widget. If not specified, the title will be "Please Select Data". OUTPUTS: NEWDATA = the variable that is to be filled with the new data. COMMON BLOCKS: GF - maintains which selection was made when using the data selection widget. SIDE EFFECTS: Desensitizes all the other widgets and is modal in behavior. It forces the user to make a selection before proceeding with other widget functions. RESTRICTIONS: Getdat2 must find the subdirectory called examples/dataimages of the main IDL directory(IDL_DIR) and the directory must contain a file called data.txt that describes the contents of the directory. PROCEDURE: If the FILENAME keyword was not set, determine the file name using a widget that lets the user make a selection from the data.txt file and then open that file, read the data, dimensions, and description, and return the data. MODIFICATION HISTORY: Written by Steve Richards, Dec, 1990 Modified by DAT, renamed demo_getdata, add group keyword, 2/97
(See C:\RSI\IDL52\examples\demo\demosrc\demo_getdata.pro)
NOTE: This routine has been made obsolete because it has been replaced by LMGR(/DEMO). NAME: DEMO_MODE PURPOSE: Returns true if IDL is in Demo Mode. CALLING SEQUENCE: Result = DEMO_MODE() OUTPUTS: Returns 1 if IDL is in Demo Mode and 0 otherwise. SIDE EFFECTS: Does a FLUSH, -1. PROCEDURE: Do a FLUSH, -1 and trap the error message. MODIFICATION HISTORY: Written by SMR, Research Systems, Inc. Feb. 1991 KDB Oct,1993: The error string had an extra ' ' in it and the function would always return 0.
(See C:\RSI\IDL52\lib\obsolete\demo_mode.pro)
NAME: DEMO_RECORD PURPOSE: Append IDL commands to an ASCII file of IDL commands in the current directory. If the file does not exist, it will get created. Edited output from DEMO_RECORD is played by DEMO_TOUR. CATEGORY: Demos CALLING SEQUENCE: demo_record, arg INPUTS: Arg: The event being recorded. Typically this is a widget event structure. (e.g. {WIDGET_BUTTON, ID:...}) Handler_Name (optional): A procedure that takes ARG. The name of the procedure will appear in the recorded command string. By default this name is the name of the procedure in which DEMO_RECORD was invoked. KEYWORD PARAMETERS: Filename: (Input). Set this keyword to the name of the file to which DEMO_RECORD will write. The default name is "recording.txt". If filename is explicitly set to '', then no recording is performed. CW: (Input). An array of widget IDs. Events recorded for widgets on this list are recorded with a WIDGET_CONTROL, SET_VALUE command or WIDGET_CONTROL, SET_BUTTON command preceding them. This is useful for compund widgets such as CW_BGROUP radio buttons, and for buttons in exclusive or non-exclusive bases. OUTPUTS: none SIDE EFFECTS: A file in the current directory can be created or appended. RESTRICTIONS: Please note: demo_record is not a "complete solution" for end-user use. This is because: 1. The file that results from using DEMO_RECORD is not necessarily "ready-to-run", and may require hand editing. In particular, applications which use unusual widgets (e.g. applications which use compound widgets that do not send events with a "value:" field that contains a value that can be sensibly passed to WIDGET_CONTROL, SET_VALUE=...) may be difficult (or impossible?) to record successfully. 2. Within an application, invokations of DEMO_RECORD must be used/placed carefully (typically one call to DEMO_RECORD in each event handler) to ensure that the resulting series of recorded commands is not missing needed events, or does not have unwanted events. 3. Only events for widgets that have a suitable UNAME can be successfully recorded. The commands output by DEMO_RECORD include calls to DEMO_FIND_WID(), which only works for widgets that have a UNAME suitable for use with DEMO_FIND_WID(). 4. DEMO_RECORD makes its recording with the assumption that HANDLER_NAME is a procedure (not a function). 5. DEMO_RECORD relies on the convention that pseudo events (generated by explicit calls to an event handler routine in IDL .pro program code) contain 0 in the ARG.handler field. (Such events are skipped by DEMP_RECORD; they are not recorded.) 6. DEMO_RECORD assumes that ARG is an event structure with id, top and handler fields. PROCEDURE: Typically, one line of text is appended to an ASCII file with each invocation of DEMO_RECORD. The line is of the form..., ...where is a HANDLER_NAME, and is an ASCII string like {WIDGET_BUTTON: ID: ...etc...} If CW is supplied, and ARG.ID is in CW, then two lines of text are recorded. The first is of the form... widget_control, ..., set_value= or widget_control, ..., set_button= ...and the second is of the form... , ...as discussed above.
(See C:\RSI\IDL52\examples\demo\demosrc\demo_record.pro)
NAME: DEMO_TOUR PURPOSE: Provide GUI controls and functionality to play a series of events that step through and display the IDL demonstration system. Typically, (possibly hand-edited) output from DEMO_RECORD is played by DEMO_TOUR. CATEGORY: Demos CALLING SEQUENCE: demo_tour KEYWORD PARAMETERS: Show_Filenums: (Input). If this keyword is set, numbers from filenames such as 'recording55.txt' will be shown in DEMO_TOUR's GUI control panel. For example 'recording55.txt' would create an item on DEMO_TOUR's GUI checklist with a name ending in '(55)'. OUTPUTS: none SIDE EFFECTS: The IDL demo system is left running. RESTRICTIONS: The IDL Demo system must be installed. PROCEDURE: Read ASCII lines from certain IDL batch files. Execute each line via IDL's CALL_PROCEDURE or EXECUTE commands. Batch files to be executed by DEMO_TOUR are assumed to have the naming convention "recording??.pro", where "??" can be any two digits.
(See C:\RSI\IDL52\examples\demo\demosrc\demo_tour.pro)
NAME: DERIV PURPOSE: Perform numerical differentiation using 3-point, Lagrangian interpolation. CATEGORY: Numerical analysis. CALLING SEQUENCE: Dy = Deriv(Y) ;Dy(i)/di, point spacing = 1. Dy = Deriv(X, Y) ;Dy/Dx, unequal point spacing. INPUTS: Y: Variable to be differentiated. X: Variable to differentiate with respect to. If omitted, unit spacing for Y (i.e., X(i) = i) is assumed. OPTIONAL INPUT PARAMETERS: As above. OUTPUTS: Returns the derivative. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: See Hildebrand, Introduction to Numerical Analysis, Mc Graw Hill, 1956. Page 82. MODIFICATION HISTORY: Written, DMS, Aug, 1984.
(See C:\RSI\IDL52\lib\deriv.pro)
NAME: DERIVSIG PURPOSE: This function computes the standard deviation of a derivative as found by the DERIV function, using the input variables of DERIV and the standard deviations of those input variables. CATEGORY: Numerical analysis. CALLING SEQUENCE: sigDy = Derivsig(sigy) ;sigma(Dy(i)/di), point spacing = 1. sigDy = Derivsig(X,Y,sigx,sigy) ;sigma(Dy/Dx), unequal point spacing. INPUTS: Y: The variable to be differentiated. Omit if X is omitted. X: The Variable to differentiate with respect to. If omitted, unit spacing is assumed for Y, i.e. X(i) = i. sigy: The standard deviation of Y. (Vector if used alone in call, vector or constant if used with other parameters) sigx: The standard deviation of X (either vector or constant). Use "0.0" if the abscissa is exact; omit if X is omitted. OPTIONAL INPUT PARAMETERS: As above. OUTPUTS: This function returns the standard deviation of the derivative. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: See Bevington, "Data Analysis and Reduction for the Physical Sciences," McGraw-Hill (1969), Chap 4. MODIFICATION HISTORY: Written by Richard Bonomo at the University of Wisconsin - Madison department of Electrical and Computer Engineering, July, 1991. "DERIV" written by DMS, Aug, 1984.
(See C:\RSI\IDL52\lib\derivsig.pro)
NAME: DETERM PURPOSE: This function computes the determinant of an N by N array. CATEGORY: Linear Algebra. CALLING SEQUENCE: Result = DETERM(A) INPUTS: A: An N by N array of type: float, or double. KEYWORD PARAMETERS: CHECK: If set to a non-zero value, A is checked for singularity. The determinant of a singular array is returned as zero if this keyword is set. Run-time errors may result if A is singular and this keyword is not set. DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. ZERO: Use this keyword to set the value of floating-point zero. A floating-point zero on the main diagonal of a triangular matrix results in a zero determinant. For single-precision inputs, the default value is 1.0e-6. For double-precision inputs, the default value is 1.0e-12. EXAMPLE: Define an array (a). a = [[ 2.0, 1.0, 1.0], $ [ 4.0, -6.0, 0.0], $ [-2.0, 7.0, 2.0]] Compute the determinant. result = determ(a) Note: See CRAMER.PRO, in the same directory as this file, for an application of the determinant function. PROCEDURE: LU decomposition is used to represent the input array in triangular form. The determinant is computed as the product of diagonal elements of the triangular form. Row interchanges are tracked during the LU decomposition to ensure the correct sign, + or - . REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Written by: GGS, RSI, February 1994 Modified: GGS, RSI, November 1994 Added CHECK keyword to check for singular arrays. Changed NR_LUDCMP to LUDC. Modified: GGS, RSI, April 1996 Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\determ.pro)
NAME: dicom_example PURPOSE: This widget application illustrates the use of the IDL DICOM procedural and object interfaces. MAJOR TOPICS: DICOM CALLING SEQUENCE: dicom_example PROCEDURE: dicom_example MAJOR FUNCTIONS and PROCEDURES: MODIFICATION HISTORY: Written by: RJF, RSI, Oct 1998
(See C:\RSI\IDL52\examples\misc\dicom_example.pro)
NAME: DIFFEQ_23 PURPOSE: Solve a system of first-order, ordinary differential equations: yi' = fi(t, y1(t), ... yn(y)), i = 1,..., n ai = yi(start), i = 1,..., n using the Runge-Kutta method of order 2 and 3. Step size is selected automatically and hence is variable. CATEGORY: Mathematical Functions, General CALLING SEQUENCE: DIFFEQ_23, Funct, Init, Start, Finish, Times, Yvalues, $ TOL = Tol, PARAMS = Params, REPORT = Report, $ LISTNAME = Listname, DEPVAR = Depvar INPUTS: Funct: A character string containing the name of the user-supplied function implementing f = [f1, ...., fn]. This function should be written in IDL and have two arguments -- the scalar- valued time argument t, and the vector argument [y1(t), ... ,yn(t)]. Additional constant parameters may be supplied through the keyword PARAMS. Init: The vector [a1, ..., an] of initial values. Start: The initial value of t. Finish: The final value of t. KEYWORD PARAMETERS: TOL: The error tolerance. The default is .001. PARAMS: A keyword to be passed to the function f. PARAMS can be used to specify constant-parameter values if f is a parametric family of functions. See the example below. If the IDL function to compute f does accept the keyword PARAMS, then PARAMS should not be set in the call to DIFFEQ_23. REPORT: If set, this flag signals that, at each step, the time value, step size, and dependent variable values should be written to the screen or to a file specified by keyword LISTNAME. LISTNAME: The name of the file to receive any output. The default is to write to the screen. DEPVAR: A string array of the names of the dependent variables to be used in the output. Depvar(i) = name of variable i. OUTPUT PARAMETERS: Times: A vector of times at which f is computed. Yvalues: An array of y values. If ti = times(i), Yvalues(*, i) = f(ti,y1(ti),..., yn(ti)) = [f1(ti,y1(ti),..., yn(ti)), ..., fn(ti,y1(ti), ...,yn(ti))]. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. EXAMPLE: Solve the set of equations: y1' = -.1 * y1, y2' = .1*y1 - .05*y2, y3' = .05*y2 y1(0) = 1000, y2(0) = 0, y3(0) = 0 on the interval [0, 5]. First, we define the function RADIO as FUNCTION RADIO, t, y, PARAMS = params k = params(0) kp = params(1) RETURN, [-k*y(0), k*y(0) - kp*y(1), kp* y(1)] END Next, call DIFFEQ_23: DIFFEQ_23, "radio", [1000, 0, 0], 0, 5., times, yvalues, $ PARAMS = [.1, .05], /REPORT The result can be plotted by entering: PLOT, times, yvalues(0,*) FOR i = 1,2 DO OPLOT, times, yvalues(i,*) MODIFICATION HISTORY: CAB, Sept., 1991.
(See C:\RSI\IDL52\lib\obsolete\diffeq_23.pro)
NAME: DIFFEQ_45 PURPOSE: Solve system of first-order, ordinary differential equations: yi' = fi(t, y1(t),...yn(y)), i = 1,..., n ai = yi(start), i = 1,..., n using the Runge-Kutta method of order 4 and 5. Step size is selected automatically and hence is variable. CATEGORY: Mathematical Functions, General CALLING SEQUENCE: DIFFEQ_45, Funct, Init, Start, Finish, Times, Yvalues, $ TOL = Tol, PARAMS = Params, REPORT = Report, $ LISTNAME = Listname, DEPVAR = Depvar INPUTS: Funct: A character string containing the name of the user-supplied function implementing f = [f1, ...., fn]. This function should be written in IDL and have two arguments -- the scalar- valued time argument t, and the vector argument [y1(t), ... , yn(t)]. Additional constant parameters may be supplied through the keyword PARAMS. Init: The vector [a1, ..., an] of initial values. Start: The initial value of t. Finish: The final value of t. KEYWORD PARAMETERS: TOL: The error tolerance. The default is 1.e-6. PARAMS: A keyword to be passed to the function f. Params can be used to specify constant-paramter values if f is a parametric family of functions. See the example for the procedure DIFFEQ_23. If the IDL function to compute f does not accept the keyword PARAMS, then PARAMS should not be set in the call to DIFFEQ_45. REPORT: If set, this flag signals that, at each step, the time value, step size, and dependent variable values should be written to the screen or to a file specified by keyword LISTNAME. LISTNAME: The name of the file to receive any output. The default is to write to the screen. DEPVAR: A string array of the names of the dependent variables to be used in the output. Depvar(i) = name of variable i. OUTPUT PARAMETERS: Times: A vector of times at which f is computed. Yvalues: An array of y values. If ti = times(i), Yvalues(*, i) = f(ti,y1(ti),..., yn(ti)) = [f1(ti,y1(ti),..., yn(ti)), ..., fn(ti,y1(ti), ...,yn(ti))]. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. EXAMPLE: See the example for DIFFEQ_23. PROCEDURE: The constants of Fehlberg are used to obtain the Runge-Kutta formula. See "Klassiche Runge-Kutta Formeln vierter und niedrigerer Ordnung mit Schrittweiten-Kontrolle und ihre Anwendung auf Warmeleitungsprobleme", Computing 6, 1970, pp. 61 - 71. MODIFICATION HISTORY: CAB, Sept., 1991.
(See C:\RSI\IDL52\lib\obsolete\diffeq_45.pro)
NAME: DIGITAL_FILTER PURPOSE: Compute the coefficients of a non-recursive, digital filter. Highpass, lowpass, bandpass and bandstop filters may be constructed with this function. CATEGORY: Signal processing. CALLING SEQUENCE: Coeff = DIGITAL_FILTER(Flow, Fhigh, A, Nterms) ;To get coefficients. Followed by: Yout = CONVOL(Yin, Coeff) ;To apply the filter. INPUTS: Flow: The lower frequency of the filter as a fraction of the Nyquist frequency. Fhigh: The upper frequency of the filter as a fraction of the Nyquist frequency. A: The size of Gibbs phenomenon wiggles in -db. 50 is a good choice. Nterms: The number of terms in the filter formula. The order of filter. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * The following conditions are necessary for various types of filters: No Filtering: Flow = 0, Fhigh = 1. Low Pass: Flow = 0, 0 < Fhigh < 1. High Pass: 0 < Flow < 1, Fhigh =1. Band Pass: 0 < Flow < Fhigh < 1. Band Stop: 0 < Fhigh < Flow < 1. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * OPTIONAL INPUT PARAMETERS: None. OUTPUTS: Returns a vector of coefficients with (2*nterms + 1) elements. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: This function returns the coefficients of a non-recursive, digital filter for evenly spaced data points. Frequencies are expressed in terms of the Nyquist frequency, 1/2T, where T is the time between data samples. MODIFICATION HISTORY: DMS, April, 1985. Adapted from: "Digital Filters", Robert Walraven, Proceedings of the Digital Equipment User's Society, Fall, 1984. Department of Applied Science, University of California, Davis, CA 95616.
(See C:\RSI\IDL52\lib\digital_filter.pro)
NAME: DISP_TXT PURPOSE: This procedure displays text strings in the current IDL window. The text strings may contain control sequences which define what font, color, and position to use when drawing the text. CATEGORY: Text Display. CALLING SEQUENCE: DISP_TXT, Strings, Fonts, Yspace INPUTS: Strings: A string or string array containing the text to display in the current IDL window. The string(s) may contain control sequences which specify what font, color, and position to use when drawing the text. Control sequences are enclosed in back quotes. Control sequences consist of one or more commands separated by commas. Commands start with one of the following upper or lower case characters : F - Specify a new font to use C - Specify a new color to use J - Specify a new justification (alignment) X - Specify a new absolute X position (in pixels) Y - Specify a new absolute Y position (in pixels) H - Shift horizontally a relative amount (in pixels) V - Shift vertically a relative amount (in pixels) Here is an example of a text string with an imbedded control sequence to change to font #2, color #255, justification 0.5 (center), and absolute Y position 100 : ABCDEF`F2,C255,J0.5,Y100`GHIJKL The actual fonts to use are specified by the "Fonts" parameter (see below). Care must be taken when specifying any justification other than 0.0 (left justify) or the strings may overlap. A good rule of thumb is if center justification (0.5) or right justification (1.0) is desired, then put the control commands before or after a block of text, but not in the middle of it. One line of text is output for each non-null element in "Strings". If an element in "Strings" is null or contains only a control seqence, then no new line is output. To output a blank line, use a space character on a line by itself. Data Type : String or Strarr. Fonts: A string or string array containing the font(s) to use. When a command of the form "Fn" is encountered while processing the text, the nth element of "Fonts" is passed to the "Device, Font=" command. Using the above example, when the "F2" command is processed, the font is set by automatically issuing the command : Device, Font=Fonts(2) IF the specified font number is less than zero, or greater than or equal to the number of elements in "Fonts", then Fonts(0) is used. Fonts may be specified using wildcards, and may have an optional field that specifies what style of vector drawn font to use if the specified hardware font does not exist. The optional field is separated from the actual font string by a "|" character. (The optional field is always stripped off before passing the string to the "Device, Font=" command.) An example of a "Fonts" array is as follows : *helvetica-bold*--12*|10!5 vector|20!3 *helvetica-bold*--24* This example array specifies the following : 0. Use 12 point helvetica bold hardware font for font F0. If no matching font exists on the current system then use vector font style #5 (duplex roman), and size the font so that it is 10 pixels high. For a list of the IDL vector drawn fonts, see chapter 12 in the IDL User's Guide. 1. Since there is no such thing as a hardware font called "vector", then use a software (vector drawn) font for font F1. Draw this font 20 pixels high and use font style #3 (simplex roman). 2. Use 24 point helvetica bold hardware font for font F2. If no matching font exists on the current system then use the most recently specified vector drawn font (since there is no optional field specified for this font). On some Unix systems, it is possible to list the available hardware fonts by using the Unix command "xlsfonts". When running under Windows or MacOS, fonts are specified in a slightly different manner. For example, a Helvetica italic 24-point font could be specified by the font definition : HELVETICA*ITALIC*24 For best results, use a scalable font. See "The Windows Device Driver" in the "IDL For Windows" document. Data Type : String or Strarr. Yspace: The spacing, in pixels, between the baseline of each line of text. IF "Yspace" is negative then the baseline of each line of text will be Yspace pixels ABOVE the previous line. Otherwise, each line is placed Yspace pixels BELOW the previous line. Data Type : Int or Long. KEYWORD PARAMETERS: Xstart: The X location (in pixels) at which to start drawing the text. The default is to start near the left edge of the current window (unless the default justification is Center or Right, in which case the default starting X location is set accordingly). Data Type : Int or Long. Ystart: The Y location (in pixels) at which to start drawing the text. The default is to start near the top edge of the current window. (Unless "Yspace" is negative, in which case the default is to start near the bottom edge of the current window). Data Type : Int or Long. Def_Font: The font to use when no font has been specified in "Strings". "Def_Font" is specified just like the fonts in "Fonts" (except that no optional field should be used). If no font is specified in "Strings" and "Def_Font" is not supplied, then the default is to use the default hardware font. If no hardware font is available then use a vector drawn font as the default. Data Type : String. Def_Size: The default height (in pixels) of the vector drawn font. The default is !D.Y_CH_SIZE. Data Type : Int or Long. Def_Style: The default style (such as !3, !4, etc.) of the vector drawn font. The default is '!3' (simplex roman). Data type : String. Def_Color: The color index to use when no color is specified in "Strings". The default is (!D.N_COLORS - 1L). Data Type : Byte, Int or Long. Colors: Normally, color indices can be specified directly in "Strings". If "Colors" is specified, however, then "Colors" acts as a translation table to modify the actual color index of the text. For example, when the following string is drawn : `C13`ABCDEF It will be drawn in color index 13 if "Colors" is NOT specified. If "Colors" IS specified then the string "ABCDEF" will be drawn in color index Colors(13). If "Colors" is specified, and the color number is less than zero then Colors(0) is used. IF the color number is greater than or equal to the number of elements in "Colors" then Colors(n-1) is used (where "n" is the number of elements in "Colors). W_Erase: The color index to erase the window with before drawing the text. If "W_Erase" is less than zero then the window will NOT be erased first. The default is to NOT erase the window first. Data Type : Int or Long. RESTRICTIONS: An IDL window must exist before calling "DISP_TXT" or an error will result. All text is drawn in Device coordinates and no 3-D transformations have any effect. EXAMPLE: Display a text screen using "DISP_TXT" ; Create some strings. strings = STRARR(4) strings(0) = '0000000000000' strings(1) = '`F1,C200`' strings(2) = 'ABC`X200,V-100`DEF`F0`GHIJKL`C155`abc' strings(3) = '`C255,F1`ABCDEF`F2`GHIJKL' ; Specify the fonts. fonts = STRARR(3) fonts(0) = '*helvetica-bold*--24*|20!5' fonts(1) = 'vector|15!6' fonts(2) = '8x13|11!3' ; Create a window and display the text. Window, 0 DISP_TXT, strings, fonts, 28, Def_Font='12x24' MODIFICATION HISTORY: Written by: Daniel Carr. Tue Sep 29 11:52:56 MDT 1992 Added support for 'Win32' and 'MacOS' Daniel Carr. Mon Nov 23 09:44:33 MST 1992 Modified Yspace for 'Win32' and 'MacOS' Daniel Carr. Thu Dec 17 17:02:40 MST 1992
(See C:\RSI\IDL52\lib\obsolete\disp_txt.pro)
NAME: DISSOLVE PURPOSE: A digital "dissolve" effect for images. Copies the pixels (arranged into square tiles) from the image to the display in pseudo-random order. CATEGORY: Image display. CALLING SEQUENCE: DISSOLVE, Image INPUTS: Image: The image to be displayed. It is assumed that the image is already scaled. Byte-valued images display most rapidly. OPTIONAL INPUT PARAMETERS: None. KEYWORD PARAMETERS: SIZ: Size of square tile. The default is 32 x 32 pixels. X0, Y0: The X and Y offsets of the lower-left corner of the image on screen. The defaults are X0 = 0 and Y0 = 0. DELAY: The wait between displaying tiles. The default is 0.01 secs. ORDER: The Image display order: 0 = default = bottom up. 1 = top-down. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: The image is written to the screen. RESTRICTIONS: None, but the effect is dependent upon the speed of the machine/display. PROCEDURE: An integer pseudo-random number generator is used to decide which tile to display. The algorithm is taken from "Graphics Gems", Andrew Glassner, ed., Academic Press, 1990, Page 221. MODIFICATION HISTORY: DMS, Sept, 1990.
(See C:\RSI\IDL52\lib\dissolve.pro)
NAME: DIST PURPOSE: Create a rectangular array in which each element is proportional to its frequency. This array may be used for a variety of purposes, including frequency-domain filtering and making pretty pictures. CATEGORY: Signal Processing. CALLING SEQUENCE: Result = DIST(N [, M]) INPUTS: N = number of columns in result. M = number of rows in result. If omitted, N is used to return a square array. OUTPUTS: Returns an (N,M) floating array in which: R(i,j) = SQRT(F(i)^2 + G(j)^2) where: F(i) = i IF 0 <= i <= n/2 = n-i IF i > n/2 G(i) = i IF 0 <= i <= m/2 = m-i IF i > m/2 SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Straightforward. The computation is done a row at a time. MODIFICATION HISTORY: Very Old. SMR, March 27, 1991 - Added the NOZERO keyword to increase efficiency. (Recomended by Wayne Landsman) DMS, July, 1992. - Added M parameter to make non-square arrays.
(See C:\RSI\IDL52\lib\dist.pro)
NAME: DL_DOS PURPOSE: Extract the documentation template of one or more procedures (DOS version). CATEGORY: Help, documentation. CALLING SEQUENCE: DL_DOS ;For prompting. DL_DOS, Name ;Extract documentation for procedure Name using the current !PATH. INPUTS: Name: A string containing the name of the procedure or "*" for all. OPTIONAL INPUT PARAMETERS: PRINT: A keyword parameter which, if set to 1, sends the output of DL_DOS to PRN:. If PRINT is a string, it specifies the name of a file that will contain the documentation. DIRECTORY: The directory to search. If omitted, the current directory and !PATH are used. OUTPUTS: No explicit outputs. Documentation is output using 'more' format unless /PRINT is specified. COMMON BLOCKS: None. SIDE EFFECTS: Output is produced on terminal or printer. If the current directory is also one of the directories specified in !PATH or DIRECTORY, documentation will be output twice for the specified module(s). RESTRICTIONS: ?? PROCEDURE: Straightforward. MODIFICATION HISTORY: SNG, Dec, 1990 - adapted from DOC_LIB_UNIX AB, 21 September 1992, renamed from DOC_LIB_DOS to DL_DOS to avoid DOS filename limitations.
(See C:\RSI\IDL52\lib\dl_dos.pro)
NAME: DL_MAC PURPOSE: Extract the documentation template of one or more procedures (Macintosh version). CATEGORY: Help, documentation. CALLING SEQUENCE: DL_MAC ;For prompting. DL_MAC, Name ;Extract documentation for procedure Name using the current !PATH. INPUTS: Name: A string containing the name of the procedure or "*" for all. OPTIONAL INPUT PARAMETERS: DIRECTORY: The directory to search. If omitted, the current directory and !PATH are used. PRINT: Name of a file to print to. OUTPUTS: No explicit outputs. Documentation is output using 'more' format unless /PRINT is specified. COMMON BLOCKS: None. SIDE EFFECTS: Output is produced on terminal or to a file. If the current directory is also one of the directories specified in !PATH or DIRECTORY, documentation will be output twice for the specified module(s). RESTRICTIONS: ?? PROCEDURE: Straightforward. MODIFICATION HISTORY: DJE, 14 Nov 1994, adapted from DL_DOS.PRO
(See C:\RSI\IDL52\lib\dl_mac.pro)
NAME: DL_UNIX PURPOSE: Extract the documentation template of one or more IDL modules (procedures or functions). CATEGORY: Help, documentation. CALLING SEQUENCE: DL_UNIX ;For prompting. DL_UNIX, Name ;Extract documentation for procedure Name using the current !PATH. INPUTS: Name: The string containing the name of the procedure or "*" for all. KEYWORDS: PRINT: If set, this keyword sends output of DL_UNIX to lpr. If PRINT is a string, it is interpreted as a shell command used for output with the documentation from DL_UNIX providing standard input (i.e., PRINT="cat > junk"). DIRECTORY: The directory to search. If omitted, the current directory and !PATH are used. MULTI: If set, this flag allows printing of more than one file if the requested module exists in more than one directory in the path and the current directory. OUTPUTS: No explicit outputs. Documentation is piped through "more" unless /PRINT is specified. COMMON BLOCKS: None. SIDE EFFECTS: Output is produced on terminal or printer. RESTRICTIONS: None. PROCEDURE: Straightforward. MODIFICATION HISTORY: DMS, Feb, 1988. AB, 21 September 1992, renamed from DOC_LIB_UNIX to DL_UNIX to avoid DOS filename limitations.
(See C:\RSI\IDL52\lib\dl_unix.pro)
NAME: DL_VMS PURPOSE: Extract the documentation template of one or more procedures. CATEGORY: Help, documentation. CALLING SEQUENCE: DL_VMS ;For prompting. DL_VMS, Name ;Extract documentation for procedure Name using the current !PATH. INPUTS: Name: A string containing the name of the procedure. KEYWORDS: FILE: If this keyword is set, the output is sent to the file "userlib.doc", in the current directory. PRINT: If set, this keyword sends the output of DL_VMS to lpr. PATH: An optional directory/library search path. This keyword uses the same format and semantics as !PATH. If omitted, !PATH is used. OUTPUTS: Documentation is output to terminal or printer. COMMON BLOCKS: None. SIDE EFFECTS: Output is produced on terminal or printer. RESTRICTIONS: None. PROCEDURE: Straightforward. MODIFICATION HISTORY: Written, DMS, Sept, 1982. Added library param, Jul 1987. Unix version, Feb, 1988. Revised for VMS Version 2, 15 December 1989 Modified by Jim Pendleton, GRO/OSSE NU, July 30, 1992 to handle !PATH's gt 255 characters. AB, 21 September 1992, renamed from DOC_LIB_VMS to DL_VMS to avoid DOS filename limitations. ACY, 25 January 1993, file should be written with stream mode
(See C:\RSI\IDL52\lib\dl_vms.pro)
NAME: DOC_LIBRARY PURPOSE: Extract the documentation template of one or more IDL modules (procedures or functions). This command provides a standard interface to the operating-system specific DL_DOS, DL_UNIX, and DL_VMS procedures. CATEGORY: Help, documentation. CALLING SEQUENCE: DOC_LIBRARY ;For prompting. DOC_LIBRARY, Name ;Extract documentation for procedure Name using the current !PATH. INPUTS: Name: The string containing the name of the procedure. Under Unix, Name may be "*" to get information on all routines. KEYWORDS: PRINT: If set, this keyword sends the output of DOC_LIBRARY to the default printer. Under Unix, if PRINT is a string, it is interpreted as a shell command used for output with the documentation from DOC_LIBRARY providing standard input (i.e. PRINT="cat > junk"). UNIX KEYWORDS: DIRECTORY: The directory to search. If omitted, the current directory and !PATH are used. MULTI: If set, this flag allows printing of more than one file if the requested module exists in more than one directory in the path and the current directory. VMS KEYWORDS: FILE: If this keyword is set, the output is left in the file "userlib.doc", in the current directory. PATH: An optional directory/library search path. This keyword uses the same format and semantics as !PATH. If omitted, !PATH is used. OUTPUTS: Documentation is sent to the standard output unless /PRINT is specified. COMMON BLOCKS: None. SIDE EFFECTS: Output is produced on terminal or printer. RESTRICTIONS: The DIRECTORY and MULTI keywords are ignored under VMS. The FILE and PATH keywords are ignored under Unix. EXAMPLE: To obtain documentation for the User's Library function DIST, enter: DOC_LIBRARY, 'DIST' For a graphical interface to DOC_LIBRARY, see the procedure XDL. MODIFICATION HISTORY: Written, DMS, Sept, 1982. Added library param, Jul 1987. Unix version, DMS, Feb, 1988. New VMS version, DMS, Dec. 1989 Wrapper procedure to call the correct version under Unix and VMS, AB, Jan 1990 Added support for DOS, SNG, Dec, 1990 Added support for Macintosh, DJE, Nov, 1994
(See C:\RSI\IDL52\lib\doc_library.pro)
NAME: DXF_EXAMPLE PURPOSE: This procedure serves as an example of loading and displaying geometry from a DXF file. CATEGORY: Access. Object Graphics. CALLING SEQUENCE: DXF_EXAMPLE[, Filename] OPTIONAL INPUTS: Filename: The name of a DXF file to be loaded. By default, heart.dxf from the examples/data subdirectory of IDL is loaded. MODIFICATION HISTORY: Written by: DLD, Sept. 1998
(See C:\RSI\IDL52\examples\object\dxf_example.pro)
FILE: d_animate.pro CALLING SEQUENCE: d_animate PURPOSE: Display several animations. MAJOR TOPICS: Animation and widgets CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_cfd - Call the cfd animation. pro d_gated - Call the gated blood animation. pro d_animateEvent - Event handler pro d_animateCleanup - Cleanup pro cfd - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro CW_ANIMATE: - Animation tool routine pro CW_ANIMATE_INIT: - Animation tool routine pro CW_ANIMATE_LOAD: - Animation tool routine pro CW_ANIMATE_RUN: - Animation tool routine pro demo_gettips - Read the tip file and create widgets REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY:
(See C:\RSI\IDL52\examples\demo\demosrc\d_animate.pro)
FILE: d_contour.pro CALLING SEQUENCE: d_contour PURPOSE: Shows several feature of contour plots and contour objects. MAJOR TOPICS: Plots, widgets and objects CATEGORY: IDL Demo System REFERENCE: IDL Reference Guide, IDL User's Guide Variable name conventions used herein: r==Reference to Object p==pointer, w==widget ID.
(See C:\RSI\IDL52\examples\demo\demosrc\d_contour.pro)
FILE: d_filter.pro CALLING SEQUENCE: d_filter PURPOSE: Shows the Fourier filtering technique. MAJOR TOPICS: Data analysis and plotting. CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_filter - Main procedure pro d_filterSetSliders - Create the sliders pro d_filterLoadData - Read and load new data set pro d_filterResetFilter - Compute the new filter function pro d_filterColorMapCallback - Redraw after colormap change pro d_filterResetView - Show the updated plots pro d_filterEvent - Event handler pro d_filterCleanup - Event handler pro d_filterGetImage - Load a new image pro d_filterGetImageEvent - Event handler for d_filterGetImage pro d_filterGetImageCleanup - Event handler for d_filterGetImage EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro demo_gettips - Read the tip file and create widgets filter.tip data.txt abnorm.dat alie.dat cereb.dat chirp.dat damp_sn.dat damp_sn2.dat dirty_sine.dat galaxy.dat jet.dat REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: filterCommon MODIFICATION HISTORY: Written by: DS, RSI, Modified by : DAT 12/96, Change GUI
(See C:\RSI\IDL52\examples\demo\demosrc\d_filter.pro)
NAME: d_filterGetImage PURPOSE: This procedure retrieves an image file from the examples/data directory. CATEGORY: Examples General. CALLING SEQUENCE: d_filterGetImage, newdata KEYWORD PARAMETERS: OUTPUTS: newdata:The image data is returned in this variable. COMMON BLOCKS: GF: RESTRICTIONS: This procedure can only be used to reference the example data. PROCEDURE: EXAMPLE: d_filterGetImage, frames, DESCRIPTION=description, $ DIMENSIONS=dimensions, SUBDIR = ["examples","data"], $ /THREE_DIM, TITLE="Select Animation", /ASSOC_IT MODIFICATION HISTORY: Written by: WSO, RSI, January 1995
(See C:\RSI\IDL52\examples\demo\demosrc\d_filter.pro)
FILE: d_flythru.pro CALLING SEQUENCE: d_flythru PURPOSE: Shows texture mapping and an interactive flight simulation. MAJOR TOPICS: Visualization CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_flythruStop - Stop the flight pro d_flythruReset - Reset to original orientation pro d_flythruEvent - Event handler pro d_flythruCleanup - Cleanup pro d_flythru - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro trackball__define - Create the trackball object pro demo_gettips - Read the tip file and create widgets flythru.tip elevbin.dat elev_t.jpg REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 1/97, DAT - Written. 4/98, ACY - Added interactive flying controls and functionality.
(See C:\RSI\IDL52\examples\demo\demosrc\d_flythru.pro)
FILE: d_forecast.pro CALLING SEQUENCE: d_forecast PURPOSE: Shows forecast of a data set. MAJOR TOPICS: Statistics and widget. CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_forecastAutoCorr - Compute the autocorrelation function pro d_forecastAutoFCast - Compute the autoforecast function fun d_forecastTsData - Create a time series. pro d_forecastEvent - Event handler pro d_forecastCleanup - Cleanup pro d_forecast - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro demo_gettips - Read the tip file and create widgets forecast.tip REFERENCE: The Analysis of Time Series, An Introduction (Fourth Edition) Chapman and Hall ISBN 0-412-31820-2 NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: Written by: GGS, RSI, January 1995 Modified by DAT,RSI, July 1996 New GUI Remove common blocs.
(See C:\RSI\IDL52\examples\demo\demosrc\d_forecast.pro)
FILE: d_globe.pro CALLING SEQUENCE: d_globe PURPOSE: Demonstrates texture mapping, model rotations, and indexed color table stretching with IDL's object graphics system. (object graphics only) MAJOR TOPICS: Indexed colors & Color palettes, Texture Mapping, Trackball. CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_globeRGBStretch - stretches RGB vectors to new RGB vectors pro d_globeStretchEvent - event handler for stretching colors pro d_globeEvent - event handler pro d_globeCleanup - cleanup routine pro d_globeReadImages - inputs and scales images function d_globeMakeObjects - creates the object hierarchy pro d_globe - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro trackball__define.pro - Create trackball object. pro orb__define.pro - Create an orb object pro demo_gettips - Read the tip file and create widgets globe.tip - "Tips" file worldelv.dat - global topography image dataset worldtmp.sav - global temperature image dataset & RGB's REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: Written by: MCR, RSI, February 97
(See C:\RSI\IDL52\examples\demo\demosrc\d_globe.pro)
FILE: d_gridding.pro CALLING SEQUENCE: d_gridding PURPOSE: Display the gridding and interpolation routines in IDL. MAJOR TOPICS: Data analysis and plotting. CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_griddingGeneratePlots - Generate all the plots pro d_griddingEvent - Event handler pro d_griddingCleanup - Cleanup pro d_gridding - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro demo_gettips - Read the tip file and create widgets gridding.tip REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: Written by DAT,RSI, January 1997
(See C:\RSI\IDL52\examples\demo\demosrc\d_gridding.pro)
FILE: d_heart.pro CALLING SEQUENCE: d_heart PURPOSE: Display an animation of a beating heart MAJOR TOPICS: Animation and widgets CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_heartWin3dEvent - Handle viewing area events fun d_heartAxis3d - Handle the 3-D axis event pro d_heartMenuEvent - Handle the QUIT and INFO events pro d_heartOptionEvent - Handle menu bar options events pro d_heartEvent - Handle heart events (left column) pro d_heartCleanup - Cleanup pro d_heart - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: heart.tip heart.sav - Data file pro trackball__define.pro - Create a trackball object pro demo_gettips - Read the tip file and create widgets REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODifICATION HISTORY: WRITTEN, SDG, RSI, DEC, 1996.
(See C:\RSI\IDL52\examples\demo\demosrc\d_heart.pro)
FILE: d_hydrogen.pro CALLING SEQUENCE: d_hydrogen PURPOSE: Demonstrate IDL math and graphics capabilities. CATEGORY: IDL Demo System REFERENCE: IDL Reference Guide, IDL User's Guide
(See C:\RSI\IDL52\examples\demo\demosrc\d_hydrogen.pro)
FILE: d_imagproc.pro CALLING SEQUENCE: d_imagproc PURPOSE: Demonstrate a few of IDL's image processing features: Fourier filtering, pixel scaling, pixel distribution (histogram), edge enhancement, dilate & erode, convolution, and zooming. MAJOR TOPICS: Image processing and widgets CATEGORY: IDL Demo System REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: Written by: DC, RSI, 1995 Modified by DAT,RSI, December 1996 Combining tour elements 203, 280 to 284
(See C:\RSI\IDL52\examples\demo\demosrc\d_imagproc.pro)
NAME: d_imagprocLPF_ALL PURPOSE: This function performs Low Pass Filtering (smoothing) on one, two, and three dimensional arrays. This function is similar to the "Smooth" function except that it smoothes ALL the array elements (even at the edges of the array). The "Smooth" function does NOT smooth array elements that are within band/2 of any edge of the array (where band is the width of the smoothing window). When smoothing a two dimensional array, d_imagprocLPF_ALL can optionally smooth in one of three ways : rectangular, cylindrical, and spherical. When smoothing a one dimensional array, d_imagprocLPF_ALL can smooth in either linear or circular mode. CATEGORY: Filtering. CALLING SEQUENCE: lpf_array = d_imagprocLPF_ALL(Array, Band) INPUTS: Array: The array to smooth. Data type : Any one, two, or three dimensional array except string or structure. Band: The width of the smoothing window. Data type : Int KEYWORD PARAMETERS: Wrap_Mode: The smoothing mode. If Array has three dimensions, then Wrap_Mode is ignored. If Array has two dimensions, then specify Wrap_Mode=0 for rectangular smoothing, Wrap_Mode=1 for cylindrical smoothing, and Wrap_Mode=2 for spherical smoothing. In the cylindrical and spherical cases, smoothing is performed across the first and last columns of Array. In the spherical case, smoothing is also performed across all the elements in the top row, and across all the elements in the bottom row. If Array has one dimension, then specify Wrap_Mode=0 for linear smoothing, and Wrap_mode=1 for circular smoothing. In the circular case, smoothing is performed across the first and last elements in Array. The default is zero. OUTPUTS: Lpf_Array: The low pass filtered array. Data type : Same as input Array. PROCEDURE : This function smoothes the edges of the array by extrapolating the values at the edges of the array to a distance of band/2. EXAMPLE: Smooth a two dimensional array in spherical mode. ; *** Create data to smooth. array = REBIN(RANDOMU(s, 8, 8), 512, 512) ; *** Smooth the array in spherical mode. lpf_array = d_imagprocLPF_ALL(array, 64, Wrap_Mode=2) MODIFICATION HISTORY: Written by: Daniel Carr. Mon Aug 23 12:46:31 MDT 1993
(See C:\RSI\IDL52\examples\demo\demosrc\d_imagproc.pro)
FILE: d_livetool.pro CALLING SEQUENCE: d_livetool PURPOSE: This demo shows the various plots in IDL made from 2-D data. MAJOR TOPICS: Data analysis and plotting CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_livetoolEvent - Event handler pro d_livetoolCleanup - Cleanup pro d_livetool - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: livetool.tip pro demo_gettips - Read the tip file and create widgets REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 98, ACY - Written.
(See C:\RSI\IDL52\examples\demo\demosrc\d_livetool.pro)
FILE: d_map.pro CALLING SEQUENCE: d_map PURPOSE: Shows mapping features available in IDL. MAJOR TOPICS: Visualization and maps CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: fun d_mapMenuToggleState - Toggle off and on state of a button fun d_mapMenuChoice - Handle the menu bar selection button pro d_mapMenuCreate - Create the menu bar pro d_mapColorInit - Initialize working colors pro d_mapDraw - Draw the map pro d_mapDrawCirc - Draw a great circle pro d_mapCir2P - Connect 2 points with a great circle fun d_mapCityMark - Mark a city pro d_mapEvent - Event handler pro d_mapCleanup - Cleanup pro d_map - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro demo_gettips - Read the tip file and create widgets pro demo_puttips - Change tips text map_demo.tip cities.dat worldelv.dat REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCKS: MAP_DEMO_COM MODIFICATION HISTORY: 3/97, DMS - Written.
(See C:\RSI\IDL52\examples\demo\demosrc\d_map.pro)
FILE: d_mathstat.pro CALLING SEQUENCE: d_mathstat PURPOSE: Shows 6 mathematical data analysis routines : Surface fitting, polynomial fitting, linear regression, optimization, solving equations, and inegration. MAJOR TOPICS: Data analysis and plotting CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: func d_mathstatNewtonFunc - callback for Newton routine func d_mathstatPowellFunc - callback for Powell routine pro d_mathstatMakeSurfaceFit - Surface fitting pro d_mathstatMakePolyFit - Polynomial fitting pro d_mathstatMakeRegression - Linear regression pro d_mathstatMakeMinimization - Optimization or minimization pro d_mathstatMakeSolving - Solving equations pro d_mathstatGenerateIntegration - Integration of functions pro d_mathstatEvent - Event handler pro d_mathstatCleanup - Cleanup pro d_mathstat - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro demo_gettips - Read the tip file and create widgets pro demo_puttips - Change tips text REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: Written by: DC, RSI, 1995 Modified by DAT,RSI, November 1996 Combining tour elements 270, 271 and 272
(See C:\RSI\IDL52\examples\demo\demosrc\d_mathstat.pro)
FILE: d_matrix.pro CALLING SEQUENCE: d_matrix PURPOSE: This demo shows the various plots in IDL made from 2-D data. MAJOR TOPICS: Data analysis and plotting CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_matrixGenerate - Generate the 2-D data set pro d_matrixMakePlot - Make 5 plots to pixmaps. pro d_matrixEvent - Event handler pro d_matrixCleanup - Cleanup pro d_matrix - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: matrix.tip pro demo_gettips - Read the tip file and create widgets REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 95, Dan Carr - Written. 11/95, DAT - Modified for IDL 5.0 demo
(See C:\RSI\IDL52\examples\demo\demosrc\d_matrix.pro)
FILE: d_morph.pro CALLING SEQUENCE: d_morph PURPOSE: Morph 2 images. MAJOR TOPICS: Visualization and data analysis CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: fun d_morphBarycentric - Compute the barycentric matrix. pro d_morphCompute - Compute the morphing images pro d_morphEvent - Event handler pro d_morphCleanup - Cleanup pro d_morph - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: d_peopleReadImage d_peopleReadIndex REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: morph_demo_common MODifICATION HISTORY: DS - Written.
(See C:\RSI\IDL52\examples\demo\demosrc\d_morph.pro)
FILE: d_obj.pro CALLING SEQUENCE: d_obj PURPOSE: Shows geometric objects (molecules and others.) MAJOR TOPICS: Visualizaton and widgets CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: fun makespheres - Create a shere fun makemolecule - Create a molecule fun moleread - Read the molecule file pro new_select - Handle a new selection pro panimate - Animate (with pattern keyword) pro o3d_animate - Animate (with pattern keyword) pro toggle_state - Toggle off and on fun read_noff - Read the object file pro d_obj_Event - Event handler pro d_obj_Cleanup - Cleanup pro d_obj - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro demo_gettips - Read the tip file and create widgets pro demo_puttips - Change tips text object3d.tip knot.nof seashell.nof teapot.nof aspartam.mol caffeine.mol valium.mol pro orb__define.pro - Create an orb object pro trackball__define.pro - Create a trackball object REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 9/96, DD - Written. 10/96, DAT - New GUI and combining molecule and objects.
(See C:\RSI\IDL52\examples\demo\demosrc\d_obj.pro)
FILE: d_objworld2.pro CALLING SEQUENCE: d_objworld2 PURPOSE: Visualization of thunderstorm data. MAJOR TOPICS: Visualization CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_objworld2Event - Event handler pro d_objworld2Cleanup - Cleanup pro d_objworld2 - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro trackball__define - Create the trackball object pro IDLexModelManip__define - Define Model Manipulator pro IDLexViewManip__define - Define View Manipulator pro demo_gettips - Read the tip file and create widgets REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 1/97, ACY - adapted from objworld2, written by R.F. 7/98, PCS - changed GUI to require only the left mouse-button. Changed code to use IDLexModelManip and IDLexViewManip.
(See C:\RSI\IDL52\examples\demo\demosrc\d_objworld2.pro)
FILE: d_optimize.pro CALLING SEQUENCE: d_optimize PURPOSE: Shows the path taken by 2 optimization algorithms : Powell and DFP. MAJOR TOPICS: Data analysis and plotting CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_optimizeInit16Colors - Initialize 16 working colors pro d_optimizeInitPoint - Initialize starting points coordinates pro d_optimizeResetPoint - Redraw the starting point pro d_optimizeResetSurface - Redraw the surface (function) pro d_optimizeResetResults - Reset the result labels pro d_optimizeShowStart - Show starting point (Label and point) pro d_optimizeAbout - Display the inforation file pro d_optimizePlotPoint - Plot the points along the path pro d_optimizeDFP - DFP algorithm pro d_optimizePoweop - Powell algorithm pro d_optimizeFuncOp - function to minimize (DFP and Powell) pro d_optimizeLinmOp - subroutine in Powell pro d_optimizeBreOp5 - subroutine in Powell pro d_optimizeMnbOp5 - subroutine in Powell pro d_optimizeF1DOp5 - subroutine in Powell pro d_optimizeSign - subroutine in Powell pro d_optimizeLnSrch - subroutine in Powell pro d_optimizeGrad - subroutine in Powell pro d_optimizeEvent - Event handler pro d_optimizeCleanup - Cleanup pro d_optimize - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro demo_gettips - Read the tip file and create widgets optimize.tip REFERENCE: IDL Reference Guide, IDL User's Guide Numerical recipes in C, 2nd ed. Press, Vetterling, Teukolsky, and Flannery Cambridge University Press ISBN 0-521-43108-5 NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: Written by: DAT,RSI, 1996
(See C:\RSI\IDL52\examples\demo\demosrc\d_optimize.pro)
FILE: d_orbit.pro CALLING SEQUENCE: d_orbit PURPOSE: Shows an orbiting satellite. The forcings are the Earth's central body and J2. MAJOR TOPICS: Visualization. CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: fun d_orbitGetRotation - Rotation values of the satellite fun d_orbitCreateSatellite - create the satellite object fun d_orbitFindE - Compute the eccentric anomaly fun d_orbitFindPosition - Compute the satelitte's ephemeris. pro d_orbitEvent - Event handler pro d_orbitCleanup - Cleanup pro d_orbit - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro orb__define.pro - Create an orb object pro trackball__define - Create the trackball object pro demo_gettips - Read the tip file and create widgets orbit.tip REFERENCE: 1) Fundamentals of celestial mechanics (2nd ed.) J.M.A. Danby Willmann-Bell editor ISBN 0-943396-20-4 2) Methods of orbit determination P. R. Escobal R. E. Kreiger publishing company ISBN 0-88275-319-3 NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: Written by DAT,RSI, July 1996
(See C:\RSI\IDL52\examples\demo\demosrc\d_orbit.pro)
FILE: d_pca.pro CALLING SEQUENCE: d_pca PURPOSE: This demo shows the various plots in IDL made from 2-D data. MAJOR TOPICS: Data analysis and plotting CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_pcaEvent - Event handler pro d_pcaCleanup - Cleanup pro d_pca - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pca.tip pro demo_gettips - Read the tip file and create widgets REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 98, ACY - Written.
(See C:\RSI\IDL52\examples\demo\demosrc\d_pca.pro)
FILE: d_people.pro CALLING SEQUENCE: d_people PURPOSE: Demonstrates image warping and morphing. MAJOR TOPICS: Data analysis and images CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: fun d_peopleLuminance - Set the images luminance pro d_peopleReadIndex - Get the index of the image fun d_peopleReadImage - read the people image pro d_peopleLoadMorph - Start up the morphing application pro d_peopleDisplayEveryone - Display the image of everyone pro d_peopleDisplay - Display the original image pro d_peopleCorners - Set up corners points for warping pro d_peopleEvent - Event handler pro d_peopleCleanup - Cleanup pro d_people - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro d_morph - Morphing application pro demo_gettips - Read the tip file and create widgets pro demo_puttips - Change tips text REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: Written by: DS, RSI Modified by DS,RSI, February 1997
(See C:\RSI\IDL52\examples\demo\demosrc\d_people.pro)
FILE: d_plot2d.pro CALLING SEQUENCE: d_plot2d PURPOSE: This example demonstrates features of 2-D plots. MAJOR TOPICS: Plotting CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_plot2dMakeLine - Make a line plot pro d_plot2dMakeSymbol - Make a plot with symbols pro d_plot2dMakeBar - Make a histogram plot (bar) pro d_plot2dMakePolar - Make a polar plot pro d_plot2dMakeLogLog - Make a log-log plot pro d_plot2dMakeSemiLog - Make a semi-log plot pro d_plot2dEvent - Event handler pro d_plot2dCleanup - Cleanup pro d_plot2d - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro demo_gettips - Read the tip file and create widgets pro demo_puttips - Change tips text plot2d.tip REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 95, Dan Carr - Written. 11/95, DAT - Modified for IDL 5.0 demo
(See C:\RSI\IDL52\examples\demo\demosrc\d_plot2d.pro)
FILE: d_reconstr.pro CALLING SEQUENCE: d_reconstr PURPOSE: Shows reconstruction techniques for images. (Computerized tomography) MAJOR TOPICS: Visualization and data analysis CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_reconstrMenuChoice - Identify the menu button choice pro d_reconstrMenuCreate - Create the menu bar pro d_reconstrNone - Set the filter to none pro d_reconstrRamlak - Compute the Ramlak filter pro d_reconstrShepp_Logan - Compute the Shepp_Logan filter pro d_reconstrLp_Cosine - Compute the Lp_Cosine filter pro d_reconstrGen_Hamming - Compute the Gen_Hamming filter pro d_reconstrDEllipse - Draw an ellipse pro d_reconstrDCircle - Draw a circle pro d_reconstrDPoly - Draw a polygon pro d_reconstrMakePhantom - Create a phantom object pro d_reconstrReconstructIt - Do the image reconstruction pro d_reconstrRedraw - Redraw the windows pro d_reconstrColorMapCallback - Redraw after colormap change pro d_reconstrEvent - Event handler pro d_reconstrCleanup - Cleanup pro d_reconstr - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro demo_gettips - Read the tip file and create widgets pro demo_puttips - Change tips text reconstr.tip ctscan.dat REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: tomodemo_com MODIFICATION HISTORY: 1/94, DS - Written. 1/97, DAT - New GUI, IDL Style Guide.
(See C:\RSI\IDL52\examples\demo\demosrc\d_reconstr.pro)
FILE: ROI.pro CALLING SEQUENCE: p = DemoROI([, GROUP_LEADER = GROUP_LEADER $] [, APPTLB = APPTLB $] [, NO_CATCH = NO_CATCH $] [, NO_POINTERS = NO_POINTERS $] [, /ASTRONOMY_DEMO $] [, /MEDICAL_DEMO]) PURPOSE: This application highlights the ability of IDL to find "objects" in an image. It also shows implementation details of a fairly sophisticated widget application's management of heap variables, and displaying images in TrueColor vs. 256 color modes in Direct Graphics. This routine operates as a BLOCKING widget application due to its use of Direct Graphics IDL system variables and color tables. The procedure was authored by the Professional Services Group of Research Systems. The source code to the demonstration routine can be modified to return information about individual objects. These data can in turn be fed into further processing and refinement steps. For those desiring a larger implementation, the Professional Services Group can be contacted (psg@rsinc.com) for consulting and custom coding. KEYWORD PARAMETERS: GROUP_LEADER can be set to the ID of a parent widget when this routine is called as a compound widget. APPTLB returns the application top level base, mainly for use in the IDL Demo (i.e., don't worry about this if you aren't RSI.) /NO_CATCH can be set for debugging purposes. It will turn off automatic error trapping while the routine is running. It will also be necessary to turn off XMANAGER's error trapping before running the routine, via XMANAGER, CATCH = 0. /NO_POINTERS can be set to prevent the application from returning the array of pointers to objects found in the image. In demo mode, the default is to return a NULL pointer. /ASTRONOMY_DEMO can be set to execute the procedure in "automatic" demo mode, with restricted access to tools. /MEDICAL_DEMO can be set to execute the procedure in "manual" demo mode. RETURN VALUE: In demo mode, the return value is a NULL pointer. In application mode unless the /NO_POINTERS keyword is set, the return value is a an array of pointers which refer to heap variables that are anonymous structures containing characteristics of each object. The anonymous structure is in the form: {Origin : [X, Y], The origin of the object's bounding rectangle with respect to the image origin, in pixels Extents : [DX, DY], The X and Y lengths of the bounding rectangle, in pixels Perimeter : [[X], [Y]], The X and Y coordinates of the perimeter of the object within the bounding rectangle, in pixels with respect to Origin Area : Area, The area in pixels of the object within the bounding perimeter BiLevelMask : Mask, A byte array dimensioned [DX, DY] containing 1s for pixels within the bounding perimeter, and 0s for pixels outside it SurfaceBrightness : B} The sum of the R, G, and B planes of the object, divided by the Area. A typical call to display surface brightness distribution might look like: ObjPtrs = DemoROI() SurfB = FltArr(N_elements(ObjPtrs)) For I = 0, N_elements(ObjPtrs) - 1 Do $ SurfB[I] = (*ObjPtrs[I]).SurfaceBrightness Plot, SurfB ; Don't forget to execute a "PTR_FREE, ObjPtrs" when you're ; finished! MAJOR TOPICS: Visualization, Analysis, Demo, Language CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro demoroi$read_image - Read JPEG image data pro demoroi$read_file_and_initialize - Read image and initialize the environment fun demoroi$histogram - Define surface brightness distribution of objects pro demoroi$display_chosen_subset - Display objects selected from image pro demoroi$generate_gray_background - Create the "ghost" background grayscale image pro demoroi$generate_edge_enhanced_image - Create the edge-enhanced image pro demoroi$display_original_image - Display the image pro demoroi$find_edge_enhanced_contours - Contour the edge-enhanced image pro demoroi$find_objects - Find objects based on edge enhancement, selection criteria pro demoroi$ghost_image_event - Turn on or off ghost image pro demoroi$apply_selection - Adjust selection criteria from widget settings pro demoroi$main_image_event - Take draw widget button events in manual mode pro demoroi_event - Application main event handler fun demoroi$free_pointers - Free heap variables that are no longer needed pro demoroi - Application main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: abell115.jpg - Image for astronomy demo ??? - Image for medical imaging demo REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 3/97, JLP - Completed version for IDL 5.0.
(See C:\RSI\IDL52\examples\demo\demosrc\d_roi.pro)
FILE: d_surfview.pro CALLING SEQUENCE: d_surfview PURPOSE: This application demonstrates the capabilities of a surface. MAJOR TOPICS: Visualization CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: fun d_surfviewToggleOffOn - Toggle between 'off' and 'on' pro d_surfviewAnimateSurface50 - Animate the surface pro d_surfviewAddTracePoint - Add a tracing point pro d_surfviewEvent - Event handler pro d_surfviewCleanup - Cleanup pro d_surfview - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro idlexrotator__define - Create a trackball-like object pro demo_gettips - Read the tip file and create widgets pro demo_puttips - Change tips text REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 9/96, DD - Written. 10/96, DAT - New GUI.
(See C:\RSI\IDL52\examples\demo\demosrc\d_surfview.pro)
FILE: d_tankleak.pro CALLING SEQUENCE: d_tankleak PURPOSE: Shows the contamination of leaky tanks. MAJOR TOPICS: Visualization CATEGORY: IDL Demo System INTERNAL FUNCTIONS and proCEDURES: fun d_tankleakIndexColor2RGB - Change the color index into RGB fun d_tankleakReadBores - Read bore holes data pro d_tankleakWin3dEvent - Drawing area event handler pro d_tankleakVolumeBounds - Draw the volume fun d_tankleakExtentBounds - Drawing a box (event handler) pro d_tankleakGenIso - Compute the isosurface pro d_tankleakMenuEvent - menu bar event handler pro d_tankleakOptionEvent - option event handler pro d_tankleakViewEvent - view event handler pro d_tankleakEvent - main event handler pro d_tankleakCleanup - Cleanup pro d_tankleak - Main procedure EXTERNAL FUNCTIONS, proCEDURES, and FILES: pro trackball__define - Create the trackball object pro demo_gettips - Read the tip file and create widgets pro demo_puttips - Change tips text vol1.sav vol2.sav bores0.dat tanks.gif tankleak.tip REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODifICATION HISTORY: WRITTEN, SDG, RSI, DEC, 1996.
(See C:\RSI\IDL52\examples\demo\demosrc\d_tankleak.pro)
FILE: d_t_series.pro CALLING SEQUENCE: d_t_series PURPOSE: Shows a time series as an image or a 3-D plot. MAJOR TOPICS: Data analysis and plotting CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: fun d_t_seriesREAD - Read the time series file fun d_t_seriesCOLOR - Define working colors fun d_t_seriesSIZES - Size the widgets pro d_t_seriesSURF - Create the surface plot pro d_t_seriesMENUEVENT - Handle the menu events fun d_t_seriesDATE - Convert date format fun d_t_seriesTIME - Find time for the cursor location fun d_t_seriesIMAGE - Find min and max of image data set pro d_t_seriesLEGEND - Create the legend pro d_t_seriesDRAWEVENT - Handle the drawing area event pro d_t_seriesDRAW - Create the image plot pro d_t_seriesROTATIONEVENT - Handle the rotation slider event pro d_t_seriesNONEVENT - Do nothing pro d_t_seriesTOGGLEEVENT - Toggle z axis button state fun d_t_seriesMONTH_STR - convert month format pro d_t_seriesMONTHEVENT - Handle month event slider fun d_t_seriesSTRSLIDER - Create sliders pro d_t_seriesQuitEvent - Event Handler pro d_t_seriesCLEANUP - Cleanup procedure pro d_t_series - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: Written: DF, RSI, 1995 Modified by SU, RSI, January 1997
(See C:\RSI\IDL52\examples\demo\demosrc\d_t_series.pro)
FILE: D_Uscensus.pro CALLING SEQUENCE: D_Uscensus [, GROUP_LEADER = GROUP_LEADER $] [, /ANIMATE_STATES $] [, /BACKDROP $] [, /DEPTH] PURPOSE: Demonstrate the definition and use of object classes. Each of the 50 U.S.A. states in this program is an instance of a class defined by this program. This program was authored by the Professional Services Group of Research Systems. For those desiring a larger implementation, we can be contacted (psg@rsinc.com) for consulting and custom coding. KEYWORD PARAMETERS: GROUP_LEADER can be set to the ID of a parent widget when this routine is called as a compound widget. APPTLB returns the application top level base, mainly for use in the IDL Demo (i.e., don't worry about this if you aren't RSI.) /ANIMATE_STATES when set allows States to be individually rendered when a new year of data is displayed. By default all States are scaled before the view is rendered. This option is recommended only on machines with good rendering speed, such as a Pentium Pro 200 or Sun Ultra. /BACKDROP when set causes a backdrop image to be drawn behind the USA map. It's a good example of view object instancing. This is recommended only for machines with TrueColor displays and good rendering speed. By default, the backdrop image is not displayed. /DEPTH turns on depth cueing in the view. By default, depth cueing is not performed. MAJOR TOPICS: Visualization, Analysis, Demo, Language CATEGORY: IDL Demo System REFERENCE: IDL Reference Guide, IDL User's Guide MODIFICATION HISTORY: 4/97, JLP - Initial version for IDL 5.0. 1997-1999 JLP & PCS - Revisions.
(See C:\RSI\IDL52\examples\demo\demosrc\d_uscensus.pro)
FILE: d_vectrack.pro CALLING SEQUENCE: d_vectrack PURPOSE: Visualization of thunderstorm data. MAJOR TOPICS: Visualization CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_vectrackEvent - Event handler pro d_vectrackCleanup - Cleanup pro d_vectrack - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro trackball__define - Create the trackball object pro demo_gettips - Read the tip file and create widgets vectrack.tip storm25.sav storm25b.sav storm.opa storm.pal REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 1/97, ACY - adapted from vec_track, written by D.D.
(See C:\RSI\IDL52\examples\demo\demosrc\d_vectrack.pro)
FILE: d_volrendr.pro CALLING SEQUENCE: d_volrendr PURPOSE: Shows the volume rendering techniques. MAJOR TOPICS: Visualization and data processing. CATEGORY: IDL 5.1 REFERENCE: IDL Reference Guide, IDL User's Guide MODIFICATION HISTORY: Written by RF, RSI, 1996 Modified by DAT,RSI, 1996 New GUI New datasets, controls, code improvements, 1998 PCS Data-centric rotation constraints, 7/1998 PCS
(See C:\RSI\IDL52\examples\demo\demosrc\d_volrendr.pro)
FILE: d_wavelet.pro CALLING SEQUENCE: d_wavelet PURPOSE: This example demonstrates the wavelets orthogonal functions MAJOR TOPICS: Plotting and data analysis CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: fun d_waveletWVCutoff - Returns a threshold value fun d_waveletDecimate - Set vals within threshold limits fun d_waveletTV - Display image pro d_waveletGetBasis - Compute the wavelet basis fun d_waveletAdjustSize - Adjust data size fun d_waveletInRange - Set values within a give n range pro d_waveletNoCompressedImage - Handle no compressed image state pro d_waveletResetPlot - Reset the plots pro d_waveletPercentPlot - Display percentage plot pro d_waveletUpdatePlot - Redraw the plots pro d_waveletNewPercentage - Set to a new percentage (slider) pro d_waveletMoveLine - Move the plot line pro d_waveletMoveSlider - Update slider value pro d_waveletGotNewImage - Display the image pro d_waveletSensitize - Sensitize a widget pro d_waveletChangeFilename - Update the title pro d_waveletEraseOriginal - Erase the original image pro d_waveletEraseSecondary - Erase the secondary image pro d_waveletDataInput - Load a new data set pro d_waveletDoCompression - Compute & display image pro d_waveletNewCoeff - Handle the new coefficients pro d_waveletEvent - Event handler pro d_waveletCleanup - Cleanup pro d_wavelet - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: pro demo_gettips - Read the tip file and create widgets pro demo_puttips - Change tips text pro demo_getdata - Read new data wavelet.tip hurric.dat (Image of Hurricane Gilbert) Other two dimensional images in the examples/data directory can be viewed by selecting "Open" from the "File" menu REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 95, DS - Written. 11/95, DAT - Modified for IDL 5.0 demo
(See C:\RSI\IDL52\examples\demo\demosrc\d_wavelet.pro)
FILE: d_widgets.pro CALLING SEQUENCE: d_widgets PURPOSE: This demo shows the various types of widgets in IDL's Graphical User Interface (GUI) Toolkit. MAJOR TOPICS: Widgets CATEGORY: IDL Demo System INTERNAL FUNCTIONS and PROCEDURES: pro d_widgetsEvent - Event handler pro d_widgetsCleanup - Cleanup pro d_widgets - Main procedure EXTERNAL FUNCTIONS, PROCEDURES, and FILES: widgets.tip pro demo_gettips - Read the tip file and create widgets REFERENCE: IDL Reference Guide, IDL User's Guide NAMED STRUCTURES: none. COMMON BLOCS: none. MODIFICATION HISTORY: 96, DAT - Written. 98, ACY - Major rewrite.
(See C:\RSI\IDL52\examples\demo\demosrc\d_widgets.pro)
NAME: Editor PURPOSE: Display an ASCII text file using widgets. MAJOR TOPICS: Text manipulation. CALLING SEQUENCE: Editor [, filename] INPUTS: Filename: A scalar string that contains the filename of the file to display. The filename can include a path to that file. If the filename is omitted, the user will be prompted for a filename, via the system function, DIALOG_PICKFILE(). KEYWORD PARAMETERS: FONT: The name of the font to use. If omitted use the default font. HEIGHT: The number of text lines that the widget should display at one time. If this keyword is not specified, 24 lines is the default. WIDTH: The number of characters wide the widget should be. If this keyword is not specified, 80 characters is the default. PROCEDURE: Editor reads, writes and manipulates text strings ... MAJOR FUNCTIONS and PROCEDURES: COMMON BLOCKS and STRUCTURES: SIDE EFFECTS: Triggers the XMANAGER if it is not already in use. MODIFICATION HISTORY: Written by: WSO, RSI, January 1995 Modified by: ...
(See C:\RSI\IDL52\examples\misc\editor.pro)
NAME: EFONT PURPOSE: This widget provides a vector font editor and display. CATEGORY: Fonts. CALLING SEQUENCE: EFONT, Init_font INPUTS: Init_font: The initial font index, from 3 to 29. Default = 3. KEYWORD PARAMETERS: GROUP: The widget group, if part of a hierarchy. FILE: alternate font file name/path. Use this if you don't want to modify the standard font file. BLOCK: Set this keyword to have XMANAGER block when this application is registered. By default the Xmanager keyword NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting BLOCK for this application will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. OUTPUTS: No explicit outputs. COMMON BLOCKS: efont_com. SIDE EFFECTS: Reads and modifies the vector font file, which is normally hersh1.chr in the IDL resource/fonts directory. RESTRICTIONS: A basic editor. PROCEDURE: Call EFONT and press the HELP button for instructions. MODIFICATION HISTORY: DMS Nov, 1992. WSO, 1/95, Updated for new directory structure DMS, May, 1996. Removed device dependencies, updated to newer widgets.
(See C:\RSI\IDL52\lib\efont.pro)
NAME: EIGENVEC PURPOSE: This function computes the eigenvectors of an N by N real, non- symmetric array using inverse subspace iteration. The result is a complex array with a column dimension equal to N and a row dimension equal to the number of eigenvalues. CATEGORY: Linear Algebra / Eigensystems CALLING SEQUENCE: Result = Eigenvec(A, Eval) INPUTS: A: An N by N nonsymmetric array of type float or double. EVAL: An N-element complex vector of eigenvalues. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. ITMAX: The number of iterations performed in the computation of each eigenvector. The default value is 4. RESIDUAL: Use this keyword to specify a named variable which returns the residuals for each eigenvalue/eigenvector(lambda/x) pair. The residual is based on the definition Ax - (lambda)x = 0 and is an array of the same size and type as RESULT. The rows this array correspond to the residuals for each eigenvalue/ eigenvector pair. This keyword must be initialized to a non- zero value before calling EIGENVEC if the residuals are desired. EXAMPLE: Define an N by N real, nonsymmetric array. a = [[1.0, -2.0, -4.0, 1.0], $ [0.0, -2.0, 3.0, 4.0], $ [2.0, -6.0, -1.0, 4.0], $ [3.0, -3.0, 1.0, -2.0]] Compute the eigenvalues of A using double-precision complex arithmetic. eval = HQR(ELMHES(a), /double) Print the eigenvalues. The correct solution should be: (0.26366259, -6.1925899), (0.26366259, 6.1925899), $ (-4.9384492, 0.0000000), (0.41112397, 0.0000000) print, eval Compute the eigenvectors of A. The eigenvectors are returned in the rows of EVEC. The residual keyword must be initialized as a nonzero value prior to calling EIGENVEC. residual = 1 result = EIGENVEC(a, eval, residual = residual) Print the eigenvectors. print, evec(*,0), evec(*,1), evec(*,2), evec(*,3) The accuracy of each eigenvalue/eigenvector (lamda/x) pair may be checked by printing the residual array. This array is the same size and type as RESULT and returns the residuals as its rows. The residual is based on the mathematical definition of an eigenvector, Ax - (lambda)x = 0. All residual values should be floating-point zeros. print, residual PROCEDURE: EIGENVEC computes the set of eigenvectors that correspond to a given set of eigenvalues using Inverse Subspace Iteration. The eigenvectors are computed up to a scale factor and are of Euclidean length. The existence and uniqueness of eigenvectors are not guaranteed. MODIFICATION HISTORY: Written by: GGS, RSI, December 1994 Modified: GGS, RSI, April 1996 Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\eigenvec.pro)
NAME: EIGEN_II PURPOSE: This function computes the eigenvectors of an N by N real, nonsymmetric matrix. The result is an array of complex type with a column dimension equal to the number of eigenvalues and a row dimension equal to N. CATEGORY: Numerical Linear Algebra. CALLING SEQUENCE: Result = EIGEN_II(A, Eval) INPUTS: A: An N by N matrix real, nonsymmetric matrix. Eval: An n-element complex vector of eigenvalues. KEYWORD PARAMETERS: Double: If set to a non-zero value, computations are done in double precision arithmetic. NOTE: Since IDL lacks a double-precision complex data type, computations are done internally in double-precision and the result is truncated to single-precision complex. Itmax: The number of iterations performed in the computation of each eigenvector. The default value is 4. EXAMPLE: 1) A real, nonsymmetric matrix with real eigenvalues/eigenvectors. Define an N by N real, nonsymmetric array. a = [[ 7.3, 0.2, -3.7], $ [-11.5, 1.0, 5.5], $ [ 17.7, 1.8, -9.3]] Transpose the array into IDL column (matrix) format. at = transpose(a) Compute the eigenvalues of a. eval = NR_HQR(NR_ELMHES(at)) Print the eigenvalues. print, eval Compute the eigenvectors of a. evec = EIGEN_II(at, eval) Print the eigenvectors. print, evec(0,*), evec(1,*), evec(2,*) Check the accuracy of each eigenvalue/eigenvector (lamda/x) pair using the mathematical definition of an eigenvector; Ax - (lambda)x = 0 print, (evec(0,*) # a) - (eval(0) * evec(0,*)) print, (evec(1,*) # a) - (eval(1) * evec(1,*)) print, (evec(2,*) # a) - (eval(2) * evec(2,*)) 2) A real, nonsymmetric matrix with complex eigenvalues/eigenvectors. Define an N by N real, nonsymmetric array. a = [[ 0.0, 1.0], $ [-1.0, 0.0]] Transpose the array into IDL column (matrix) format. at = transpose(a) Compute the eigenvalues of a. eval = NR_HQR(NR_ELMHES(at)) Print the eigenvalues. print, eval Compute the eigenvectors of a. evec = EIGEN_II(at, eval, /double) Print the eigenvectors. print, evec(0,*), evec(1,*) Check the accuracy of each eigenvalue/eigenvector (lamda/x) pair using the mathematical definition of an eigenvector; Ax - (lambda)x = 0 print, (evec(0,*) # a) - (eval(0) * evec(0,*)) print, (evec(1,*) # a) - (eval(1) * evec(1,*)) PROCEDURE: EIGEN_II.PRO computes the set of eigenvectors that correspond to a given set of eigenvalues using Inverse Subspace Iteration. The eigenvectors are computed up to a scale factor and are of Euclidean length. The functions NR_ELMHES and NR_HQR may be used to find the eigenvalues of an N by N matrix real, nonsymmetric matrix. REFERENCE: Numerical Recipes, The Art of Scientific Computing (Second Edition) Cambridge University Press ISBN 0-521-43108-5 MODIFICATION HISTORY: Written by: GGS, RSI, December 1993
(See C:\RSI\IDL52\lib\obsolete\eigen_ii.pro)
NAME: EOS_EXISTS PURPOSE: Test for the existence of the HDF EOS library CATEGORY: File Formats CALLING SEQUENCE: Result = EOS_EXISTS() INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: Returns TRUE (1) if the HDF EOS data format library is supported. Returns FALSE(0) if it is not. EXAMPLE: IF eos_exists() EQ 0 THEN Fail,"HDF not supported on this machine" MODIFICATION HISTORY Written by: Scott Lasica, 10/30/98
(See C:\RSI\IDL52\lib\eos_exists.pro)
NAME: EQUAL_VARIANCE PURPOSE: To test treatments, blocks and interactions, as applicable, for variance equality before performing an anova test. CATEGORY: Statisitics. CALLING SEQUENCE: EQUAL_VARIANCE, X [, FC, DF, P] INPUTS: X: two or three dimensional array of experimental data. KEYWORDS: BLOCK: a flag, if set by user, to test homogeneity of block variances. Default is treatment variances. Block should only be set when either the keyword TWO_WAY or INTERACTIONS_TWO_WAY is set. TINTERACTION: a flag, if set by the user, to test homogeneity of variance for all treatment/block combinations. Type of design structure. Options are ONE_WAY: if set, 1-way anova. UNEQUAL_ONE_WAY: if set, 1-way ANOVA with unequal sample sizes. TWO_WAY: if set, 2-way ANOVA. INTERACTIONS_TWO_WAY: if set, 2-way ANOVA with interactions. One and only one of the above options may be set. Type of test to be used to test variance equality. Options are: HARTLEY: Hartley's F-Max test. Sample sizes should be equal and data nearly normally distributed. BARTLETT: Bartlett's test for nearly normally distributed data and not necessarily equal sample sizes. BOX: Box's test. Robust for large data sets, data not necessarily normally distributed. LEVENE: Levene's test. One and only one test may be selected. MISSING: place holder for missing data or undefined if no data is missing. GROUP_NO: number of groups to use in Box test. OUTPUT: FC: value of statistic computed by each test. If Bartlett's is selected, FC has chi square distribution. Otherwise, FC has F distribution. DF: degrees of freedom. Hartley: DF = [max sample size -1, number of treatments], Bartlett: DF = number of treatments, Box,Levene: DF =[numertor DF,denominator DF] P: probability of FC or something greater for Barlett's, Box's and Levene's Test. P = -1 for Hartley's. PROCEDURE: Milliken and Johnson, "Analysis of Messy Data", Van Nostrand, Reinhold, 1984, pp. 18-22.
(See C:\RSI\IDL52\lib\obsolete\equal_variance.pro)
NAME: ERRPLOT PURPOSE: Plot error bars over a previously drawn plot. CATEGORY: J6 - plotting, graphics, one dimensional. CALLING SEQUENCE: ERRPLOT, Low, High ;X axis = point number. ERRPLOT, X, Low, High ;To explicitly specify abscissae. INPUTS: Low: A vector of lower estimates, equal to data - error. High: A vector of upper estimates, equal to data + error. OPTIONAL INPUT PARAMETERS: X: A vector containing the abscissae. KEYWORD Parameters: WIDTH: The width of the error bars. The default is 1% of plot width. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: An overplot is produced. RESTRICTIONS: Logarithmic restriction removed. PROCEDURE: Error bars are drawn for each element. EXAMPLES: To plot symmetrical error bars where Y = data values and ERR = symmetrical error estimates, enter: PLOT, Y ;Plot data ERRPLOT, Y-ERR, Y+ERR ;Overplot error bars. If error estimates are non-symetrical, enter: PLOT,Y ERRPLOT, Upper, Lower ;Where Upper & Lower are bounds. To plot versus a vector of abscissae: PLOT, X, Y ;Plot data (X versus Y). ERRPLOT, X, Y-ERR, Y+ERR ;Overplot error estimates. MODIFICATION HISTORY: DMS, RSI, June, 1983. Joe Zawodney, LASP, Univ of Colo., March, 1986. Removed logarithmic restriction. DMS, March, 1989. Modified for Unix IDL. KDB, March, 1997. Modified to used !p.noclip RJF, Nov, 1997. Removed unnecessary print statement Disable and re-enable the symbols for the bars
(See C:\RSI\IDL52\lib\errplot.pro)
NAME: Examples PURPOSE: This widget application guides the user through the IDL family of technical widget programming examples. MAJOR TOPICS: Launching widget applications. CALLING SEQUENCE: Examples PROCEDURE: Examples ... MAJOR FUNCTIONS and PROCEDURES: MODIFICATION HISTORY: Written by: WSO, RSI, January 1995
(See C:\RSI\IDL52\examples\misc\examples.pro)
NAME: EXPAND PURPOSE: Array magnification (CONGRIDI like except that this really works!) CATEGORY: Z4 - IMAGE PROCESSING CALLING SEQUENCE: EXPAND,A,NX,NY,RESULT [,MAXVAL=MAXVAL,FILLVAL=FILLVAL] INPUTS: A Array to be magnified NX Desired size of X Dimension NY Desired size of Y Dimension Keywords: MAXVAL Largest good value. Elements greater than this are ignored FILLVAL Value to use when elements larger than MAXVAL are encountered. Defaults to -1. OUTPUTS: RESULT Magnified Floating point image of A array (NX by NY) COMMON BLOCKS: NONE SIDE EFFECTS: NONE RESTRICTIONS: A must be two Dimensional PROCEDURE: Bilinear interpolation. Not really fast if you have to swap memory (eg. NX*NY is a big number). OK Postscript users don't forget that postscript pixels are scaleable! MODIFICATION HISTORY: Aug 15, 1989 J. M. Zawodny, NASA/LaRC, MS 475, Hampton VA, 23665. Aug 26, 1992 JMZ, Added maxval and fillval keywords. Sep 30, 1992 DMS, RSI, Rewrote to use INTERPOLATE function. Please send suggestions and bugreports to zawodny@arbd0.larc.nasa.gov
(See C:\RSI\IDL52\lib\expand.pro)
NAME: EXTRAC PURPOSE: The EXTRAC function returns as its result any rectangular sub-matrix or portion of the parameter array. When parts of the specified subsection lie outside the bounds of the array, zeros are entered into these outlying elements. EXTRAC was originally a built-in system procedure in the PDP-11 version of IDL, and was retained in that form in the original VAX/VMS IDL for compatibility. Most applications of the EXTRAC function are more concisely written using subscript ranges (e.g., X(10:15)). In the current release of IDL, EXTRAC has been rewritten as a User Library function that provides the same interface as the previous versions. CATEGORY: Array Manipulation. CALLING SEQUENCE: Result = EXTRAC(Array, C1, C2, ..., Cn, S1, S2, ..., Sn) INPUTS: Array: The array from which the subarray will be copied. Ci: The starting subscript in Array for the subarray. There should be one Ci for each dimension of Array. Si: The size of each dimension. The result will have dimensions of (S1, S2, ..., Sn). There should be one Si for each dimension of Array. OUTPUTS: This function returns a two-dimensional, floating-point, interpolated array. RESTRICTIONS: In order to make the most typical cases run quickly, little error checking is done on the input. In particular, the Ci and Si arguments must all be scalar integers, and the Si must be non-negative. If you know that the subarray will never lie beyond the edges of the array, it is more efficient to use array subscript ranges to extract the data instead of EXTRAC. PROCEDURE: If the subarray lies entirely inside the Array argument, the standard array subscript-range mechanism is used to do the work. Otherwise, a zeroed array of the correct type and size is created, and the overlapping subarray is copied into it. EXAMPLES: EXAMPLE 1: Define a 1000 point vector with each element initialized to its subscript. Extract a 300 pt. vector, starting at A(200) and going to A(499). B(0) will be equal to A(200), B(299) will be equal to A(499). Enter: A = FINDGEN(1000) B = EXTRAC(A, 200, 300) EXAMPLE 2: Here, the first 49 points extracted (B(0) to B(49)) lie outside the bounds of the vector and are set to 0. B(50) is set to A(0), B(51) is set to A(1) which is 1, ... Enter: A = FINDGEN(1000) B = EXTRAC(A, -50, 100) EXAMPLE 3: The following commands illustrate the use of EXTRAC with multi- dimensional arrays. Enter: A = INTARR(64,64) ;Make a 64X64 matrix to play with Take out a 32X32 portion starting at A(20,30) by entering: B = EXTRAC(A, 20, 30, 32, 32) A better way to perform the same operation as the previous line is: B = A(20:51, 30:61) Extract the 20th column and 32nd row of A: B = EXTRAC(A, 19, 0, 1, 64) ; Extract 20th column of A B = EXTRAC(A, 0, 31, 64, 1) ; Extract 32nd row of A Take a 32X32 matrix from A starting at A(40,50). B = EXTRAC(A, 40, 50, 32, 32) NOTE: Those points beyond the boundaries of A are set to 0. REVISION HISTORY: July 18, 1989 Written AB, RSI October 15, 1997, AB, RSI, Made correction provided by Eric Deutsch (deutsch@dione.astro.washington.edu)in clipping size of subarray so results that overlap on all sides can be properly handled. Added tests for the completely overlapping case.
(See C:\RSI\IDL52\lib\extrac.pro)
NAME: EXTRACT_SLICE PURPOSE: This function returns a 2-D planar slice extracted from 3-D volumetric data. The slicing plane may be oriented at any angle, and may pass through any desired location in the volume. CATEGORY: Volume Rendering. CALLING SEQUENCE: Slice = EXTRACT_SLICE(Vol, X_size, Y_size, X_center, Y_center, $ Z_center, X_rot, Y_rot, Z_rot) INPUTS: Vol: The three dimensional volume of data to slice. Data type : Any 3-D array except string or structure. X_size: The size of the returned slice in X (The returned slice will have the dimensions X_size by Y_size). Data type : Long. Y_size: The size of the returned slice in Y. To preserve the correct aspect ratio of the data, Y_size should equal X_size. For optimal results, set X_size and Y_size to be greater than or equal to the largest of the three dimensions of Vol. Data type : Long. X_center: The X coordinate (index) within the volume that the slicing plane passes through. The center of the slicing plane passes through Vol at the coordinate (X_center, Y_Center, Z_center). Data type : Any scalar numeric value (usually Long). Y_center: The Y coordinate (index) within the volume that the slicing plane passes through. Data type : Any scalar numeric value (usually Long). Z_center: The Z coordinate (index) within the volume that the slicing plane passes through. Data type : Any scalar numeric value (usually Long). X_rot: The orientation (X rotation) of the slicing plane. Before transformation, the slicing plane is parallel to the X-Y plane. The slicing plane transformations are performed in the following order : 1. Rotate Z_rot degrees about the Z axis. 2. Rotate Y_rot degrees about the Y axis. 3. Rotate X_rot degrees about the X axis. 4. Translate the center of the plane to X_center, Y_center, Z_center. Data type : Float. Y_rot: The orientation (Y rotation) of the slicing plane. Data type : Float. Z_rot: The orientation (Z rotation) of the slicing plane. Data type : Float. KEYWORD PARAMETERS: CUBIC: If CUBIC is set, then cubic interpolation is used. The default is to use tri-linear interpolation. If the SAMPLE keyword is set, then the CUBIC keyword is ignored. OUT_VAL: If OUT_VAL is set, then the portions of the returned slice that lie outside the original volume are set to the value passed to OUT_VAL. Data type : Any scalar numeric value (usually the same type as Vol). RADIANS: Set this keyword to a non-zero value to indicate that X_rot, Y_rot, and Z_rot are in radians. The default is degrees. Data type : Int. SAMPLE: If SAMPLE is set to a non-zero value then nearest neighbor sampling is used to compute the slice. Otherwise, tri-linear (or cubic) interpolation is used. A small reduction in execution time will result if SAMPLE mode is set and the OUT_VAL keyword is NOT used. OUTPUTS: This function returns the planar slice as a two dimensional array with the same data type as Vol. The dimensions of the returned array are X_size by Y_size. EXAMPLE: Display an oblique slice through volumetric data. ; Create some data. vol = RANDOMU(s, 40, 40, 40) FOR i=0, 10 DO vol = SMOOTH(vol, 3) vol = BYTSCL(vol(3:37, 3:37, 3:37)) ; Extract and display a slice. slice = EXTRACT_SLICE(vol, 40, 40, 17, 17, 17, 30.0, 30.0, 0.0, $ OUT_VAL=0B) TVSCL, REBIN(slice, 400, 400) MODIFICATION HISTORY: Written by: Daniel Carr. Wed Sep 2 14:47:07 MDT 1992 Modified by: Daniel Carr. Mon Nov 21 14:59:45 MST 1994 Improved speed and added the CUBIC keyword.
(See C:\RSI\IDL52\lib\extract_slice.pro)
NAME: FACTORIAL PURPOSE: This function computes the factorial N! as the double-precision product, (N) * (N-1) * (N-2) * ...... * 3 * 2 * 1. CATEGORY: Special Functions. CALLING SEQUENCE: Result = Factorial(n) INPUTS: N: A non-negative scalar of type integer, float or double. KEYWORD PARAMETERS: STIRLING: If set to a non-zero value, Stirling's asymptotic formula is used to approximate N!. EXAMPLE: Compute 20! with and without Stirling's asymptotic formula. result_1 = factorial(20, /stirling) result_2 = factorial(20) Result_1 and result_2 should be 2.4227869e+18 and 2.4329020e+18 respectively. REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Written by: GGS, RSI, November 1994
(See C:\RSI\IDL52\lib\factorial.pro)
NAME: FILEPATH PURPOSE: Given the name of a file in the IDL distribution, FILEPATH returns the fully-qualified path to use in opening the file. Operating system dependencies are taken into consideration. This routine is used by RSI to make the User Library portable. CATEGORY: File Management. CALLING SEQUENCE: Result = FILEPATH('filename' [, SUBDIRECTORY = subdir]) INPUTS: filename: The lowercase name of the file to be opened. No device or directory information should be included. KEYWORDS: ROOT_DIR: The name of the directory from which the resulting path should be based. If not present, the value of !DIR is used. This keyword is ignored if TERMINAL or TMP are specified. SUBDIRECTORY: The name of the subdirectory in which the file should be found. If this keyword is omitted, the main directory is used. This variable can be either a scalar string or a string array with the name of each level of subdirectory depth represented as an element of the array. TERMINAL: Return the filename of the user's terminal. TMP: The file is a scratch file. Return a path to the proper place for temporary files under the current operating system. OUTPUTS: The fully-qualified file path is returned. If one of the subdirectory keywords is not specified, the file is assumed to exist in the main distribution directory. COMMON BLOCKS: None. RESTRICTIONS: ROOT_DIR, TERMINAL, and TMP are mutually exclusive. Only one of these should be used in a single call to FILEPATH. SUBDIRECTORY does not make sense with TERMINAL or TMP. EXAMPLE: To get a path to the file DETERM in the "userlib" subdirectory to the IDL "lib" subdirectory, enter: path = FILEPATH("determ", SUBDIRECTORY = ["lib", "userlib"]) The variable "path" contains a string that is the fully-qualified file path for the file DETERM. MODIFICATION HISTORY: December, 1989, AB, RSI (Formalized from original by DMS) October, 1990, SG, RSI (added support for MSDOS) February, 1991, SMR, RSI (added string array support for multi-level directories) 21 April 1993, AB, Added ROOT_DIR keyword. 14 July 1994, KDB, RSI - Corrected logic error in VMS section of the ROOT_DIR keyword. Any sub-directory specification was being ignored when using ROOT_DIR. March, 1995, DJE, Add a ':' if root_dir is specified on the Mac. 29 July 1995, Robert.M.Candey.1@gsfc.nasa.gov, Changed VMS case for no specified path to not append '.][000000]' April, 1996, DJE, Remove call to STRLOWCASE(SUBDIR). August, 1996, AJH, used environment variables to define TMP on Win32 12 January 1998, AB, General cleanup and added 2 improvements for VMS supplied by Paul Hick (pphick@ucsd.edu): (1) Add a colon to the end of ROOT_DIR if it doesn't end in a ':' or ']' to allow root_dir to be a logical name without the trailing ':', and (2) Remove instances of '.][' that result when using rooted logical names for ROOT_DIR. These changes make it easier to use the same FILEPATH call across VMS and other operating systems.
(See C:\RSI\IDL52\lib\filepath.pro)
NAME: FILLCONTOUR PURPOSE: Contour, /fill does not fill the lowest contour level. FILLCONTOUR attempts to fill that level. CATEGORY: Plot CALLING SEQUENCE: FILLCONTOUR, data, x, y, ......(keyword parameters) INPUTS: data - 2 dimensional data displayable with CONTOUR command. x, y - x and y coordinates (see description on CONTOUR) KEYWORD INPUTS: All the contour keywords are allowed. OUTPUTS: A filled contour plot to the current graphics device. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Does not work with certain map projections. PROCEDURE: Pretty much Straightforward. MODIFICATION HISTORY: July, 1993 JIY - Initial creation
(See C:\RSI\IDL52\lib\obsolete\fillcontour.pro)
NAME: FLICK PURPOSE: Flicker between two output images at a given rate. CATEGORY: Image display, animation. CALLING SEQUENCE: FLICK, A, B, Rate INPUTS: A: Byte image number 1, scaled from 0 to 255. B: Byte image number 2, scaled from 0 to 255. OPTIONAL INPUT PARAMETERS: Rate: The flicker rate. The default is 1.0 sec/frame KEYWORD PARAMETERS: None. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: Sunview: Modifies the display, changes the write mask. X and Windows: uses two additional pixmaps. RESTRICTIONS: None. PROCEDURE: SunView: Image A is written to the bottom 4 bits of the display. Image B is written to the top 4 bits. Two color tables are created from the current table, one that shows the low 4 bits using 16 of the original colors, and one that shows the high 4 bits. The color table is changed to switch between images. Other window systems: two off screen pixmaps are used to contain the images. MODIFICATION HISTORY: DMS, 3/ 88. DMS, 4/92, Added X window and MS window optimizations.
(See C:\RSI\IDL52\lib\flick.pro)
NAME: FLOW3 - Draw 3D flow/velocity field. PURPOSE: Draw lines representing a 3D flow/velocity field. CATEGORY: Graphics. CALLING SEQUENCE: FLOW3, vx, vy, vz INPUTS: Vx, Vy, Vz = 3D arrays containing X, Y, and Z components of the field. KEYWORD PARAMETERS: Sx, Sy, Sz = Optional vectors containing the starting coordinates of the flow lines. If omitted random starting points are chosen. Nvecs = Number of random flow lines to draw (Default = 200). Only used if Sx, Sy, Sz are not present. Len = Length of each step used to follow flow lines. Default = 2.0 Expressed in units of largest field vector, i.e. the length of the longest step is set to len times the grid spacing. Nsteps = number of steps used to follow the flow lines. Default = largest dimension of vx / 5. Blob = 1 to draw a blob at the beginning of each flow line and suppress the arrows. Arrowsize = size of arrowheads, default = 0.05 OUTPUTS: None. Graphics are produced on the currently selected graphics device. COMMON BLOCKS: None. RESTRICTIONS: Works best with Z buffer output device. PROCEDURE: The 3D scaling system must be set before calling this procedure. For example: scale3, xr=[0,nx-1], yr=[0,ny-1], zr = [0,nz-1] where nx, ny, and nz are the 1st, 2nd, and 3rd dimensions of VX, VY, and VZ. MODIFICATION HISTORY: DMS - RSI, Nov, 1991.
(See C:\RSI\IDL52\lib\flow3.pro)
NAME: FRIEDMAN PURPOSE: Perform a two-way analysis of variance with k treatments and b blocks to test the hypothesis that all treatments have the same distribution versus the alternative that at least two treatment distributions differ in location. No assumptions are needed about the underlying probability distributions. CATEGORY: Statistics. CALLING SEQUENCE: FRIEDMAN, Data [, Rank, F, Prob, Df] INPUTS: Data: two dimensional array. Data(i,j) = the observation from the ith treatment and jth block. KEYWORDS: NAMES: vector of names for the populations to be used in the output. LIST_NAME: name of output file. Default is to the screen. NOPRINT: a flag, if set, to suppress output to the screen or a file. OUTPUT: Table written to the screen showing rank sum for each treatment. Also, the Friedman test statistic and it is probability assuming a chi-square distribution are written to the screen. OPTIONAL OUTPUT PARAMETERS: Rank: 1-dim array of rank sums. Rank(i) = sum of ranks of population i. F: Friedman test statistic. Prob: probability of F, assuming a chi-square distribution. DF: degrees of freedom of chi-square distribution. RESTRICTIONS: No missing data COMMON BLOCKS: None. PROCEDURE: For each block, the observations for the k treatments are ranked. Let Ri = rank sum for ith treatment, RRi = Ri/b and Let R = average of all ranks =(k+1)/2. Let RRi = Ri/ni. The rank sum analogue to the standard sum of squares is: SS =b* sum((RRi -R)^2). The Friedman statistic F = 12/(k(k+1)) * V and has approximately the chi-square distribution if each sample size exceeds 4.
(See C:\RSI\IDL52\lib\obsolete\friedman.pro)
NAME: FUNCT PURPOSE: Evaluate the sum of a Gaussian and a 2nd-order polynomial and optionally return the value of its partial derivatives. Normally, this function is used by CURVEFIT to fit the sum of a line and a varying background to actual data. CATEGORY: E2 - Curve and surface fitting. CALLING SEQUENCE: FUNCT, X, A, F [, Pder] INPUTS: X: The values of the independent variable. A: The parameters of the equation described in PROCEDURE below. OUTPUTS: F: The value of the function at each X(i). OPTIONAL OUTPUT PARAMETERS: Pder: An array of the size (N_ELEMENTS(X),6) that contains the partial derivatives. Pder(i,j) represents the derivative at the i'th point with respect to j'th parameter. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: F = A(0)*EXP(-Z^2/2) + A(3) + A(4)*X + A(5)*X^2 Z = (X-A(1))/A(2) MODIFICATION HISTORY: WRITTEN, DMS, RSI, SEPT, 1982. Modified, DMS, Oct 1990. Avoids divide by 0 if A(2) is 0.
(See C:\RSI\IDL52\lib\funct.pro)
NAME: FV_TEST PURPOSE: This function computes the F-statistic and the probability that two vectors of sampled data have significantly different variances. This type of test is often refered to as the F-variances Test. CATEGORY: Statistics. CALLING SEQUENCE: Result = FV_TEST(X, Y) INPUTS: X: An n-element vector of type integer, float or double. Y: An m-element vector of type integer, float or double. EXAMPLE Define two n-element vectors of tabulated data. X = [257, 208, 296, 324, 240, 246, 267, 311, 324, 323, 263, 305, $ 270, 260, 251, 275, 288, 242, 304, 267] Y = [201, 56, 185, 221, 165, 161, 182, 239, 278, 243, 197, 271, $ 214, 216, 175, 192, 208, 150, 281, 196] Compute the F-statistic (of X and Y) and its significance. The result should be the two-element vector [2.48578, 0.0540116], indicating that X and Y have significantly different variances. result = fv_test(X, Y) PROCEDURE: FV_TEST computes the F-statistic of X and Y as the ratio of variances and its significance. X and Y may be of different lengths. The result is a two-element vector containing the F-statistic and its significance. The significance is a value in the interval [0.0, 1.0]; a small value (0.05 or 0.01) indicates that X and Y have significantly different variances. REFERENCE: Numerical Recipes, The Art of Scientific Computing (Second Edition) Cambridge University Press ISBN 0-521-43108-5 MODIFICATION HISTORY: Written by: GGS, RSI, Aug 1994 FV_TEST is based on the routine: ftest.c described in section 14.2 of Numerical Recipes, The Art of Scientific Computing (Second Edition), and is used by permission.
(See C:\RSI\IDL52\lib\fv_test.pro)
NAME: FX_ROOT PURPOSE: This function computes real and complex roots (zeros) of a univariate nonlinear function. CATEGORY: Nonlinear Equations/Root Finding CALLING SEQUENCE: Result = FX_ROOT(X, Func) INPUTS: X : A 3-element initial guess vector of type real or complex. Real initial guesses may result in real or complex roots. Complex initial guesses will result in complex roots. Func: A scalar string specifying the name of a user-supplied IDL function that defines the univariate nonlinear function. This function must accept the vector argument X. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. ITMAX: Set this keyword to specify the maximum number of iterations The default is 100. STOP: Set this keyword to specify the stopping criterion used to judge the accuracy of a computed root, r(k). STOP = 0 implements an absolute error criterion between two successively-computed roots, |r(k) - r(k+1)|. STOP = 1 implements a functional error criterion at the current root, |Func(r(k))|. The default is 0. TOL: Set this keyword to specify the stopping error tolerance. If the STOP keyword is set to 0, the algorithm stops when |x(k) - x(k+1)| < TOL. If the STOP keyword is set to 1, the algorithm stops when |Func(x(k))| < TOL. The default is 1.0e-4. EXAMPLE: Define an IDL function named FUNC. function FUNC, x return, exp(sin(x)^2 + cos(x)^2 - 1) - 1 end Define a real 3-element initial guess vector. x = [0.0, -!pi/2, !pi] Compute a root of the function using double-precision arithmetic. root = FX_ROOT(x, 'FUNC', /double) Check the accuracy of the computed root. print, exp(sin(root)^2 + cos(root)^2 - 1) - 1 Define a complex 3-element initial guess vector. x = [complex(-!pi/3, 0), complex(0, !pi), complex(0, -!pi/6)] Compute a root of the function. root = FX_ROOT(x, 'FUNC') Check the accuracy of the computed root. print, exp(sin(root)^2 + cos(root)^2 - 1) - 1 PROCEDURE: FX_ROOT implements an optimal Muller's method using complex arithmetic only when necessary. REFERENCE: Numerical Recipes, The Art of Scientific Computing (Second Edition) Cambridge University Press ISBN 0-521-43108-5 MODIFICATION HISTORY: Written by: GGS, RSI, March 1994 Modified: GGS, RSI, September 1994 Added support for double-precision complex inputs.
(See C:\RSI\IDL52\lib\fx_root.pro)
NAME: F_CVF PURPOSE: This function computes the cutoff value (v) such that: Probability(X > v) = p where X is a random variable from the F distribution with (dfn) and (dfd) degrees of freedom. CALLING SEQUENCE: Result = f_cvf(P, DFN, DFD) INPUTS: P: A non-negative scalar, in the interval [0.0, 1.0], of type float or double that specifies the probability of occurance or success. DFN: A positive scalar of type integer, float or double that specifies the degrees of freedom of the F distribution numerator. DFD: A positive scalar of type integer, float or double that specifies the degrees of freedom of the F distribution denominator. EXAMPLE: Compute the cutoff value (v) such that Probability(X > v) = 0.100 from the F distribution with (dfn = 10) and (dfd = 6) degrees of freedom. The result should be 7.87413 result = f_cvf(0.01, 10, 6) REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Modified by: GGS, RSI, July 1994 Minor changes to code. New documentation header.
(See C:\RSI\IDL52\lib\f_cvf.pro)
NAME: F_PDF PURPOSE: This function computes the probabilty (p) such that: Probability(X <= v) = p where X is a random variable from the F distribution with (dfn) and (dfd) degrees of freedom. CATEGORY: Statistics. CALLING SEQUENCE: Result = f_pdf(V, DFN, DFD) INPUTS: V: A scalar of type integer, float or double that specifies the cutoff value. DFN: A positive scalar of type integer, float or double that specifies the degrees of freedom of the F distribution numerator. DFD: A positive scalar of type integer, float or double that specifies the degrees of freedom of the F distribution EXAMPLE: Compute the probability that a random variable X, from the F distribution with (dfn = 5) and (dfd = 24) degrees of freedom, is less than or equal to 3.90. The result should be 0.990059 result = f_pdf(3.90, 5, 24) REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Modified by: GGS, RSI, July 1994 Minor changes to code. New documentation header.
(See C:\RSI\IDL52\lib\f_pdf.pro)
NAME: F_TEST PURPOSE: F_TEST returns the cutoff value v such that: Probability(X > v) = a where X is a random variable from the F distribution with DFN and DFD numerator and denominator degrees of freedom. CATEGORY: Statistics. CALLING SEQUENCE: Result = F_TEST(A, DFN, DFD) INPUT: A: probability DFN: numerator degrees of freedom DFD: denominator degrees of freedom OUTPUT: If A is between 0 and 1, then the cutoff value is returned. Otherwise, -1 is returned to indicate an error.
(See C:\RSI\IDL52\lib\obsolete\f_test.pro)
NAME: F_TEST1 PURPOSE: F_test1 returns the probabilty of an observed value greater than X from an F distribution with DFN and DFD numerator and denominator degrees of freedom. CATEGORY: Statistics. CALLING SEQUENCE: Result = F_TEST1(X, DFN, DFD) INPUT: X: cutoff DFN: numerator degrees of freedom DFD: denominator degrees of freedom OUTPUT: The probability of a value greater than X.
(See C:\RSI\IDL52\lib\obsolete\f_test1.pro)
NAME: GAMMA PURPOSE: The introduction of the GAMMA function as a built in system routine in IDL 4.0 caused inconvenience to customers with existing code in which GAMMA had been used as a variable, because IDL system routines have precedence over variable names. To minimize this problem, RSI has renamed GAMMA to NR_GAMMA. This wrapper serves to make NR_GAMMA available under the name GAMMA as documented in the IDL Reference Manual. However, since IDL library routines have lower precedence than variables, programs that use GAMMA as a variable name will work as before. See the documentation for GAMMA in the IDL Reference manual for details on arguments, keywords, and results. MODIFICATION HISTORY: 3 July 1995, AB, RSI.
(See C:\RSI\IDL52\lib\gamma.pro)
NAME: GAMMA_CT PURPOSE: Apply gamma correction to the color table. CATEGORY: Image display. CALLING SEQUENCE: GAMMA, Gamma GAMMA, Gamma, /CURRENT INPUTS: Gamma: The value of gamma correction. A value of 1.0 indicates a linear ramp, i.e., no gamma correction. Higher values of gamma give more contrast. Values less than 1.0 yield lower contrast. KEYWORD PARAMETERS: CURRENT: If this keyword is set, apply correction from the current table. Otherwise, apply from the original color table. When CURRENT is set, the color table input to GAMMA_CT is taken from the R_CURR, G_CURR, and B_CURR variables. Otherwise, input is from R_ORIG, G_ORIG, and B_ORIG. The resulting tables are always saved in the "current" table. INTENSITY: If this keyword is set, correct the individual intensities of each color in the color table. Otherwise, shift the colors according to the gamma function. OUTPUTS: No explicit outputs. The modified color table vectors are saved in the COLORS common block, as the variables r_curr, g_curr, and b_curr variables. COMMON BLOCKS: COLORS: The IDL color table common block. SIDE EFFECTS: A new color table is loaded, and its contents are placed in the "current" variables of the COLORS common block. RESTRICTIONS: None. PROCEDURE: Straightforward. The gamma correction is implemented as x^gamma, where x is the range of color table indices scaled from 0 to 1. MODIFICATION HISTORY: DMS, Oct, 1990. Added ability shift intensities of colors, rather than the mapping of the colors. DMS, April, 1991.
(See C:\RSI\IDL52\lib\gamma_ct.pro)
NAME: GAUSS PURPOSE: Gauss returns the cutoff value v such that Probability(X > v) = a, where X is a standard gaussian random variable. CATEGORY: Statistics. CALLING SEQUENCE: Result = GAUSS(A) INPUT: A: The probability for which a cutoff is desired. OUTPUT: The cutoff value if a is beween 0 and 1 inclusively. Otherwise, -1.
(See C:\RSI\IDL52\lib\obsolete\gauss.pro)
NAME: GAUSS2DFIT PURPOSE: Fit a 2 dimensional elliptical gaussian equation to rectilinearly gridded data. Z = F(x,y) where: F(x,y) = A0 + A1*EXP(-U/2) And the elliptical function is: U= (x'/a)^2 + (y'/b)^2 The parameters of the ellipse U are: Axis lengths are 2*a and 2*b, in the unrotated X and Y axes, respectively. Center is at (h,k). Rotation of T radians from the X axis, in the CLOCKWISE direction. The rotated coordinate system is defined as: x' = (x-h) * cos(T) - (y-k) * sin(T)y' = (x-h) * sin(T) + (y-k) * cos(T) The rotation is optional, and may be forced to 0, making the major/ minor axes of the ellipse parallel to the X and Y axes. The coefficients of the function, are returned in a seven element vector: a(0) = A0 = constant term. a(1) = A1 = scale factor. a(2) = a = width of gaussian in X direction. a(3) = b = width of gaussian in Y direction. a(4) = h = center X location. a(5) = k = center Y location. a(6) = T = Theta the rotation of the ellipse from the X axis in radians, counterclockwise. CATEGORY: curve / data fitting CALLING SEQUENCE: Result = GAUSS2DFIT(z, a [,x,y]) INPUTS: Z = dependent variable in a 2D array dimensioned (Nx, Ny). Gridding must be rectilinear. X = optional Nx element vector containing X values of Z. X(i) = X value for Z(i,j). If omitted, a regular grid in X is assumed, and the X location of Z(i,j) = i. Y = optional Ny element vector containing Y values of Z. Y(j) = Y value for Z(i,j). If omitted, a regular grid in Y is assumed, and the Y location of Z(i,j) = j. Optional Keyword Parameters: NEGATIVE = if set, implies that the gaussian to be fitted is a valley (such as an absorption line). By default, a peak is fit. TILT = if set to 1, allow the orientation of the major/minor axes of the ellipse to be unrestricted. The default is that the axes of the ellipse must be parallel to the X-Y axes. In this case, A(6) is always returned as 0. OUTPUTS: The fitted function is returned. OUTPUT PARAMETERS: A: The coefficients of the fit. A is a seven element vector as described under PURPOSE. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Timing: Approximately 4 seconds for a 128 x 128 array, on a Sun SPARC LX. Time required is roughly proportional to the number of elements in Z. PROCEDURE: The peak/valley is found by first smoothing Z and then finding the maximum or minimum respectively. Then GAUSSFIT is applied to the row and column running through the peak/valley to estimate the parameters of the Gaussian in X and Y. Finally, CURVEFIT is used to fit the 2D Gaussian to the data. Be sure that the 2D array to be fit contains the entire Peak/Valley out to at least 5 to 8 half-widths, or the curve-fitter may not converge. EXAMPLE: This example creates a 2D gaussian, adds random noise and then applies GAUSS2DFIT: nx = 128 ;Size of array ny = 100 ;** Offs Scale X width Y width X cen Y cen ** ;** A0 A1 a b h k ** a = [ 5., 10., nx/6., ny/10., nx/2., .6*ny] ;Input function parameters x = findgen(nx) # replicate(1.0, ny) ;Create X and Y arrays y = replicate(1.0, nx) # findgen(ny) u = ((x-a(4))/a(2))^2 + ((y-a(5))/a(3))^2 ;Create ellipse z = a(0) + a(1) * exp(-u/2) ;to gaussian z = z + randomn(seed, nx, ny) ;Add random noise, SD = 1 yfit = gauss2dfit(z,b) ;Fit the function, no rotation print,'Should be:',string(a,format='(6f10.4)') ;Report results.. print,'Is: :',string(b(0:5),format='(6f10.4)') MODIFICATION HISTORY: DMS, RSI, June, 1995.
(See C:\RSI\IDL52\lib\gauss2dfit.pro)
NAME: GAUSS2_FUNCT PURPOSE: Evaluate function for gauss2fit. CALLING SEQUENCE: FUNCT,X,A,F,PDER INPUTS: X = values of independent variables, encoded as: [nx, ny, x, y] A = parameters of equation described below. OUTPUTS: F = value of function at each X(i,j), Y(i,j). Function is: F(x,y) = A0 + A1*EXP(-U/2) where: U= (yp/A2)^2 + (xp/A3)^2 If A has 7 elements a rotation of the ellipse is present and: xp = (x-A4) * cos(A6) - (y-A5) * sin(A6) yp = (x-A4) * sin(A6) + (y-A5) * cos(A6) If A has 6 elements, A6 (theta) is 0, the major and minor axes of the ellipse are parallel to the XY axes, and: xp = (x-A4) and yp = (x-A5) Optional output parameters: PDER = (n_elements(z),6 or 7) array containing the partial derivatives. pder(i,j) = derivative at ith point w/respect to jth parameter. PROCEDURE: Evaluate the function and then if requested, eval partials. MODIFICATION HISTORY: WRITTEN, DMS, RSI, June, 1995.
(See C:\RSI\IDL52\lib\gauss2dfit.pro)
NAME: GAUSSFIT PURPOSE: Fit the equation y=f(x) where: F(x) = A0*EXP(-z^2/2) + A3 + A4*x + A5*x^2 and z=(x-A1)/A2 A0 = height of exp, A1 = center of exp, A2 = sigma (the width). A3 = constant term, A4 = linear term, A5 = quadratic term. Terms A3, A4, and A5 are optional. The parameters A0, A1, A2, A3 are estimated and then CURVEFIT is called. CATEGORY: ?? - fitting CALLING SEQUENCE: Result = GAUSSFIT(X, Y [, A]) INPUTS: X: The independent variable. X must be a vector. Y: The dependent variable. Y must have the same number of points as X. KEYWORD INPUTS: KEYWORD INPUTS: ESTIMATES = optional starting estimates for the parameters of the equation. Should contain NTERMS (6 if NTERMS is not provided) elements. NTERMS = Set NTERMS to 3 to compute the fit: F(x) = A0*EXP(-z^2/2). Set it to 4 to fit: F(x) = A0*EXP(-z^2/2) + A3 Set it to 5 to fit: F(x) = A0*EXP(-z^2/2) + A3 + A4*x OUTPUTS: The fitted function is returned. OPTIONAL OUTPUT PARAMETERS: A: The coefficients of the fit. A is a three to six element vector as described under PURPOSE. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: The peak or minimum of the Gaussian must be the largest or smallest point in the Y vector. PROCEDURE: The initial estimates are either calculated by the below procedure or passed in by the caller. Then the function CURVEFIT is called to find the least-square fit of the gaussian to the data. Initial estimate calculation: If the (MAX-AVG) of Y is larger than (AVG-MIN) then it is assumed that the line is an emission line, otherwise it is assumed there is an absorbtion line. The estimated center is the MAX or MIN element. The height is (MAX-AVG) or (AVG-MIN) respectively. The width is found by searching out from the extrema until a point is found less than the 1/e value. MODIFICATION HISTORY: DMS, RSI, Dec, 1983. DMS, RSI, Jun, 1995, Added NTERMS keyword. Result is now float if Y is not double. DMS, RSI, Added ESTIMATES keyword.
(See C:\RSI\IDL52\lib\gaussfit.pro)
NAME: GAUSS_CVF PURPOSE: This function computes the cutoff value (v) such that: Probability(X > v) = p where X is a random variable from the standard Gaussian (Normal) distribution with a mean of 0.0 and a variance of 1.0 CATEGORY: Statistics. CALLING SEQUENCE: Result = Gauss_cvf(P) INPUTS: P: A non-negative scalar, in the interval [0.0, 1.0], of type float or double that specifies the probability of occurance or success. EXAMPLE: Compute the cutoff value (v) such that Probability(X > v) = 0.025 from the standard Gaussian (Normal) distribution. The result should be 1.95997 result = gauss_cvf(0.025) REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Modified by: GGS, RSI, July 1994 Minor changes to code. New documentation header.
(See C:\RSI\IDL52\lib\gauss_cvf.pro)
NAME: GAUSS_PDF PURPOSE: This function computes the probabilty (p) such that: Probability(X <= v) = p where X is a random variable from the standard Gaussian (Normal) distribution with a mean of 0.0 and a variance of 1.0 CATEGORY: Statistics. CALLING SEQUENCE: Result = Gauss_Pdf(V) INPUTS: V: A scalar of type integer, float or double that specifies the cutoff value. EXAMPLES: Compute the probability that a random variable X, from the standard Gaussian (Normal) distribution, is less than or equal to 2.44. The result should be 0.992656 result = gauss_pdf(2.44) Compute the probability that a random variable X, from the standard Gaussian (Normal) distribution, is less than or equal to 10.0 and greater than or equal to 2.0. The result should be 0.0227501 [i.e. Probability(2.0 <= X <= 10.0)] result = gauss_pdf(10.0) - gauss_pdf(2.0) Compute the probability that a random variable X, from the Gaussian (Normal) distribution with a mean of 0.8 and a variance of 4.0, is less than or equal to 2.44. The result should be 0.793892 result = gauss_pdf( (2.44 - 0.80)/sqrt(4.0) ) PROCEDURE: GAUSS_PDF calls GAUSSINT() to evaluate the Gaussian integral. This function was included to provide consistency with the other probability functions: CHISQR_PDF(), F_PDF(), and T_PDF(). REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Written by: GGS, RSI, July 1994
(See C:\RSI\IDL52\lib\gauss_pdf.pro)
NAME: GEAR PURPOSE: Graphically display how the front and rear gears of a bike interact by calculating the "inches of chain" for each combination. Inches of chain (as used here) is calculated as: IOC = (# chainring teeth)/(# freewheel teeth) * 27 The 27 is for a 27" wheel, but 27 is generally used for all wheels. Inches of chain is a relative measure, so the difference is not important. Also 700C wheels are pretty close to 27" anyway. CATEGORY: ?? - Misc. CALLING SEQUENCE: GEAR, Front, Rear INPUTS: Front: A scalar, or vector. Each element contains the number of teeth on one of the chainrings, in increasing order (e.g. [36, 42, 52]). Rear: A vector. Each element contains the number of teeth on one of the freewheel cluster, in increasing order (e.g. [13, 15, 17, 19, 21, 24]). of the front chainring. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: GEAR produces two side-by-side plots. The first shows the inches of chain as a function of the freewheel gear while holding the chainring size constant. The second shows how the front and rear gears must be switched to move through the possible settings in a monotonic way. This plot allows you to see duplications in gear combinations. RESTRICTIONS: This routine can't handle a single gear setup, but it would be meaningless anyway. MODIFICATION HISTORY: 23, June, 1988, Written by AB, RSI.
(See C:\RSI\IDL52\examples\misc\gear.pro)
NAME: GETHELP PURPOSE: This function is used to get information on variables in the routine that called this function. The function builts a string array that contains information that follows the format that is used by the IDL HELP command. CATEGORY: Help CALLING SEQUENCE: Result = GetHelp([Vname]) INPUTS: Vname: Optional parameter that contains the name of a variable the user wants information about. KEYWORD PARAMETERS: ONELINE: If a variable name is greater than 15 charaters it is usally returned as 2 two elements of the output array (Variable name in 1st element, variable info in the 2nd element). Setting this keyword will put all the information in one string, seperating the name and data with a space. FULLSTRING: Normally a string that is longer than 45 chars is truncated and followed by "..." just like the HELP command. Setting this keyword will cause the full string to be returned. PROCEDURES: Setting this keyword will cause the function to return all current IDL compiled procedures. FUNCTIONS: Setting this keyword will cause the function to return all current IDL compiled functions. SYS_PROCS: Setting this keyword will cause the function to return the names of all IDL system (built-in) procedures. SYS_FUNCS: Setting this keyword will cause the function to return the names of all IDL system (built-in) functions. OUTPUTS: This function returns a string array that normally contains variable data that is in the same format as used by the IDL HELP procedure. The variables in this list are for the routine that called GetHelp(). If other info is requested via keywords, this data is returned. Upon an error or if no data is found the function returns an Null ('') string. COMMON BLOCKS: None SIDE EFFECTS: None RESTRICTIONS: Due to the diffuculties in determining if a variable is of type associate, the following conditions will result in the variable being listed as a structure. These conditions are: o Associate record type is structure. o Associated file is opened for update (openu). o Associate file is not empty. Another difference between this routine and the IDL help command is that if a variable is in a common block, the common block name is not listed next to the variable name. Currently there is no method available to get the common block names used in a routine. PROCEDURE: This function uses the IDL routine Routine_Names() to get the names and values of the variables contained in the calling routine. These values are then placed in a string array using the format of the IDL HELP command. If there are no variables in the calling routine, a null ('') scalar string is returned. EXAMPLE: To obtain a listing in a help "format" of the variables contained in the current routine you would make the following call: HelpData = GetHelp() The variable HelpData would be a string array containing the requested information. MODIFICATION HISTORY: Initial Coding April 1994 - KDB
(See C:\RSI\IDL52\lib\obsolete\gethelp.pro)
NAME: GET_BOUNDS PURPOSE: This procedure fills in the xrange, yrange, and zrange vectors that represent the overall data ranges of the objects within the given tree. CATEGORY: Object graphics. CALLING SEQUENCE: GET_BOUNDS, oObj, xrange, yrange, zrange INPUTS: oObj - An instance of an IDLgrModel or IDLgrGraphic. The bounds to be computed will include this object plus all of its children. OUTPUTS: xrange: A two-element vector, [xmin, xmax], representing the overall range of the X data values of the objects in the tree. yrange: A two-element vector, [ymin, ymax], representing the overall range of the Y data values of the objects in the tree. zrange: A two-element vector, [zmin, zmax], representing the overall range of the Z data values of the objects in the tree. MODIFICATION HISTORY: Written by: DD, February 1997. RJF, Jan 1998. Included Paul Nash's patch to avoid an improper call to GetCTM()
(See C:\RSI\IDL52\examples\object\get_bounds.pro)
FILE: get_screen_size.pro PURPOSE: This application retrieves the screen size for the current (or specified) display. CATEGORY: Graphics CONTENTS: fun get_screen_size - retrieves the screen size NAMED STRUCTURES: none. COMMON BLOCKS: none. MODIFICATION HISTORY: 10/96 DD - Original. 01/97 DD - Use an unmapped widget draw rather than a pixmap window because in some (rare) cases on certain X window configurations, a GL pixmap context cannot be supported.
(See C:\RSI\IDL52\lib\get_screen_size.pro)
NAME: GOODFIT PURPOSE: Test that a set of data has a given distibution. User can select built-in distribution through the keyword DISTR or supply own expected values. CATEGORY: Statistics. CALLING SEQUENCE: GOODFIT, Freq, [A, B, ChiSqr, Prob, DF, DISTR=D] INPUTS: Freq: Vector of value or range frequencies. OPTIONAL INPUTS: A: Vector of observed values or left endpoints for interval data. Should have same length as F. A must be present if user selects built-in distributions. B: Vector of right hand endpoints. OPTIONAL OUTPUT PARAMETERS: ChiSqr: The chi square statistic to test for the goodness of fit of the data to the distribution. Prob: The probability of ChiSqr or somethinG larger from a chi square distribution. DF: Degrees of freedom. User must specify chi square degrees of freedom for user supplied distribution. Compute DF to be s-1-t, where s = N_Elements(A) and t is the number of parameters that must be estimated to derive expected frequencies. KEYWORDS: Distr: the type of distribution for which the data is to be tested. If Distr = "G", then GOODFIT tests for a Gaussian distribution. To supply distribution, set Distr to the vector of expected frequencies, say, EF. EF(i) = the frequency expected for the observation with observed frequency Freq(i). RESTRICTIONS: None. COMMON BLOCKS: None. SIDE EFFECT: None. PROCEDURE: Compute expected frequencies EXP(i). Chi_Sqr = SUM((Freq(i)-ExpV(i))^2/ExpV(i)^2) has the chi sqr distribution.
(See C:\RSI\IDL52\lib\obsolete\goodfit.pro)
NAME: GRAPHICS_TIMES PURPOSE: This is a wrapper on the procedure GRAPHICS_TIMES_INTERNAL contained in the file time_test.pro. Please see that file for further information. The reason for doing it this way is so that the various time_test and graphics_test routines can stay in a single file while still being easily callable.
(See C:\RSI\IDL52\lib\graphics_times.pro)
NAME: GRAPHICS_TIMES2 PURPOSE: This is a wrapper on the procedure GRAPHICS_TIMES2_INTERNAL contained in the file time_test.pro. Please see that file for further information. The reason for doing it this way is so that the various time_test and graphics_test routines can stay in a single file while still being easily callable.
(See C:\RSI\IDL52\lib\graphics_times2.pro)
NAME: GRAPHICS_TIMES3 PURPOSE: This is a wrapper on the procedure GRAPHICS_TIMES3_INTERNAL contained in the file time_test.pro. Please see that file for further information. The reason for doing it this way is so that the various time_test and graphics_test routines can stay in a single file while still being easily callable.
(See C:\RSI\IDL52\lib\graphics_times3.pro)
NAME: GS_ITER PURPOSE: This function solves an n by n linear system of equations using Gauss-Seidel iteration. CATEGORY: Linear Algebra. CALLING SEQUENCE: Result = GS_ITER(A, B) INPUTS: A: An N by N array of type: int, float, or double. B: An N-element vector of type: int, float, or double. KEYWORD PARAMETERS: CHECK: An integer value of 0 or 1 that denies or requests checking A for a diagonally dominant form. CHECK = 0 (the default) results in no checking. CHECK = 1 Checks A and reports if it does not meet the required condition. This is just a warning. The algorithm will proceed on the chance it may converge. LAMBDA: A scalar value in the range: [0.0, 2.0] This value determines the amount of 'RELAXATION'. Relaxation is a weighting technique that is used to enhance convergence. 1) LAMBDA = 1.0 (the default) no weighting. 2) A value in the range 0.0 <= LAMBDA < 1.0 improves convergence in oscillatory and non-convergent systems. 3) A value in the range 1.0 < LAMBDA <= 2.0 improves convergence in systems known to converge. MAX_ITER: The maximum number of iterations allowable for the algorithm to converge to the solution. The default is 30 iterations. X_0: An N-element vector that provides the algorithm's starting point. The default is [1.0, 1.0, ... , 1.0]. TOL: The relative error tolerance between current and past iterates calculated as: ABS( (current-past)/current ) The default is 1.0e-4. SIDE EFFECTS: Upon output A and B are divided by the diagonal elements of A. Integer inputs are converted to floats. Note: These SIDE EFFECTS have been removed for IDL v5.0. RESTRICTIONS: The equations must be entered in a DIAGONALLY DOMINANT form to guarantee convergence. A system is diagonally dominant if it satisfies the condition: abs(A(row,row)) > SUM(abs(A(row,col))) where SUM runs col=1,N excluding col = row and A is in row major. This restriction on A is known as a sufficient condition. That is, it is sometimes possible for the algorithm to converge without the condition being satisfied. But, convergence is guaranteed if the condition is satisfied. EXAMPLE: Define an array (a) in a non-diagonally dominant form. a = [[ 1.0, 7.0, -4.0], $ [ 4.0, -4.0, 9.0], $ [12.0, -1.0, 3.0]] And right-side vector (b). b = [12.0, 2.0, -9.0] Compute the solution of the system, ax = b. result = gs_iter(a, b) Note: This example fails to converge, because A is not in diagonally dominant form. Reorder the array given above into diagonally dominant form. a = [[12.0, -1.0, 3.0], $ [ 1.0, 7.0, -4.0], $ [ 4.0, -4.0, 9.0]] Make corresponding changes in the ordering of b. b = [-9.0, 12.0, 2.0] Compute the solution of the system, ax = b. result = gs_iter(a, b) PROCEDURE: GS_ITER.PRO implements the Gauss-Seidel iterative method with over- and under- relaxation to enhance convergence. REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Written by: GGS, RSI, April 1993 Modified: GGS, RSI, February 1994 1) Format keyword is no longer supported. The matrix should be supplied in a row major format. 2) The input/output parameter X has been removed. The algorithm's initial starting point is an n-element vector of 1s. The keyword X_0 has been added to override the default. 3) GS_ITER is now called as a function, x = gs_iter( ). Modified: GGS, RSI, April 1996 The input arguments are no longer overwritten. Added DOUBLE keyword. Modified keyword checking and use of double precision. Modified: S. Lett, RSI, March 1998 Modified stopping criteria. Tol is used as an absolute tolerance when the iterates are very near zero.
(See C:\RSI\IDL52\lib\gs_iter.pro)
NAME: HANNING PURPOSE: Window function for Fourier Transform filtering. May be used for both the Hanning and Hamming windows. CATEGORY: Signal, image processing. CALLING SEQUENCE: Result = HANNING(N1) ;For 1 dimension. Result = HANNING(N1, N2) ;For 2 dimensions. INPUTS: N1: The number of columns of the result. N2: The number of rows of the result. Keyword Parameters: Alpha = width parameter of generalized Hamming window. Alpha must be in the range of 0.5 to 1.0. If Alpha = 0.5, the default, the function is called the "Hanning" window. If Alpha = 0.54, the result is called the "Hamming" window. OUTPUTS: Result(i) = 1/2 [1 - COS(2 PI i / (N-1)] For two dimensions, the result is the same except that "i" is replaced with "i*j", where i and j are the row and column subscripts. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Straightforward. MODIFICATION HISTORY: DMS, May, 1987. DMS, Jan, 1994. Added generalized width parameter.
(See C:\RSI\IDL52\lib\hanning.pro)
NAME: HDF_EXISTS PURPOSE: Test for the existence of the HDF library CATEGORY: File Formats CALLING SEQUENCE: Result = HDF_EXISTS() INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: Returns TRUE (1) if the HDF data format library is supported. Returns FALSE(0) if it is not. EXAMPLE: IF hdf_exists() EQ 0 THEN Fail,"HDF not supported on this machine" MODIFICATION HISTORY Written by: Joshua Goldstein, 12/21/92 Modified by: Steve Penton, 12/27/95
(See C:\RSI\IDL52\lib\hdf_exists.pro)
NAME: HELPFILES PURPOSE: HELPFILES prints useful information about the currently open files. This procedure was built-in under version 1 VMS IDL, and is provided in this form to help users of that version adapt to version 2. CALLING SEQUENCE: HELPFILES INPUT: None. OUTPUT: Information about open files is printed. RESTRICTIONS: None. REVISION HISTORY: 10 January 1990
(See C:\RSI\IDL52\lib\obsolete\helpfiles.pro)
NAME: HELPSY PURPOSE: HELPSY prints the values of all of the system variables. This procedure was built-in under version 1 VMS IDL, and is provided in this form to help users of that version adapt to version 2. CALLING SEQUENCE: HELPSY INPUT: None. OUTPUT: The the values of all of the system variables are printed. RESTRICTIONS: None. REVISION HISTORY: 10 January 1990
(See C:\RSI\IDL52\lib\obsolete\helpsy.pro)
NAME: HELP_VM PURPOSE: HELP_VM prints the amount of virtual memory currently allocated. This procedure was built-in under version 1 VMS IDL, and is provided in this form to help users of that version adapt to version 2. CALLING SEQUENCE: HELP_VM INPUT: None. OUTPUT: Information about current memory usage is printed. RESTRICTIONS: None. REVISION HISTORY: 10 January 1990
(See C:\RSI\IDL52\lib\obsolete\help_vm.pro)
NAME: HILBERT PURPOSE: Return a series that has all periodic terms shifted by 90 degrees. CATEGORY: G2 - Correlation and regression analysis A1 - Real arithmetic, number theory. CALLING SEQUENCE: Result = HILBERT(X [, D]) INPUT: X: A floating- or complex-valued vector containing any number of elements. OPTIONAL INPUT: D: A flag for rotation direction. Set D to +1 for a positive rotation. Set D to -1 for a negative rotation. If D is not provided, a positive rotation results. OUTPUTS: Returns the Hilbert transform of the data vector, X. The output is a complex-valued vector with the same size as the input vector. COMMON BLOCKS: None. SIDE EFFECTS: HILBERT uses FFT() so this procedure exhibits the same side effects with respect to input arguments as that function. PROCEDURE: A Hilbert transform is a series that has had all periodic components phase-shifted by 90 degrees. It has the interesting property that the correlation between a series and its own Hilbert transform is mathematically zero. The method consists of generating the fast Fourier transform using the FFT() function and shifting the first half of the transform products by +90 degrees and the second half by -90 degrees. The constant elements in the transform are not changed. Angle shifting is accomplished by multiplying or dividing by the complex number, I=(0.0000, 1.0000). The shifted vector is then submitted to FFT() for transformation back to the "time" domain and the output is divided by the number elements in the vector to correct for multiplication effect peculiar to the FFT algorithm. REVISION HISTORY: JUNE, 1985, Written, Leonard Kramer, IPST (U. of Maryland) on site contractor to NASA(Goddard Sp. Flgt. Cntr.)
(See C:\RSI\IDL52\lib\hilbert.pro)
NAME: HIST_2D PURPOSE: Return the density function (histogram) of two variables. CATEGORY: Image processing, statistics, probability. CALLING SEQUENCE: Result = hist_2d(V1, V2) INPUTS: V1 and V2 = arrays containing the variables. May be any non-complex numeric type. Keyword Inputs: MIN1: MIN1 is the minimum V1 value to consider. If this keyword is not specified, then it is set to 0. MIN2: MIN2 is the minimum V2 value to consider. If this keyword is not specified, then it is set to 0. MAX1: MAX1 is the maximum V1 value to consider. If this keyword is not specified, then V1 is searched for its largest value. MAX2 MAX2 is the maximum V2 value to consider. If this keyword is not specified, then V2 is searched for its largest value. BIN1 The size of each bin in the V1 direction (column width). If this keyword is not specified, the size is set to 1. BIN2 The size of each bin in the V2 direction (row height). If this keyword is not specified, the size is set to 1. OUTPUTS: The two dimensional density function of the two variables, a longword array of dimensions (m1, m2), where: m1 = Floor((max1-min1)/bin1) + 1 and m2 = Floor((max2-min2)/bin2) + 1 and Result(i,j) is equal to the number of sumultaneous occurences of an element of V1 falling in the ith bin, with the same element of V2 falling in the jth bin, where: i = (v1 < max1 - min1 > 0) / b1 and j = (v2 < max2 - min2 > 0) / b2 Note: elements larger than the max or smaller than the min are truncated to the max and min, respectively. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Not usable with complex or string data. PROCEDURE: Creates a combines array from the two variables, equal to the linear subscript in the resulting 2D histogram, then applies the standard histogram function. EXAMPLE: Return the 2D histogram of two byte images: R = HIST_2D(image1, image2) Return the 2D histogram made from two floating point images with range of -1 to +1, and with 101 (= 2/.02 + 1) bins: R = HIST_2D(f1, f2, MIN1=-1, MIN2=-1, MAX1=1, MAX2=1, $ BIN1=.02, BIN2=.02) MODIFICATION HISTORY: Written by: DMS, Sept, 1992 Written DMS, Oct, 1995 Added MIN, MAX, BIN keywords following suggestion of Kevin Trupie, GSC, NASA/GSFC.
(See C:\RSI\IDL52\lib\hist_2d.pro)
NAME: HIST_EQUAL PURPOSE: Return a histogram-equalized image or vector. CATEGORY: Z1 - Image processing, spatially invariant. CALLING SEQUENCE: Result = HIST_EQUAL(A [, MINV = minv] [, MAXV = maxv]) INPUTS: A: The array to be histogram-equalized. KEYWORD PARAMETERS: BINSIZE: Size of bin to use. If this keyword is omitted, the value 1 is used. Ignored for byte type data. Default = approx 5000 bins for floating or double data. For integer data default is the smaller of the data range and 5000. HISTOGRAM_ONLY: If set, return the cumulative distribution histogram, rather than the histogram equalized array. MAXV, MINV, and BINSIZE will be set, describing the scaling of the histogram, if not specified. MAXV: The maximum value to consider. If this keyword is omitted, the maximum element is used. Input elements greater than or equal to MAXV are output as 255. MINV: The minimum value to consider. If this keyword is omitted, the minimum is computed. Input elements less than or equal to MINV are output as zero. TOP: The maximum value to scale the output array. If this keyword is omitted, 255 is used. OUTPUTS: A histogram-equalized byte array is returned. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: The output array is always of byte type and is scaled from 0 to TOP. Floating-point arrays should not have small ranges, (e.g., less than around 255) unless a binsize is specified. PROCEDURE: The HISTOGRAM function is used to obtain the density distribution of the input array. The histogram is integrated to obtain the cumulative density-propability function and finally the lookup function is used to transform to the output image. The first element of the histogram is always zeroed, to remove the background. EXAMPLE: Create a sample image using the IDL DIST function and display it by entering: IMAGE = DIST(100) TV, DIST Create a histogram-equalized version of the byte array, IMAGE, and display the new version. Use a minumum input value of 10, a maximum input value of 200, and limit the top value of the output array to 220. Enter: NEW = HIST_EQUAL(IMAGE, MINV = 10, MAXV = 200, TOP = 220) TV, NEW MODIFICATION HISTORY: August, 1982. Written by DMS, RSI. Feb, 1988, Revised for Sun, DMS. Dec, 1994. DMS. Improved handling offloating/double images with large or small ranges. Default value for MINV is computed, rather than set to 0. Oct, 1996. DMS. Made the handling of MIN=, and MAX= consistent for all data types.
(See C:\RSI\IDL52\lib\hist_equal.pro)
NAME: HLS PURPOSE: Make a color table based on the HLS (Hue, Lightness, Saturation) color system. CATEGORY: Z4 - Image processing, color table manipulation CALLING SEQUENCE: HLS, Litlo, Lithi, Satlo, Sathi, Hue, Loops [, Colr] INPUTS: Litlo: Starting lightness, from 0 to 100%. Lithi: Ending lightness, from 0 to 100%. Satlo: Starting saturation, from 0 to 100%. Sathi: Ending stauration, from 0 to 100%. Hue: Starting Hue, from 0 to 360 degrees. Red = 0 degs, green = 120, blue = 240. Loops: The number of loops through the color spiral. This parameter does not have to be an integer. A negative value causes the loops to traverse the spiral in the opposite direction. OUTPUTS: No required outputs. OPTIONAL OUTPUT PARAMETERS: Colr: A (256,3) integer array containing the R, G, and B values that were loaded into the color tables. Red = colr(*,0), green = colr(*,1), blue = colr(*,2). COMMON BLOCKS: COLORS: Contains the red, green, and blue vectors on exit. SIDE EFFECTS: The color tables are loaded. RESTRICTIONS: None. PROCEDURE: Adapted from program on page 619, Fundamentals of Interactive Computer Graphics, Foley and Van Dam. Using the input parameters, a spiral through the double- ended HLS cone is traced. Points along the cone are converted from HLS to RGB. MODIFICATION HISTORY: Written, DMS, Jan, 1983. Changed common block, dms, 4/1987.
(See C:\RSI\IDL52\lib\hls.pro)
NAME: HSV PURPOSE: Make a color table based on the HSV (Hue, Saturation, and Value) color system. CATEGORY: Z4 - Image processing, color table manipulation CALLING SEQUENCE: HLS, Vlo, Vhi, Satlo, Sathi, Hue, Loops [, Colr] INPUTS: Vlo: Starting value, from 0 to 100%. Vhi: Ending value, from 0 to 100%. Satlo: Starting saturation, from 0 to 100%. Sathi: Ending saturation, from 0 to 100%. Hue: Starting Hue, from 0 to 360 degrees. Red = 0 degs, green = 120, blue = 240. Loops: The number of loops through the color spiral. This parameter does not have to be an integer. A negative value causes the loops to traverse the spiral in the opposite direction. OUTPUTS: No required outputs. OPTIONAL OUTPUT PARAMETERS: Colr: A (256,3) integer array containing the R, G, and B values that were loaded into the color tables. Red = colr(*, 0), green = colr(*, 1), blue = colr(*, 2). COMMON BLOCKS: COLORS: Contains the red, green and blue color vectors on exit. SIDE EFFECTS: The color tables are loaded. RESTRICTIONS: None. PROCEDURE: Adapted from a program on page 616, Fundamentals of Interactive Computer Graphics, Foley and Van Dam. Using the input parameters, a spiral through the single-ended HSV cone is traced. Points along the cone are converted from HLS to RGB. MODIFICATION HISTORY: Written, DMS, Jan, 1983. Added common block COLORS, DMS, Dec, 1983 and Apr, 1987.
(See C:\RSI\IDL52\lib\hsv.pro)
NAME: HSV_TO_RGB PURPOSE: Convert from the HSV (Hue, Saturation, Value) color system to the RGB (Red, Green, Blue) color system. CATEGORY: Graphics, color systems. CALLING SEQUENCE: HSV_TO_RGB, H, S, V, Red, Green, Blue INPUTS: H: The hue variable. This value may be either vector or scalar. Values for hue range from 0 to 360. H is 0 if S (saturation) is 0.0. S: The saturation variable. This variable should be the same size as H. Valid values range from 0 to 1. V: The value variable. This variable should be the same size as H. Valid values range from 0 to 1. KEYWORD PARAMETERS: None. OUTPUTS: Red: The returned red color value(s). This returned variable has the same size as H. RGB values are short integers in the range 0 to 255. Green: The green color value(s). Blue: The blue color value(s). COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: H must be in the range 0 to 360. S and V must be in the range 0 to 1.0. PROCEDURE: Taken from Foley & Van Dam, Fundamentals of Interactive Computer Graphics, 1982, page 616. MODIFICATION HISTORY: DMS, Aug, 1989.
(See C:\RSI\IDL52\lib\obsolete\hsv_to_rgb.pro)
NAME: H_EQ_CT PURPOSE: Histogram-equalize the color tables for an image or a region of the display. CATEGORY: Image processing. CALLING SEQUENCE: H_EQ_CT, Image ;To histogram equalize from an image. H_EQ_CT ;To histogram equalize from a region INPUTS: Image: Image whose histogram is to be used in determining the new color tables. If this value is omitted, the user is prompted to mark the diagonal corners of a region of the display. Image MUST be a byte image, scaled the same way as the image loaded to the display. OUTPUTS: No explicit outputs. The result is applied to the current color tables. COMMON BLOCKS: COLORS: The IDL color table common block. SIDE EFFECTS: The current color table is modified. RESTRICTIONS: If a parameter is supplied, it is assumed to be an image that was just displayed. PROCEDURE: Either the image parameter or the region of the display marked by the user is used to obtain a pixel-distribution histogram. The cumulative integral is taken and scaled. This function is applied to the current color tables. MODIFICATION HISTORY: DMS, March, 1988, written. DMS, May, 1990, added BOX_CURSOR. AB, 21 September 1992,renamed from HIST_EQUAL_CT to H_EQ_CT to avoid DOS filename limitations. HIST_EQUAL_CT is still available as a wrapper to this routine under operating systems that can handle longer file names.
(See C:\RSI\IDL52\lib\h_eq_ct.pro)
NAME: H_EQ_INT PURPOSE: Interactively histogram-equalize the color tables of an image or a region of the display. By moving the cursor across the screen, the amount of histogram equalization is varied. CATEGORY: Image processing. CALLING SEQUENCE: H_EQ_INT, Image ;To histogram equalize from an image. H_EQ_INT ;To histogram equalize from a region. INPUTS: Image: The image whose histogram is to be used in determining the new color tables. If this value is omitted, the user is prompted to mark the diagonal corners of a region of the display. Image MUST be a byte image, scaled the same way as the image loaded to the display. OUTPUTS: No explicit outputs. The result is applied to the current color tables. COMMON BLOCKS: COLORS: The IDL color table common block. SIDE EFFECTS: The current color table is modified. RESTRICTIONS: If a parameter is supplied, it is assumed to be an image that was just displayed. PROCEDURE: Either the image parameter or the region of the display marked by the user is used to obtain a pixel-distribution histogram. The cumulative integral is taken and scaled. This function is applied to the current color tables. A window is created and the histogram equalization function is plotted. A linear ramp is overplotted. Move the cursor from left to right to vary the amount of histogram equalization applied to the color tables from 0 to 100%. Press the right mouse button to exit. MODIFICATION HISTORY: DMS, November, 1989, written. AB, 21 September 1992,renamed from HIST_EQUAL_INT to H_EQ_INT to avoid DOS filename limitations. HIST_EQUAL_INT is still available as a wrapper to this routine under operating systems that can handle longer file names. JWG, 14 December 1992,routine did not restore font.
(See C:\RSI\IDL52\lib\h_eq_int.pro)
NAME: IBETA PURPOSE: This function computes the incomplete beta function, Ix(a, b). CATEGORY: Special Functions. CALLING SEQUENCE: Result = Ibeta(a, b, x) INPUTS: A: A positive scalar of type integer, float or double that specifies the parametric exponent of the integrand. B: A positive scalar of type integer, float or double that specifies the parametric exponent of the integrand. X: A scalar, in the interval [0, 1], of type integer, float or double that specifies the upper limit of integration. EXAMPLE: Compute the incomplete beta function for the corresponding elements of A, B, and X. Define the parametric exponents. A = [0.5, 0.5, 1.0, 5.0, 10.0, 20.0] B = [0.5, 0.5, 0.5, 5.0, 5.0, 10.0] Define the the upper limits of integration. X = [0.01, 0.1, 0.1, 0.5, 1.0, 0.8] Allocate an array to store the results. result = fltarr(n_elements(A)) Compute the incomplete beta functions. for k = 0, n_elements(A)-1 do $ result(k) = Ibeta(A(k), B(k), X(k)) The result should be: [0.0637686, 0.204833, 0.0513167, 0.500000, 1.00000, 0.950736] REFERENCE: Numerical Recipes, The Art of Scientific Computing (Second Edition) Cambridge University Press ISBN 0-521-43108-5 MODIFICATION HISTORY: Written by: GGS, RSI, September 1994 IBETA is based on the routines: betacf.c, betai.c and gammln.c described in section 6.2 of Numerical Recipes, The Art of Scientific Computing (Second Edition), and is used by permission.
(See C:\RSI\IDL52\lib\ibeta.pro)
NAME: IBETA_PDF PURPOSE: This function computes the incomplete beta function. It is called by the probability density functions in this directory. See the function IBETA() in the "math" subdirectory for the user-callable version of the incomplete beta function.
(See C:\RSI\IDL52\lib\ibeta_pdf.pro)
NAME: IDENTITY PURPOSE: This function returns an N by N identity array, an array with ones along the main diagonal and zeros elsewhere. CATEGORY: Linear Algebra. CALLING SEQUENCE: Result = IDENTITY(N) INPUTS: N: The desired column and row dimensions. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, a double precision identity array is returned. EXAMPLE: Define an array, A. A = [[ 2.0, 1.0, 1.0, 1.5], $ [ 4.0, -6.0, 0.0, 0.0], $ [-2.0, 7.0, 2.0, 2.5], $ [ 1.0, 0.5, 0.0, 5.0]] Compute the inverse of A using the INVERT function. Inverse = INVERT(A) Verify the accuracy of the computed inverse using the mathematical identity, A x A^-1 - I(4) = 0; where A^-1 is the inverse of A, I(4) is the 4 by 4 identity array and 0 is a 4 by 4 array of zeros. PRINT, A ## Inverse - IDENTITY(4) REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Written by: GGS, RSI, January 1996
(See C:\RSI\IDL52\lib\identity.pro)
NAME: IDLdemoClrTblFile PURPOSE: Color Table File class. Provide methods for easy access to info in color files such as colors1.tbl (the default). CATEGORY: IDL demonstration code. CALLING SEQUENCE: oClrTblFile = obj_new('IDLdemoClrTblFile') METHODS: GetNames (function) Reurns string array of color table names. Get (function) Given an index, returns a 256x3 byte array of rgb values. Count (function) Returns the number of colortables in file. RESTRICTIONS: +--------------------------------------------------------------+ |Please note: This file is demonstration code. RSI does not | |guarantee that programs written using this code will continue | |to work in future releases of IDL. RSI reserves the right | |to change this code or remove it from future versions of IDL. | +--------------------------------------------------------------+ MODIFICATION HISTORY: Written by: TB, 1998
(See C:\RSI\IDL52\examples\demo\demosrc\idldemoclrtblfile__define.pro)
NAME: IDLdemoMultiSlider PURPOSE: Define a WIDGET_SLIDER-like control using IDL object graphics. CATEGORY: IDL demonstration code. CALLING SEQUENCE: oMultiSlider = obj_new('IDLdemoMultiSlider') RESTRICTIONS: +--------------------------------------------------------------+ |Please note: This file is demonstration code. RSI does not | |guarantee that programs written using this code will continue | |to work in future releases of IDL. RSI reserves the right | |to change this code or remove it from future versions of IDL. | +--------------------------------------------------------------+ MODIFICATION HISTORY: Written by: TB, 1998
(See C:\RSI\IDL52\examples\demo\demosrc\idldemomultislider__define.pro)
NAME: IDLexModelManip PURPOSE: This object serves to simplify dynamic manipulation of the transformation matrix of an IDLgrModel object. CATEGORY: Object graphics examples. CALLING SEQUENCE: oMm = OBJ_NEW('IDLexModelManip') IDLexModelManip::MouseTrack, pos, oDest IDLexModelManip::MouseUp, pos, oDest IDLexModelManip::MouseDown, [event.x, event.y], oDest IDLexModelManip::SetTarget, oTarget, oDest, _extra=e IDLexModelManip::Undo -- undo manipulation IDLexModelManip::SetProperty IDLexModelManip::GetProperty TARGET - The IDLgrModel Object currently being manipulated (GET only) MODE - The manipulation mode (0=translation,1=rotation,2=scale) TWO_D - Set if the visuals should be 2D instead of 3D MANIP_SHOW_SEL - True if the selection visual is to be displayed MANIP_SHOW_MANIP - True if the manipulation visual is to be displayed TRANSLATE - Set to a 3 element binary vector. Element is true if translation along that axis is to be allowed. Axes are with respect to self's orientation. Note: the default is no translation, i.e [0b,0b,0b]. Set or initialize this property to a value other than the default to allow translation. CONSTRAIN_REF_PT - Reference point for constrained translation CONSTRAIN_TRANS - True if constrained translation is in effect CONSTRAIN_XRANGE - Limits of translation in X [min,max] CONSTRAIN_YRANGE - Limits of translation in Y [min,max] CONSTRAIN_ZRANGE - Limits of translation in Z [min,max] KEYWORD PARAMETERS: IDLexModelManip::Init: MODIFICATION HISTORY: Written by: RJF, Nov 1996
(See C:\RSI\IDL52\examples\object\idlexmodelmanip__define.pro)
NAME: IDLexPalImage PURPOSE: This object subclasses the IDLgrImage object to allow for 16bit (or deeper) paletted image support. This allows the user to use images with a dynamic range greater than 8bits. The basic idea is that the object contains a 2D array and a palette of any length. The palette can be 1xn, 2xn, 3xn or 4xn for GS, GSA RGB or RGBA images. The 2D array is mapped through the palette into an RGBA image and then sent to the superclass for display. Values in the input image outside the range of the palette are clamped to the end values of the palette. CATEGORY: Object graphics examples. CALLING SEQUENCE: oObj = OBJ_NEW('IDLexPalImage') KEYWORD PARAMETERS: MODIFICATION HISTORY: Written by: RJF, Jun 1998
(See C:\RSI\IDL52\examples\object\idlexpalimage__define.pro)
NAME: IDLexRotator PURPOSE: Provide a type of IDLgrModel that can rotate itself using methods very similar to an IDL Trackball object. Also, provide a way to constrain rotations with respect to self's orientation (CONSTRAIN=2). CATEGORY: IDL object examples. CREATION: oRotatorModel = OBJ_NEW('IDLdsRotatorModel', Center, Radius) METHODS: The methods for IDLgrRotatorModel are the same as those of IDL's Trackball and IDLgrModel classes, with the following exceptions: INIT: Requires Center and Radius arguments. Keyword TRANSLATE not accepted. Keyword CONSTRAIN: If this keyword is set to 2, constrain with respect to self's orientation (rather than screen orientation). Note: Rotations specified via the ROTATE method are not subject to constraints. RESET: Keyword TRANSLATE not accepted. Keyword PRESERVE_ROTATION added. When this keyword is set, RESET will not change self's current TRANSFORM property. SCALE: Not accepted. Error thrown at run-time. TRANSLATE: Not accepted. Error thrown at run time. UPDATE: Keyword TRANSLATE not accepted. Keyword TRANSFORM not accepted. SETPROPERTY: Keyword TRANSFORM: Matrix must be a valid 4x4 rotation matrix, Keyword CENTER added. Sets Trackball center. Keyword RADIUS added. Sets Trackball radius. Keyword AXIS added. Sets Trackball axis for constraints. 0=constrain to X, 1=y, 2=z Keyword CONSTRAIN added. Sets Trackball rotation constraint. 0=none. 2=constrain to AXIS in Model orientation. else: constrain to AXIS in screen orientation. Keyword MOUSE added. Sets Trackball MOUSE property. GETPROPERTY: Keyword CENTER added. Gets Trackball center. Keyword RADIUS added. Gets Trackball radius. Keyword AXIS added. Gets Trackball axis for constraints. 0=constrain to X, 1=y, 2=z Keyword CONSTRAIN added. Gets Trackball rotation constraint. 0=none. 2=constrain to AXIS in Model orientation. else: constrain to AXIS in screen orientation. Keyword MOUSE added. Gets Trackball MOUSE property. EXAMPLE: pro example_event, event widget_control, event.top, get_uvalue=pState if (*pState).oRotator->Update(event) then $ (*pState).oWindow->Draw, (*pState).oView end ; pro example_cleanup, wid widget_control, wid, get_uvalue=pState obj_destroy, (*pState).oWindow obj_destroy, (*pState).oView ptr_free, pState end ; pro example tlb = widget_base() xsize = 300 ysize = 300 wDraw = widget_draw( $ tlb, $ xsize=xsize, $ ysize=ysize, $ graphics_level=2, $ /button_events, $ /motion_events $ ) widget_control, tlb, /realize widget_control, wDraw, get_value=oWindow oModel = obj_new('IDLgrModel') oModel->Add, obj_new('IDLgrSurface', dist(50)) oModel->Scale, 1./50, 1./50, 1./50 oModel->Translate, -.5, -.5, -.25 oRotator = obj_new('IDLpdRotator', $ [xsize/2.,ysize/2.], $ xsize/2. $ ) oRotator->Add, oModel oView = obj_new('IDLgrView') oView->Add, oRotator oWindow->Draw, oView widget_control, tlb, set_uvalue=ptr_new({ $ oRotator: oRotator, $ oWindow: oWindow, $ oView: oView $ }) xmanager, 'example', tlb, cleanup='example_cleanup', /no_block end MODIFICATION HISTORY: Written by PCS, RSI, 7/1998 unction IDLexRotator__matrix, q Given a unit quaternion, q, return its 4x4 rotation matrix. = q[0] = q[1] = q[2] = q[3] = transpose([[ w^2+x^2-y^2-z^2, 2*(x*y+w*z), 2*(x*z-w*y), 0], $ [ 2*(x*y-w*z), w^2-x^2+y^2-z^2, 2*(y*z+w*x), 0], $ [ 2*(x*z+w*y), 2*(y*z-w*x), w^2-x^2-y^2+z^2, 0], $ [ 0, 0, 0 ,1]]) eturn, a nd
(See C:\RSI\IDL52\examples\object\idlexrotator__define.pro)
NAME: IDLexShow3 PURPOSE: This object subclasses from the IDLgrModel object to combine an image, surface mesh, and contour plot representation of a given two-dimensional data set into a single entity. CATEGORY: Object Graphics examples. CALLING SEQUENCE: oObj = OBJ_NEW('IDLexShow3'[, Data] ) KEYWORD PARAMETERS: DATA - Set this keyword to a two-dimensional array of values to be displayed as an image, surface mesh, and contour. NO_COPY - Set this keyword to a nonzero value to indicate that the value data may be taken away from the variable passed in via the DATA keyword and attached directly to the IDLexShow3 object's data heap variable. MODIFICATION HISTORY: Written by: DLD, Jul 1998
(See C:\RSI\IDL52\examples\object\idlexshow3__define.pro)
NAME: IDLexViewManip PURPOSE: This object serves to simplify dynamic manipulation of the position and size of an IDLgrView object within a destination object. CATEGORY: Object graphics examples. CALLING SEQUENCE: oVm = OBJ_NEW('IDLexViewManip') IDLexViewManip::SetProperty IDLexViewManip::GetProperty IDLexViewManip::MouseUp, mouseXY, oDest IDLexViewManip::MouseTrack, mouseXY, oDest IDLexViewManip::MouseDown, mouseXY, oDest IDLexViewManip::Reshape IDLexViewManip::SetTarget, oView, oDest KEYWORD PARAMETERS: IDLexViewManip::Init: MODIFICATION HISTORY: Written by: RJF, Nov 1996
(See C:\RSI\IDL52\examples\object\idlexviewmanip__define.pro)
CLASS_NAME: IDLgrColorbar PURPOSE: An IDLgrColorbar object consists of a color-ramp with an optional framing box and annotation axis. CATEGORY: Graphics SUPERCLASSES: This class inherits from IDLgrModel. SUBCLASSES: This class has no subclasses. CREATION: See IDLgrColorbar::Init METHODS: Intrinsic Methods This class has the following methods: IDLgrColorbar::Cleanup IDLgrColorbar::Init IDLgrColorbar::GetProperty IDLgrColorbar::SetProperty MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/22/97
(See C:\RSI\IDL52\lib\idlgrcolorbar__define.pro)
============================================================= METHODNAME: IDLgrColorbar::Init PURPOSE: The IDLgrColorbar::Init function method initializes the colorbar object. NOTE: Init methods are special lifecycle methods, and as such cannot be called outside the context of object creation. This means that in most cases, you cannot call the Init method directly. There is one exception to this rule: If you write your own subclass of this class, you can call the Init method from within the Init method of the subclass. CALLING SEQUENCE: oColorbar = OBJ_NEW('IDLgrColorbar' [,aRed, aGreen, aBlue]) or Result = oColorbar->[IDLgrColorbar::]Init([aRed, aGreen, aBlue]) OPTIONAL INPUTS: aRed: A vector containing the red values for the colorbar. These values should be within the range of 0 <= Value <= 255. The number of elements comprising the aRed vector must not exceed 256. aGeeen: A vector containing the green values for the colorbar. These values should be within the range of 0 <= Value <= 255. The number of elements comprising the aGreen vector must not exceed 256. aBlue: A vector containing the blue values for the colorbar. These values should be within the range of 0 <= Value <= 255. The number of elements comprising the aBlue vector must not exceed 256. If no data is provided, the color palette will default to a 256 entry greyscale ramp. KEYWORD PARAMETERS: BLUE_VALUES(Get,Set): A vector containing the blue values for the colorbar. Setting this value is the same as specifying the aBlue argument to the IDLgrColorbar::Init method. COLOR(Get,Set): Set this keyword to the color to be used as the foreground color for the axis and outline box. The color may be specified as a color lookup table index or as an RGB vector. The default is [0,0,0]. DIMENSIONS(Get,Set): Set this keyword to a two element vector [dx,dy] which specifies the size of the ramp display (not the axis) in units. If dx > dy, the colorbar is drawn horizontally with the axis placed below or above the ramp box depending on the value of the SHOW_AXIS property. If dx < dy, the colorbar is drawn vertically with the axis placed to the right or left of the ramp box depending on the value of the SHOW_AXIS property. The default value is [16,256]. GREEN_VALUES(Get,Set): A vector containing the green values for the colorbar. Setting this value is the same as specifying the aGreen argument to the IDLgrColorbar::Init method. HIDE(Get,Set): Set this keyword to a boolean value to indicate whether this object should be drawn. 0=Draw (default), 1 = Hide. MAJOR(Get,Set): Set this keyword to an integer representing the number of major tick marks. The default is -1, specifying that IDL will compute the number of tick marks. Setting MAJOR equal to zero suppresses major tick marks entirely. MINOR(Get,Set): Set this keyword to an integer representing the number of minor tick marks. The default is -1, specifying that IDL will compute the number of tick marks. Setting MINOR equal to zero suppresses minor tick marks entirely. NAME(Get,Set): Set this keyword to a string representing the name to be associated with this object. The default is the null string, ''. PALETTE(Get,Set): Set this keyword to an IDLgrPalette object to define the color table for the colorbar. RED_VALUES(Get,Set): A vector containing the red values for the colorbar. Setting this value is the same as specifying the aRed argument to the IDLgrColorbar::Init method. SHOW_AXIS(Get,Set): Set this keyword to an integer value indicating whether the axis should be drawn. 0 = Do not display axis (the default). 1 = Display axis on left side or below the color ramp. 2 = Display axis on right side or above the color ramp. SHOW_OUTLINE(Get,Set): Set this keyword to a boolean value indicating whether the colorbar bounds should be outlined. 0 = Do not display outline (the default). 1 = Display outline. SUBTICKLEN(Get,Set): Set this keyword to a scale ratio specifying the length of minor tick marks relative to the length of major tick marks. The default is 0.5, specifying that the minor tick mark is one-half the length of the major tick mark. THICK(Get,Set): Set this keyword to an integer value between 1 and 10, specifying the line thickness used to draw the axis and outline box, in pixels. The default is 1. THREED(Get): Set this keyword to indicate that the colorbar image is to be implemented as a vertex colored surface to allow the colorbar to be viewed in a true 3 dimensional space. TICKFORMAT(Get,Set): Set this keyword to either a standard IDL format string or a string containing the name of a user supplied function that returns a string to be used to format the axis tick mark labels. The function should accept integer arguments for the direction of the axis, the index of the tick mark, and the value of the tick mark, and hsould return a string to be used as the tick mark's label. The default is '', the null string, which indicated that IDL will determine the appropriate format for each value. TICKFRMTDATA(Get,Set): Set this keyword to a value of any type. If present, this value is passed via the keyword DATA to any TICKFORMAT function the user may have set. TICKLEN(Get,Set): Set this keyword to the length of each major tick mark, measured in dimension units. The default tick mark length is 8. TICKTEXT(Get,Set): Set this keyword to either a single instance of the IDLgrText object class (with multiple strings) of to a vector of instances of the IDLgrText object class (one per major tick) to specify the annotations to be assigned to the tickmarks. By default, with TICKTEXT set equal to a null object, IDL computes the tick labels based on major tick values. The positions of the provided text objects may be overwritten; position is determined according to tick mark location. TICKVALUES(Get,Set): Set this keyword to a vector of data values representing the values at each tick mark. TITLE(Get,Set): Set this keyword to an instance of the IDLgrText object class to specify the title for the axis. The default is the null object, specifying that no title is drawn. The title will be centered along the axis, even if the text object itself has an associated location. UVALUE(Get,Set): Set this keyword to a value of any type. You may use this value to contain any information you wish. XCOORD_CONV(Get,Set): Set this keyword to a vector, [t,s], indicating the translation and scaling to be applied to convert the X coordinates to an alternate data space. The formula for the conversion is as follows: converted X = t+s*X. The default is [0,1]. YCOORD_CONV(Get,Set): Set this keyword to a vector, [t,s], indicating the translation and scaling to be applied to convert the Y coordinates to an alternate data space. The formula for the conversion is as follows: converted Y = t+s*Y. The default is [0,1]. ZCOORD_CONV(Get,Set): Set this keyword to a vector, [t,s], indicating the translation and scaling to be applied to convert the Z coordinates to an alternate data space. The formula for the conversion is as follows: converted Z = t+s*Z. The default is [0,1]. OUTPUTS: 1: successful, 0: unsuccessful. EXAMPLE: oColorbar = OBJ_NEW('IDLgrColorbar') MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/22/97 Scott J. Lasica, 5/8/98 - Added the THREED keyword. - Added the PALETTE keyword.
(See C:\RSI\IDL52\lib\idlgrcolorbar__define.pro)
============================================================= METHODNAME: IDLgrColorbar::ComputeDimensions PURPOSE: The IDLgrColorbar::ComputeDimensions method function computes and returns the dimensions of the colorbar for a given destination. CALLING SEQUENCE: Result = oColorbar->[IDLgrColorbar::]ComputeDimensions(SrcDest) MODIFICATION HISTORY: Written by: Scott J. Lasica, 3/5/98
(See C:\RSI\IDL52\lib\idlgrcolorbar__define.pro)
============================================================= METHODNAME: IDLgrColorbar::CalcSize PURPOSE: This method is intended to be private, and should never be called directly. MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/22/97
(See C:\RSI\IDL52\lib\idlgrcolorbar__define.pro)
============================================================= METHODNAME: IDLgrColorbar::Cleanup PURPOSE: The IDLgrColorbar::Cleanup procedure method preforms all cleanup on the object. NOTE: Cleanup methods are special lifecycle methods, and as such cannot be called outside the context of object destruction. This means that in most cases, you cannot call the Cleanup method directly. There is one exception to this rule: If you write your own subclass of this class, you can call the Cleanup method from within the Cleanup method of the subclass. CALLING SEQUENCE: OBJ_DESTROY, oColorbar or oColorbar->[IDLgrColorbar::]Cleanup INPUTS: There are no inputs for this method. KEYWORD PARAMETERS: There are no keywords for this method. MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/22/97
(See C:\RSI\IDL52\lib\idlgrcolorbar__define.pro)
============================================================= METHODNAME: IDLgrColorbar::SetProperty PURPOSE: The IDLgrColorbar::SetProperty procedure method sets the value of a property or group of properties for the colorbar. CALLING SEQUENCE: oColorbar->[IDLgrColorbar::]SetProperty INPUTS: There are no inputs for this method. KEYWORD PARAMETERS: Any keyword to IDLgrColorbar::Init followed by the word "Set" can be set using IDLgrColorbar::SetProperty. EXAMPLE: oColorbar->SetProperty, THICK = 1 MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/22/97
(See C:\RSI\IDL52\lib\idlgrcolorbar__define.pro)
============================================================= METHODNAME: IDLgrColorbar::GetProperty PURPOSE: The IDLgrColorbar::GetProperty procedure method retrieves the value of a property or group of properties for the colorbar. CALLING SEQUENCE: oColorbar->[IDLgrColorbar::]GetProperty INPUTS: There are no inputs for this method. KEYWORD PARAMETERS: Any keyword to IDLgrColorbar::Init followed by the word "Get" can be retrieved using IDLgrColorbar::GetProperty. In addition the following keywords are available: ALL: Set this keyword to a named variable that will contain an anonymous structure containing the values of all the retrievable properties associated with this object. NOTE: UVALUE is not returned in this struct. PARENT: Set this keyword to a named variable that will contain an object reference to the object that contains this colorbar. XRANGE: Set this keyword to a named variable that will contain a two-element vector of the form [xmin,xmax] specifying the range of the x data coordinates covered by the colorbar. YRANGE: Set this keyword to a named variable that will contain a two-element vector of the form [ymin,ymax] specifying the range of the y data coordinates covered by the colorbar. ZRANGE: Set this keyword to a named variable that will contain a two-element vector of the form [zmin,zmax] specifying the range of the z data coordinates covered by the colorbar. EXAMPLE: myColorbar->GetProperty, PARENT = parent MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/22/97
(See C:\RSI\IDL52\lib\idlgrcolorbar__define.pro)
CLASS_NAME: IDLgrLegend PURPOSE: An IDLgrLegend object provides a simple interface for displaying a list of glyph/box/styled line - text string tuples. They are displayed in a single column (default) with an optional title string and bounding box which can be filled. CATEGORY: Graphics SUPERCLASSES: This class inherits from IDLgrModel. SUBCLASSES: This class has no subclasses. CREATION: See IDLgrLegend::Init METHODS: Intrinsic Methods This class has the following methods: IDLgrLegend::Cleanup IDLgrLegend::ComputeDimensions IDLgrLegend::Init IDLgrLegend::GetProperty IDLgrLegend::SetProperty MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/26/97
(See C:\RSI\IDL52\lib\idlgrlegend__define.pro)
============================================================= METHODNAME: IDLgrLegend::DefaultArrays PURPOSE: The IDLgrLegend::DefaultArrays procedure method is a private method and is not intended to be called directly. MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/30/97
(See C:\RSI\IDL52\lib\idlgrlegend__define.pro)
============================================================= METHODNAME: IDLgrLegend::Init PURPOSE: The IDLgrLegend::Init function method initializes the legend object. NOTE: Init methods are special lifecycle methods, and as such cannot be called outside the context of object creation. This means that in most cases, you cannot call the Init method directly. There is one exception to this rule: If you write your own subclass of this class, you can call the Init method from within the Init method of the subclass. CALLING SEQUENCE: Obj = OBJ_NEW('IDLgrLegend'[,aItemNames]) or Result = oLegend->[IDLgrLegend::]Init([aItemNames]) OPTIONAL INPUTS: aItemNames - an array of strings to be used as the displayed item labels. The length of this array is used to determine the number of items to be displayed. Each item is defined by taking one element from the ITEM_NAME, ITEM_TYPE, ITEM_LINESTYLE, ITEM_THICK, ITEM_COLOR and ITEM_OBJECT vectors. IF the number of items (as defined by the ITEM_NAME array) exceeds any of the attribute vectors, the attribute defaults will be used for any additional items. KEYWORD PARAMETERS: BORDER_GAP(Get,Set): Set this keyword to a float value to indicate the amount of blank space to be placed around the outside of the glyphs and text items. The units for this keyword are in fraction of the legend label font height. The default is 0.1 (10% of the label font height). COLUMNS(Get,Set): Set this keyword to an integer value to indicate the number of columns the legend items should be displayed in. The default is 1. FILL_COLOR(Get,Set): Set this keyword to the color to be used to fill the legend background box. The color may be specified as a color lookup table index or as an RGB vector. The default is [255,255,255]. FONT(Get,Set): Set this keyword to an instance of an IDLgrFont object class to describe the font to use to draw the legend labels. The default is 12 point Helvetica. NOTE: If the default font is in use, retrieving the value of the FONT property (using the GetProperty method) will return a null object. GAP(Get,Set): Set this keyword to a float value to indicate the blank space to be placed vertically between each legend item. The units for this keyword are in fraction of the legend label font height. The default is 0.1 (10% of the label font height). This same gap is placed horizontally between the legend glyph and the legend text string. GLYPH_WIDTH(Get,Set): Set this keyword to a float value to indicate the width of the glyphs. The units for this keyword are a percentage of the font height. The default value is .8 (80%). HIDE(Get,Set): Set this keyword to a boolean value to indicate whether this object should be drawn. 0=Draw (default), 1=Hide. ITEM_COLOR(Get,Set): Set this keyword to an array of colors defining the color of each item. This array can be of the form [3,M] or [M] which defines M separate colors. In the first case, the three values are used as an RGB triplet, in the second case, the single value is used as a color index value. The default color is: [0,0,0]. ITEM_LINESTYLE(Get,Set): Set this keyword to an array of integers defining the style of the line to be drawn if the TYPE is 0. The array can be of the form [M] or [2,M]. The first form selects the linestyle for each legend item from the predefined defaults: 0=Solid line (the default) 1=dotted 2=dashed 3=dash dot 4=dash dot dot dot 5=long dash 6=no line drawn The second form specifies the stippling pattern explicity for each legend item (see IDLgrPolyline::Init LINESTYLE keyword for details). ITEM_NAME(Get,Set): Set this keyword to an array of strings. This keyword is the same as the aItemNames argument for the IDLgrLegend::Init method. ITEM_OBJECT(Get,Set): Set this keyword to an array of object references. These can be objects of type IDLgrSymbol or IDLgrPattern. A symbol object is drawn only if the TYPE is 0. A pattern object is used when drawing the color patch if the TYPE is 1. The default is the null object. ITEM_THICK(Get,Set): Set this keyword to an array of integers which define the thickness of each item line (TYPE=0) in pixels. The default is 1 pixel. ITEM_TYPE(Get,Set): Set this keyword to an array of integers which define the type of glyph to be displayed for each item. 0=line type (default), 1=filled box type. NAME(Get,Set): Set this keyword to a string representing the name to be associated with this object. The default is the null string, ''. OUTLINE_COLOR(Get,Set): Set this keyword to the color to be used to draw the legend outline box. The color may be specified as a color lookup table index or as an RGB vector. The default is [0,0,0]. OUTLINE_THICK(Get,Set): Set this keyword to an integer which defines the thickness of the legend outline box. Default = 1 pixel. SHOW_OUTLINE(Get,Set): Set this keyword to a boolean value indicating whether the outline box should be displayed. 0=Do not display outline (default), 1=Display outline. SHOW_FILL(Get,Set): Set this keyword to a boolean value indicating whether the background should be filled with a color. 0=Do not fill background (default), 1=fill background. TEXT_COLOR(Get,Set): Set this keyword to the color to be used to draw the legend item text. The color may be specified as a color lookup table index or as an RGB vector. The default is [0,0,0]. TITLE(Get,Set): Set this keyword to an instance of the IDLgrText object class to specify the title for the legend. The default is the null object, specifying that no title is drawn. The title will be centered at the top of the legend, even if the text object itself has an associated location. UVALUE(Get,Set): Set this keyword to a value of any type. You may use this value to contain any information you wish. XCOORD_CONV(Get,Set): Set this keyword to a vector, [t,s], indicating the translation and scaling to be applied to convert the X coordinates to an alternate data space. The formula for the conversion is as follows: converted X = t + s*X. The default is [0,1]. YCOORD_CONV(Get,Set): Set this keyword to a vector, [t,s], indicating the translation and scaling to be applied to convert the Y coordinates to an alternate data space. The formula for the conversion is as follows: converted Y = t + s*Y. The default is [0,1]. ZCOORD_CONV(Get,Set): Set this keyword to a vector, [t,s], indicating the translation and scaling to be applied to convert the Y coordinates to an alternate data space. The formula for the conversion is as follows: converted Y = t + s*Y. The default is [0,1]. OUTPUTS: 1: successful, 0: unsuccessful. EXAMPLE: oLegend = OBJ_NEW('IDLgrLegend') MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/26/97
(See C:\RSI\IDL52\lib\idlgrlegend__define.pro)
============================================================= METHODNAME: IDLgrLegend::CreateGlyphs PURPOSE: The IDLgrLegend::CreateGlyphs procedure method is a private method and is not intended to be called directly. MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/30/97
(See C:\RSI\IDL52\lib\idlgrlegend__define.pro)
============================================================= METHODNAME: IDLgrLegend::ComputeDimensions PURPOSE: The IDLgrLegend::ComputeDimensions method function computes and returns the dimensions of the legend for a given destination. CALLING SEQUENCE: Result = oLegend->[IDLgrLegend::]ComputeDimensions(SrcDest) INPUTS: SrcDest - A destination object. EXAMPLE: dimensions = oLegend->ComputeDimensions(oSrcDest) MODIFICATION HISTORY: Written by: Scott J. Lasica, 10/17/97
(See C:\RSI\IDL52\lib\idlgrlegend__define.pro)
============================================================= METHODNAME: IDLgrLegend::Draw PURPOSE: The IDLgrLegend::Draw procedure method is a private method and is not to be called directly. MODIFICATION HISTORY: Written by: Scott J. Lasica, 10/1/97
(See C:\RSI\IDL52\lib\idlgrlegend__define.pro)
============================================================= METHODNAME: IDLgrLegend::Cleanup PURPOSE: The IDLgrLegend::Cleanup procedure method preforms all cleanup on the object. NOTE: Cleanup methods are special lifecycle methods, and as such cannot be called outside the context of object destruction. This means that in most cases, you cannot call the Cleanup method directly. There is one exception to this rule: If you write your own subclass of this class, you can call the Cleanup method from within the Cleanup method of the subclass. CALLING SEQUENCE: OBJ_DESTROY, oLegend or oLegend->[IDLgrLegend::]Cleanup INPUTS: There are no inputs for this method. KEYWORD PARAMETERS: There are no keywords for this method. MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/26/97
(See C:\RSI\IDL52\lib\idlgrlegend__define.pro)
============================================================= METHODNAME: IDLgrLegend::SetProperty PURPOSE: The IDLgrLegend::SetProperty procedure method sets the value of a property or group of properties for the legend. CALLING SEQUENCE: oLegend->[IDLgrLegend::]SetProperty INPUTS: There are no inputs for this method. KEYWORD PARAMETERS: Any keyword to IDLgrLegend::Init followed by the word "Set" can be set using IDLgrLegend::SetProperty. EXAMPLE: myLegend->SetProperty, NAME = 'My Legend' MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/26/97
(See C:\RSI\IDL52\lib\idlgrlegend__define.pro)
============================================================= METHODNAME: IDLgrLegend::GetProperty PURPOSE: The IDLgrLegend::GetProperty procedure method retrieves the value of a property or group of properties for the legend. CALLING SEQUENCE: oLegend->[IDLgrLegend::]GetProperty INPUTS: There are no inputs for this method. KEYWORD PARAMETERS: Any keyword to IDLgrLegend::Init followed by the word "Get" can be retrieved using IDLgrLegend::GetProperty. In addition the following keywords are available: ALL: Set this keyword to a named variable that will contain an anonymous structure containing the values of all the retrievable properties associated with this object. NOTE: UVALUE is not returned in this struct. PARENT: Set this keyword to a named variable that will contain an object reference to the object that contains this Legend. XRANGE: Set this keyword to a named variable that will contain a two-element vector of the form [xmin,xmax] specifying the range of the x data coordinates covered by the Legend. YRANGE: Set this keyword to a named variable that will contain a two-element vector of the form [ymin,ymax] specifying the range of the y data coordinates covered by the Legend. ZRANGE: Set this keyword to a named variable that will contain a two-element vector of the form [zmin,zmax] specifying the range of the z data coordinates covered by the Legend. EXAMPLE: oLegend->GetProperty, PARENT = parent MODIFICATION HISTORY: Written by: Scott J. Lasica, 9/26/97
(See C:\RSI\IDL52\lib\idlgrlegend__define.pro)
NAME: IDLINFO PURPOSE: Print contact information for Research Systems and offer other basic information on using or demoing IDL. CALLING SEQUENCE: IDLINFO INPUTS: None. KEYWORDS: None. OUTPUT: Basic information is printed. COMMON BLOCKS: NONE. SIDE EFFECTS: None. RESTRICTIONS: None. MODIFICATION HISTORY: Written, DMS, RSI, 17 April 1997
(See C:\RSI\IDL52\lib\idlinfo.pro)
NAME: IDL_CRANK PURPOSE: Replace elements of the sorted array "w" by their rank. Identical observations ("ties") return the mean rank. NOTE: This procedures is not a supported user-level routine. It is a support routine for IDL statistics library functions. CATEGORY: Analysis CALLING SEQUENCE: IDL_CRANK, W INPUTS: W: A sorted array OPTIONAL INPUTS: KEYWORD PARAMETERS: OUTPUTS: W: IDL_CRANK replaces the input array W with its rank. OPTIONAL OUTPUTS: s = total(f^3 - f) (f is the number of elements in each set of identical observations.) COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: EXAMPLE: X = [-1, 2, 3, 5, 6, 6, 9] IDL_CRANK, X produces X = [1.000, 2.000, 3.000, 4.000, 5.500, 5.500, 6.000 ] MODIFICATION HISTORY: Tue Jan 27 16:50:31 1998, Scott Lett, RSI, Adapted from earlier IDL library routines.
(See C:\RSI\IDL52\lib\idl_crank.pro)
NAME: IGAMMA PURPOSE: This function computes the incomplete gamma function, Px(a). CATEGORY: Special Functions. CALLING SEQUENCE: Result = Igamma(a, x) INPUTS: A: A positive scalar of type integer, float or double that specifies the parametric exponent of the integrand. X: A positive scalar of type integer, float or double that specifies the upper limit of integration. KEYWORD PARAMETERS: METHOD: Use this keyword to specify a named variable which returns the method used to compute the incomplete gamma function. A value of 0 indicates that a power series representation was used. A value of 1 indicates that a continued fractions method was used. EXAMPLE: Compute the incomplete gamma function for the corresponding elements of A and X. Define the parametric exponents. A = [0.10, 0.50, 1.00, 1.10, 6.00, 26.00] Define the the upper limits of integration. X = [0.0316228, 0.0707107, 5.00000, 1.04881, 2.44949, 25.4951] Allocate an array to store the results. result = fltarr(n_elements(A)) Compute the incomplete gamma functions. for k = 0, n_elements(A)-1 do $ result(k) = Igamma(A(k), X(k)) The result should be: [0.742026, 0.293128, 0.993262, 0.607646, 0.0387318, 0.486387] PROCEDURE: IGAMMA computes the incomplete gamma function, Px(a), using either a power series representation or a continued fractions method. If X is less than or equal to A+1, a power series representation is used. If X is greater than A+1, a continued fractions method is used. REFERENCE: Numerical Recipes, The Art of Scientific Computing (Second Edition) Cambridge University Press ISBN 0-521-43108-5 MODIFICATION HISTORY: Written by: GGS, RSI, September 1994 IGAMMA is based on the routines: gser.c, gcf.c, and gammln.c described in section 6.2 of Numerical Recipes, The Art of Scientific Computing (Second Edition), and is used by permission. Modified: GGS, RSI, January 1996 Corrected the case of IGAMMA(a, 0) for a > 0.
(See C:\RSI\IDL52\lib\igamma.pro)
NAME: IGAMMA_PDF PURPOSE: This function computes the incomplete gamma function using a series representation. It is called by the probability density functions in this directory. See the function IGAMMA() in the "math" subdirectory for the user-callable version of the incomplete gamma function. MODIFICATION HISTORY: Modified by: Jong Yi, Sept 1992 Increased iterations in g_series.pro Modified by: GGS, RSI, July 1994 Minor changes to code.
(See C:\RSI\IDL52\lib\igamma_pdf.pro)
NAME: IMAGE_CONT PURPOSE: Overlay an image and a contour plot. CATEGORY: General graphics. CALLING SEQUENCE: IMAGE_CONT, A INPUTS: A: The two-dimensional array to display. KEYWORD PARAMETERS: WINDOW_SCALE: Set this keyword to scale the window size to the image size. Otherwise, the image size is scaled to the window size. This keyword is ignored when outputting to devices with scalable pixels (e.g., PostScript). ASPECT: Set this keyword to retain the image's aspect ratio. Square pixels are assumed. If WINDOW_SCALE is set, the aspect ratio is automatically retained. INTERP: If this keyword is set, bilinear interpolation is used if the image is resized. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: The currently selected display is affected. RESTRICTIONS: None. PROCEDURE: If the device has scalable pixels, then the image is written over the plot window. MODIFICATION HISTORY: DMS, May, 1988.
(See C:\RSI\IDL52\lib\image_cont.pro)
NAME: INSGET PURPOSE: Stub for INSGET. Displays message saying that Insight must be running. Once Insight is restored and running this routine will be replaced by the actual compiled version in the Insight save file. NOTES: - See the online documentation for usage information.
(See C:\RSI\IDL52\lib\insget.pro)
NAME: INSPUT PURPOSE: Stub for INSPUT. Displays message saying that Insight must be running. Once Insight is restored and running this routine will be replaced by the actual compiled version in the Insight save file. NOTES: - See the online documentation for usage information.
(See C:\RSI\IDL52\lib\insput.pro)
NAME: INSVIS PURPOSE: Stub for INSVIS. Displays message saying that Insight must be running. Once Insight is restored and running this routine will be replaced by the actual compiled version in the Insight save file. NOTES: - See the online documentation for usage information.
(See C:\RSI\IDL52\lib\insvis.pro)
NAME: INTERPOL PURPOSE: Linearly interpolate vectors with a regular or irregular grid. CATEGORY: E1 - Interpolation CALLING SEQUENCE: Result = INTERPOL(V, N) ;For regular grids. Result = INTERPOL(V, X, U) ;For irregular grids. INPUTS: V: The input vector can be any type except string. For regular grids: N: The number of points in the result when both input and output grids are regular. Irregular grids: X: The absicissae values for V. This vector must have same # of elements as V. The values MUST be monotonically ascending or descending. U: The absicissae values for the result. The result will have the same number of elements as U. U does not need to be monotonic. OPTIONAL INPUT PARAMETERS: None. OUTPUTS: INTERPOL returns a floating-point vector of N points determined by linearly interpolating the input vector. If the input vector is double or complex, the result is double or complex. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Result(i) = V(x) + (x - FIX(x)) * (V(x+1) - V(x)) where x = i*(m-1)/(N-1) for regular grids. m = # of elements in V, i=0 to N-1. For irregular grids, x = U(i). m = number of points of input vector. MODIFICATION HISTORY: Written, DMS, October, 1982. Modified, Rob at NCAR, February, 1991. Made larger arrays possible and correct by using long indexes into the array instead of integers. Modified, DMS, August, 1998. Now use binary intervals which speed things up considerably when U is random.
(See C:\RSI\IDL52\lib\interpol.pro)
NAME: INT_2D PURPOSE: This function computes the double integral of a bivariate function F(x,y) using either a dy-dx or dx-dy order of integration. CATEGORY: Numerical Analysis. CALLING SEQUENCE: Result = INT_2D(Fxy, AB_Limits, PQ_Limits, Pts) INPUTS: Fxy: A scalar string specifying the name of a user-supplied IDL function that defines the bivariate function to be integrated. The function must accept x & y and return a scalar result. AB_Limits: A two-element vector containing the lower, A, and upper, B, limits of integration. These limits correspond to x when using a dy-dx order of integration or they correspond to y when using a dx-dy order of integration. PQ_Limits: A scalar string specifying the name of a user-supplied IDL function that defines the lower, P, and upper, Q, limits of integration. These limits correspond to y when using a dy-dx order of integration or they correspond to x when using a dx-dy order of integration. They must accept x (for a dy-dx order of integration) or y (for a dx-dy order of integration) and return a two-element vector result. Pts: The number of transformation points used in the computation. Possible values are: 6, 10, 20, 48 or 96. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. ORDER: A scalar value of either 0 or 1. If set to 0, the integral is computed using a dy-dx order of integration. If set to 1, the integral is computed using a dx-dy order of integration. EXAMPLE: Compute the double integral of the bivariate function F(x, y) = y * cos(x^5) over the region: [0.0, x^2] for y and [0.0, 2.0] for x using a dy-dx order of integration. ;Define the limits of integration for y as a function of x. function PQ_Limits, x return, [0.0, x^2] end ;Define the limits of integration for x. AB_Limits = [0.0, 2.0] ;Integrate with 48 and 96 point formulas using a dy-dx order of ;integration and double-precision arithmetic. print, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 48, /double) print, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 96, /double) INT_2D with 48 transformation points yields: 0.055142668 INT_2D with 96 transformation points yields: 0.055142668 Compute the double integral of the bivariate function F(x, y) = y * cos(x^5) over the equivalent region using a dx-dy order of integration. ;Define the limits of integration for x as a function of y. function PQ_Limits, y return, [sqrt(y), 2.0] end ;Define the limits of integration for y. AB_Limits = [0.0, 4.0] ;Integrate with 48 and 96 point formulas using a dx-dy order of ;integration and double-precision arithmetic. print, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 48, /double, /order) print, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 96, /double, /order) INT_2D with 48 transformation points yields: 0.055142678 INT_2D with 96 transformation points yields: 0.055142668 The exact solution (9 decimal accuracy) yields: 0.055142668 PROCEDURE: INT_2D.PRO computes the double integral of a bivariate function using iterated Gaussian Quadrature. The algorithm's transformation data is provided in tabulated form with 15 decimal accuracy. REFERENCE: Handbook of Mathematical Functions U.S. Department of Commerce Applied Mathematics Series 55 MODIFICATION HISTORY: Written by: GGS, RSI, January 1994 Modified: GGS, RSI, September 1994 Added 96 point transformation data. Added DOUBLE keyword. Replaced nested FOR loop with vector operations resulting in faster execution. Modified: GGS, RSI, June 1995 Added ORDER keyword allowing a dx-dy order of integration. Modified: GGS, RSI, April 1996 Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\int_2d.pro)
NAME: INT_3D PURPOSE: This function computes the triple integral of a trivariate function F(x,y,z) with limits of integration from A to B for X, from P(x) to Q(x) for Y and from U(x,y) to V(x,y) for Z. CATEGORY: Numerical Analysis. CALLING SEQUENCE: Result = INT_3D(Fxyz, AB_Limits, PQ_Limits, UV_Limits, Pts) INPUTS: Fxyz: A scalar string specifying the name of a user-supplied IDL function that defines the trivariate function to be integrated. The function must accept x, y & z and return a scalar result. AB_Limits: A two-element vector containing the lower, A, and upper, B, limits of integration for x. PQ_Limits: A scalar string specifying the name of a user- supplied IDL function that defines the lower, P(x), and upper, Q(x), limits of integration for y. The function must accept x and return a two-element vector result. UV_Limits: A scalar string specifying the name of a user- supplied IDL function that defines the lower, U(x,y), and upper, V(x,y), limits of integration for z. The function must accept x & y and return a two-element vector result. Pts: The number of transformation points used in the computation. Possible values are: 6, 10, 20, 48 or 96. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE: Compute the triple integral of the trivariate function F(x,y,z) = z * (x^2 + y^2 + z^2)^1.5 over the region: A = -2, B = 2, Px = -sqrt(4 - x^2), Qx = sqrt(4 - x^2), Uxy = 0, Vxy = sqrt(4 - x^2 - y^2). ;Define the trivariate function. function Fxyz, x, y, z return, z * (x^2 + y^2 + z^2)^1.5 end ;Define the limits of integration for y. function PQ_Limits, x return, [-sqrt(4. - x^2), sqrt(4. - x^2)] end ;Define the limits of integration for z. function UV_Limits, x, y return, [0.0, sqrt(4. - x^2 - y^2)] end ;Define the limits of integration for x. AB_Limits = [-2.0, 2.0] ;Integrate with 10, 20, 48, and 96 point formulas using double- ;precision arithmetic. Notice that it is possible to abbreviate ;keywords. print, INT_3D('Fxyz', AB_Limits, 'PQ_Limits', 'UV_Limits', 10, /d) print, INT_3D('Fxyz', AB_Limits, 'PQ_Limits', 'UV_Limits', 20, /d) print, INT_3D('Fxyz', AB_Limits, 'PQ_Limits', 'UV_Limits', 48, /d) print, INT_3D('Fxyz', AB_Limits, 'PQ_Limits', 'UV_Limits', 96, /d) INT_3D with 10 transformation points yields: 57.444248 INT_3D with 20 transformation points yields: 57.446201 INT_3D with 48 transformation points yields: 57.446265 INT_3D with 96 transformation points yields: 57.446266 The exact solution (6 decimal accuracy) yields: 57.446267 PROCEDURE: INT_3D.PRO computes the triple integral of a trivariate function using iterated Gaussian Quadrature. The algorithm's transformation data is provided in tabulated form with 15 decimal accuracy. REFERENCE: Handbook of Mathematical Functions U.S. Department of Commerce Applied Mathematics Series 55 MODIFICATION HISTORY: Written by: GGS, RSI, January 1994 Modified: GGS, RSI, September 1994 Added 96 point transformation data. Added DOUBLE keyword. Replaced nested FOR loop with vector operations resulting in faster execution. Modified: GGS, RSI, April 1996 Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\int_3d.pro)
NAME: INT_TABULATED PURPOSE: This function integrates a tabulated set of data { x(i) , f(i) }, on the closed interval [min(X) , max(X)]. CATEGORY: Numerical Analysis. CALLING SEQUENCE: Result = INT_TABULATED(X, F) INPUTS: X: The tabulated X-value data. This data may be irregularly gridded and in random order. If the data is randomly ordered you must set the SORT keyword to a nonzero value. Duplicate x values will result in a warning message. F: The tabulated F-value data. Upon input to the function X(i) and F(i) must have corresponding indices for all values of i. If X is reordered, F is also reordered. X and F must be of floating point or double precision type. KEYWORD PARAMETERS: SORT: A zero or non-zero scalar value. SORT = 0 (the default) The tabulated x-value data is already in ascending order. SORT = 1 The tabulated x-value data is in random order and requires sorting into ascending order. Both input parameters X and F are returned sorted. DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. OUTPUTS: This fuction returns the integral of F computed from the tabulated data in the closed interval [min(X) , max(X)]. RESTRICTIONS: Data that is highly oscillatory requires a sufficient number of samples for an accurate integral approximation. PROCEDURE: INT_TABULATED.PRO constructs a regularly gridded x-axis with a number of segments as an integer multiple of four. Segments are processed in groups of four using a 5-point Newton-Cotes integration formula. For 'sufficiently sampled' data, this algorithm is highly accurate. EXAMPLES: Example 1: Define 11 x-values on the closed interval [0.0 , 0.8]. x = [0.0, .12, .22, .32, .36, .40, .44, .54, .64, .70, .80] Define 11 f-values corresponding to x(i). f = [0.200000, 1.30973, 1.30524, 1.74339, 2.07490, 2.45600, $ 2.84299, 3.50730, 3.18194, 2.36302, 0.231964] Compute the integral. result = INT_TABULATED(x, f) In this example, the f-values are generated from a known function, (f = .2 + 25*x - 200*x^2 + 675*x^3 - 900*x^4 + 400*x^5) The Multiple Application Trapazoid Method yields; result = 1.5648 The Multiple Application Simpson's Method yields; result = 1.6036 INT_TABULATED.PRO yields; result = 1.6232 The Exact Solution (4 decimal accuracy) yields; result = 1.6405 Example 2: Create 30 random points in the closed interval [-2 , 1]. x = randomu(seed, 30) * 3.0 - 2.0 Explicitly define the interval's endpoints. x(0) = -2.0 & x(29) = 1.0 Generate f(i) corresponding to x(i) from a given function. f = sin(2*x) * exp(cos(2*x)) Call INT_TABULATED with the SORT keyword. result = INT_TABULATED(x, f, /sort) In this example, the f-values are generated from the function, f = sin(2*x) * exp(cos(2*x)) The result of this example will vary because the x(i) are random. Executing this example three times gave the following results: INT_TABULATED.PRO yields; result = -0.0702 INT_TABULATED.PRO yields; result = -0.0731 INT_TABULATED.PRO yields; result = -0.0698 The Exact Solution (4 decimal accuracy) yields; result = -0.0697 MODIFICATION HISTORY: Written by: GGS, RSI, September 1993 Modified: GGS, RSI, November 1993 Use Numerical Recipes cubic spline interpolation function NR_SPLINE/NR_SPLINT. Execution time is greatly reduced. Added DOUBLE keyword. The 'sigma' keyword is no longer supported. Modified: GGS, RSI, April 1995 Changed cubic spline calls from NR_SPLINE/NR_SPLINT to SPL_INIT/SPL_INTERP. Improved double-precision accuracy. Modified: GGS, RSI, April 1996 Replaced WHILE loop with vector operations. Check for duplicate points in x vector. Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\int_tabulated.pro)
NAME: INT_TABULATED_2D PURPOSE: Integrate the volume formed by a surface defined by tabulated data, (x[i], y[i], f[i]), and the XY plane, over the area defined by the convex hull of the set of points (x,y). CATEGORY: Numerical Analysis. CALLING SEQUENCE: Result = INT_TABULATED_2D(X, Y, F) INPUTS: X: The array of tabulated X-value data. This data may be irregularly gridded and in random order. Y: The tabulated Y-value data, Y[i] corresponds to X[i]. F: The tabulated F-value data. F[i] is the function's value at the point (X[i],Y[i]).; X Y, and F must be of floating point or double precision type. OUTPUTS: This fuction returns the integral of F computed from the tabulated data over the convex hull defined by the points in (X,Y). Linear interpolation is used. PROCEDURE: The (X,Y) points are triangulated using TRIANGULATE. Then for each triangle, in the convex hull, formed by points X[[i,j,k]] and Y[[i,j,k]], the volume of the triangular cylinder formed by the 6 points: (X[i], Y[i], Z[i]), (X[j], Y[j], Z[j]), (X[i], Y[k], Z[k]), (X[i], Y[i], 0), (X[j], Y[j], 0), and (X[k], Y[k], 0), is computed and summed. EXAMPLE: Compute the volume between the surface f=x^2+y^2 and the XY plane, over the interval of x=-1 to +1, y=-1 to 1, with a grid increment of 0.1: n = 21 x = (findgen(n) * (2./(n-1)) - 1.0) # replicate(1.0, n) y = transpose(x) f = x^2 + y^2 print, int_tabulated_2d(x,y,f) 2.68000 (The correct answer computed symbolically is 8/3 = 2.66667) MODIFICATION HISTORY: DMS, August, 1998.
(See C:\RSI\IDL52\lib\int_tabulated_2d.pro)
NAME: JOIN PURPOSE: To partition the cases represented by the rows in DataArray into nested clusters. CATEGORY: Statistics. CALLING SEQUENCE: JOIN, DataArray, pos, Imin, Sim INPUTS: DataArray: a (C,R) dimensioned array where R is the number of cases to be partitioned and C is the number of variables. KEYWORDS CASENAME: one dimensional array of R case names. NORM: Flag to signal whether to normalize the variable values in Data. Values normalized only if Norm=1. MISSING: Missing data value. If undefined, assume no missing data DISTANCE: Rule for computing case distances. Options are: 1. "%": Distance = percent of variable values that disagree between two cases. 2. "EUCLID": This is the default. 3. "COR": Distance between i and j = 1-rij, where rij= the correlation between i and j. 4. "OWN": DataArray= a symmetric a distance array supplied by the user. This array should be a 1-dim array of the elements in the distance array that are below the main diagonal. AMAL: Rule for computing cluster distances. Options are: 1. "MIN": distance = distance between closest members. 2. "MAX": distance = distance between farthest members. 3. "MEAN" : distance = average of distances between members. NOPRINT: A flag, if set, to suppress output to the screen. WIDTH: User supplied tree width in characters. The default is 60. OUTPUT: The tree of hierarchical clusters is printed to the screen. OPTIONAL OUTPUT PARAMETERS: Pos: One-dimensional array of cases in the in the tree of hierarchical clusters. Pos(i) = position of case i in tree. Imin: One-dimensional array specifying nesting of clusters. Imin(i) = smallest cluster properly containing cluster or case i. Sim: One-dimensional array of minimum distances. Sim(i) = the distance between the two clusters joined to form cluster i. RESTRICTIONS: None. COMMON BLOCKS: None. SIDE EFFECTS: None. PROCEDURE: Adapted from algorithm in Clustering Algorithms by Hartigan, Wiley Series in Probablity and Mathematical Statistics, Chapt.4. Function kmeans1 implements a function that given a partition P returns a partition P' in the same neighborhood with reduced in group error. Function is called repeatedly until it finds a fixed point or local minimum. Kmeans1 recomputes cluster means after each reassignment. Procedure Kmeans successively finds partitions with the starting partition for K the final partition for K-1 with the case farthest from its cluster mean split off to form a new cluster.
(See C:\RSI\IDL52\lib\obsolete\join.pro)
NAME: JULDAY PURPOSE: Calculate the Julian Day Number for a given month, day, and year. This is the inverse of the library function CALDAT. See also caldat, the inverse of this function. CATEGORY: Misc. CALLING SEQUENCE: Result = JULDAY(Month, Day, Year) INPUTS: MONTH: Number of the desired month (1 = January, ..., 12 = December). DAY: Number of day of the month. YEAR: Number of the desired year. HOUR: Number of the hour of the day. MINUTE: Number of the minute of the hour. SECOND: OPTIONAL INPUT PARAMETERS: Hour, Minute, Second = optional time of day. OUTPUTS: JULDAY returns the Julian Day Number (which begins at noon) of the specified calendar date. If the time of day (Hr, Min, Sec), is 0, the result will be a long integer, otherwise the result is a double precision floating point number. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Accuracy using IEEE double precision numbers is approximately 1/10000th of a second. MODIFICATION HISTORY: Translated from "Numerical Recipies in C", by William H. Press, Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling. Cambridge University Press, 1988 (second printing). AB, September, 1988 DMS, April, 1995, Added time of day.
(See C:\RSI\IDL52\lib\julday.pro)
NAME: KMEANS PURPOSE: To split the cases in Data into n (default=2) groups that have minimum in group variation relative to between group variation. CATEGORY: Statistics. CALLING SEQUENCE: KMEANS, Data, Cluster, VarName, CaseName INPUTS: Data = a (C,R) dimensioned array where R is the number of cases to be partitioned and C is the number of variables. KEYWORDS: Number = the number of clusters in final partition. The default is 2 Iter = the number of iterations used to assign cases to clusters. The default is 50. Norm = flag, if set, to signal whether to normalize the variable values in Data. Values normalized only if Norm=1. Missing = missing data value. If undefined, assume no missing data List_Name= name of output file. Default is to the screen. ClustMeans=array of cluster means. If defined on entry, CM(i,j) = mean of ith variable in j th cluster on exit ClustSTD = array of cluster standard deviations. If defined on entry, CS(i,j) = standard deviation of ith variable in jth cluster on exit SSBetween = array of sum of squares between clusters. If defined on entry, SSB(i)= sum of squares for ith variable. SSWithin = array of sum of squares within clusters. SSW is the analogue for SSB VarName= one dimensional array of C variable names CaseName= one dimensional array of R case names OUTPUT: Summary statistics for each variable for each cluster, overall analysis of variance for each variable. OPTIONAL OUTPUT PARAMETERS: Cluster a one dimensional array. Cluster(i) = the cluster containing case i in the final partition RESTRICTIONS: None. COMMON BLOCKS: None. SIDE EFFECTS: None. PROCEDURE: Adapted from algorithm in Clustering Algorithms by Hartigan, Wiley Series in Probablity and Mathematical Statistics, Chapt.4. Function kmeans1 implements a function that given a partition P returns a partition P' in the same neighborhood with reduced in group error. Function is called repeatedly until it finds a fixed point or local minimum. Kmeans1 recomputes cluster means after each reassignment. Procedure Kmeans successively finds partitions with the starting partition for K the final partition for K-1 with the case farthest from its cluster mean split off to form a new cluster.
(See C:\RSI\IDL52\lib\obsolete\kmeans.pro)
NAME: KRIG_2D PURPOSE: This function interpolates a regularly or irregularly gridded set of points Z = F(X,Y) using kriging. CATEGORY: Interpolation, Surface Fitting CALLING SEQUENCE: Result = KRIG2D(Z [, X, Y]) INPUTS: X, Y, Z: arrays containing the X, Y, and Z coordinates of the data points on the surface. Points need not be regularly gridded. For regularly gridded input data, X and Y are not used: the grid spacing is specified via the XGRID and YGRID (or XVALUES and YVALUES) keywords, and Z must be a two dimensional array. For irregular grids, all three parameters must be present and have the same number of elements. KEYWORD PARAMETERS: Model Parameters: EXPONENTIAL: if set (with parameters [A, C0, C1]), use an exponential semivariogram model. SPHERICAL: if set (with parameters [A, C0, C1]), use a spherical semivariogram model. Both models use the following parameters: A: the range. At distances beyond A, the semivariogram or covariance remains essentialy constant. See the definition of the functions below. C0: the "nugget," which provides a discontinuity at the origin. C1: the covariance value for a zero distance, and the variance of the random sample Z variable. If only a two element vector is supplied, C1 is set to the sample variance. (C0 + C1) = the "sill," which is the variogram value for very large distances. Input grid description: REGULAR: if set, the Z parameter is a two dimensional array of dimensions (N,M), containing measurements over a regular grid. If any of XGRID, YGRID, XVALUES, YVALUES are specified, REGULAR is implied. REGULAR is also implied if there is only one parameter, Z. If REGULAR is set, and no grid (_VALUE or _GRID) specifications are present, the respective grid is set to (0, 1, 2, ...). XGRID: contains a two element array, [xstart, xspacing], defining the input grid in the X direction. Do not specify both XGRID and XVALUES. XVALUES: if present, XVALUES(i) contains the X location of Z(i,j). XVALUES must be dimensioned with N elements. YGRID: contains a two element array, [ystart, yspacing], defining the input grid in the Y direction. Do not specify both YGRID and YVALUES. YVALUES: if present, YVALUES(i) contains the Y location of Z(i,j). YVALUES must be dimensioned with N elements. Output grid description: GS: If present, GS must be a two-element vector [XS, YS], where XS is the horizontal spacing between grid points and YS is the vertical spacing. The default is based on the extents of X and Y. If the grid starts at X value Xmin and ends at Xmax, then the default horizontal spacing is (Xmax - Xmin)/(NX-1). YS is computed in the same way. The default grid size, if neither NX or NY are specified, is 26 by 26. BOUNDS: If present, BOUNDS must be a four element array containing the grid limits in X and Y of the output grid: [Xmin, Ymin, Xmax, Ymax]. If not specified, the grid limits are set to the extent of X and Y. NX: The output grid size in the X direction. NX need not be specified if the size can be inferred from GS and BOUNDS. The default value is 26. NY: The output grid size in the Y direction. See NX. OUTPUTS: This function returns a two dimensional floating point array containing the interpolated surface, sampled at the grid points. RESTRICTIONS: The accuracy of this function is limited by the single precision floating point accuracy of the machine. SAMPLE EXECUTION TIMES (measured on a Sun IPX) # of input points # of output points Seconds 10 676 1.1 20 676 1.5 40 676 2.6 80 676 7.8 10 1024 1.6 10 4096 5.9 10 16384 23 PROCEDURE: Ordinary kriging is used to fit the surface described by the data points X,Y, and Z. See: Isaaks and Srivastava, "An Introduction to Applied Geostatistics," Oxford University Press, 1989, Chapter 12. The parameters of the data model, the range, nugget, and sill, are highly dependent upon the degree and type of spatial variation of your data, and should be determined statistically. Experimentation, or preferrably rigorus analysis, is required. For N data points, a system of N+1 simultaneous equations are solved for the coefficients of the surface. For any interpolation point, the interpolated value is: F(x,y) = Sum( w(i) * C(x(i),y(i), x, y) Formulas used to model the variogram functions: d(i,j) = distance from point i to point j. V = variance of samples. C(i,j) = Covariance of sample i with sample j. C(x0,y0,x1,y1) = Covariance of point (x0,y0) with (x1,y1). Exponential covar: C(d) = C1 * EXP(-3*d/A) if d ne 0. = C1 + C0 if d eq 0. Spherical covar: C(d) = (1.0 - 1.5 * d/a + 0.5 * (d/a)^3) = C1 + C0 if d eq 0. = 0 if d > a. EXAMPLES: Example 1: Irregularly gridded cases Make a random set of points that lie on a gaussian: n = 15 ;# random points x = RANDOMU(seed, n) y = RANDOMU(seed, n) z = exp(-2 * ((x-.5)^2 + (y-.5)^2)) ;The gaussian get a 26 by 26 grid over the rectangle bounding x and y: e = [ 0.25, 0.0] ;Range and nugget are 0.25, and 0. ;(These numbers are dependent upon ;your data model.) r = krig2d(z, x, y, EXPON = e) ;Get the surface. Or: get a surface over the unit square, with spacing of 0.05: r = krig2d(z, x, y, EXPON=e, GS=[0.05, 0.05], BOUNDS=[0,0,1,1]) Or: get a 10 by 10 surface over the rectangle bounding x and y: r = krig2d(z, x, y, EXPON=e, NX=10, NY=10) Example 2: Regularly gridded cases s = [ 10., 0.2] ;Range and sill, data dependent. z = randomu(seed, 5, 6) ;Make some random data interpolate to a 26 x 26 grid: CONTOUR, krig2d(z, /REGULAR, SPHERICAL = s) MODIFICATION HISTORY: DMS, RSI, March, 1993. Written. GSL, RSI, October 1997. Replaced obsolete LUDCMP,LUBKSB with LUDC and LUSOL.
(See C:\RSI\IDL52\lib\krig2d.pro)
NAME: KRUSKAL_WALLIS PURPOSE: To perform a one-way analysis of variance on k treatments to test the hypothesis that all treatments have the same distribution versus the alternative that at least two treatments differ in location. No assumptions are needed about the underlying probability distributions. CATEGORY: Statistics. CALLING SEQUENCE: KRUSKAL_WALLIS, Data [,Rank, H, Prob, df, Pop $ names=names, List_Name=Ln, Missing=M , NoPrint =NP] INPUTS: Data: Two-dimensional array. Data(i,j) =the jth $ observation from the ith treatment; KEYWORDS: NAMES: vector of names for the treatments to be used in the output. LIST_NAME: Name of output file. Default is to the screen. MISSING: value used as a place holder for missing data. Pairwise handling of missing data. NOPRINT: flag, if set, to suppress ouput to the screen or a file. OUTPUT: Table written to the screen showing rank sum for each treatment. Also, the kruskal_wallis test statistic and it is probability assuming a chi-square distribution are written to the screen. OPTIONAL OUTPUT PARAMETERS: Rank: 1-dim array of rank sums. Rank(i) = sum of ranks of treatment i H: kruskal_wallis test statistic. Prob: probability of H assuming a chi-square distribution. DF: degrees of freedom of chi-square distribution. POP: 1-dim array of treatment sizes RESTRICTIONS: None. COMMON BLOCKS: None. PROCEDURE: The samples from the k treatments are pooled and their members are ranked. Let Ri = rank sum for ith treatment and let ni = the sample size. Let R = the average of all ranks =(n+1)/2 where n = sum(ni). Let RRi = Ri/ni. The rank sum analogue to the standard sum of squares is: SS = sum(ni(RRi -R))^2. The Kruskal-Wallis statistic H = 12/(n(n+1)) * V and has approximately the chi-square distribution if each sample size exceeds 4.
(See C:\RSI\IDL52\lib\obsolete\kruskal_wallis.pro)
NAME: KURTOSIS PURPOSE: This function computes the statistical kurtosis of an N-element vector. If the variance of the vector is zero, the kurtosis is not defined, and KURTOSIS returns !VALUES.F_NAN as the result. CATEGORY: Statistics. CALLING SEQUENCE: Result = KURTOSIS(X) INPUTS: X: An N-element vector of type integer, float or double. KEYWORD PARAMETERS: DOUBLE: IF set to a non-zero value, computations are done in double precision arithmetic. NAN: If set, treat NaN data as missing. EXAMPLE: Define the N-element vector of sample data. x = [65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71, 66, 65, 70] Compute the mean. result = KURTOSIS(x) The result should be: -1.18258 PROCEDURE: KURTOSIS calls the IDL function MOMENT. REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Written by: GSL, RSI, August 1997
(See C:\RSI\IDL52\lib\kurtosis.pro)
NAME: KW_TEST PURPOSE: This function tests the hypothesis that three or more sample popultions have the same mean of distribution against the hypothesis that they differ. The popultions may be of equal or unequal lengths. The result is a two-element vector containing the test statistic H and the one-tailed probability of obtaining a value of H or greater from a chi-square distribution. This type of test is often refered to as the Kruskal-Wallis H-Test. CATEGORY: Statistics. CALLING SEQUENCE: Result = KW_test(X) INPUTS: X: An array of m-columns (m >= 3) and n-rows of type integer, float or double. The columns of this two dimensional array correspond to the sample popultions. If the sample popultions are of unequal length, all vectors must be appended up to a common length of n using a user-specified missing value. This method requires the use of the MISSING keyword. KEYWORD PARAMETERS: DF: Use this keyword to specify a named variable which returns the degrees of freedom used to compute the probability of obtaining a value of H or greater from the corresponding chi-square distribution MISSING: Use this keyword to specify a non-zero numeric value which is used to appended popultions of unequal length up to a common length of n. EXAMPLE: Test the hypothesis that three sample popultions have the same mean of distribution against the hypothesis that they differ at the 0.05 significance level. sp0 = [24.0, 16.7, 22.8, 19.8, 18.9] sp1 = [23.2, 19.8, 18.1, 17.6, 20.2, 17.8] sp2 = [18.2, 19.1, 17.3, 17.3, 19.7, 18.9, 18.8, 19.3] Since the sample popultions are of unequal lengths, a missing value must be appended to sp0 and sp1. In this example the missing value is -1.0 and the 3-column, 8-row input array is defined as: x = [[24.0, 23.2, 18.2], $ [16.7, 19.8, 19.1], $ [22.8, 18.1, 17.3], $ [19.8, 17.6, 17.3], $ [18.9, 20.2, 19.7], $ [-1.0, 17.8, 18.9], $ [-1.0, -1.0, 18.8], $ [-1.0, -1.0, 19.3]] result = kw_test(x, missing = -1) The result should be the 2-element vector: [1.65862, 0.436351] The computed probability (0.436351) is greater than the 0.05 significance level and therefore we do not reject the hypothesis that the three sample popultions s0, s1 and s2 have the same mean of distribution. PROCEDURE: KW_TEST computes the nonparametric Kruskal-Wallis H-Test for three or more populations of equal or unequal size. This test is an extension of the Rank Sum Test implemented in the RS_TEST function. When each sample population contains at least five observations, the H test statistic is approximated very well by a chi-square distribution with DF degrees of freedom. The hypothesis that three of more sample populations have the same mean of distribution is rejected if two or more populations differ with statistical significance. REFERENCE: PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition) Ronald E. Walpole & Raymond H. Myers ISBN 0-02-424170-9 MODIFICATION HISTORY: Written by: GGS, RSI, September 1994
(See C:\RSI\IDL52\lib\kw_test.pro)
NAME: LABEL_DATE PURPOSE: This function labels axes with dates and times. CATEGORY: Plotting. CALLING SEQUENCE: To set up: dummy = LABEL_DATE(DATE_FORMAT='string') To use: PLOT, x, y, XTICKFORMAT='LABEL_DATE' INPUTS: No explicit user defined inputs. When called from the plotting routines, the input parameters are (Axis, Index, Value) KEYWORD PARAMETERS: DATE_FORMAT: a format string which may contain the following: %M for month (3 character abbr) %N for month (2 digit abbr) %D for day of month, %Y for 4 digit year. %Z for last two digits of year. For time: %H for Hours, 2 digits. %I for mInutes, 2 digits. %S for Seconds, 2 digits. %% is %. Other characters are passed directly thru. For example, '%M %D, %Y' prints DEC 11, 1993 '%M %2Y' yields DEC 93 '%D-%M' yields 11-DEC '%D/%N/%Y' yields 11/12/1993 '%M!C%Y' yields DEC on the top line, 1993 on the bottom (!C is the new line graphic command). MONTHS: The names of the months, a twelve element string array. If omitted, use Jan, Feb, ..., Dec. OFFSET: An optional starting offset of the plot. Unfortunately, single precision floating point is not accurate enough to properly represent Julian times. This offset, which may be double precision, contains an offset that is added to all x values, before conversion to Julian date and time. OUTPUTS: The date string to be plotted. COMMON BLOCKS: LABEL_DATE_COM. RESTRICTIONS: Only one date axis may be simultaneously active. PROCEDURE: Straightforward. For an alternative way to label a plot axis with dates, refer to the C() format code accepted within format strings (applicable via the [XYZ]TICKFORMAT keywords). This new format code was introduced in IDL 5.2. EXAMPLE: For example, to plot from Jan 1, 1993, to July 12, 1994: Start_date = julday(1, 1, 1993) End_date = julday(7, 12, 1994) Dummy = LABEL_DATE(DATE_FORMAT='%N/%D') ;Simple mm/dd x = findgen(end_date+1 - start_date) + start_date ;Time axis PLOT, x, sqrt(x), XTICKFORMAT = 'LABEL_DATE', XSTYLE=1 (Plot with X axis style set to exact.) Example with times: For example, to plot from 3PM, Jan 1, 1993, to 5AM, Jan 3, 1993: Start_date = Julday(1,1,1993) ;Also starting offset Start_time = (3+12)/24. ;Starting_time less offset End_time = (Julday(1,3,1993) - Start_date) + 5./24. ;Ending ;date/time - offset, note that the order of operations is ; important to avoid loss of precision. Dummy = LABEL_DATE(DATE_FORMAT='%D %M!C%H:%I', $ offset=Start_date) ;MMM NNHH:MM format x = findgen(20) * (End_time - Start_time) / 19 + start_time ;Time axis PLOT, x, sqrt(x), XTICKFORMAT = 'LABEL_DATE', XSTYLE=1 MODIFICATION HISTORY: DMS, RSI. April, 1993. Written. DMS, RSI. March, 1997. Added Time format.
(See C:\RSI\IDL52\lib\label_date.pro)
NAME: LADFIT PURPOSE: This function fits the paired data {X(i), Y(i)} to the linear model, y = A + Bx, using a "robust" least absolute deviation method. The result is a two-element vector containing the model parameters, A and B. CATEGORY: Statistics. CALLING SEQUENCE: Result = LADFIT(X, Y) INPUTS: X: An n-element vector of type integer, float or double. Y: An n-element vector of type integer, float or double. KEYWORD PARAMETERS: ABSDEV: Use this keyword to specify a named variable which returns the mean absolute deviation for each data-point in the y-direction. DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE: Define two n-element vectors of paired data. x = [-3.20, 4.49, -1.66, 0.64, -2.43, -0.89, -0.12, 1.41, $ 2.95, 2.18, 3.72, 5.26] y = [-7.14, -1.30, -4.26, -1.90, -6.19, -3.98, -2.87, -1.66, $ -0.78, -2.61, 0.31, 1.74] Compute the model parameters, A and B. result = ladfit(x, y, absdev = absdev) The result should be the two-element vector: [-3.15301, 0.930440] The keyword parameter should be returned as: absdev = 0.636851 REFERENCE: Numerical Recipes, The Art of Scientific Computing (Second Edition) Cambridge University Press, 2nd Edition. ISBN 0-521-43108-5 This is adapted from the routine MEDFIT described in: Fitting a Line by Minimizing Absolute Deviation, Page 703. MODIFICATION HISTORY: Written by: GGS, RSI, September 1994 Modified: GGS, RSI, July 1995 Corrected an infinite loop condition that occured when the X input parameter contained mostly negative data. Modified: GGS, RSI, October 1996 If least-absolute-deviation convergence condition is not satisfied, the algorithm switches to a chi-squared model. Modified keyword checking and use of double precision. Modified: GGS, RSI, November 1996 Fixed an error in the computation of the median with even-length input data. See EVEN keyword to MEDIAN. Modified: DMS, RSI, June 1997 Simplified logic, remove SIGN and MDfunc2 functions. Modified: RJF, RSI, Jan 1999 Fixed the variance computation by adding some double conversions. This prevents the function from generating NaNs on some specific datasets (bug 11680).
(See C:\RSI\IDL52\lib\ladfit.pro)
NAME: LATLON PURPOSE: If the current window has map coordinates (i.e., MAP_SET has been used to set up a map projection), LATLON tracks the longitude and latitude of the mouse location and displays them in a separate window. To activate tracking, click on the left mouse button while the cursor is in the plotting window. To stop, position the cursor in the plotting window and press the right button. CATEGORY: Mapping. CALLING SEQUENCE: LATLON INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: Latitude and longitude values are printed in a new window. COMMON BLOCKS: None. SIDE EFFECTS: A new window is created. RESTRICTIONS: The window must have map coordinates. EXAMPLE: Set up a Mercator map projection by entering the following command: MAP_SET, /MERCATOR, /GRID, /CONTINENT Invoke LATLON by entering: LATLON A new window labeled "Latitude/Longitude" should appear. Put the mouse cursor in the map window and press the left mouse button to begin tracking the position of the cursor. Press the right mouse button over the map to end LATLON. MODIFICATION HISTORY: Written by Ann Bateson, June 1990
(See C:\RSI\IDL52\lib\obsolete\latlon.pro)
NAME: LEEFILT PURPOSE: Performs the Lee filter algorithm on an image array using a box of size 2N+1. This function can also be used on vectors. CATEGORY: E3 Smoothing (image). CALLING SEQUENCE: Result = LEEFILT(A [, N, Sig]) INPUTS: A: The input image array or one-dimensional vector. OPTIONAL INPUT PARAMETERS: N: The size of the filter box is 2N+1. The default value is 5. Sig: Estimate of the standard deviation. The default is 5. If Sig is negative the procedure requests a value to be entered, and displays the resulting image or vector. This cycle continues until a zero value of Sig is entered. KEYWORDS: EXACT: Use this keyword to use a more accurate, but much slower Lee filter algorithm. Recommended when N > ~7. OUTPUTS: The filtered image or vector is returned. COMMON BLOCKS: None. SIDE EFFECTS: Displays the filtered image in an IDL window using TVSCL or PLOT if Sig is negative. RESTRICTIONS: None. PROCEDURE: The LEE (Optical Engineering, Vol 25, No 5, Pg 636-643, May 1986) technique smooths additive image noise by generating statistics in a local neighborhood and comparing them to the expected values. MODIFICATION HISTORY: Written, 24-Nov-1982, by R. A. Howard, Naval Research Lab, Washington, DC 20375 Modified, 30-May-1996, SVP. Modifed to match 1986 algorithm & Added /EXACT at user suggestion. Added PLOT for vector support.
(See C:\RSI\IDL52\lib\leefilt.pro)
NAME: LEGO PURPOSE: This procedure plots a lego graph of 2-dimensional data. CATEGORY: Plotting. CALLING SEQUENCE: LEGO, Data, Xa, Ya INPUTS: Data: A 2-dimensional array. Xa: If present, a 1-dimensional array of X coordinates. Ya: If present, a 1-dimensional array of Y coordinates. KEYWORD PARAMETERS: BARSPACE: If this keyword is specified, LEGO will leave space between the bars. The value of BARSPACE must be between 0.0 and 0.8. OUTLINE: If this keyword is specified, LEGO will draw ONLY the outline of the bars. This is useful when creating black and white hardcopy. SHADES: If this keyword is specified, LEGO will draw ONLY the shaded part of the bars. DELTA: This keyword allows fine adjustment of the width of the bar outlines. RECOMMENDED USE: lower delta value for a small data set and higher delta value for a large data set. The value of DELTA must be between 0.07 and 0.15 The following keywords to SURFACE are also applicable: AX, AZ, CHARSIZE, CHARTHICK, FONT, XMARGIN, YMARGIN, SUBTITLE, TICKLEN, TITLE, (XYZ)CHARSIZE, (XYZ)MINOR, (XYZ)RANGE, (XYZ)STYLE, (XYZ)TICKNAME, (XYZ)TICKS, (XYZ)TICKV, (XYZ)TITLE, BACKGROUND OUTPUTS: The LEGO procedure creates a lego graph on the currently selected device. SIDE EFFECTS: A graphics window is created if none currently exist. RESTRICTIONS: This procedure does not work with the HP device. Of Tektronix terminals, only the 4100 series is supported. PROCEDURE: Straightforward. EXAMPLE: X = FINDGEN(10, 10) ; create 2D array to plot LEGO, X ; create plot MODIFICATION HISTORY: 12/20/91 - Initial creation - jiy (RSI) 06/15/92 - Modified to produce better PS output - jiy (RSI) 08/28/92 - modified to better deal with small arrays -jiy (RSI)
(See C:\RSI\IDL52\lib\obsolete\lego.pro)
NAME: LINFIT PURPOSE: This function fits the paired data {X(i), Y(i)} to the linear model, y = A + Bx, by minimizing the chi-square error statistic. The result is a two-element vector containing the model parameters,[A,B]. CATEGORY: Statistics. CALLING SEQUENCE: Result = LINFIT(X, Y) INPUTS: X: An n-element vector of type integer, float or double. Y: An n-element vector of type integer, float or double. KEYWORD PARAMETERS: CHISQ: Use this keyword to specify a named variable which returns the chi-square error statistic as the sum of squared errors between Y(i) and A + BX(i). If individual standard deviations are supplied, then the chi-square error statistic is computed as the sum of squared errors divided by the standard deviations. DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. PROB: Use this keyword to specify a named variable which returns the probability that the computed fit would have a value of CHISQR or greater. If PROB is greater than 0.1, the model parameters are "believable". If PROB is less than 0.1, the accuracy of the model parameters is questionable. SDEV: An n-element vector of type integer, float or double that specifies the individual standard deviations for {X(i), Y(i)}. SIGMA: Use this keyword to specify a named variable which returns a two-element vector of probable uncertainties for the model par- ameters, [SIG_A,SIG_B]. EXAMPLE: Define two n-element vectors of paired data. x = [-3.20, 4.49, -1.66, 0.64, -2.43, -0.89, -0.12, 1.41, $ 2.95, 2.18, 3.72, 5.26] y = [-7.14, -1.30, -4.26, -1.90, -6.19, -3.98, -2.87, -1.66, $ -0.78, -2.61, 0.31, 1.74] Define a vector of standard deviations with a constant value of 0.85 sdev = replicate(0.85, n_elements(x)) Compute the model parameters, A and B. result = linfit(x, y, chisq = chisq, prob = prob, sdev = sdev) The result should be the two-element vector: [-3.44596, 0.867329] The keyword parameters should be returned as: chisq = 11.4998, prob = 0.319925 REFERENCE: Numerical Recipes, The Art of Scientific Computing (Second Edition) Cambridge University Press ISBN 0-521-43108-5 MODIFICATION HISTORY: Written by: GGS, RSI, September 1994 LINFIT is based on the routines: fit.c, gammq.c, gser.c, and gcf.c described in section 15.2 of Numerical Recipes, The Art of Scientific Computing (Second Edition), and is used by permission. Modified: SVP, RSI, June 1996 Changed SIG_AB to SIGMA to be consistant with the other fitting functions. Changed CHISQR to CHISQ in the docs for the same reason. Note that the chisqr and the SIG_AB keywords are left for backwards compatibility. Modified: GGS, RSI, October 1996 Modified keyword checking and use of double precision. Added DOUBLE keyword.
(See C:\RSI\IDL52\lib\linfit.pro)
NAME: LJLCT PURPOSE: Load standard color tables for LJ-250/252 printer. CATEGORY: Image display. CALLING SEQUENCE: LJLCT OUTPUTS: No explicit outputs. SIDE EFFECTS: The color tables are modified if the current device is 'LJ'. LIMITATIONS: The default color maps used are for the 90dpi color palette. There are only 8 colors colors availible at 180 dpi. PROCEDURE: If the current device is 'LJ', !D.N_COLORS is used to determine how many bit planes are in use (1 to 4). The standard color map for that number of planes is loaded. These maps are described in Chapter 7 of the "LJ250/LJ252 Companion Color Printer Programmer Reference Manual", Table 7-5. That manual gives the values scaled from 1 to 100, LJLCT scales them from 0 to 255. MODIFICATION HISTORY: AB, 29 July 1990.
(See C:\RSI\IDL52\lib\ljlct.pro)
NAME: LL_ARC_DISTANCE PURPOSE: This function returns the longitude and latitude [lon, lat] of a point a given arc distance (-pi <= Arc_Dist <= pi), and azimuth (Az), from a specified location Lon_lat0. CATEGORY: Mapping, geography. CALLING SEQUENCE: Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az) INPUTS: Lon_lat0: A 2-element vector containing the longitude and latitude of the starting point. Values are assumed to be in radians unless the keyword DEGREES is set. Arc_Dist: The arc distance from Lon_lat0. The value must be between -!PI and +!PI. To express distances in arc units, divide by the radius of the globe expressed in the original units. For example, if the radius of the earth is 6371 km, divide the distance in km by 6371 to obtain the arc distance. Az: The azimuth from Lon_lat0. The value is assumed to be in radians unless the keyword DEGREES is set. KEYWORD PARAMETERS: DEGREES: Set this keyword to express all measurements and results in degrees. OUTPUTS: This function returns a two-element vector containing the longitude and latitude of the resulting point. Values are in radians unless the keyword DEGREES is set. PROCEDURE: Formula from Map Projections - a working manual. USGS paper 1395. Equations (5-5) and (5-6). EXAMPLE: Lon_lat0 = [1.0, 2.0] ; Initial point specified in radians Arc_Dist = 2.0 ; Arc distance in radians Az = 1.0 ; Azimuth in radians Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az) PRINT, Result 2.91415 -0.622234 MODIFICATION HISTORY: DMS, Aug, 1992. Written. DJC, Jun, 1994. Added test for zero arc distance. Renamed "dist" variable to "arc_dist" for compatibility with IDL "Dist" function.
(See C:\RSI\IDL52\lib\ll_arc_distance.pro)
NAME: LMFIT PURPOSE: Non-linear least squares fit to a function of an arbitrary number of parameters. The function may be any non-linear function. If available, partial derivatives can be calculated by the user function, else this routine will estimate partial derivatives with a forward difference approximation. CATEGORY: E2 - Curve and Surface Fitting. CALLING SEQUENCE: Result = LMFIT(X, Y, A, FITA=FITA, FUNCTION_NAME = name, ITER=ITER,$ ITMAX=ITMAX, SIGMA=SIGMA, TOL=TOL, WEIGHTS=WEIGHTS,$ CONVERGENCE=CONVERGENCE, ITMIN=ITMIN, DOUBLE=DOUBLE) INPUTS: X: A row vector of independent variables. This routine does not manipulate or use values in X, it simply passes X to the user-written function. Y: A row vector containing the dependent variable. A: A vector that contains the initial estimate for each parameter. WEIGHTS: Set this keyword equal to a vector of fitting weights for Y(i). This vector must be the same length as X and Y. If instrumental (Gaussian) weighting is desired, that is the measurement errors or standard deviations of Y are known (SIGMA), then WEIGHTS should be set to 1/(SIGMA^2.) Or if statistical (Poisson) weighting is appropriate, set WEIGHTS=1/Y. If WEIGHTS is not specified then, no weighting is assumed (WEIGHTS=1.0). FITA: A vector, with as many elements as A, which contains a Zero for each fixed parameter, and a non-zero value for elements of A to fit. If not supplied, all parameters are taken to be non-fixed. KEYWORDS: FUNCTION_NAME: The name of the function (actually, a procedure) to fit. If omitted, "LMFUNCT" is used. The procedure must be written as described under RESTRICTIONS, below. ALPHA: The value of the Curvature matrix upon exit. CHISQ: The value of chi-squared on exit CONVERGENCE: Returns 1 if the fit converges, 0 if it does not meet the convergence criteria in ITMAX iterations, or -1 if a singular matrix is encountered. COVAR: The value of the Covariance matrix upon exit. DOUBLE: Set this keyword to force the computations to be performed in double precision. ITMAX: Maximum number of iterations. Default = 20. ITMAX: Minimum number of iterations. Default = 5. ITER: The actual number of iterations which were performed SIGMA: A vector of standard deviations for the returned parameters. TOL: The convergence tolerance. The routine returns when the relative decrease in chi-squared is less than TOL in an interation. Default = 1.e-6. OUTPUTS: Returns a vector containing the fitted function evaluated at the input X values. The final estimates for the coefficients are returned in the input vector A. SIDE EFFECTS: The vector A is modified to contain the final estimates for the parameters. RESTRICTIONS: The function to be fit must be defined and called LMFUNCT, unless the FUNCTION_NAME keyword is supplied. This function, must accept a single value of X (the independent variable), and A (the fitted function's parameter values), and return an array whose first (zeroth) element is the evalutated function value, and next n_elements(A) elements are the partial derivatives with respect to each parameter in A. If X is passed in as a double, the returned vector MUST be of type double as well. Likewise, if X is a float, the returned vector must also be of type float. For example, here is the default LMFUNCT in the IDL User's Libaray. which is called as : out_array = LMFUNCT( X, A ) function lmfunct,x,a ;Return a vector appropriate for LMFIT ; ;The function being fit is of the following form: ; F(x) = A(0) * exp( A(1) * X) + A(2) = bx+A(2) ; ;dF/dA(0) is dF(x)/dA(0) = exp(A(1)*X) ;dF/dA(1) is dF(x)/dA(1) = A(0)*X*exp(A(1)*X) = bx * X ;dF/dA(2) is dF(x)/dA(2) = 1.0 ; ;return,[[F(x)],[dF/dA(0)],[dF/dA(1)],[dF/dA(2)]] ; ;Note: returning the required function in this manner ; ensures that if X is double the returned vector ; is also of type double. Other methods, such as ; evaluating size(x) are also valid. bx=A(0)*exp(A(1)*X) return,[ [bx+A(2)], [exp(A(1)*X)], [bx*X], [1.0] ] end PROCEDURE: Based upon "MRQMIN", least squares fit to a non-linear function, pages 683-688, Numerical Recipies in C, 2nd Edition, Press, Teukolsky, Vettering, and Flannery, 1992. "This method is the Gradient-expansion algorithm which combines the best features of the gradient search with the method of linearizing the fitting function." Iterations are performed until three consequtive iterations fail to chang the chi square changes by greater than TOL, or until ITMAX, but at least ITMIN, iterations have been performed. The initial guess of the parameter values should be as close to the actual values as possible or the solution may not converge. The function may fail to converge, or it can encounter a singular matrix. If this happens, the routine will fail with the Numerical Recipes error message: EXAMPLE: Fit a function of the form: f(x)=a(0) * exp(a(1)*x) + a(2) + a(3) * sin(x) Define a lmfit return function: function myfunct,x,a ;Return a vector appropriate for LMFIT ;The function being fit is of the following form: ; F(x) = A(0) * exp( A(1) * X) + A(2) + A(3) * sin(x) ; dF(x)/dA(0) = exp(A(1)*X) ; dF(x)/dA(1) = A(0)*X*exp(A(1)*X) = bx * X ; dF(x)/dA(2) = 1.0 ; dF(x)/dA(3) = sin(x) bx=A(0)*exp(A(1)*X) return,[[bx+A(2)+A(3)*sin(x)],[exp(A(1)*X)],[bx*X],[1.0],[sin(x)]] end pro run_lmfunct x=findgen(40)/20. ;Define indep & dep variables. y=8.8 * exp( -9.9 * X) + 11.11 + 4.9 * sin(x) sig=0.05 * y a=[10.0,-7.0,9.0,4.0] ;Initial guess fita=[1,1,1,1] ploterr,x,y,sig yfit=lmfit(x,y,a,WEIGHTS=(1/sig^2.),FITA=FITA,$ SIGMA=SIGMA,FUNCTION_NAME='myfunct') oplot,x,yfit for i=0,3 do print,i,a(i),format='("A (",i1,")= ",F6.2)' end MODIFICATION HISTORY: Written, SVP, RSI, June 1996. Modified, S. Lett, RSI, Dec 1997 Jan 1998 Feb 1998
(See C:\RSI\IDL52\lib\lmfit.pro)
NAME: LN03 PURPOSE: Produce plot files suitable for printing by an LN03+ laser printer. CATEGORY: Graphics. CALLING SEQUENCE: LN03, Filename ;To start outputting plot codes to a file and ;the terminal. LN03, Filename, 0 ;Same as above, but don't send to terminal. LN03 ;To close the file. INPUTS: Filename: The name of the file to contain the plots. The default extension is .LIS. To_terminal: An optional parameter, which if present and 0, inhibits sending the plots to the terminal. Note: The terminal must be a Tektronix compatible terminal. OUTPUTS: No explicit outputs. COMMON BLOCKS: LN03_COMMON: This common block ontains the unit number and name of the graphics device to restore to when finished. SIDE EFFECTS: A file is opened and closed. RESTRICTIONS: Be sure to call LN03 to close the file after all the plots have been produced. If you don't, the file will not contain the escape sequence to take the printer out of the Tektronix mode when done. You can repeat this process as many times as you wish, producing more than one file. The plot files produced by IDL must be printed using a special form: For VMS, include the following command in your SYS$MANAGER:SYSTARTUP.COM file: $ DEFINE /FORM PLOT 3 /NOWRAP /NOTRUNC /STOCK=DEFAULT This command makes the form and assigns it to form number 3. Of course, you can also define a symbol to accomplish the same thing in your LOGIN.COM file: $ PLOT :== PRINT /FORM=PLOT /PASSALL Then, to print a plot file, enter: $ PLOT EXAMPLE Real VMS wizards may want to define a device-control library for the PLOT form to insert the escape sequences at the beginning to put the LN03+ into the Tektronix mode, and to revert to the normal mode. In this case, you will have to remove the print statements in the LN03 procedure that put these escape sequences in the output file. For ULTRIX, we can make no specific recommendations, as the printcap files vary greatly. We suggest that you copy your printcap entry to a new entry, called for example: "lntek" Be sure that the pl and pw parameters are not set. Also, disable all output filters. Use xc#0177777:xs#040 to disable output translations. Then to print a plot file, enter: lpr -Plntek file. PROCEDURE: Opening Call: Open the file, set the device to that of a TEK 4014 printer, output the correct escape sequence. Closing Call: Restore the previous graphics device and send out the correct closing escape sequence before closing the file. MODIFICATION HISTORY: DMS, March, 1988. SMR, September, 1990. Updated to work with V2 of IDL and included all pertinent documentation in library header.
(See C:\RSI\IDL52\lib\obsolete\ln03.pro)
NAME: LOADCT PURPOSE: Load predefined color tables. CATEGORY: Image display. CALLING SEQUENCE: LOADCT [, Table] OPTIONAL INPUTS: Table: The number of the pre-defined color table to load, from 0 to 15. If this value is omitted, a menu of the available tables is printed and the user is prompted to enter a table number. KEYWORD PARAMETERS: FILE: If this keyword is set, the file by the given name is used instead of the file colors1.tbl in the IDL directory. This allows multiple IDL users to have their own color table file. The specified file must exist. GET_NAMES: If this keyword is present AND DEFINED, the names of the color tables are returned as a string array. No changes are made to the color table. NCOLORS = number of colors to use. Use color indices from 0 to the smaller of !D.TABLE_SIZE-1 and NCOLORS-1. Default = !D.TABLE_SIZE = all available colors. SILENT: If this keyword is set, the Color Table message is suppressed. BOTTOM = first color index to use. Use color indices from BOTTOM to BOTTOM+NCOLORS-1. Default = 0. OUTPUTS: No explicit outputs. COMMON BLOCKS: COLORS: The IDL color common block. SIDE EFFECTS: The color tables of the currently-selected device are modified. RESTRICTIONS: Works from the file: $IDL_DIR/resource/colors/colors1.tbl or the file specified with the FILE keyword. PROCEDURE: The file "colors1.tbl" or the user-supplied file is read. If the currently selected device doesn't have 256 colors, the color data is interpolated from 256 colors to the number of colors available. The colors loaded into the display are saved in the common block COLORS, as both the current and original color vectors. Interpolation: If the current device has less than 256 colors, the color table data is interpolated to cover the number of colors in the device. MODIFICATION HISTORY: Old. For a widgetized version of this routine, see XLOADCT in the IDL widget library. DMS, 7/92, Added new color table format providing for more than 16 tables. Now uses file colors1.tbl. Old LOADCT procedure is now OLD_LOADCT. ACY, 9/92, Make a pixmap if no windows exist for X windows to determine properly the number of available colors. Add FILE keyword. WSO, 1/95, Updated for new directory structure AB, 10/3/95, The number of entries in the COLORS common block is now always !D.TABLE_SIZE instead of NCOLORS + BOTTOM as before. This better reflects the true state of the device and works with other color manipulations routines. DLD, 09/98, Avoid repeating a color table name in the printed list.
(See C:\RSI\IDL52\lib\loadct.pro)
NAME: LU_COMPLEX PURPOSE: This function solves an N by N complex linear system using LU decomposition. The result is an N-element complex vector. Alternatively, this function computes the generalized inverse of an N by N complex array using LU decomposition. The result is an N by N complex array. CATEGORY: Complex Linear Algebra. CALLING SEQUENCE: Result = LU_COMPLEX(A, B) INPUTS: A: An N by N complex array. B: An N-element right-side vector (real or complex). KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. INVERSE: If set to a non-zero value, the generalized inverse of A is computed. In this case the input parameter B is ignored. SPARSE: If set to a non-zero value, the input array is converted to row-indexed sparse storage format. Computations are done using the iterative biconjugate gradient method. This keyword is effective only when solving complex linear systems. This keyword has no effect when calculating the generalized inverse. EXAMPLE: 1) Define a complex array (A) and right-side vector (B). A = [[complex(1, 0), complex(2,-2), complex(-3,1)], $ [complex(1,-2), complex(2, 2), complex(1, 0)], $ [complex(1, 1), complex(0, 1), complex(1, 5)]] B = [complex(1, 1), complex(3,-2), complex(1,-2)] Solve the complex linear system (Az = B) for z. z = LU_COMPLEX(a, b) 2) Compute the generalized inverse of A. inv = LU_COMPLEX(a, b, /inverse) PROCEDURE: LU_COMPLEX solves the complex linear system Az = b using LU decomposition. If the SPARSE keyword is set, the coefficient array is converted to row-indexed sparse storage format and the system is solved using the iterative biconjugate gradient method. LU_COMPLEX computes the generalized inverse of the complex array A using LU decomposition if B is supplied as an arbitrary scalar value or if the INVERSE keyword is set. REFERENCE: Numerical Recipes, The Art of Scientific Computing (Second Edition) Cambridge University Press ISBN 0-521-43108-5 MODIFICATION HISTORY: Written by: GGS, RSI, October 1993 Modified: GGS, RSI, February 1994 Transposing the array prior to calling LU_COMPLEX is no longer necessary. LU_COMPLEX is now able to compute the generalized inverse of an N by N complex array using LU decomposition. Modified: GGS, RSI, June 1994 Included support for sparse complex arrays using the Numerical Recipes functions NR_SPRSIN and NR_LINBCG. Modified: GGS, RSI, Decemberber 1994 Added support for double-precision complex inputs. Reduced internal memory allocation requirements. Added INVERSE keyword. New documentation header. Modified: GGS, RSI, April 1996 Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\lu_complex.pro)
NAME: MAKETREE PURPOSE: MakeTree constructs a tree representation of the nested clusters created by the join procedure. CATEGORY: Statistics. CALLING SEQUENCE: MAKETREE, Pos, Imin, Sim [, Unit] INPUT: Pos(i): The position of the ith case as a leaf in the tree to be constructed. Imin(i): The smallest cluster to strictly contain the case or object i. Sim (i): A measure of similarity among the objects in cluster i. OPTIONAL INPUT PARAMETERS: Unit: The file unit for output. Default is to the screen. KEYWORDS: WIDTH: User-supplied tree width in characters. The default is 60. MAKETREE tries to fit the tree into the specified width. CASENAME: User-supplied vector of case names to be used in the output. PROCEDURE: We scan the cases in the order they appear in the tree. A list V is maintained of strictly increasing clusters to be used to determine which cluster should appear in the gap between case i and case i+1. Each cluster in V contains at least one case that has been scanned.
(See C:\RSI\IDL52\lib\obsolete\maketree.pro)
NAME: MANN_WHITNEY PURPOSE: To test the null hypothesis that two populations have the same distribution -i.e. F(x) = G(x) against the alternative that their distributions differ in location, i.e F(x) = G(x+a). MANN_WHITNEY is a rank test that does not assume equal population sizes. CATEGORY: Statistics. CALLING SEQUENCE: MANN_WHITNEY, Pop [, U0, U1, N1, N2, Z, Prob, MISSING = M] INPUTS: Pop: Array dimensioned (2,Maxsize). Pop(i,j) = jth observation from ith population, i = 0, 1. KEYWORDS: MISSING: Value used as a place holder for missing data. Pairwise handling of missing data. OPTIONAL OUTPUT PARAMETERS: U0: MANN_WHITNEY statistic for Population 0. U1: MANN_WHITNEY statistic for Population 1. N1: Size of sample from Pop(0,*) N2: Size of sample from Pop(1,*) Z: Test statistic,almost normal, to be used when sample sizes exceed 10. Otherwise, Z=0. Prob: Probablity of Z or something more extreme. Undefined for small sample sizes. RESTRICTIONS: All populations have the same sample size. COMMON BLOCKS: None. PROCEDURE: The Mann_Whitney statistics Ua may be computed by ordering all observations according to their magnitude and counting the number of observations in the first sample that precede each observation in the second. Ub may be computed likewise. Very large or very small values of UA or UB indicate seperation in the data and suggest rejection of the null hypothesis.
(See C:\RSI\IDL52\lib\obsolete\mann_whitney.pro)
NAME: MAN_PROC PURPOSE: Provide online documentation for IDL topics. If the current graphics device supports widgets, a graphical user interface is used. Otherwise, a more basic version that is a cross between the Unix man pages and VMS online help is used. The help is organized in a two-level hierarchy. Level 1 is the global subject, and Level 2 supplies help on subjects within each global subject. CATEGORY: Help, documentation. CALLING SEQUENCE: MAN_PROC [, Request] INPUTS: Request: A scalar string containing the item for which help is desired. This string can contain one or two (whitespace separated) words. The first word is taken as the global topic and the second as the topic within the scope of the first. The user is prompted for missing words. OUTPUTS: The widget version uses a text widget to display the help text. The basic version sends help text to the standard output. COMMON BLOCKS: None. RESTRICTIONS: The help text is derived from the LaTeX files used to produce the reference manual. However, it is not possible to produce exactly the same output as found in the manual due to the limitations of text-oriented terminals. Therefore, the text used is considerably abbreviated. Always check the manual if the online help is insufficient. MODIFICATION HISTORY: 4 January 1991, AB Renamed the old MAN_PROC to MP_BASIC and added MP_WIDGETS to handle the widget interface. 3 September 1992, AB Switched from the IDLwidgets version (MP_WIDGETS) to the builtin help. This allows help and the IDL> prompt to work simultaneously 17 May 1993, AB Reverted to using MP_WIDGETS for the Sun 3 because it is stuck at OpenWindows 2.0 and recent changes to online help will not be ported to that platform.
(See C:\RSI\IDL52\lib\obsolete\man_proc.pro)
NAME: MAP_CONTINENTS PURPOSE: The MAP_CONTINENTS procedure draws continental boundaries, filled continents, political boundaries, coastlines, and/or rivers, over an existing map projection established by MAP_SET. Outlines can be drawn in low or high-resolution (if the optional high-resolution CIA World Map database is installed). If MAP_CONTINENTS is called without any keywords, it draws low-resolution, unfilled continent outlines. MAP_SET must be called before MAP_CONTINENTS to establish the projection type, the center of the projection, polar rotation and geographic limits. Keywords not recognized are passed along in _EXTRA to PLOTS and/or POLYFILL depending on options requested. CATEGORY: MAPPING CALLING SEQUENCE: MAP_CONTINENTS INPUTS: NONE INPUT KEYWORD PARAMETERS: COASTS -- Set this keyword to draw coastlines, islands, and lakes instead of the default continent outlines. Note that if you are using the low-resolution map database (if the HIRES keyword is not set), many islands are drawn even when COASTS is not set. If you are using the hi gh-resolution map database (if the HIRES keyword is set), no islands are drawn unless COASTS is set. COLOR -- The color index of the lines being drawn. COUNTRIES -- Set this keyword to draw political boundaries as of 1993. _EXTRA -- Other keywords passed along to PLOTS/POLYFILL depending on options selected. Note that command line keywords (like MLINETHICK) will take precedence over options specified with _EXTRA or their natural names (like THICK). FILL_CONTINENTS -- Set this keyword to 1 to fill continent boundaries with a solid color. The color is set by the COLOR keyword. Set this keyword to 2 to fill continent boundaries with a line fill. For line filling, the COLOR, MLINESTYLE, MLINETHICK, ORIENTATION, and SPACING keywords can be used to control the type of line fill. Any option valid for polyfill can also be used (i.e. PATTERN). HIRES -- Set this keyword to use high-resolution map data instead of the default low-resolution data. This option is only available if you have installed the optional high-resolution map datasets. If the high-resolution data is not available, a warning is printed and the low-resolution data is used instead. This keyword can be used in conjunction with the COASTS, COUNTRIES, FILL_CONTINENTS, and RIVERS keywords. MLINESTYLE -- The line style of the boundaries being drawn. The default is solid lines. MLINETHICK -- The thickness of the boundary or fill lines. The default thickness is 1. ORIENTATION -- Set this keyword to the counterclockwise angle in degrees from horizontal that the line fill should be drawn. The default is 0. This keyword only has effect if the FILL_CONTINENTS keyword is set to 2. RIVERS -- Set this keyword to draw rivers. SPACING -- Set this keyword to the spacing, in centimeters, for a line fill. This keyword only has effect if the FILL_CONTINENTS keyword is set to 2. The default is 0.5 centimeters. USA -- Set this keyword to draw borders for each state in the United States in addition to continental boundaries. OUTPUT KEYWORD PARAMETERS: NONE OUTPUTS: Draws continents, etc. over the current map display. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: See DESCRIPTION. DESCRIPTION: See PURPOSE. EXAMPLES: Draw Low-Resolution continents, with high resolution political boundaries. MAP_SET MAP_CONTINENTS MAP_CONTINENTS,/hires,/countries DEVELOPMENT NOTES: This version uses !type=3 and uses the NEW (IDL5) map software. requires map_struct_append in map_set.pro MODIFICATION HISTORY: SVP, 11/96 ; Added header template.
(See C:\RSI\IDL52\lib\map_continents.pro)
NAME: MAP_GRID PURPOSE: The MAP_GRID procedure draws the graticule of parallels and meridians, according to the specifications established by MAP_SET. MAP_SET must be called before MAP_GRID to establish the projection type, the center of the projection, polar rotation and geographical limits. CATEGORY: Mapping. CALLING SEQUENCE: MAP_GRID INPUTS: NONE OPTIONAL INPUTS: NONE KEYWORD PARAMETERS: BOX_AXES: Surround the map window with a "box" style axes with annotations, outside the box, where the parallels intersect the sides, and the meridians intersect the bottom and top edges of the box. The border of the box is drawn in alternating foreground and background colors, with color changes at each intersection with a parallel or meridian. This keyword determines the thickness of the box's border, in millimeters. If LABEL is not explicitly specified, it defaults to 1 when this keyword is present. If this feature is selected, be sure to leave enough room around the map window for the annotation, usually by specifying the XMARGIN and YMARGIN keywords to MAP_SET. See the example below. CHARSIZE: The size of the characters used for the labels. The default is 1. COLOR: The color index for the grid lines. FILL_HORIZON: Fills the current map_horizon. HORIZON: Draws the current map horizon. INCREMENT: Determines the spacing between graticle points. GLINESTYLE: If set, the line style used to draw the grid of parallels and meridians. See the IDL User's Guide for options. The default is dotted. GLINETHICK: The thickness of the grid lines. Default is 1. LABEL: Set this keyword to label the parallels and meridians with their corresponding latitudes and longitudes. Setting this keyword to an integer will cause every LABEL gridline to be labeled (i.e, if LABEL=3 then every third gridline will be labeled). The starting point for determining which gridlines are labeled is the minimum latitude or longitude (-180 to 180), unless the LATS or LONS keyword is set to a single value. In this case, the starting point is the value of LATS or LONS. LATALIGN: This keyword controls the alignment of the text baseline for latitude labels. A value of 0.0 left justifies the label, 1.0 right justifies it, and 0.5 centers it. LATDEL: The spacing in degrees between parallels of latitude in the grid. If not set, a suitable value is determined from the current map projection. LATS: The desired latitudes to be drawn (and optionally labeled). If this keyword is omitted, appropriate latitudes will be generated with consideration of the optional LATDEL keyword. If this keyword is set to a single value, drawn (and optionally labeled) latitudes will be automatically generated as [...,LATS-LATDEL,LATS,LATS+LATDEL,...] over the extent of the map. The single valued LATS is taken to be the starting point for labelling (See the LABEL keyword). LATLAB: The longitude at which to place latitude labels. The default is the center longitude on the map. LATNAMES: An array specifing the names to be used for the latitude labels. By default, this array is automatically generated in units of degrees. This array can be a string array or numeric, but should not be of mixed type. When LATNAMES is specified, LATS must also be specified, but the number of elments in the two arrays need not be equal. Extra LATNAMES are ignored, while LATNAMES not supplied are automatically reported in degrees. LATNAMES can be used when LATS is set to a single value. It this case, the LATS used will start at the specified latitude and progress northward, wrapping around the globe if appropriate. Caution should be used when using LATNAMES in conjunction with a single LATS, since the number of visible latitude gridlines is dependent on many factors. LONALIGN: This keyword controls the alignment of the text baseline for longitude labels. A value of 0.0 left justifies the label, 1.0 right justifies it, and 0.5 centers it. LONDEL: The spacing in degrees between meridians of longitude in the grid. If not set, a suitable value is determined from the current map projection. LONLAB: The latitude at which to place longitude labels. The default is the center latitude on the map. LONS: The desired longitudes to be drawn (and optionally labeled). If this keyword is omitted, appropriate longitudes will be generated with consideration of the optional LONDEL keyword. If this keyword is set to a single value, drawn (and optionally labeled) longitudes will be automatically generated as [...,LONS-LONDEL,LONS,LONS+LONDEL,...] over the extent of the map. The single valued LONS is taken to be the starting point for labeling (See the LABEL keyword). LONNAMES: An array specifing the names to be used for the longitude labels. By default, this array is automatically generated in units of degrees. This array can be a string array or numeric, but should not be of mixed type. When LONNAMES is specified, LATS must also be specified, but the number of elments in the two arrays need not be equal. Extra LONNAMES are ignored, while LATNAMES not supplied are automatically reported in degrees. LONNAMES can be used when LONS is set to a single value. It this case, the LONS used will start at the specified longitude and progress eastward, wrapping around the globe if appropriate. Caution should be used when using LONNAMES in conjunction with a single LONS, since the number of visible longitude gridlines is dependent on many factors. ORIENTATION: Specifies the clockwise angle in degrees from horizontal of the text baseline that the labels should be rotated. Note, that the rotation used in MAP_SET is also clockwise, but XYOUTS is normally counterclockwise. OUTPUTS: Draws gridlines and labels on the current map. EXAMPLE: map_set,10,20,23.5,/cont,/ortho,/horizon ; establish a projection lats=[-65,-52,-35,-20,-2.59,15,27.6,35,45,55,75,89] ; choose the parallels to draw map_grid,lats=lats,londel=20,lons=-13,label=2,lonlab=-2.5,latlab=7 ;draw the grid Make a map with a grid surrounded by a box style axis: map_set, /STEREO, 40, -90,scale=50e6,/CONTINENTS, XMARGIN=3, YMARGIN=3 map_grid, /BOX_AXES, COLOR=3, CHARSIZE=1.5 ; MODIFICATION HISTORY: Written by: SVP, May, 23 1996. DMS, Feb, 1996 Note that this version plots all gridlines unless a 4 element LIMIT was specified to MAP_SET. SVP, Nov 1996 Changed over !map1 (new IDL5 maps) SVP, May 1996 Map_Grid used to live inside of map_set.pro, now it lives here. SVP, May 1996 Changed LABEL to determine the skip between labelled gridlines. Also, added the LATS and LONS keywords to give complete control over where the labels go. SVP, Sept 1996 Added LATNAMS,LONAMES, and ORIENTATION keywords DMS, Nov, 1996 Rev 2 of maps. DMS, Jul, 1997 Added Box Axes
(See C:\RSI\IDL52\lib\map_grid.pro)
NAME: map_image PURPOSE: This function returns the Image_Orig image warped to fit the current map. Image_Orig must be centered at 0. This routine works in image space. Category: Mapping Calling Sequence: result = map_image(Image_Orig [, Startx, Starty [, xsize, ysize]]) INPUT: Image_Orig--- A two-dimensional array representing geographical image to be overlayed on map. It has Nx columns, and Ny rows. KEYWORDS: LATMIN --- the latitude corresponding to the first row of Image_Orig. The default value is -90. Latitude and Longitude values refer to the CENTER of each cell. LATMAX --- the latitude corresponding to last row of Image_Orig. The default is 90 - (180. / Ny). LONMIN --- the longitude corresponding to the first [left] column of Image_Orig. The default value is -180. Lonmin must be in the range of -180 to +180 degrees. LONMAX --- the longitude corresponding to the last column of Image_Orig. Lonmax must be larger than Lonmin. If the longitude of the last column is equal to (lonmin - (360. /Nx)) MODULO 360. it is assumed that the image covers all longitudes. BILINEAR --- A flag, if set, to request bilinear interpolation. The default is nearest neighbor. Bilinear appears much better. COMPRESS --- Interpolation compression flag. Setting this to a higher number saves time --- lower numbers produce more accurate results. Setting this to 1 solves the inverse map transformation for every pixel of the output image. Default = 4 for output devices with fixed pixel sizes. Fix is used to make this an int. SCALE = pixel / graphics scale factor for devices with scalable pixels (e.g. PostScript). Default = 0.02 pixels/graphic_coord. This yields an approximate output image size of 350 x 250. Make this number larger for more resolution (and larger PostScript files, and images), or smaller for faster and smaller, less accurate images. MISSING = value to set areas outside the valid map coordinates. If omitted, areas outside the map are set to 255 (white) if the current graphics device is PostScript, or 0 otherwise. MAX_VALUE = values in Image_Orig greater than or equal to MAX_VALUE are considered missing. Pixels in the output image that depend upon missing pixels will be set to MISSING. MIN_VALUE = values in Image_Orig less than or equal to MIN_VALUE are considered missing. Optional Output Parameters: Startx --- the x coordinate where the left edge of the image should be placed on the screen. Starty --- the y coordinate where th bottom edge of the image should be placed on the screen. xsize --- returns the width of the resulting image expressed in graphic coordinate units. If current graphics device has scalable pixels, the value of XSIZE and YSIZE should be passed to the TV procedure. ysize --- returns the pixel height of the resulting image, if the current graphics device has scalable pixels. Output: The warped image is returned. Procedure: An image space algorithm is used, so the time required is roughly proportional to the size of the final image. For each pixel in the box enclosed by the current window, and enclosed by the Image, the inverse coordinate transform is applied to obtain lat/lon. The lat/lon coordinates are then scaled into image pixel coordinates, and these coordinates are then interpolated from Image values. Restrictions: Probably won't work on VMS cause it doesn't support NaN. MODIFICATION HISTORY: CAB, Feb, 1992. Map_image has been changed to handle images crossing the international dateline in a more convenient way. Specifically, it no longer requires that the keyword LONMIN be greater than or equal to -180 or the keyword LONMAX be less than or equal to 180. DMS, Aug, 1992. Completly rewritten. Uses different algorithms. DMS, Dec, 1992. Coordinates were off by part of a pixel bin. Also, round when not doing bi-linear interpolation. DMS, Sep, 1993. Added MAX_VALUE keyword. DMS, Nov, 1994. Added MIN_VALUE keyword. SVP, Mar, 1995. Compress is now fix()'d. y is now scaled correctly. SVP, May, 1996. Removed Whole_Map keyword. Changes in the noborder behavior of MAP_SET make this keyword obselete. DMS, Nov, 1996. Adapted for new maps, rev 2.
(See C:\RSI\IDL52\lib\map_image.pro)
NAME: map_patch PURPOSE: This function linearly interpolates a data sampled in latitude/longitude into device space. Data values may be either rectangularly or irregularly gridded over the globe. Category: Mapping Calling Sequence: result = map_patch(Image_Orig [, Lons] [, Lats]) INPUT: Image_Orig- A array containing the data to be overlayed on map. It may be either 1D or 2D. If 2D, it has Nx columns, and Ny rows. The cell connectivity must be rectangular, unless the TRIANGULATE keyword is specified. If Image_Orig is 1D, then Lats and Lons must contain the same number of points. Lons- A vector or 2D array containing the longitude of each data point or column. If Lons is 1D, lon(image_orig(i,j)) = Lons(i); if Lons is 2D, lon(image_orig(i,j)) = Lons(i,j). This optional parameter may be omitted if the longitudes are equally spaced and are specified with the LON0 and LON1 keywords. Lats- A vector or 2D array containing the latitude of each data point or row If Lats is 1D, lat(image_orig(i,j)) = Lats(j); if Lats is 2D, lat(image_orig(i,j)) = Lat(i,j). This optional parameter may be omitted if the latitudes are equally spaced and are specified with the LAT0 and LAT1 keywords. KEYWORDS: LAT0- The latitude of the first row of data. Default=-90. LAT1- The latitude of the last row of data. Default=+90. LATMIN, LATMAX - For compatibility with MAP_IMAGE, the latitude range of equally spaced cells may be specified using these keywords, rather than with LAT0 and LAT1. LON0- The longitude of the first column of data. Default=-180. LON1- The longitude of the last column of data. Default=180-360/Ny. LONMIN, LONMAX - For compatibility with MAP_IMAGE, the longitude range of equally spaced cells may be specified using these keywords, rather than with LON0 and LON1. MISSING = value to set areas outside the valid map coordinates. If omitted, areas outside the map are set to 255 (white) if the current graphics device is PostScript, or 0 otherwise. MAX_VALUE = values in Image_Orig greater than MAX_VALUE are considered missing. Pixels in the output image that depend upon missing pixels will be set to MISSING. TRIANGULATE = if set, the points are Delauny triangulated on the sphere using the TRIANGULATE procedure to determine connectivity. Otherwise, rectangular connectivity is assumed. Optional Output Keywords: xstart --- the x coordinate where the left edge of the image should be placed on the screen. ystart --- the y coordinate where th bottom edge of the image should be placed on the screen. xsize --- returns the width of the resulting image expressed in graphic coordinate units. If current graphics device has scalable pixels, the value of XSIZE and YSIZE should be passed to the TV procedure. ysize --- returns the pixel height of the resulting image, if the current graphics device has scalable pixels. Restrictions: This could be quicker. Output: The interpolated function/warped image is returned. Procedure: An object space algorithm is used, so the time required is roughly proportional to the size, in elements, of Image_Orig. Computations are performed in floating point. For rectangular grids, each rectangular cell of the original image is divided by a diagonal, into two triangles. If TRIANGULATE is set, indicating irregular gridding, the cells are triangulated. The trianges are then converted from lat/lon to image coordinates and then interpolated into the image array using TRIGRID. MODIFICATION HISTORY: DMS of RSI, July, 1994. Written. DMS, Nov, 1996. Rewritten and adapted for new maps, rev 2.
(See C:\RSI\IDL52\lib\map_patch.pro)
Limit = A four or eight element vector. If a four element vector, [Latmin, Lonmin, Latmax, Lonmax] specifying the boundaries of the region to be mapped. (Latmin, Lonmin) and (Latmax, Lonmax) are the latitudes and longitudes of two diagonal points on the boundary with Latmin < Latmax and Lonmin < Lonmax. For maps that cross the international dateline, specify west longitudes as angles between 180 and 360. If an eight element vector: [ lat0, lon0, lat1, lon1, lat2, lon2, lat3, lon3] specify four points on the map which give, respectively, the location of a point on the left edge, top edge, right edge, and bottom edge of the map extent.
(See C:\RSI\IDL52\lib\map_set.pro)
NAME: MD_TEST PURPOSE: This function tests the hypothesis that a sample population is random against the hypothesis that it is not random. The result is a two-element vector containing the nearly-normal test statistic Z and the one-tailed probability of obtaining a value of Z or greater. This test is often refered to as the Median Delta Test. CATEGORY: Statistics. CALLING SEQUENCE: Result = MD_test(X) INPUTS: X: An n-element vector of type integer, float or double. KEYWORD PARAMETERS: ABOVE: Use this keyword to specify a named variable which returns the number of sample population values greater than the median of X. BELOW: Use this keyword to specify a named variable which returns the number of sample population values less than the median of X. MDC: Use this keyword to specify a named variable which returns the number of Median Delta Clusters; sequencial values of X above and below the median. EXAMPLE: Define a sample population. x = [2.00, 0.90, -1.44, -0.88, -0.24, 0.83, -0.84, -0.74, 0.99, $ -0.82, -0.59, -1.88, -1.96, 0.77, -1.89, -0.56, -0.62, -0.36, $ -1.01, -1.36] Test the hypothesis that X represents a random population against the hypothesis that it does not represent a random population at the 0.05 significance level. result = md_test(x, mdc = mdc) The result should be the 2-element vector: [0.459468, 0.322949] The computed probability (0.322949) is greater than the 0.05 significance level and therefore we do not reject the hypothesis that X represents a random population. PROCEDURE: MD_TEST computes the nonparametric Median Delta Test. Each sample in the population is tagged with either a 1 or a 0 depending on whether it is above or below the population median. Samples that are equal to the median are removed and the population size is corresponding reduced. This test is an extension of the Runs Test for Randomness. REFERENCE: APPLIED NONPARAMETRIC STATISTICAL METHODS Peter Sprent ISBN 0-412-30610-7 MODIFICATION HISTORY: Written by: GGS, RSI, November 1994 Modified: GGS, RSI, November 1996 Fixed an error in the computation of the median with even-length input data. See EVEN keyword to MEDIAN.
(See C:\RSI\IDL52\lib\md_test.pro)
NAME: MEAN PURPOSE: This function computes the mean of an N-element vector. CATEGORY: Statistics. CALLING SEQUENCE: Result = MEAN(X) INPUTS: X: An N-element vector of type integer, float or double. KEYWORD PARAMETERS: DOUBLE: IF set to a non-zero value, computations are done in double precision arithmetic. NAN: If set, treat NaN data as missing. EXAMPLE: Define the N-element vector of sample data. x = [65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71, 66, 65, 70] Compute the standard deviation. result = MEAN(x) The result should be: 66.7333 PROCEDURE: MEAN calls the IDL function MOMENT. REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Written by: GSL, RSI, August 1997
(See C:\RSI\IDL52\lib\mean.pro)
NAME: MeanAbsDev PURPOSE: MeanAbsDev computes the mean absolute deviation (average deviation) of an N-element vector. CATEGORY: Statistics. CALLING SEQUENCE: Result = MeanAbsDev(X) INPUTS: X: An N-element vector of type integer, float or double. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, MEANABSDEV performs its computations in double precision arithmetic and returns a double precision result. If not set to a non-zero value, the computations and result depend upon the type of the input data (integer and float data return float results, while double data returns double results). This has no effect if the Median keyword is set. MEDIAN: If set to a non-zero value, meanabsdev will return the average deviation from the median, rather than the mean. If Median is not set, meanabsdev will return the average deviation from the mean. NAN: If set, treat NaN data as missing. EXAMPLES: Define the N-element vector of sample data. x = [1, 1, 1, 2, 5] Compute the average deviation from the mean. result = MeanAbsDev( x ) The result should be: 1.20000 Compute the average deviation from the median. result = MeanAbsDev( x, /median ) The result should be: 1.00000 PROCEDURE: MeanAbsDev calls the IDL function MEAN. MeanAbsDev calls the IDL function MEDIAN if the Median keyword is set to a nonzero value. REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Written by: GSL, RSI, August 1997 RJF, RSI, Sep 1998, Removed NaN keyword from Median call as NaN is not currently supported by the Median routine.
(See C:\RSI\IDL52\lib\meanabsdev.pro)
NAME: MENUS PURPOSE: Implement a crude menu facility using character strings at the bottom of an IDL window. The mouse can be used to select the different menu items. CATEGORY: ?? CALLING SEQUENCE: Result = MENUS(Fcn, Choices, Help_Str) INPUTS: Fcn: A flag that tells MENUS to either create the menu or allow a selection from the menu. Set Fcn to 0 to draw the original choices, drawn on bottom of window. Set Fcn to 1 to select a choice, and to "unhighlight" the previous choice. Choices: A string array containing the text for each choice. Help_str: A string array with the same number of elements as Choices. Help text is displayed on top of the window if the corresponding choice is made. OUTPUTS: MENUS returns the subscript corresponding to the selected Choice, from 0 to the number of elements in Choice -1. If the right button is pressed, -1 is returned to indicate done. COMMON BLOCKS: MENU_COMMON SIDE EFFECTS: Text is written on the display. RESTRICTIONS: This simple menu-creation utility is quite crude. X Windows users can create much better user interfaces with the IDL Widgets. See the WIDGETLIB for details. PROCEDURE: Make menu, allow selections, and exit. MODIFICATION HISTORY: DMS, December, 1987. DMS, April, 1989. Added wait for button debouncing
(See C:\RSI\IDL52\lib\obsolete\menus.pro)
NAME: MESH_OBJ PURPOSE: MESH_OBJ generates a polygon mesh (vertex list and polygon list) that represent the desired primitive object. The available primitive objects are: triangulated surface, rectangular surface, polar surface, cylindrical surface, spherical surface, surface of extrusion, surface of revolution, and ruled surface. CATEGORY: Graphics. CALLING SEQUENCE: MESH_OBJ, Type, Vertex_List, Polygon_List, Array1, Array2 INPUTS: Type: An integer which specifies what type of object to create. TYPE CODE: SURFACE TYPE: ---------- ------------- 0 TRIANGULATED 1 RECTANGULAR 2 POLAR 3 CYLINDRICAL 4 SPHERICAL 5 EXTRUSION 6 REVOLUTION 7 RULED ELSE none Vertex_List: On input, Vertex_List may be undefined. On output, it contains the mesh vertices. Vertex_List and Polygon_List have the same format as the lists returned by the SHADE_VOLUME procedure. Polygon_List: On input, Polygon_List may be undefined. On output, it contains the mesh indexes. Array1: An array whose use depends on the type of object being created. SURFACE TYPE: Array1 type ------------- -------------------------------------------- TRIANGULATED A (3, n) array containing random [x, y, z] points to build a triangulated surface from. The resulting polygon mesh will have n vertices. When shading a triangulated mesh, the shading array should have (n) elements. RECTANGULAR A two dimensional (n, m) array containing z values. The resulting polygon mesh will have n*m vertices. When shading a rectangular mesh, the shading array should have (n, m) elements. POLAR A two dimensional (n, m) array containing z values. The resulting polygon mesh will have n*m vertices. The n dimension of the array is mapped to the polar angle, and the m dimension is mapped to the polar radius. When shading a polar mesh, the shading array should have (n, m) elements. CYLINDRICAL A two dimensional (n, m) array containing radius values. The resulting polygon mesh will have n*m vertices. The n dimension of the array is mapped to the polar angle, and the m dimension is mapped to the Z axis. When shading a cylindrical mesh, the shading array should have (n, m) elements. SPHERICAL A two dimensional (n, m) array containing radius values. The resulting polygon mesh will have n*m vertices. The n dimension of the array is mapped to the longitude (0.0 to 360.0 degrees), and the m dimension is mapped to the latitude (-90.0 to +90.0 degrees). When shading a spherical mesh, the shading array should have (n, m) elements. EXTRUSION A (3, n) array of connected 3-D points which define the shape to extrude. The resulting polygon mesh will have n*(steps+1) vertices (where steps is the number of "segments" in the extrusion). (See the P1 keyword). If the order of the elements in Array1 is reversed, then the polygon facing is reversed. When shading an extrusion mesh, the shading array should have (n, steps+1) elements. REVOLUTION A (3, n) array of connected 3-D points which define the shape to revolve. The resulting polygon mesh will have n*((steps>3)+1) vertices (where steps is the number of "steps" in the revolution). (See the P1 keyword). If the order of the elements in Array1 is reversed, then the polygon facing is reversed. When shading a revolution mesh, the shading array should have (n, (steps>3)+1) elements. RULED A (3, n) array of connected 3-D points which define the shape of the first ruled vector. The optional (3, m) Array2 parameter defines the shape of the second ruled vector. The resulting polygon mesh will have (n>m)*(steps+1) vertices (where steps is the number of intermediate "steps"). (See the P1 keyword). When shading a ruled mesh, the shading array should have (n>m, steps+1) elements. OPTIONAL INPUTS: Array2: If the object type is 7 (Ruled Surface) then Array2 is a (3, m) array containing the 3-D points which define the second ruled vector. If Array2 has fewer elements than Array1 then Array2 is processed with CONGRID to give it the same number of elements as Array1. If Array1 has fewer elements than Array2 then Array1 is processed with CONGRID to give it the same number of elements as Array2. Array2 MUST be supplied if the object type is 7. Otherwise, Array2 is ignored. KEYWORD PARAMETERS: P1 - P5: The meaning of the keywords P1 through P5 vary depending upon the object type. SURFACE TYPE: Keywords ------------- -------------------------------------------- TRIANGULATED P1, P2, P3, P4, and P5 are ignored. RECTANGULAR If Array1 is an (n, m) array, and if P1 has n elements, then the values contained in P1 are the X coordinates for each column of vertices. Otherwise, FINDGEN(n) is used for the X coordinates. If P2 has m elements, then the values contained in P2 are the Y coordinates for each row of vertices. Otherwise, FINDGEN(m) is used for the Y coordinates. The polygon facing is reversed if the order of either P1 or P2 (but not both) is reversed. P3, P4, and P5 are ignored. POLAR P1 specifies the polar angle of the first column of Array1 (the default is 0). P2 specifies the polar angle of the last column of Array1 (the default is 2*PI). If P2 is less than P1 then the polygon facing is reversed. P3 specifies the radius of the first row of Array1 (the default is 0). P4 specifies the radius of the last row of Array1 (the default is m-1). If P4 is less than P3 then the polygon facing is reversed. P5 is ignored. CYLINDRICAL P1 specifies the polar angle of the first column of Array1 (the default is 0). P2 specifies the polar angle of the last column of Array1 (the default is 2*PI). If P2 is less than P1 then the polygon facing is reversed. P3 specifies the Z coordinate of the first row of Array1 (the default is 0). P4 specifies the Z coordinate of the last row of Array1 (the default is m-1). If P4 is less than P3 then the polygon facing is reversed. P5 is ignored. SPHERICAL P1 specifies the longitude of the first column of Array1 (the default is 0). P2 specifies the longitude of the last column of Array1 (the default is 2*PI). IF P2 is less than P1 then the polygon facing is reversed. P3 specifies the latitude of the first row of Array1 (the default is -PI/2). P4 specifies the latitude of the last row of Array1 (the default is +PI/2). If P4 is less than P3 then the polygon facing is reversed. P5 is ignored. EXTRUSION P1 specifies the number of steps in the extrusion (the default is 1). P2 is a three element vector specifying the direction (and length) of the extrusion (the default is [0, 0, 1]). P3, P4, and P5 are ignored. REVOLUTION P1 specifies the number of "facets" in the revolution (the default is 3). If P1 is less than 3 then 3 is used. P2 is a three element vector specifying a point that the rotation vector passes through (the default is [0, 0, 0]). P3 is a three element vector specifying the direction of the rotation vector (the default is [0, 0, 1]). P4 specifies the starting angle for the revolution (the default is 0). P5 specifies the ending angle for the revolution (the default is 2*PI). If P5 is less than P4 then the polygon facing is reversed. RULED P1 specifies the number of "steps" in the ruling (the default is 1). P2, P3, P4, and P5 are ignored. DEGREES: If set, then the input parameters are in degrees (where applicable). Otherwise, the angles are in radians. EXAMPLE: ; Create a 48x64 cylinder with a constant radius of 0.25. MESH_OBJ, 3, Vertex_List, Polygon_List, Replicate(0.25, 48, 64), $ P4=0.5 ; Transform the vertices. T3d, /Reset T3d, Rotate=[0.0, 30.0, 0.0] T3d, Rotate=[0.0, 0.0, 40.0] T3d, Translate=[0.25, 0.25, 0.25] Vertex_List = Vert_T3d(Vertex_List) ; Create the window and view. Window, 0, Xsize=512, Ysize=512 Create_View, Winx=512, Winy=512 ; Render the mesh. Set_Shading, Light=[-0.5, 0.5, 2.0], Reject=0 Tvscl, Polyshade(Vertex_List, Polygon_List, /Normal) ; Create a cone (surface of revolution). MESH_OBJ, 6, Vertex_List, Polygon_List, $ [[0.75, 0.0, 0.25], [0.5, 0.0, 0.75]], P1=16, P2=[0.5, 0.0, 0.0] ; Create the window and view. Window, 0, Xsize=512, Ysize=512 Create_View, Winx=512, Winy=512, Ax=30.0, Ay=(140.0), Zoom=0.5 ; Render the mesh. Set_Shading, Light=[-0.5, 0.5, 2.0], Reject=0 Tvscl, Polyshade(Vertex_List, Polygon_List, /Data, /T3d) MODIFICATION HISTORY: Written by: Daniel Carr, Thu Mar 31 19:16:43 MST 1994
(See C:\RSI\IDL52\lib\mesh_obj.pro)
NAME: MIN_CURVE_SURF PURPOSE: This function Interpolates a regularly- or irregularly-gridded set of points with either a minimum curvature surface or a thin-plate-spline surface. CATEGORY: Mathematical functions, Interpolation, Surface Fitting CALLING SEQUENCE: Result = MIN_CURVE_SURF(Z [, X, Y]) INPUTS: X, Y, Z: arrays containing the X, Y, and Z coordinates of the data points on the surface. Points need not be regularly gridded. For regularly gridded input data, X and Y are not used: the grid spacing is specified via the XGRID and YGRID (or XVALUES and YVALUES) keywords, and Z must be a two dimensional array. For irregular grids, all three parameters must be present and have the same number of elements. KEYWORD PARAMETERS: TPS: If set, use the thin-plate-spline method, otherwise use the minimum curvature surface method. Input grid description: REGULAR: if set, the Z parameter is a two dimensional array of dimensions (N,M), containing measurements over a regular grid. If any of XGRID, YGRID, XVALUES, YVALUES are specified, REGULAR is implied. REGULAR is also implied if there is only one parameter, Z. If REGULAR is set, and no grid (_VALUE or _GRID) specifications are present, the respective grid is set to (0, 1, 2, ...). XGRID: contains a two element array, [xstart, xspacing], defining the input grid in the X direction. Do not specify both XGRID and XVALUES. XVALUES: if present, XVALUES(i) contains the X location of Z(i,j). XVALUES must be dimensioned with N elements. YGRID: contains a two element array, [ystart, yspacing], defining the input grid in the Y direction. Do not specify both YGRID and YVALUES. YVALUES: if present, YVALUES(i) contains the Y location of Z(i,j). YVALUES must be dimensioned with N elements. Output grid description: GS: If present, GS must be a two-element vector [XS, YS], where XS is the horizontal spacing between grid points and YS is the vertical spacing. The default is based on the extents of X and Y. If the grid starts at X value Xmin and ends at Xmax, then the default horizontal spacing is (Xmax - Xmin)/(NX-1). YS is computed in the same way. The default grid size, if neither NX or NY are specified, is 26 by 26. BOUNDS: If present, BOUNDS must be a four element array containing the grid limits in X and Y of the output grid: [Xmin, Ymin, Xmax, Ymax]. If not specified, the grid limits are set to the extent of X and Y. NX: The output grid size in the X direction. NX need not be specified if the size can be inferred from GS and BOUNDS. The default value is 26. NY: The output grid size in the Y direction. See NX. XOUT: If present, XOUT must be a vector containing the output grid X values. If this parameter is supplied, GS, BOUNDS, and NX are ignored for the X output grid. Use this parameter to specify irregular spaced output grids. YOUT: If present, YOUT must be a vector containing the output grid Y values. If this parameter is supplied, GS, BOUNDS, and NY are ignored for the Y output grid. Use this parameter to specify irregular spaced output grids. XPOUT: If present, the arrays XPOUT and YPOUT contain the X and Y YPOUT: values for the output points. With these keywords, the output grid need not be regular, and all other output grid parameters are ignored. XPOUT and YPOUT must have the same number of points, which is also the number of points returned in the result. OUTPUTS: This function returns a two-dimensional floating point array containing the interpolated surface, sampled at the grid points. RESTRICTIONS: The accuracy of this function is limited by the single precision floating point accuracy of the machine. SAMPLE EXECUTION TIMES (measured on a Sun IPX) # of input points # of output points Seconds 16 676 0.19 32 676 0.42 64 676 1.27 128 676 4.84 256 676 24.6 64 256 1.12 64 1024 1.50 64 4096 1.97 64 16384 3.32 PROCEDURE: A minimum curvature spline surface is fitted to the data points described by X, Y, and Z. The basis function: C(x0,x1, y0,y1) = d^2 log(d^k), where d is the distance between (x0,y0), (x1,y1), is used, as described by Franke, R., "Smooth interpolation of scattered data by local thin plate splines," Computers Math With Applic., v.8, no. 4, p. 273-281, 1982. k = 1 for minimum curvature surface, and 2 for Thin Plate Splines. For N data points, a system of N+3 simultaneous equations are solved for the coefficients of the surface. For any interpolation point, the interpolated value is: F(x,y) = b(0) + b(1)*x + b(2)*y + Sum(a(i)*C(X(i),x,Y(i),y)) The results obtained the thin plate spline (TPS) or the minimum curvature surface (MCS) methods are very similar. The only difference is in the basis functions: TPS uses d^2*alog(d^2), and MCS uses d^2*alog(d), where d is the distance from point (x(i),y(i)). EXAMPLES: Example 1: Irregularly gridded cases Make a random set of points that lie on a gaussian: n = 15 ;# random points x = RANDOMU(seed, n) y = RANDOMU(seed, n) z = exp(-2 * ((x-.5)^2 + (y-.5)^2)) ;The gaussian get a 26 by 26 grid over the rectangle bounding x and y: r = min_curve_surf(z, x, y) ;Get the surface. Or: get a surface over the unit square, with spacing of 0.05: r = min_curve_surf(z, x, y, GS=[0.05, 0.05], BOUNDS=[0,0,1,1]) Or: get a 10 by 10 surface over the rectangle bounding x and y: r = min_curve_surf(z, x, y, NX=10, NY=10) Example 2: Regularly gridded cases Make some random data z = randomu(seed, 5, 6) interpolate to a 26 x 26 grid: CONTOUR, min_curve_surf(z, /REGULAR) MODIFICATION HISTORY: DMS, RSI, March, 1993. Written. DMS, RSI, July, 1993. Added XOUT and YOUT, XPOUT and YPOUT.
(See C:\RSI\IDL52\lib\min_curve_surf.pro)
NAME: MK_HTML_HELP PURPOSE: Given a list of IDL procedure files (.PRO), VMS text library files (.TLB), or directories that contain such files, this procedure generates a file in the HTML format that contains the documentation for those routines that contain a DOC_LIBRARY style documentation template. The output file is compatible with World Wide Web browsers. CATEGORY: Help, documentation. CALLING SEQUENCE: MK_HTML_HELP, Sources, Outfile INPUTS: Sources: A string or string array containing the name(s) of the .pro or .tlb files (or the names of directories containing such files) for which help is desired. If a source file is a VMS text library, it must include the .TLB file extension. If a source file is an IDL procedure, it must include the .PRO file extension. All other source files are assumed to be directories. Outfile: The name of the output file which will be generated. KEYWORDS: TITLE: If present, a string which supplies the name that should appear as the Document Title for the help. VERBOSE: Normally, MK_HTML_HELP does its work silently. Setting this keyword to a non-zero value causes the procedure to issue informational messages that indicate what it is currently doing. !QUIET must be 0 for these messages to appear. STRICT: If this keyword is set to a non-zero value, MK_HTML_HELP will adhere strictly to the HTML format by scanning the the document headers for characters that are reserved in HTML (<,>,&,"). These are then converted to the appropriate HTML syntax in the output file. By default, this keyword is set to zero (to allow for faster processing). COMMON BLOCKS: None. SIDE EFFECTS: A help file with the name given by the Outfile argument is created. RESTRICTIONS: The following rules must be followed in formatting the .pro files that are to be searched. (a) The first line of the documentation block contains only the characters ";+", starting in column 1. (b) There must be a line which contains the string "NAME:", which is immediately followed by a line containing the name of the procedure or function being described in that documentation block. If this NAME field is not present, the name of the source file will be used. (c) The last line of the documentation block contains only the characters ";-", starting in column 1. (d) Every other line in the documentation block contains a ";" in column 1. Note that a single .pro file can contain multiple procedures and/or functions, each with their own documentation blocks. If it is desired to have "invisible" routines in a file, i.e. routines which are only for internal use and should not appear in the help file, simply leave out the ";+" and ";-" lines in the documentation block for those routines. No reformatting of the documentation is done. MODIFICATION HISTORY: July 5, 1995, DD, RSI. Original version. July 13, 1995, Mark Rivers, University of Chicago. Added support for multiple source directories and multiple documentation headers per .pro file. July 17, 1995, DD, RSI. Added code to alphabetize the subjects; At the end of each description block in the HTML file, added a reference to the source .pro file. July 18, 1995, DD, RSI. Added STRICT keyword to handle angle brackets. July 19, 1995, DD, RSI. Updated STRICT to handle & and ". Changed calling sequence to accept .pro filenames, .tlb text librarie names, and/or directory names. Added code to set default subject to name of file if NAME field is not present in the doc header.
(See C:\RSI\IDL52\lib\mk_html_help.pro)
NAME: MK_LIBRARY_HELP PURPOSE: Given a directory or a VMS text library containing IDL user library procedures, this procedure generates a file in the IDL help format that contains the documentation for those routines that contain a DOC_LIBRARY style documentation template. The output file is compatible with the IDL "?" command. A common problem encountered with the DOC_LIBRARY user library procedure is that the user needs to know what topic to ask for help on before anything is possible. The XDL widget library procedure is one solution to this "chicken and egg" problem. The MK_LIBRARY_HELP procedure offers another solution. CATEGORY: Help, documentation. CALLING SEQUENCE: MK_LIBRARY_HELP, Source, Outfile INPUTS: SOURCE: The directory or VMS text library containing the .pro files for which help is desired. If SOURCE is a VMS text library, it must include the ".TLB" file extension, as this is what MK_LIBRARY_HELP uses to tell the difference. OUTFILE: The name of the output file which will be generated. If you place this file in the help subdirectory of the IDL distribution, and if it has a ".help" extension, then the IDL ? command will find the file and offer it as one of the availible help categories. Note that it uses the name of the file as the name of the topic. KEYWORDS: TITLE: If present, a string which supplies the name that should appear on the topic button for this file in the online help. This title is only used on systems that allow very short file names (i.e. MS DOS), so it won't always have a visible effect. However, it should be used for the broadest compatibility. If a title is not specified, IDL on short name systems will use a trucated copy of the file name. VERBOSE: Normally, MK_LIBRARY_HELP does its work silently. Setting this keyword to a non-zero value causes the procedure to issue informational messages that indicate what it is currently doing. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: A help file with the name given by the OUTFILE argument is created. RESTRICTIONS: If you put the resulting file into the "help" subdirectory of the IDL distribution, it will be overwritten when you install a new release of IDL. To avoid this problem, keep a backup copy of your created help files in another directory and move them into the new distribution. Since this routine copies the documentation block from the functions and procedures, subsequent changes will not be reflected in the help file unless you run MK_LIBRARY_HELP again. The following rules must be followed in formating the .pro files which are searched. (a) The first line of the documentation block contains only the characters ";+", starting in column 1. (b) The last line of the documentation block contains only the characters ";-", starting in column 1. (c) Every other line in the documentation block contains a ";" in column 1. No reformatting of the documentation is done. MODIFICATION HISTORY: 17 April, 1991, Written by AB, RSI. 1 December 1992, Reorganized internally. No functionality change. 31 December 1992, Added the TITLE keyword as part of the effort towards releasing the Microsoft Windows version of IDL. 20 January 1993, Corrected for VMS, W. Landsman HSTX 17 March 1993, Corrected for MSDOS and VMS, AB. 13 January 1994, Added the VERSION attribute and modified format to accomodate extended identifier names (the old format was limited to 15 characters. 7 July 1995, Added support for MacOS, DD, RSI.
(See C:\RSI\IDL52\lib\obsolete\mk_library_help.pro)
NAME: MODIFYCT PURPOSE: Update the distribution color table file "colors1.tbl" or the user-supplied file with a new table. CATEGORY: Z4 - Image processing, color table manipulation. CALLING SEQUENCE: MODIFYCT, Itab, Name, R, G, B INPUTS: Itab: The table to be updated, numbered from 0 to 255. If the table entry is greater than the next available location in the table, then the entry will be added to the table in the available location rather than the index specified by Itab. On return, Itab will contain the index for the location that was modified or extended. The table can be loaded with the IDL command: LOADCT, Itab. Name: A string up to 32 characters long that contains the name for the new color table. R: A 256-element vector that contains the values for the red color gun. G: A 256-element vector that contains the values for the green color gun. B: A 256-element vector that contains the values for the blue color gun. KEYWORD PARAMETERS: FILE: If this keyword is set, the file by the given name is used instead of the file colors1.tbl in the IDL directory. This allows multiple IDL users to have their own color table file. The file specified must be a copy of the colors1.tbl file. The file must exist. OUTPUTS: Itab: The index of the entry which was updated, 0 to 255. This may be different from the input value of Itab if the input value was greater than the next available location in the table. If this was the case the entry was added to the table in the next available location instead of leaving a gap in the table. COMMON BLOCKS: None. SIDE EFFECTS: The distribution file "colors.tbl1" or the user-supplied file is modified with the new table. PROCEDURE: Straightforward. MODIFICATION HISTORY: Aug, 1982, DMS, Written. Unix version, 1987, DMS. ACY, 9/92, Update for new color table structure, Add FILE keyword. Allow extending table. WSO, 1/95, Updated for new directory structure
(See C:\RSI\IDL52\lib\modifyct.pro)
NAME: MOMENT PURPOSE: This function computes the mean, variance, skewness and kurtosis of an N-element vector. IF the vector contains N identical elements, the mean and variance are computed; the skewness and kurtosis are not defined and are returned as IEEE NaN (Not a Number). Optionally, the mean absolute deviation and standard deviation may also be computed. The returned result is a 4-element vector containing the mean, variance, skewness and kurtosis of the input vector X. CATEGORY: Statistics. CALLING SEQUENCE: Result = Moment(X) INPUTS: X: An N-element vector of type integer, float or double. KEYWORD PARAMETERS: DOUBLE: IF set to a non-zero value, computations are done in double precision arithmetic. MDEV: Use this keyword to specify a named variable which returns the mean absolute deviation of X. SDEV: Use this keyword to specify a named variable which returns the standard deviation of X. MAXMOMENT: Use this keyword to limit the number of moments: Maxmoment = 1 Calculate only the mean. Maxmoment = 2 Calculate the mean and variance. Maxmoment = 3 Calculate the mean, variance, and skewness. Maxmoment = 4 Calculate the mean, variance, skewness, and kurtosis (the default). NAN: Treat NaN elements as missing data. (Due to problems with IEEE support on some platforms, infinite data will be treated as missing as well. ) EXAMPLE: Define the N-element vector of sample data. x = [65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71, 66, 65, 70] Compute the mean, variance, skewness and kurtosis. result = moment(x) The result should be the 4-element vector: [66.7333, 7.06667, -0.0942851, -1.18258] PROCEDURE: MOMENT computes the first four "moments" about the mean of an N-element vector of sample data. The computational formulas are given in the IDL Reference Guide. REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Written by: GGS, RSI, August 1994 Modified: GGS, RSI, September 1995 Added DOUBLE keyword. Added checking for N identical elements. Added support for IEEE NaN (Not a Number). Modified variance formula. Modified: GGS, RSI, April 1996 Modified keyword checking and use of double precision. GSL, RSI, August 1997 Added Maxmoment keyword. Modified: Wed Jan 28 13:28:07 1998, Scott Lett, RSI Added NAN keyword.
(See C:\RSI\IDL52\lib\moment.pro)
NAME: MOVIE PURPOSE: Show a cyclic sequence of images stored in a 3D array. CATEGORY: Image display. CALLING SEQUENCE: MOVIE, Images [, Rate] INPUTS: Images: A 3D (n, m, nframes) byte array of image data, consisting of nframes images, each of size n by m. This array should be stored with the top row first, (order = 1) for maximum efficiency. OPTIONAL INPUT PARAMETERS: Rate: Initial animation rate, in APPROXIMATE frames per second. If omitted, the inter-frame delay is set to 0.01 second. KEYWORD PARAMETERS: ORDER: The ordering of images in the array. Set Order to 0 for images ordered bottom up, or 1 for images ordered top down (the default). OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: The animation is displayed in the lower left corner of the currently selected window. RESTRICTIONS: SunView: As SunView has no zoom or pan, we have to write each image to the display. This restricts the maximum animation rate. Experience has shown that you can count on a rate of approximately 10 frames per second with 192 by 192-byte images. This speed varies according to the type of computer, amount of physical memory, and number of frames in the array. The amount of available memory also restricts the maximum amount of data that can be displayed in a loop. X Windows users (Motif and OPEN LOOK) should use the XINTERANIMATE routine from the Widget Library for better results. PROCEDURE: Straightforward. MODIFICATION HISTORY: DMS, Nov, 1988.
(See C:\RSI\IDL52\lib\obsolete\movie.pro)
NAME: MPEG_CLOSE PURPOSE: Frees all information associated with the given MPEG sequence. The given MPEG identifier will no longer be valid after this call. CATEGORY: Input/Output CALLING SEQUENCE: MPEG_CLOSE, mpegID INPUTS: mpegID: The unique identifier of the MPEG sequence (as returned from MPEG_OPEN) to be stored. EXAMPLE: MPEG_CLOSE, mpegID MODIFICATION HISTORY: Written by: Scott J. Lasica, December, 1997
(See C:\RSI\IDL52\lib\mpeg_close.pro)
NAME: MPEG_OPEN PURPOSE: This function initializes MPEG encoding. CATEGORY: Input/Output CALLING SEQUENCE: Result = MPEG_OPEN(Dimensions) INPUTS: Dimensions: A vector of the form [xsize,ysize] indicating the dimensions of each of the images to be used as frames for the MPEG file. KEYWORD PARAMETERS: FILENAME: Set this keyword to a string representing the name of the file to which the encoded MPEG sequence is to be saved. The default is 'idl.mpg'. OUTPUTS: Result: The ID of the underlying MPEG object. EXAMPLE: mpegID = MPEG_OPEN([100,100]) MODIFICATION HISTORY: Written by: Scott J. Lasica, December, 1997
(See C:\RSI\IDL52\lib\mpeg_open.pro)
NAME: MPEG_PUT PURPOSE: Stores the given image at the given frame index. CATEGORY: Input/Output CALLING SEQUENCE: MPEG_PUT, mpegID INPUTS: mpegID: The object reference returned from an MPEG_OPEN call. KEYWORD PARAMETERS: COLOR: Set to write 24 bit MPEG from 8 bit pseudo color direct graphics windows. FRAME: Set this keyword to the frame at which the image is to be loaded. If the frame number matches a previously put frame, the previous frame is overwritten. The default is 0. IMAGE: Set this keyword to an mxn or 3xmxn array representing the image to be loaded at the given frame. Mutually exclusive of the WINDOW keyword. ORDER: Set this keyword to a non-zero value to indicate that the rows of the image should be drawn from top to bottom. By default, the rows are drawn from bottom to top. WINDOW: Set this keyword to the index of a Direct Graphics Window (or to an object reference to an IDLgrWindow or IDLgrBuffer object) to indicate that the image to be loaded is to be read from the given window or buffer. EXAMPLE: MPEG_PUT, mpegID, FRAME=2, IMAGE=DIST(100) MODIFICATION HISTORY: Written by: Scott J. Lasica, December, 1997
(See C:\RSI\IDL52\lib\mpeg_put.pro)
NAME: MPEG_SAVE PURPOSE: Encodes and saves the MPEG sequence. CATEGORY: Input/Output CALLING SEQUENCE: MPEG_SAVE, mpegID INPUTS: mpegID: The unique identifier of the MPEG sequence (as returned from MPEG_OPEN) to be stored. KEYWORD PARAMETERS: FILENAME: Set this keyword to a string representing the name of the file to which the encoded MPEG sequence is to be saved. The default is 'idl.mpg'. EXAMPLE: MPEG_SAVE, mpegID, FILENAME='myMPEG.mpg' MODIFICATION HISTORY: Written by: Scott J. Lasica, December, 1997
(See C:\RSI\IDL52\lib\mpeg_save.pro)
NAME: MP_BASIC PURPOSE: Provide online documentation for IDL topics. The style is a cross between Unix man pages and VMS online help. The help is organized in a two level hierarchy --- Level 1 is the global subject, and Level 2 supplies help on subjects within each global subject. If !D.WINDOW is not -1, (window system in use) the mouse is used to prompt for subjects, otherwise, the normal tty interface is used. THIS ROUTINE IS TO BE CALLED ONLY BY MAN_PROC. Users can obtain online help by using the "?" command. CATEGORY: Help, documentation. CALLING SEQUENCE: MP_BASIC [, Request] INPUTS: REQUEST: A scalar string containing the item on which help is desired. This string can contain 1 or 2 (whitespace separated) words. The first word is taken as the global topic and the second as the topic within the scope of the first. The procedure prompts for missing words. OUTPUTS: Help text is sent to the standard output. COMMON BLOCKS: None. RESTRICTIONS: The help text is derived from the LaTeX files used to produce the reference manual. However, it is not possible to produce exactly the same output as found in the manual due to limitations of text oriented terminals. The text used is therefore considerably abbreviated. Always check the manual if the online help is insufficient. MODIFICATION HISTORY: 3 November 1988, AB January, 1989, AB Added ambiguity resolution, ability to handle multiple levels, and support for mouse. SNG, December, 1990 Added support for MS-DOS. 3 January 1991, AB Renamed from MAN_PROC to make room for the widget version. Bobby Candey, Atlantic Research 30 January 1991 Added looping in VMS version to extract multiple "]" from filenames 31 December 1992, AB Modified to ignore the optional %TITLE line at the top of the file. There's no reason to handle it, since this routine is obsolete. The builtin online help system *does* handle it. 11 February 1993, SMR Added support for the Mac Version 21 April 1993, AB, Added ability to use new !HELP_PATH system variable to locate help files. 13 January 1994, AB Added ability to understand new version 2 help files with extended identifier names.
(See C:\RSI\IDL52\lib\obsolete\mp_basic.pro)
NAME: MP_WIDGETS PURPOSE: Provide a graphical user interface to the online documentation. The topic is selected by pressing a button at the top. Subtopics a displayed in a scrolling list on the left side. Pressing a mouse button while pointing at a subtopic causes the information on that topic to be displayed in the large text region on the right. It is expected that this routine will only be called by MAN_PROC. CATEGORY: Help, documentation, widgets. CALLING SEQUENCE: MP_WIDGETS [, Request] INPUTS: Request: A scalar string containing the item on which help is desired. This string can contain 1 or two (whitespace separated) words. The first word is taken as the global topic and the second as the topic within the scope of the first. KEYWORD PARAMETERS: NO_BLOCK:Set this keyword to zero to have XMANAGER block when this application is registered. By default NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting NO_BLOCK=0 will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. OUTPUTS: None. A widget interface is used to allow reading the help text. COMMON BLOCKS: MPW_COM: This common block is private to MP_WIDGETS, and should not be referenced by other modules. RESTRICTIONS: The basic version of the help facility (MP_BASIC) can accept ambiguous requests, and if a request maches more than a single subtopic, they are all shown. This version can also accept ambiguous requests, but only the first subtopic matched is shown. This feature is not as important as it was in MP_BASIC because the widget interface allows multiple subjects to be viewed easily. This routine uses a COMMON block to keep its internal state, so only one copy of this routine can run at a time. MODIFICATION HISTORY: AB, August, 1990 28 December 1990 Rewritten to take advantages in changes to the widget facility, to use XMANAGER, and to accept the REQUEST argument. 31 December 1992 Modified to ignore the optional %TITLE line at the top of the file. There's no reason to handle it, since this routine is obsolete. The builtin online help system *does* handle it.
(See C:\RSI\IDL52\lib\obsolete\mp_widgets.pro)
NAME: MULTI PURPOSE: Expand the current color table to wrap around N times. CATEGORY: Image display. CALLING SEQUENCE: MULTI, N INPUTS: N: The number of times the color table will wrap. This parameter does not need not be an integer. OUTPUTS: No explicit outputs, color tables are loaded. COMMON BLOCKS: COLORS, the IDL color table common block, contains current color tables, loaded by LOADCT, ADJCT, HLS, HSV, etc. SIDE EFFECTS: Color tables are loaded. RESTRICTIONS: One of the above procedures must have been called. PROCEDURE: Tables are expanded by a factor of n. EXAMPLE: Display an image, load color table 1, and make that color table "wrap around" 3 times. Enter: TVSCL, DIST(256) ;A simple image. LOADCT, 1 ;Load color table 1. MULTI, 3 ;See how the new color table affects ;the image. MODIFICATION HISTORY: DMS, May, 1984. Changed common, DMS, 4/87.
(See C:\RSI\IDL52\lib\multi.pro)
NAME: MULTICOMPARE PURPOSE: Multicompare gives the user access to a variety of procedures for making many inferences from a single experimental data set. These procedures are designed to guard against experimentwise errors resulting from the increased probabilty of at least one inferential error when many inferences are made. CATEGORY: Statistics. CALLING SEQUENCE: MULTICOMPARE, X, Contrast, A, St INPUTS: X: 2 or 3-dimensional array of experimental data values. Contrast: An array, dimensioned (CL,C), where: CL = the number of treatments = the number of columns of X and C = the number of contrasts or inferences to be tested. Contrast, B(i,j) = the coefficient of the mean of the ith treatment in the jth contrast. A: Experimentwise significance level desired. OUTPUT: St: An array, dimensioned (2,C), where C is the number of contrasts to test. ST(0,j) = the absolute value of the test statistic. ST(1,j) = the lower limit of the rejection region - i.e., if ST(0,j) > ST(1,j) reject the null hypothesis for the jth contrast at the a*100% significance level. KEYWORD PARAMETERS: Type of design structure. Options are: ONE_WAY: If set, 1-way anova. UNEQUAL_ONE_WAY: If set, 1-way ANOVA with unequal sample sizes. TWO_WAY: If set, 2-way ANOVA. INTERACTIONS_TWO_WAY: If set, 2-way ANOVA with interactions. One and only one of the above options may be set. Options for multicomparison testing: LSD: Fisher's LSD procedure. LSD is a post-hoc test of any contrasts of the treatment means. It should only be used if the F-test for equal means rejects the null hypothesis at the A*100% significance level. LSD has an experimentwise error rate approximately equal to 5%. BONFERRONI: Bonferroni's method. This method should be selected instead of LSD if the F-test is not significant. SCHEFFE: Scheffe's procedure. Use Sheffe's procedure to make any number of unplanned comparisons - that is, to data snoop. Experimentwise error rate is A*100%. TUKEY: Tukey`s procedure. Tukey's procedure is often more sensitive than Sheffe's but in the general case it requires equal sample sizes. Pairwise testing of means is allowed with unequal sample sizes, but if the disparity is too great, Sheffe's method is more sensitive. The experimentwise error rate, A, must be between 0 and 0.1. BLOCK: a flag which ,if set, signals that comparisons should be done on block means instead of treatment means. Alternatively, input transpose(X) for the experimental data array. MISSING: Placeholding value for missing data. If not set, then assume no missing data. TINTERACTION: A flag, if set, to signal that contrasts are for interaction effects. The user should not set both keywords BLOCK and TINTERACTION.
(See C:\RSI\IDL52\lib\obsolete\multicompare.pro)
FILE: myabs.pro PURPOSE: This file contains an example Conditioning PlugIn that does absolute value, without a dialog. CONTENTS: CALLBACK ROUTINE fun DoMyAbs - main entry point REGISTRATION FUNCTION fun MyAbs - registers the PlugIn
(See C:\RSI\IDL52\examples\insight\plugins\myabs.pro)
FILE: mybias.pro PURPOSE: This file contains an example Analysis PlugIn that does biasing. CONTENTS: GENERAL ROUTINES pro HandleEventsMyBias - handle dialog box events CALLBACK ROUTINES fun ApplyMyBias - Apply/OK entry point fun PromptUserMyBias - main entry point (creates dialog) REGISTRATION FUNCTION fun MyBias - registers the PlugIn
(See C:\RSI\IDL52\examples\insight\plugins\mybias.pro)
FILE: mybias0.pro PURPOSE: This file contains an example Analysis PlugIn that biases data, without a dialog. Note only the Apply callback is used. (See mybias.pro for an example with a normal Analysis dialog.) CONTENTS: CALLBACK ROUTINES fun ApplyMyBias0 - main entry point REGISTRATION FUNCTION fun MyBias0 - registers the PlugIn
(See C:\RSI\IDL52\examples\insight\plugins\mybias0.pro)
FILE: mydat.pro PURPOSE: This file contains a File PlugIn that reads the .dat files in the examples directory of the IDL distribution. It can also be used to read other structured binary files. CONTENTS: CALLBACK ROUTINES pro WriteMydat - writes a structured binary file pro ReadMydat - reads a structured binary file fun dat_CheckDataDir - (checks for file in the example/data dir) fun dat_BuildType - (builds data for the READU routine) fun dat_Verify - (verifies user input into the dialog) pro dat_ComputeFields - (computes field values when others change) pro dat_HandleEvents - (handles dialog events) fun dat_PromptUser - (builds and displays the dialog) REGISTRATION FUNCTION fun Mydat - registers the PlugIn
(See C:\RSI\IDL52\examples\insight\plugins\mydat.pro)
FILE: myhdf.pro PURPOSE: This file contains an example File PlugIn that handles hdf files. CONTENTS: CALLBACK ROUTINES pro ReadMyHDF - reads a file REGISTRATION FUNCTION fun myHDF - registers the PlugIn NOTE: This plugin utilizes the new HDF_BROWSER and READ_HDF routines for IDL 5.1.
(See C:\RSI\IDL52\examples\insight\plugins\myhdf.pro)
FILE: mylinsys.pro PURPOSE: This file contains an Analysis PlugIn that computes the solution of an N-by-N linear system of equations using one of three methods. CONTENTS: GENERAL ROUTINES pro HandleEventsMylinsys - handle dialog box events CALLBACK ROUTINES fun ApplyMyLinSys - Apply/OK entry point fun PromptUserMyLinSys - main entry point (creates dialog) REGISTRATION FUNCTION fun MyLinSys - registers the PlugIn
(See C:\RSI\IDL52\examples\insight\plugins\mylinsys.pro)
FILE: mynegate.pro PURPOSE: This file contains an example Conditioning PlugIn that does negation. CONTENTS: GENERAL ROUTINES pro HandleEventsMyNegate - handle dialog box events CALLBACK ROUTINES fun PromptUserMyNegate - main entry point (creates dialog) REGISTRATION FUNCTION fun MyNegate - registers the PlugIn
(See C:\RSI\IDL52\examples\insight\plugins\mynegate.pro)
FILE: myppm.pro PURPOSE: This file contains an example File PlugIn that handles PPM/PGM files. CONTENTS: CALLBACK ROUTINES pro ReadMyPPM - reads a file pro WriteMyPPM - writes a file REGISTRATION FUNCTION fun MyPPM - registers the PlugIn
(See C:\RSI\IDL52\examples\insight\plugins\myppm.pro)
FILE: mystdvar.pro PURPOSE: This file contains an Analysis PlugIn that computes Standardized Variables of a 2D array. CONTENTS: GENERAL ROUTINES pro HandleEventsMyStdVar - handle dialog box events CALLBACK ROUTINES fun ApplyMyStdVar - Apply/OK entry point fun PromptUserMyStdVar - main entry point (creates dialog) REGISTRATION FUNCTION fun MyStdVar - registers the PlugIn
(See C:\RSI\IDL52\examples\insight\plugins\mystdvar.pro)
FILE: myvis.pro PURPOSE: This file contains an example Analysis PlugIn that visualizes data. CONTENTS: GENERAL ROUTINES pro SensitizeMyVis - set widget sensitivity pro HandleEventsMyVis - handle dialog box events CALLBACK ROUTINES fun ApplyMyVis - Apply/OK entry point fun PromptUserMyVis - main entry point (creates dialog) REGISTRATION FUNCTION fun MyVis - registers the PlugIn
(See C:\RSI\IDL52\examples\insight\plugins\myvis.pro)
NAME: M_CORRELATE PURPOSE: This function computes the multiple correlation coefficient of a dependent variable and two or more independent variables. CATEGORY: Statistics. CALLING SEQUENCE: Result = M_correlate(X, Y) INPUTS: X: An array of m-columns and n-rows of type integer, float or double that specifies the independent variable data. The columns of this two dimensional array correspond to the n-element vectors of independent variable data. Y: An n-element vector of type integer, float or double that specifies the dependent variable data. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE: Define the independent (X) and dependent (Y) data. X = [[0.477121, 2.0, 13.0], $ [0.477121, 5.0, 6.0], $ [0.301030, 5.0, 9.0], $ [0.000000, 7.0, 5.5], $ [0.602060, 3.0, 7.0], $ [0.698970, 2.0, 9.5], $ [0.301030, 2.0, 17.0], $ [0.477121, 5.0, 12.5], $ [0.698970, 2.0, 13.5], $ [0.000000, 3.0, 12.5], $ [0.602060, 4.0, 13.0], $ [0.301030, 6.0, 7.5], $ [0.301030, 2.0, 7.5], $ [0.698970, 3.0, 12.0], $ [0.000000, 4.0, 14.0], $ [0.698970, 6.0, 11.5], $ [0.301030, 2.0, 15.0], $ [0.602060, 6.0, 8.5], $ [0.477121, 7.0, 14.5], $ [0.000000, 5.0, 9.5]] Y = [97.682, 98.424, 101.435, 102.266, 97.067, 97.397, 99.481, $ 99.613, 96.901, 100.152, 98.797, 100.796, 98.750, 97.991, $ 100.007, 98.615, 100.225, 98.388, 98.937, 100.617] Compute the multiple correlation of Y on the first column of X. The result should be 0.798816 result = m_correlate(X(0,*), Y) Compute the multiple correlation of Y on the first two columns of X. The result should be 0.875872 result = m_correlate(X(0:1,*), Y) Compute the multiple correlation of Y on all columns of X. The result should be 0.877197 result = m_correlate(X, Y) PROCEDURE: M_CORRELATE uses relationships based upon partial correlation to compute the multiple correlation coefficient of linear models with two or more independent variables: y(x0, x1), y(x0, x1, ... , xn-1). REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Written by: GGS, RSI, July 1994 Modified by: GGS, RSI, August 1996 Added DOUBLE keyword. Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\m_correlate.pro)
NAME: NCDF_EXISTS PURPOSE: Test for the existence of the NetCDF library CATEGORY: File Formats CALLING SEQUENCE: Result = NCDF_EXISTS() INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: Returns TRUE (1) if the NetCDF data format library is supported Returns FALSE(0) if it is not. COMMON BLOCKS: NCDFTEST EXAMPLE: IF ncdf_exists() EQ 0 THEN Fail,"Library not supported on this machine" MODIFICATION HISTORY Written by: Joshua Goldstein, 12/8/92
(See C:\RSI\IDL52\lib\ncdf_exists.pro)
NAME: NORM PURPOSE: 1) This function computes the Euclidean norm of a vector. OR 2) This function computes the Infinity norm of an array. CATEGORY: Complex Linear Algebra. CALLING SEQUENCE: Result = NORM(A) INPUTS: A: An N-element real or complex vector. An M by N real or complex array. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE: 1) Define an N-element complex vector (a). a = [complex(1, 0), complex(2,-2), complex(-3,1)] Compute the Euclidean norm of (a). result = norm(a) 2) Define an M by N complex array (a). a = [[complex(1, 0), complex(2,-2), complex(-3,1)], $ [complex(1,-2), complex(2, 2), complex(1, 0)]] Compute the Infinity norm of the complex array (a). result = norm(a) PROCEDURE: NORM.PRO computes the Euclidean norm of an N-element vector. NORM.PRO computes the Infinity norm of an M by N array REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Written by: GGS, RSI, April 1992 Modified: GGS, RSI, February 1994 Computes the Euclidean norm of an N-element vector. Accepts complex inputs. Added DOUBLE keyword. Modified: GGS, RSI, September 1994 Added support for double-precision complex inputs. Modified: GGS, RSI, April 1996 Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\norm.pro)
NAME: NR_ELMHES PURPOSE: NR_ELMHES now executes ELMHES, the updated version of this routine. ELMHES has been modified to accept row vectors as the default input and column vectors with use of the COLUMN keyword. This routine preserves the input of column vectors. MODIFICATION HISTORY: Written by: BMH Nov, 1994
(See C:\RSI\IDL52\lib\obsolete\nr_elmhes.pro)
NAME: NR_HQR PURPOSE: NR_HQR now executes HQR, the updated version of this routine. HQR has been modified to accept row vectors as the default input and column vectors with use of the COLUMN keyword. This routine preserves the input of column vectors. MODIFICATION HISTORY: Written by: BMH Nov, 1994
(See C:\RSI\IDL52\lib\obsolete\nr_hqr.pro)
NAME: NR_LUBKSB PURPOSE: NR_LUBKSB now executes LUBKSB, the updated version of this routine. LUBKSB has been modified to accept row vectors as the default input and column vectors with use of the COLUMN keyword. This routine preserves the input of column vectors.
(See C:\RSI\IDL52\lib\obsolete\nr_lubksb.pro)
NAME: NR_LUDCMP PURPOSE: NR_LUDCMP now executes LUDC, the updated version of this routine. LUDC has been modified to accept row vectors as the default input and column vectors with use of the COLUMN keyword. This routine preserves the input of column vectors. MODIFICATION HISTORY: Written by: BMH Nov, 1994
(See C:\RSI\IDL52\lib\obsolete\nr_ludcmp.pro)
NAME: NR_MPROVE PURPOSE: NR_MPROVE now executes LUMPROVE, the updated version of this routine. LUMPROVE has been modified to accept row vectors as the default input and column vectors with use of the COLUMN keyword. This routine preserves the input of column vectors. MODIFICATION HISTORY: Written by: BMH Nov, 1994
(See C:\RSI\IDL52\lib\obsolete\nr_mprove.pro)
NAME: NR_SPRSIN PURPOSE: NR_SPRSIN now executes SPRSIN, the updated version of this routine. SPRSIN has been modified to accept row vectors as the default input and column vectors with use of the COLUMN keyword. This routine preserves the input of column vectors. MODIFICATION HISTORY: Written by: BMH Nov, 1994
(See C:\RSI\IDL52\lib\obsolete\nr_sprsin.pro)
NAME: NR_SVBKSB PURPOSE: NR_SVBKSB now executes SVSOL, the updated version of this routine. SVSOL has been modified to accept row vectors as the default input and column vectors with use of the COLUMN keyword. This routine preserves the input of column vectors. MODIFICATION HISTORY: Written by: BMH Nov, 1994
(See C:\RSI\IDL52\lib\obsolete\nr_svbksb.pro)
NAME: NR_SVD PURPOSE: NR_SVD now executes SVDC, the updated version of this routine. SVDC has been modified to accept row vectors as the default input and column vectors with use of the COLUMN keyword. This routine preserves the input of column vectors. MODIFICATION HISTORY: Written by: BMH Nov, 1994
(See C:\RSI\IDL52\lib\obsolete\nr_svd.pro)
NAME: NR_WTN PURPOSE: NR_WTN now executes WTN, the updated version of this routine. WTN has been modified to accept row vectors as the default input and column vectors with use of the COLUMN keyword. This routine preserves the input of column vectors. MODIFICATION HISTORY: Written by: BMH Nov, 1994
(See C:\RSI\IDL52\lib\obsolete\nr_wtn.pro)
CLASS_NAME: ClassName PURPOSE: Describe your object class does here. I like to start with the words: "Aobject ..." Try to use the active, present tense. CATEGORY: Put a category (or categories) here. For example: Graphics SUPERCLASSES: List classes this class inherits from. SUBCLASSES: List classes that inherit from this class, if any. CREATION: Note how an object of this class is created. Generally, this is just a reference to the class' Init method. METHODS: List the methods intrinsic to this class. There is no need to list the inherited methods. MODIFICATION HISTORY: Written by: Your name here, Date. June, 1997 Any additional mods get described here. Remember to change the stuff above if you add a new keyword or something! ============================================================= Include a section for each method... ============================================================= METHODNAME: ClassName::MethodName PURPOSE: Describe what the method does. Note whether the method is a lifecycle method for the class. CALLING SEQUENCE: Write the calling sequence here. Include only positional parameters (i.e., NO KEYWORDS). For procedure methods, use the form: Obj -> [Class_name::]MethodName, Parameter1, Parameter2, Foobar For functions, use the form: Result = Obj -> [Class_name::]MethodName(Parameter1, Parameter2, Foobar) Always use the "Result = " part to begin. This makes it super-obvious to the user that this routine is a function! If the method is a lifecycle method, include the Obj = OBJ_NEW('ClassName', Parameter1, Parameter2) or OBJ_DESTROY, Obj syntax along with the method-call syntax. INPUTS: Parm1: Describe the positional input parameters here. Note again that positional parameters are shown with Initial Caps. OPTIONAL INPUTS: Parm2: Describe optional inputs here. If you don't have any, just delete this section. KEYWORD PARAMETERS: KEY1: Document keyword parameters like this. Note that the keyword is shown in ALL CAPS! KEY2: Yet another keyword. Try to use the active, present tense when describing your keywords. For example, if this keyword is just a set or unset flag, say something like: "Set this keyword to use foobar subfloatation. The default is foobar superfloatation." OUTPUTS: Describe any outputs here. For example, "This function returns the foobar superflimpt version of the input array." This is where you should also document the return value for functions. OPTIONAL OUTPUTS: Describe optional outputs here. If the routine doesn't have any, just delete this section. COMMON BLOCKS: BLOCK1: Describe any common blocks here. If there are no COMMON blocks, just delete this entry. Object methods probably won't be using COMMON blocks. SIDE EFFECTS: Describe "side effects" here. There aren't any? Well, just delete this entry. RESTRICTIONS: Describe any "restrictions" here. Delete this section if there are no important restrictions. PROCEDURE: You can describe the foobar superfloatation method being used here. You might not need this section for your routine. EXAMPLE: Please provide a simple example here. An example from the PICKFILE documentation is shown below. Please try to include examples that do not rely on variables or data files that are not defined in the example code. Your example should execute properly if typed in at the IDL command line with no other preparation. Create a PICKFILE widget that lets users select only files with the extensions 'pro' and 'dat'. Use the 'Select File to Read' title and store the name of the selected file in the variable F. Enter: F = PICKFILE(/READ, FILTER = ['pro', 'dat']) MODIFICATION HISTORY: Written by: Your name here, Date. July, 1994 Any additional mods get described here. Remember to change the stuff above if you add a new keyword or something!
(See C:\RSI\IDL52\examples\misc\obj_template.pro)
NAME: ONLY_8BIT PURPOSE: Set up the Sun workstation colors (SunView) to work with IDL. This procedure must be called before any windows are created. It creates a window the number of colors specified by the COLORS keyword (the default is 249). The remaining colors are reserved for the other SunView windows. Why a default of 249 colors? This default leaves 7 colors for other windows which is adequate for most applications. If this is not enough, use the command: ONLY_8BIT, COLORS=241, /MASK leaving 15 colors for the other windows. CATEGORY: General display. CALLING SEQUENCE: ONLY_8BIT [, MASK = Mask] [, COLORS = Colors] INPUTS: None. Keyword Input parameters: MASK: Set this keyword to set the write mask to disable writing the low-order bits. If this keyword is set, images and color indices scaled in the normal range of 0 to 255 will appear properly, but without the full number of colors. For example, if you specify 249 colors, leaving 8 for other windows, the write mask will be set to 'f8'x, disabling the writing of the bottom 3 bits. Only 32 distinct colors will be written, but data scaled from 0 to 255 are written into color indices 0 to 248. If you can always scale your images and color indices into the range 0 to 247, you need not set the mask. COLORS: The number of color indices for IDL to use. The default is 249. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: A window with only 249 colors is created and the write mask is set to 255, passing all bits. RESTRICTIONS: As described above. PROCEDURE: Straightforward. MODIFICATION HISTORY: DMS, 11/1987. DMS, 3/6/89, Modified to work with the new color table scheme, which preserves the color mapping of indices not used by IDL.
(See C:\RSI\IDL52\lib\obsolete\only_8bit.pro)
NAME: OPLOTERR PURPOSE: Overplot data points with accompanying error bars. CATEGORY: Plotting, 2-dimensional. CALLING SEQUENCE: OPLOTERR, [ X ,] Y , Err [, Psym ] INPUTS: Y: The array of Y values. Err: The array of error bar values. OPTIONAL INPUT PARAMETERS: X: An optional array of X values. The procedure checks whether or not the third parameter passed is a vector to decide if X was passed. If X is not passed, then INDGEN(N_ELEMENTS(Y)) is assumed for the X values. PSYM: The plotting symbol to use (default = +7). COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Arrays cannot be of type string. There must be enough points to plot. PROCEDURE: A plot of X versus Y with error bars drawn from Y - ERR to Y + ERR is written to the output device over any plot already there. MODIFICATION HISTORY: William Thompson Applied Research Corporation July, 1986 8201 Corporate Drive Landover, MD 20785 kdb, March, 1997 - Fixed a problem if 1 element arrays where used.
(See C:\RSI\IDL52\lib\oploterr.pro)
NAME: ORB PURPOSE: This object serves as a graphical representation of an orb, (or sphere), which subclasses from the IDLgrModel class. CATEGORY: Object graphics. CALLING SEQUENCE: To initially create: oOrb = OBJ_NEW('orb') To retrieve a property value: oOrb->GetProperty To set a property value: oOrb->SetProperty To print to the standard output stream the current properties of the orb: oOrb->Print To destroy: OBJ_DESTROY, oOrb KEYWORD PARAMETERS: ORB::INIT:POS: A three-element vector, [x,y,z], specifying the position of the center of the orb, measured in data units . Defaults to [0,0,0]. RADIUS: A floating point number representing the radius of the orb (measured in data units). The default is 1.0. DENSITY: A floating point number representing the density at which the vertices should be generated along the surface of the orb. The default is 1.0. TEX_COORDS: Set this keyword to a nonzero value if texture map coordinates are to be generated for the orb. ORB::GETPROPERTY: POS: Set this keyword to a named variable that upon return will contain a three-element vector, [x,y,z], specifying the position of the center of the orb, measured in data units . RADIUS: Set this keyword to a named variable that upon return will contain a floating point number representing the radius of the orb (measured in data units). DENSITY: Set this keyword to a named variable that upon return will contain a floating point number representing the density at which the vertices are generated along the surface of the orb. ORB::SETPROPERTY: POS: A three-element vector, [x,y,z], specifying the position of the center of the orb. Defaults to [0,0,0]. RADIUS: A floating point number representing the radius of the orb (measured in data units). The default is 1.0. DENSITY: A floating point number representing the density at which the vertices should be generated along the surface of the orb. The default is 1.0. EXAMPLE: Create an orb centered at the origin with a radius of 0.5: oOrb = OBJ_NEW('Orb', POS=[0,0,0], RADIUS=0.5) MODIFICATION HISTORY: Written by: RF, September 1996.
(See C:\RSI\IDL52\examples\object\orb__define.pro)
NAME: PALETTE PURPOSE: Interactively create color tables based on the RGB color system using the mouse, three sliders, and a cell for each color index. Single colors can be defined and multiple color indices between two endpoints can be interpolated. CATEGORY: Color tables. CALLING SEQUENCE: PALETTE INPUTS: No explicit inputs. The current color table is used as a starting point. KEYWORD PARAMETERS: None. OUTPUTS: None. COMMON BLOCKS: COLORS: Contains the current RGB color tables. SIDE EFFECTS: The new color tables are saved in the COLORS common block and loaded to the display. RESTRICTIONS: Only works with window systems. PROCEDURE: A window is created with: 1) A color ramp at the top. 2) A rectangle containing the current color index at upper left. 3) Three slider bars for red, green, and blue. 4) An array of cells, one for each color index. 5) Buttons for help, undo current color, and undo all at the bottom. To use the PALETTE tool: Select the color index to be modified by clicking the mouse in the cell array over the color to be changed. The index of this color appears under the upper right rectangle. Move the mouse to the slider bars and vary the color content by depressing the left button within these bars. You can interpolate all color indices between two endpoints by defining the color first for one endpoint, and then for the other. Move the mouse back to the cell of the first endpoint and click the center button. The colors between the two endpoints change to a smooth gradient between the two points. Exit this procedure and save the colors by clicking the right button. The current color can be restored by clicking "Undo Current Color". All colors are restored to their entry values by clicking "Undo All". You can access the new color tables by declaring the common block COLORS, as shown below (PALETTE sets both the original and current arrays): COMMON COLORS, R_ORIG, G_ORIG, B_ORIG, R_CURR, G_CURR, B_CURR Users of the Motif and OPEN LOOK window systems can use XPALETTE, a widgets version of PALETTE. MODIFICATION HISTORY: DMS, September, 1988. SNG, December, 1990. Added support for DOS version, only supports 640 x 480 x 16 display mode. SMR, March, 1991. Fixed a bug where the existing IDL window was used instead of creating a new window.
(See C:\RSI\IDL52\lib\obsolete\palette.pro)
NAME: PARTIAL_COR PURPOSE: Compute the partial correlation coefficient between X and Y after both have been adjusted for the variables in C. CATEGORY: Statistics. CALLING SEQUENCE: Result = PARTIAL_COR(X,Y,C) INPUTS: X: column vector of R independent data values. Y: column vector of R dependent data values. C: two dimensional array with each column containing data values corresponding to an independent variable. Each column has length R. OUTPUT: The partial correlation coefficient.
(See C:\RSI\IDL52\lib\obsolete\partial_cor.pro)
NAME: PARTIAL_COR2 PURPOSE: Compute the partial correlation coefficient between X and Y after both have been adjusted for the variables in C CATEGORY: Statistics. CALLING SEQUENCE: Result = PARTIAL_COR(X,Y,C) INPUTS: X: Column vector of R independent data values. Y: Column vector of R dependent data values. C: Two-dimensional array with each column containing data values corresponding to an independent variable. Each column has length R. OUTPUT: The partial correlation coefficient.
(See C:\RSI\IDL52\lib\obsolete\partial2_cor.pro)
NAME: PDE_ADI PURPOSE: This procedure computes the numerical solution of the initial-boundary value problem (parabolic partial differential equation) using the ADI method (ALTERNATING DIRECTION IMPLICIT) in two space dimensions (x,y). CATEGORY: Numerical Analysis CALLING SEQUENCE: .run PDE_ADI (compiles the procedure) PDE_ADI (runs the procedure) INPUTS: There are no input parameters that can be specified from the IDL command line. However, the following Internal Parameters should be specified by editing the PDE_ADI.PRO file before compiling the procedure: DIFFUSIVITY ......................... DIFF ENDPOINTS ........................... XMAX, YMAX TIME STEP ........................... DELTA_TIME NUMBER OF INTERIOR X-NODES .......... X_NODE_MAX NUMBER OF INTERIOR Y-NODES .......... Y_NODE_MAX NUMBER OF TIME STEPS ................ TIME_MAX OUTPUTS: The numerical solution computed at each time step is stored in the file PDE_ADI.DAT. RESTRICTIONS: All Internal Parameters must be positive scalars. PROCEDURE: This procedure uses the ADI method to compute the temperature U at each node (M,N) in the rectangular grid defined by DELTA_X and DELTA_Y for each time step from time=0 to time=TIME_MAX with steps of DELTA_TIME. EXAMPLE: This procedure solves the partial differential equation: Ut-diff*(Uxx+Uyy)=NONHOMOGENEOUS(X,Y,T) Subject to the initial and boundary conditions: U(x,y,0)=INITIAL_COND(X,Y) U(0,y,t)=BOUNDARY_LT(Y,T) U(1,y,t)=BOUNDARY_RT(Y,T) U(x,0,t)=BOUNDARY_BOT(X,T) U(x,1,t)=BOUNDARY_TOP(X,T) where: Ut .... first partial derivative of U with respect to t Uxx ... second partial derivative of U with respect to x Uyy ... second partial derivative of U with respect to y The computational grid has X_NODE_MAX x Y_NODE_MAX interior mesh points and X_NODE_MAX+2 x Y_NODE_MAX+2 total mesh points. MODIFICATION HISTORY: GGS; AUGUST 1992 Adapted from: Graduate course work at the University of Colorado, Boulder Published References: Advanced Engineering Mathematics (sixth edition) Erwin Kreyzig Wiley & Sons Inc.
(See C:\RSI\IDL52\lib\obsolete\pde_adi.pro)
NAME: PHASER PURPOSE: Issue the SET_PLOT and DEVICE commands appropriate for the Tektronix Phaser IIpxi color PostScript laser printer. CATEGORY: Device drivers. CALLING SEQUENCE: PHASER [, /LETTER] [, /LEGAL] [, /LANDSCAPE] [, /PORTRAIT] INPUTS: None. KEYWORD PARAMETERS: LETTER: If this keyword is set, output is produced for letter-sized paper. This setting is the default. LEGAL: If this keyword is set, output is produced for legal-sized papter. /LEGAL should be used for overhead transparencies as well, since these are legal size before the borders are removed. LANDSCAPE: If this keyword is set, output is produced in landscape orientation, i.e. with the X axis along the long edge of the page. This setting is the default. PORTRAIT: If this keyword is set, output is produced in portrait orientation, i.e. wih the X axis along the short edge of the paper. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The plotting device is set to PostScript, 8 bits/pixel, color and with sizes, offsets and orientations appropriate to the keywords used. RESTRICTIONS: Because of the paper handling mechanism in the Phaser printer it is unable to print over the entire page. The actual print dimensions are 8.0" x 8.5" for /LETTER and 8.0" x 10.5" for /LEGAL. PROCEDURE: The SET_PLOT, 'PS' command is issued. Then PHASER issues a command like: DEVICE, BITS=8, /COLOR, XSIZE=SHORT_SIDE, YSIZE=LONG_SIDE, $ XOFFSET = SMALL_OFFSET, YOFFSET = BIG_OFFSET, $ /INCH, /PORTRAIT, [/LANDSCAPE or /PORTRAIT] The values of SHORT_SIDE, LONG_SIDE, SMALL_OFFSET, BIG_OFFSET are calculated for the paper size (/LETTER or /LEGAL) and orientation (/LANDSCAPE or /PORTRAIT). MODIFICATION HISTORY: Created 22-OCT-1991 by Mark Rivers.
(See C:\RSI\IDL52\lib\obsolete\phaser.pro)
NAME: PICKFILE PURPOSE: This function allows the user to interactively pick a file. A file selection tool with a graphical user interface is created. Files can be selected from the current directory or other directories. CATEGORY: Widgets. CALLING SEQUENCE: Result = PICKFILE() KEYWORD PARAMETERS: FILE: A string value for setting the initial value of the selection. Useful if there is a default file GET_PATH: Set to a named variable. Returns the path at the time of selection. GROUP: The widget ID of the widget that calls PICKFILE. When this ID is specified, a death of the caller results in the death of the PICKFILE widget application. READ: Set this keyword to make the title of the PICKFILE window "Select File to Read". WRITE: Set this keyword to make the title of the PICKFILE window "Select File to Write". PATH: The initial path to select files from. If this keyword is not set, the current directory is used. FILTER: A string value for filtering the files in the file list. This keyword is used to reduce the number of files to choose from. The user can modify the filter unless the FIX_FILTER keyword is set. Example filter values might be "*.pro" or "*.dat". FIX_FILTER: When this keyword is set, only files that satisfy the filter can be selected. The user has no ability to modify the filter and the filter is not shown. TITLE: A scalar string to be used for the window title. If it is not specified, the default title is "Select File" NOCONFIRM: Return immediately upon selection of a file. The default behavior is to display the selection and then return the file when the user uses the "ok" button. MUST_EXIST: When set, only files that actually exist can be selected. OUTPUTS: PICKFILE returns a string that contains the name of the file selected. If no file is selected, PICKFILE returns a null string. COMMON BLOCKS: NONE. SIDE EFFECTS: NONE. RESTRICTIONS: Only one instance of the PICKFILE widget can be running at one time. PROCEDURE: Create and register the widget and then exit, returning the filename that was picked. EXAMPLE: Create a PICKFILE widget that lets users select only files with the extensions 'pro' and 'dat'. Use the 'Select File to Read' title and store the name of the selected file in the variable F. Enter: F = PICKFILE(/READ, FILTER = '*.pro *.dat') MODIFICATION HISTORY: Written by: Steve Richards, April, 1991 July, 1991 Added a FILTER keyword to allow users to select files with a given extension or extensions. August, 1991 Fixed bugs caused by differences between spawned ls commands on different machines. September, 1991 Made Myfindfile so only one pass was necessary to find files and directories. 3/92 - ACY Corrected initialization of dirsave, change spawn command to "ls -lL" and added case for links add NOCONFIRM keyword for auto exiting on selection 8/92 - SMR Rewrote pickfile as a compound widget. 10/92 - SMR Fixed a bug where extremely large file namess didn't show up properly in the file list or as return values. 12/92 - JWG Add better machine dependency code 1/93 - JWG Added FILE, GET_PATH keywords. 1/93 - TAC Added Windows Common dialog pickfile code 2/93 - SMR Fixed the documentation example for multiple extensions 1/94 - KDB If directory had no execute permission on Unix platforms, CD fails and causes error. Added check for this. Increased spawn speed by using /sh for unix. Added -a switch to ls so that all files can be found on unix machines. 2/94 - KDB Values passed to CD cannot end in a '\' on DOS platforms. Program would crash if the PATH keyword was supplied a value that ended with a "\". Added a check for this. 3/94 - BMH Deleted the reference here to OS_PICKFILE for the Unix platforms and created an IDL routine to to call the Mac and Windows specific OS_PICKFILE routines. This solved the saving and restoring on different platforms problem. 4/94 - KDB The vms call to lib$findfile in valid_dir was commented out. This caused errors when path was changed by user. Uncommented. In Valid_Dir, with vms the type of directory specification was not checked (directory can be a path or a filename): Fixed this. In dirlist section of event handler, a "[-]" would get trimmed to "" and cause error: Fixed. 8/94 - ACY Change the spawn command in getdirs to send error output to /dev/null. 12/94 - DJE Fix the FIX_FILTER option for the MacOS. 1/96 - RPM Fixed reading of directories for when Unix long listing (ls -l) does not align columns. 3/96 - LP Implemented widget_pickfile in Motif (xmFileSelectionBox). Conformed to widget_... mechanism for all platforms. Used Motif widget_pickfile, removed file, directory internal IDL handling. 4/96 - LP Renamed widget_pickfile to dialog_pickfile. Note. This routine is maintained for compatibility reason. New system routine dialog_pickfile should be used instead.
(See C:\RSI\IDL52\lib\obsolete\pickfile.pro)
NAME: PLANET PURPOSE: This procedure demonstrates the use of object graphics to manage local and global transformations. This procedure creates a simple widget application that allows the user to orbit a planet about a sun, or rotate the planet about its own axis. CATEGORY: Object graphics. CALLING SEQUENCE: Planet MODIFICATION HISTORY: Written by: RF, September 1996.
(See C:\RSI\IDL52\examples\object\planet.pro)
NAME: PLOTERR PURPOSE: Plot data points with accompanying error bars. (See also OPLOTERR.) CATEGORY: Plotting, two-dimensional. CALLING SEQUENCE: PLOTERR, [ X ,] Y , Err [, PSYM = Psym] [, TYPE = Type] INPUTS: X: The array of abcissae. Y: The array of Y values. Err: The array of error-bar values. OPTIONAL KEYWORD PARAMETERS: PSYM: The plotting symbol to use. The default is +7. TYPE: The type of plot to be produced. The possible types are: TYPE = 0 : X Linear - Y Linear (default) TYPE = 1 : X Linear - Y Log TYPE = 2 : X Log - Y Linear TYPE = 3 : X Log - Y Log COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Arrays cannot be of type string. There must be enough points to plot. PROCEDURE: A plot of X versus Y with error bars drawn from Y - ERR to Y + ERR is written to the output device. MODIFICATION HISTORY: William Thompson Applied Research Corporation July, 1986 8201 Corporate Drive Landover, MD 20785 DMS, April, 1989 Modified for Unix.
(See C:\RSI\IDL52\lib\ploterr.pro)
NAME: Plot_3dbox PURPOSE: This procedure plots data in a 3-dimensional box, with options to have the data displayed on the walls surrounding the plot area. CATEGORY: Plotting, Three-dimensional CALLING SEQUENCE: Plot_3dbox, X, Y, Z INPUTS: X: A one dimensional array that contains the X coordinats Y: A one dimensional array that contains the Y coordinates Z: A one dimensional array that contains the Z coordinates OPTIONAL INPUTS: None. KEYWORD PARAMETERS: COLOR: The color for the Grid and Lines or the Color for the box walls when the keyword SOLID_WALLS is set. BACKGROUND: The background color of the plot or the color of the Grid and Plot data when the SOLID_WALLS keyword is set. XY_PLANE: Setting this keyword will cause the X and Y values of the data to be plotted on the Z=0 axis plane. XZ_PLANE: Setting this keyword will cause the X and Z values of the data to be plotted on the Y=Ymax axis plane. YZ_PLANE: Setting this keyword will cause the Y and Z values of the data to be plotted on the X=Xmax axis plane. SOLID_WALLS: Setting this keyword causes the axis "walls" of the plot box to be filled with the value of COLOR. PSYM: The plotting symbol that the data is draw with. GRIDSTYLE: Set this keyword to the linestyle that will be used in drawing the gridlines. TITLE: Set this keyword to the Main plot title XTITLE: Set this keyword to the X axis title. YTITLE: Set this keyword to the Y axis title. ZTITLE: Set this keyword to the Z axis title. SUBTITLE: Set this keyword to the Sub-Title LINESTYLE: The linestyle used to plot the data. XYSTYLE: The linesytle used to draw the plot in the XY plane. If this keyword is not set, the value of LINESTYLE is used. XZSTYLE: The linesytle used to draw the plot in the XZ plane. If this keyword is not set, the value of LINESTYLE is used. YZSTYLE: The linesytle used to draw the plot in the YZ plane. If this keyword is not set, the value of LINESTYLE is used. Surface All other keywords available to SURFACE are also Keywords: used by this procedure. OUTPUTS: None. OPTIONAL OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: Plotting on the current device is performed. RESTRICTIONS: None. PROCEDURE: Straightforward. Unrecognized keywords are passed to the SURFACE procedure. EXAMPLE: Create some data that can be passed to Plot_3dbox x = Replicate(5., 10) x1 = cos(findgen(36)*10.*!dtor)*2.+5. x=[x,x1,x] y = findgen(56) z = Replicate(5., 10) z1 =sin(findgen(36)*10.*!dtor)*2.+5. z=[z,z1,z] ; Plot this data in a "plot box" Plot_3dbox, X, Y, Z, /XY_PLANE, /YZ_PLANE, /XZ_PLANE, $ /SOLID_WALLS, GRIDSTYLE=1, XYSTYLE=3, XZSTYLE=4, $ YZSTYLE=5, AZ=40, TITLE="Example Plot Box", $ Xtitle="X Coodinate", Ytitle="Y Coodinate", $ Ztitle="Z Coodinate", SubTitle="Sub Title", $ /YSTYLE, ZRANGE=[0,10], XRANGE=[0,10],Charsize=1.6 ; Then to plot symbols on the locations of the above plot plots, X, Y, Z, /T3D, PSYM=4, COLOR=!p.background MODIFICATION HISTORY: 6/94 KDB, RSI - Initial Coding and Testing
(See C:\RSI\IDL52\lib\plot_3dbox.pro)
NAME: PLOT_FIELD PURPOSE: This procedure plots a 2-dimensional field. CATEGORY: Plotting, two-dimensional. CALLING SEQUENCE: PLOT_FIELD, U, V INPUTS: U: The 2-dimensional array giving the field vector at each point in the U[X] direction. V: The 2-dimensional array giving the field vector at each point in the V[Y] direction. KEYWORD PARAMETERS: N: The number of arrows to draw. The default is 200. LENGTH: The length of the longest field vector expressed as a fraction of the plotting area. The default is 0.1. ASPECT: The aspect ratio of the plot (i.e., the ratio of the X size to Y size). The default is 1.0. TITLE: The title of plot. The default is "Velocity Field". OUTPUTS: No explicit outputs. SIDE EFFECTS: A new plot is drawn to the current output device. PROCEDURE: N random points are picked, and from each point a path is traced along the field. The length of the path is proportional to "LENGTH" and the field vector magnitude. EXAMPLE: X = FINDGEN(20, 20) ; Create array X Y = FINDGEN(20, 20)*3 ; Create array Y PLOT_FIELD, X, Y ; Create plot MODIFICATION HISTORY: Jan., 1988 Neal Hurlburt, University of Colorado.
(See C:\RSI\IDL52\lib\plot_field.pro)
NAME: PM PURPOSE: Perform formatted output of matrices stored in the IMSL/IDL linear algebra storage scheme to the standard output. CATEGORY: Linear Algebra CALLING SEQUENCE: PM, E1, ..., E10 INPUTS: E1, ... E10 - Expressions to be output. These can be scalar or array and of any type. OUTPUTS: Output is written to the standard output stream. COMMON BLOCKS: None. RESTRICTIONS: No more than 10 expressions can be output. This should be sufficient for typical use. MODIFICATION HISTORY: 13, September 1991, Written by AB (RSI), Mike Pulverenti (IMSL)
(See C:\RSI\IDL52\lib\obsolete\pm.pro)
NAME: PMF PURPOSE: Perform formatted output of matrices stored in the IMSL/IDL linear algebra storage scheme to the specified file. CATEGORY: Linear Algebra CALLING SEQUENCE: PMF, UNIT, E1, ..., E10 INPUTS: Unit - The output file unit. E1, ... E20 - Expressions to be output. These can be scalar or array and of any type. OUTPUTS: Output is written to the file specified by unit. COMMON BLOCKS: None. RESTRICTIONS: No more than 20 expressions can be output. This should be sufficient for typical use. MODIFICATION HISTORY: 13, September 1991, Written by AB (RSI), MP (IMSL)
(See C:\RSI\IDL52\lib\obsolete\pmf.pro)
NAME: PNT_LINE PURPOSE: This function returns the perpendicular distance between the point P0 and the line between points L0 and L1. CATEGORY: Geometry. CALLING SEQUENCE: Result = PNT_LINE(P0, L0, L1 [, Pl]) INPUTS: P0: The location of the point. P0 may have 2 to N elements, for N dimensions. L0: One end-point of the line. L0 must have same number of elements as P0. L1: The other end-point of the line. L1 must have the same number of elements as LO. KEYWORD PARAMETERS: INTERVAL: If set, and if the point on the line between L0 and L1 that is closest to PO is not within the interval [L0, L1], causes the function to return the distance from P0 to the closer of the two endpoints L0 and L1. OUTPUTS: This function returns the distance from point P0 to the line between L0 and L1, unless the closest point on the line is not in the interval [L0, L1] and the keyword INTERVAL is set. In this case, the function returns the distance between P0 and the closer of the two end-points. OPTIONAL OUTPUTS: Pl: The point on the line between L0 and L1 that is closest to P0. Pl is not necessarily in the interval [L0, L1]. RESTRICTIONS: This function is limited by the machine accuracy of single precision floating point. PROCEDURE: Solve equations of perpendicular, etc. EXAMPLE: To print the distance between the point (2,3) and the line from (-3,3) to (5,12), and also the location of the point on the line closest to (2,3), enter the following command: PRINT, PNT_LINE([2,3], [-3,3], [5,12], Pl), Pl MODIFICATION HISTORY: DMS, RSI, Jan, 1993. Written.
(See C:\RSI\IDL52\lib\pnt_line.pro)
NAME: POLAR_CONTOUR PURPOSE: Produce a contour plot from data in polar coordinates. Data may be in a regular or scattered grid. CATEGORY: Graphics. CALLING SEQUENCE: POLAR_CONTOUR, Z, Theta, R INPUTS: Z = data values. If regulary gridded, Z must have dimensions of (NTheta, NR). Theta = values of theta in radians. For the regular grid, Theta must have the same number of elements as the first dimension of Z. For the scattered grid, Theta must have the same number of elements as Z. R = values of radius. For the regular grid, R must have the same number of elements as the second dimension of Z. For the scattered grid, R must have the same number of elements as Z. KEYWORD PARAMETERS: SHOW_TRIANGULATION = color. If set, the triangulation connecting the data points is overplotted in the designated color. DITHER = dither the input points by a small amount (1 part in 10^5) to avoid ambiguous triangulations. Regular grids frequently make ambiguous triangulations, making this keyword necessary. Also, most of the keywords accepted by CONTOUR may be specified. Keywords associated with contour following, such as FOLLOW, PATH_xxx, and C_LABELS, are not accepted. OUTPUTS: A contour plot is produced. COMMON BLOCKS: None. SIDE EFFECTS: Plot is produced on the current graphics output device. RESTRICTIONS: None. PROCEDURE: The cartesian coordinates of each point are calculated. TRIANGULATE is called to grid the data into triangles. CONTOUR is called to produce the contours from the triangles. EXAMPLE: Example with regular grid: nr = 12 ;# of radii nt = 18 ;# of thetas r = findgen(nr) / (nr-1) ;Form r and Theta vectors theta = 2 * !pi * findgen(nt) / (nt-1) z = cos(theta*3) # (r-.5)^2 ;Fake function value tek_color Create filled contours: Polar_Contour, z, theta, r, /fill, c_color=[2,3,4,5] Example with random (scattered) grid: n = 200 r = randomu(seed, n) ;N random r's and Theta's theta = 2*!pi * randomu(seed, n) x = cos(theta) * r ;Make a function to plot y = sin(theta) * r z = x^2 - 2*y Polar_Contour, z, theta, r, Nlevels=10, xrange=[0,1], yrange=[0,1] MODIFICATION HISTORY: Written by: Your name here, Date. January, 1995. DMS, RSI.
(See C:\RSI\IDL52\lib\polar_contour.pro)
NAME: POLAR_SURFACE PURPOSE: This function interpolates a surface from polar coordinates (R, Theta, Z) to rectangular coordinates (X, Y, Z). CATEGORY: Gridding. CALLING SEQUENCE: Result = POLAR_SURFACE(Z, R, Theta) INPUTS: Z: An array containing the surface value at each point. If the data are regularly gridded (GRID=1) in R and Theta, Z is a two dimensional array, where Z[i,j] has a radius of R[i] and an azimuth of Theta[j]. If GRID is not set, R[i] and Theta[i] contain the radius and azimuth of each Z[i]. R: The radius. If GRID is set, Z[i,j] has a radius of R[i]. If GRID is not set, R must have the same number of elements as Z, and contains the radius of each point. Theta: The azimuth, in radians. If GRID is set, Z[i,j] has an azimuth of Theta[j]. If GRID is not set, Theta must have the same number of elements as Z, and contains the azimuth of each point. KEYWORD PARAMETERS: GRID: Set GRID to indicate that Z is regularly gridded in R and Theta. SPACING: A two element vector containing the desired grid spacing of the resulting array in X and Y. If omitted, the grid will be approximately 51 by 51. BOUNDS: A four element vector, [X0, Y0, X1, Y1], containing the limits of the XY grid of the resulting array. If omitted, the extent of input data sets the limits of the grid. QUINTIC: If set, the function uses quintic interpolation, which is slower but smoother than the default linear interpolation. MISSING: A value to use for areas within the grid but not within the convex hull of the data points. The default is 0.0. OUTPUTS: This function returns a two-dimensional array of the same type as Z. PROCEDURE: First, each data point is transformed to (X, Y, Z). Then the TRIANGULATE and TRIGRID procedures are used to interpolate the surface over the rectangular grid. EXAMPLE: r = findgen(50) / 50. ;Radius theta = findgen(50) * (2 * !pi / 50.) ;Theta z = r # sin(theta) ;Make a function (tilted circle) SURFACE, POLAR_SURFACE(z, r, theta, /GRID) ;Show it MODIFICATION HISTORY: DMS Sept, 1992 Written
(See C:\RSI\IDL52\lib\polar_surface.pro)
NAME: POLY PURPOSE: Evaluate a polynomial function of a variable. CATEGORY: C1 - Operations on polynomials. CALLING SEQUENCE: Result = POLY(X,C) INPUTS: X: The variable. This value can be a scalar, vector or array. C: The vector of polynomial coefficients. The degree of of the polynomial is N_ELEMENTS(C) - 1. OUTPUTS: POLY returns a result equal to: C[0] + c[1] * X + c[2]*x^2 + ... COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Straightforward. MODIFICATION HISTORY: DMS, Written, January, 1983.
(See C:\RSI\IDL52\lib\poly.pro)
NAME: POLYCONTOUR PURPOSE: Fill the contours defined by a path file created by CONTOUR. This routine has been obsoleted by the FILL option to CONTOUR, and should NOT be used. CATEGORY: Graphics. CALLING SEQUENCE: POLYCONTOUR, Filename [, COLOR_INDEX = color_index] INPUTS: Filename: The name of a file containing contour paths. This file must have been created by using the CONTOUR procedure: CONTOUR, PATH=Filename, ... KEYWORD PARAMETERS: COLOR_INDEX: An array of color indices for the filled contours. Element i contains the color of contour level number i-1. Element 0 contains the background color. There must be one more color index than the number of levels. DELETE_FILE: If present and non-zero, Filename will be deleted after POLYCONTOUR is finished with it. PATTERN: An optional array of patterns with the dimensions (NX, NY, NPATTERN). OUTPUTS: The contours are filled on the display using normalized coordinates and the POLYFILL procedure. COMMON BLOCKS: None. SIDE EFFECTS: A filled contour plot is drawn to the current display. RESTRICTIONS: This routine will NOT draw open contours. To eliminate open contours in your dataset, surround the original array with a 1-element border on all sides. The border should be set to a value less than or equal to the minimum data array value. For example, if A is an (N,M) array enter: B = REPLICATE(MIN(A), N+2, M+2) ;Make background B(1,1) = A ;Insert original data CONTOUR, B, PATH=Filename ... ;Create the contour file. PROCEDURE: The contour file is scaned to find the starting byte of each contour's path. Then POLYCONTOUR sorts the contour levels and reads each record, filling its path. High contours are draw in increasing order, then Low contours are drawn in decreasing order. EXAMPLE: Create a 8 by 8 array of random numbers, place it into a 10 by 10 array to eliminate open contours, polycontour it, then overdraw the contour lines. Enter: B = FLTARR(10,10) ;Create a big array of 0's. B(1,1) = RANDOMU(seed, 8,8) ;Insert random numbers. CONTOUR, b, /SPLINE, PATH = 'path.dat' ;Make the path file. POLYCONTOUR, 'path.dat' ;Fill the contours. CONTOUR, b, /SPLINE, /NOERASE ;Overplot lines & labels. Suggestion: Use TEK_COLOR to load a color table suitable for viewing this display. MODIFICATION HISTORY: DMS, AB, January, 1989. DMS, April, 1993. Made it obsolete.
(See C:\RSI\IDL52\lib\obsolete\polycontour.pro)
NAME: POLYFITW PURPOSE: Perform a least-square polynomial fit with optional error estimates. CATEGORY: Curve fitting. CALLING SEQUENCE: Result = POLYFITW(X, Y, W, NDegree [, Yfit, Yband, Sigma, A]) INPUTS: X: The independent variable vector. Y: The dependent variable vector. This vector should be the same length as X. W: The vector of weights. This vector should be same length as X and Y. NDegree: The degree of polynomial to fit. OUTPUTS: POLYFITW returns a vector of coefficients of length NDegree+1. OPTIONAL OUTPUT PARAMETERS: Yfit: The vector of calculated Y's. Has an error of + or - Yband. Yband: Error estimate for each point = 1 sigma. Sigma: The standard deviation in Y units. A: Correlation matrix of the coefficients. COMMON BLOCKS: None. SIDE EFFECTS: None. MODIFICATION HISTORY: Written by: George Lawrence, LASP, University of Colorado, December, 1981. Adapted to VAX IDL by: David Stern, Jan, 1982. Weights added, April, 1987, G. Lawrence
(See C:\RSI\IDL52\lib\polyfitw.pro)
NAME: POLYWARP PURPOSE: Perform polynomial spatial warping. Using least squares estimation, determine the coefficients Kx[i,j] and Ky[i,j] of the polynomial functions: Xi = sum over i and j of: Kx[i,j] * Xo^j * Yo^i Yi = sum over i and j of: Ky[i,j] * Xo^j * Yo^i Kx and Ky can be used as inputs P and Q to the built-in function POLY_2D. CATEGORY: Image processing. CALLING SEQUENCE: POLYWARP, Xi, Yi, Xo, Yo, Degree, Kx, Ky INPUTS: Xi, Yi: The vectors of x,y coordinates to be fit as a function of Xo and Yo. Xo, Yo: The vectors of x,y independent coordinates. These vectors must have the same number of elements as Xi and Yi. Degree: The degree of the fit. The number of coordinate pairs must be greater than or equal to (Degree+1)^2. OUTPUTS: Kx: The array of coefficients for Xi as a function of (xo,yo). This parameter is returned as a (Degree+1) by (Degree+1) element array. Ky: The array of coefficients for yi. This parameter is returned as a (Degree+1) by (Degree+1) element array. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: See: Computer Image Processing and Recognition, Ernest L. Hall, Academic Press, 1979, Pages 186-188. Xi and Yi are expressed as polynomials of Xo, Yo: Xi = Kx[i,j] * Xo^j * Yo^i Summed for i,j = 0 to degree. And Yi = Ky[i,j] * Xo^j * Yo^i. This coordinate transformation may be then used to map from Xo, Yo coordinates into Xi, Yi coordinates. EXAMPLE: The following example shows how to display an image and warp it using the POLYWARP and POLY_2D routines. Create and display the original image by entering: A = BYTSCL(SIN(DIST(250))) TVSCL, A Now set up the Xi's and Yi's. Enter: XI = [24, 35, 102, 92] YI = [81, 24, 25, 92] Enter the Xo's and Yo's: XO = [61, 62, 143, 133] YO = [89, 34, 38, 105] Run POLYWARP to obtain a Kx and Ky: POLYWARP, XI, YI, XO, YO, 1, KX, KY Create a warped image based on Kx and Ky with POLY_2D: B = POLY_2D(A, KX, KY) Display the new image: TV, B MODIFICATION HISTORY: DMS, RSI, Dec, 1983.
(See C:\RSI\IDL52\lib\polywarp.pro)
NAME: POLY_AREA PURPOSE: Return the area of a polygon given the coordinates of its vertices. CATEGORY: Analytical Geometry CALLING SEQUENCE: Result = POLY_AREA(X, Y) INPUTS: It is assumed that the polygon has N vertices with N sides and the edges connect the vertices in the order: [(x1,y1), (x2,y2), ..., (xn,yn), (x1,y1)]. i.e. the last vertex is connected to the first vertex. X: An N-element vector of X coordinate locations for the vertices. Y: An N-element vector of Y coordinate locations for the vertices. Keyword Inputs: SIGNED = If set, returned a signed area. Polygons with edges listed in counterclockwise order have a positive area, while those traversed in the clockwise direction have a negative area. OUTPUTS: POLY_AREA returns the area of the polygon. This value is positive, unless the SIGNED keyword is set and the polygon is in clockwise order. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: The area is computed as: Area = 1/2 * [ x1y2 + x2y3 + x3y4 +...+x(n-1)yn + xny1 - y1x2 - y2x3 -...-y(n-1)xn - ynx1) MODIFICATION HISTORY: DMS, July, 1984. DMS, Aug, 1996, Added SIGNED keyword.
(See C:\RSI\IDL52\lib\poly_area.pro)
NAME: POLY_FIT PURPOSE: Perform a least-square polynomial fit with optional error estimates. This routine uses matrix inversion. A newer version of this routine, SVDFIT, uses Singular Value Decomposition. The SVD technique is more flexible, but slower. Another version of this routine, POLYFITW, performs a weighted least square fit. CATEGORY: Curve fitting. CALLING SEQUENCE: Result = POLY_FIT(X, Y, NDegree [,Yfit, Yband, Sigma, CORRM] ) INPUTS: X: The independent variable vector. Y: The dependent variable vector, should be same length as x. NDegree: The degree of the polynomial to fit. OUTPUTS: POLY_FIT returns a vector of coefficients with a length of NDegree+1. OPTIONAL OUTPUT PARAMETERS: Yfit: The vector of calculated Y's. These values have an error of + or - Yband. Yband: Error estimate for each point = 1 sigma Sigma: The standard deviations of the returned coefficients. Corrm: Correlation matrix of the coefficients. Keyword Parameters: DOUBLE = if set, force computations to be in double precision. COMMON BLOCKS: None. SIDE EFFECTS: None. MODIFICATION HISTORY: Written by: George Lawrence, LASP, University of Colorado, December, 1981. Adapted to VAX IDL by: David Stern, Jan, 1982. Modified: GGS, RSI, March 1996 Corrected a condition which explicitly converted all internal variables to single-precision float. Added support for double-precision inputs. Added a check for singular array inversion. SVP, RSI, June 1996 Changed A to Corrm to match IDL5.0 docs. S. Lett, RSI, December 1997 Changed inversion status check to check only for numerically singular matrix. S. Lett, RSI, March 1998 Initialize local copy of the independent variable to be of type DOUBLE when working in double precision.
(See C:\RSI\IDL52\lib\poly_fit.pro)
NAME: POPD PURPOSE: Change the current working directory to the directory saved on the top of the directory stack maintained by the PUSHD and POPD User Library procedures. This top entry is then removed. CALLING SEQUENCE: POPD SIDE EFFECTS: The top entry of the directory stack is removed. RESTRICTIONS: Popping a directory from an empty stack causes a warning message to be printed. The current directory is not changed in this case. COMMON BLOCKS: DIR_STACK: Contains the stack. MODIFICATION HISTORY: 17, July, 1989, Written by AB, RSI.
(See C:\RSI\IDL52\lib\popd.pro)
NAME: PRIMES PURPOSE: This function computes the first K prime numbers. The result is a K-element vector of type long integer. CATEGORY: Statistics. CALLING SEQUENCE: Result = Primes(K) INPUTS: K: A scalar of type integer or long integer that specifies the number of primes to be computed. EXAMPLE: Compute the first 25 prime numbers. result = primes(25) The result should be: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, $ 53, 59, 61, 67, 71, 73, 79, 83, 89, 97] REFERENCE: PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition) Ronald E. Walpole & Raymond H. Myers ISBN 0-02-424170-9 MODIFICATION HISTORY: Written by: GGS, RSI, November 1994 S. Lett, RSI, December 1997, added support for k=1
(See C:\RSI\IDL52\lib\primes.pro)
NAME: PRINTD PURPOSE: Display the contents of the directory stack maintained by the PUSHD and POPD User Library procedures. CALLING SEQUENCE: PRINTD OUTPUTS: PRINTD lists the contents of the directory stack on the default output device. COMMON BLOCKS: DIR_STACK: Contains the stack. MODIFICATION HISTORY: 17, July, 1989, Written by AB, RSI.
(See C:\RSI\IDL52\lib\printd.pro)
NAME: PROFILE PURPOSE: Extract a profile from an image. CATEGORY: Image processing. CALLING SEQUENCE: Result = PROFILE(Image, XX, YY) INPUTS: Image: The data array representing the image. This array can be of any type except complex. KEYWORD PARAMETERS: XSTART: The starting X location of the lower-left corner of Image. If this keyword is not specified, 0 is assumed. YSTART: The starting Y location of the lower-left corner of Image. If this keyword is not specified, 0 is assumed. NONMARK: Set this keyword to inhibit marking the image with the profile line. OUTPUTS: PROFILE returns a floating-point vector containing the values of the image along the profile line marked by the user. OPTIONAL OUTPUTS: XX: After picking the end points, XX contains the X coordinates of the points along the selected profile. YY: After picking the end points, YY contains the Y coordinates of the points along the selected profile. COMMON BLOCKS: None. SIDE EFFECTS: Cursor on image display is enabled. RESTRICTIONS: None. PROCEDURE: Allow the operator to mark two points on the image display with the joystick. Extract and return the points along the line. Optionally return the X and Y values of each extracted point. EXAMPLE: Display an image, select a profile and plot that profile in a new window. Create and display an image by entering: A = BYTSCL(DIST(256)) TV, A Extract a profile from the image. Enter the following command and mark two points on the image with the mouse: R = PROFILE(A) Create a new plotting window and plot the profile by entering: WINDOW, /FREE PLOT, R An interactive version of this routine is available with the User Library procedure PROFILES. MODIFICATION HISTORY: Written, DMS, November, 1982. Modified for Sun, march, 1988. December 1991, KRC Made PROFILES return XX and YY. Modified: GGS, June 1996 OPTIONAL OUTPUTS: XX and YY are type long.
(See C:\RSI\IDL52\lib\profile.pro)
NAME: PROFILES PURPOSE: Interactively draw row or column profiles of an image in a separate window. CATEGORY: Image analysis. CALLING SEQUENCE: PROFILES, Image [, SX = sx, SY = sy] INPUTS: Image: The variable that represents the image displayed in current window. This data need not be scaled into bytes. The profile graphs are made from this array. KEYWORD PARAMETERS: SX: Starting X position of the image in the window. If this keyword is omitted, 0 is assumed. SY: Starting Y position of the image in the window. If this keyword is omitted, 0 is assumed. WSIZE: The size of the PROFILES window as a fraction or multiple of 640 by 512. ORDER: Set this keyword param to 1 for images written top down or 0 for bottom up. Default is the current value of !ORDER. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: A new window is created and used for the profiles. When done, the new window is deleted. RESTRICTIONS: None. PROCEDURE: A new window is created and the mouse location in the original window is used to plot profiles in the new window. Pressing the left mouse button toggles between row and column profiles. The right mouse button exits. EXAMPLE: Create and display an image and use the PROFILES routine on it. Create and display the image by entering: A = BYTSCL(DIST(256)) TV, A Run the PROFILES routine by entering: PROFILES, A The PROFILES window should appear. Move the cursor over the original image to see the profile at the cursor position. Press the left mouse button to toggle between row and column profiles. Press the right mouse button (with the cursor over the original image) to exit the routine. MODIFICATION HISTORY: DMS, Nov, 1988.
(See C:\RSI\IDL52\lib\profiles.pro)
NAME: PROJECT_VOL PURPOSE: This function returns a two dimensional image that is the projection of a 3-D volume of data onto a plane (similar to an X-ray). The returned image is a translucent rendering of the volume (the highest data values within the volume show up as the brightest regions in the returned image). Depth queing and opacity may be used to affect the image. The volume is projected using a 4x4 matrix, so any type of projection may be used including perspective. Typically the system viewing matrix (!P.T) is used as the 4x4 matrix. Also, see the intrinsic procedure VOXEL_PROJ which performs many of the same functions as this routine. VOXEL_PROJ provides the RGBO rendering method. VOXEL_PROJ is faster, but it does not allow for perspective projections. PROJECT_VOL can combine the contents of the Z-buffer with the projection when the Z_BUFFER keyword is set. PROJECT_VOL will not, however, modify the contents of the Z-buffer. CATEGORY: Volume Rendering. CALLING SEQUENCE: Image = PROJECT_VOL(Vol, X_sample, Y_sample, Z_sample) INPUTS: Vol: The three dimensional volume of data to project. Data type : Any 3-D array except string or structure. X_sample: The number of rays to project along the X dimension of the image. (The returned image will have the dimensions X_sample by Y_sample). Data type : Long. Y_sample: The number of rays to project along the Y dimension of the image. Data type : Long. Z_sample: The number of samples to take along each ray. Higher values for X_sample, Y_sample, and Z_sample increase the image resolution as well as execution time. Data type : Long. KEYWORD PARAMETERS: AVG_INTENSITY: If set, then the average intensity method of projection is used. The default is a maximum intensity projection. This keyword only has effect when NOT using the Z-buffer. CUBIC: If set, then the cubic method of interpolation is used. The default is a bilinear interpolation. DEPTH_Q: Set this keyword to indicate that the image should be created using depth queing. The depth queing should be a single floating point value (between 0.0 and 1.0). This value specifies the brightness of the farthest regions of the volume relative to the closest regions of the volume. A value of 0.0 will cause the back side of the volume to be completely blacked out, while a value of 1.0 indicates that the back side will show up just as bright as the front side. The default is 1.0 (indicating no depth queing). Data type : Float. OPAQUE: A 3-D array with the same size and dimensions as Vol. This array specifies the opacity of each cell in the volume. Opaque values of 0 allow all light to pass through. Opaque values are cumulative. For example, if a ray eminates from a data value of 50, and then passes through 10 opaque cells (each with a data value of 0 and an opacity value of 5) then that ray would be completely blocked out (the cell with the data value of 50 would be invisible on the returned image). The default is no opacity. Data type : Any 3-D array except string or structure (usually the same type as Vol). TRANS: A 4x4 floating point array to use as the transformation matrix when projecting the volume. The default is to use the system viewing matrix (!P.T). Data type : Fltarr(4, 4). XSIZE: The X size of the image to return. Congrid is used to resize the final image to be XSIZE by YSIZE. The default is the X size of the current window (or the X size of the Z-buffer). If there is no current window then the default is X_sample. Data type: Int or Long. YSIZE: The Y size of the image to return. Congrid is used to resize the final image to be XSIZE by YSIZE. The default is the Y size of the current window (or the Y size of the Z-buffer). If there is no current window then the default is Y_sample. Data type: Int or Long. Z_BUFFER: If set, then the projection is combined with the contents of the Z-buffer. The default is to not use the Z-buffer contents. OUTPUTS: This function returns the projected volume as a two dimensional array with the same data type as Vol. The dimensions of the returned array are XSIZE by YSIZE. EXAMPLE: Use "T3D" to set up a viewing projection and render a volume of data using "PROJECT_VOL" : ; Create some data. vol = RANDOMU(s, 40, 40, 40) FOR i=0, 10 DO vol = SMOOTH(vol, 3) vol = BYTSCL(vol[3:37, 3:37, 3:37]) opaque = RANDOMU(s, 40, 40, 40) FOR i=0, 10 DO opaque = SMOOTH(opaque, 3) opaque = BYTSCL(opaque[3:37, 3:37, 3:37], TOP=25B) ; Set up the view. xmin = 0 & ymin = 0 & zmin = 0 xmax = 34 & ymax = 34 & zmax = 34 !X.S = [-xmin, 1.0] / (xmax - xmin) !Y.S = [-ymin, 1.0] / (ymax - ymin) !Z.S = [-zmin, 1.0] / (zmax - zmin) T3D, /RESET T3D, TRANSLATE=[-0.5, -0.5, -0.5] T3D, SCALE=[0.7, 0.7, 0.7] T3D, ROTATE=[30, -30, 60] T3D, TRANSLATE=[0.5, 0.5, 0.5] window, 0, xsize=512, ysize=512 ; Generate and display the image. img = PROJECT_VOL(vol, 64, 64, 64, DEPTH_Q=0.7, $ OPAQUE=opaque, TRANS=(!P.T)) TVSCL, img MODIFICATION HISTORY: Written by: Daniel Carr. Tue Sep 1 17:52:06 MDT 1992 Modified to increase speed. Also modified to use current data->normal coordinate conversion. Added CUBIC, AVG_INTENSITY, XSIZE, YSIZE, and Z_BUFFER keywords. Daniel Carr. Tue Nov 15 16:03:15 MST 1994
(See C:\RSI\IDL52\lib\project_vol.pro)
NAME: PROMPT PURPOSE: PROMPT sets the interactive prompt, normally "IDL>", to the specified string. If no parameter is supplied, the prompt string reverts to "IDL>". This procedure was built-in under version 1 VMS IDL, and is provided in this form to help users of that version adapt to version 2. CALLING SEQUENCE: PROMPT [, String] OPTIONAL INPUT: String: A scalar string giving the new prompt. OUTPUT: The interactive prompt (controlled by the !PROMPT system variable) is changed. RESTRICTIONS: None REVISION HISTORY: 10 January 1990
(See C:\RSI\IDL52\lib\obsolete\prompt.pro)
NAME: PSAFM PURPOSE: Given an Abobe Font metric file, this procedure generates an AFM file in the format that IDL likes. This new file differs from the original in the following ways: [] Information not used by IDL is removed. [] AFM files with the AdobeStandardEncoding are supplemented with an ISOLatin1Encoding. CATEGORY: Misc., PostScript, Fonts CALLING SEQUENCE: PSAFM, input_filename, output_filename INPUTS: Input_Filename: Name of existing AFM file from Adobe. Output_FIlename: Name of new AFM file to be created. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: Generates an output file. MODIFICATION HISTORY: 8 January 1993, Written by AB, RSI.
(See C:\RSI\IDL52\lib\psafm.pro)
NAME: PSEUDO PURPOSE: Generate a pseudo-color table based on the LHB, (lightness, hue, and brightness) system and load it. CATEGORY: Z4 - Image processing, color table manipulation. CALLING SEQUENCE: PSEUDO, Litlo, Lithi, Satlo, Sathi, Hue, Loops [, Colr] INPUTS: Litlo: Starting lightness, from 0 to 100%. Lithi: Ending lightness, from 0 to 100%. Satlo: Starting saturation, from 0 to 100%. Sathi: Ending saturation, from 0 to 100%. Hue: Starting hue, in degrees, from 0 to 360. Loops: The number of loops of hue to make in the color helix. This value can range from 0 to around 3 to 5 and it need not be an integer. OUTPUTS: No required outputs. OPTIONAL OUTPUT PARAMETERS: Colr: A [256,3] integer array containing the red, green, and blue color values that were loaded into the color lookup tables. Red = COLR[*,0], Green = COLR[*,1], Blue = COLR[*,1]. COMMON BLOCKS: None. SIDE EFFECTS: Color tables are loaded. RESTRICTIONS: None. PROCEDURE: This procedure generates a pseudo-color table and loads the red, green, and blue LUTS with the table. The pseudo-color mapping used is generated by first translating from the LHB (lightness, hue, and brightness) coordinate system to the LAB coordinate system, finding N colors spread out along a helix that spans this LAB space (supposedly a near maximal entropy mapping for the eye, given a particular N) and remapping back into the RGB space (red, green, and blue color space). Thus, given N desired colors, the output will be N discrete values loaded into the red LUTs, N discrete values loaded into the blue LUTs, and N discrete values loaded into the green LUTs. MODIFICATION HISTORY: Adapted from the IIS primitive DPSEU. DMS, Nov, 1982. Changed common, DMS, Apr, 1987. MWR: 9/13/94 - The cur_* variables in common block need to be non-zero for use with other routines (e.g. XPALETTE). MWR: 10/27/94 - Changed common block variable names to comply with naming convention used by other IDL routines.
(See C:\RSI\IDL52\lib\pseudo.pro)
NAME: PS_SHOW_FONTS PURPOSE: This procedure displays all the PostScript fonts that IDL knows about, with both the StandardAdobe and ISOLatin1 encodings. Each display takes a separate page, and each character in each font is shown with its character index. CATEGORY: Misc., PostScript, Fonts. CALLING SEQUENCE: PS_SHOW_FONTS INPUTS: None. KEYWORDS: NOLATIN: If set, do NOT output ISOLatin1 encodings. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: A PostScript file is produced, one page per font/mapping combination. RESTRICTIONS: The output file contains almost 70 pages of output. A PostScript previewer is recommended rather than sending it to a printer. MODIFICATION HISTORY: 12 January 1993, AB, RSI. 12 October 1993, Rob Montgomery, NCAR - added 'nolatin' keyword.
(See C:\RSI\IDL52\lib\ps_show_fonts.pro)
NAME: PUSHD PURPOSE: Push a directory onto the top of the directory stack maintained by the PUSHD and POPD User Library procedures. CALLING SEQUENCE: PUSHD, Dir INPUTS: Dir: The directory to change to. The current directory will be pushed to the top of the directory stack. SIDE EFFECTS: The current directory is pushed onto the directory stack. It will be the next directory used by POPD. COMMON BLOCKS: DIR_STACK: Contains the stack. MODIFICATION HISTORY: 17, July, 1989, Written by AB, RSI.
(See C:\RSI\IDL52\lib\pushd.pro)
NAME: P_CORRELATE PURPOSE: This function computes the partial correlation coefficient of a dependent variable and one particular independent variable when the effects of all other variables involved are removed. CATEGORY: Statistics. CALLING SEQUENCE: Result = P_correlate(X, Y, C) INPUTS: X: An n-element vector of type integer, float or double that specifies the independent variable data. Y: An n-element vector of type integer, float or double that specifies the dependent variable data. C: An array of type integer, float or double that specifies the independent variable data whose effects are to be removed. The columns of this two dimensional array correspond to the n-element vectors of independent variable data. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLES: Define the data vectors. x0 = [64, 71, 53, 67, 55, 58, 77, 57, 56, 51, 76, 68] x1 = [57, 59, 49, 62, 51, 50, 55, 48, 52, 42, 61, 57] x2 = [ 8, 10, 6, 11, 8, 7, 10, 9, 10, 6, 12, 9] Compute the partial correlation of x0 and x1 with the effects of x2 removed. The result should be 0.533469 result = p_correlate(x0, x1, reform(x2, 1, n_elements(x2))) Compute the partial correlation of x0 and x2 with the effects of x1 removed. The result should be 0.334572 result = p_correlate(x0, x2, reform(x1, 1, n_elements(x1))) Compute the partial correlation of x1 and x2 with the effects of x0 removed. The result should be 0.457907 result = p_correlate(x1, x2, reform(x0, 1, n_elements(x0))) REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Modified by: GGS, RSI, July 1994 Minor changes to code. New documentation header. Modified by: GGS, RSI, August 1996 Added DOUBLE keyword. Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\p_correlate.pro)
NAME: QUERY_BMP PURPOSE: Read the header of a BMP format image file and return a structure containing information about the image. CATEGORY: Input/Output. CALLING SEQUENCE: result = QUERY_BMP(File, Info) INPUTS: File: Scalar string giving the name of the BMP file to query. Keyword Inputs: IMAGE_INDEX: For some image query functions this keyword can be used to specify for which image in a multi-image file the information should be returned. For QUERY_BMP this keyword is ignored. OUTPUTS: Result is a long with the value of 1 if the query was successful (and the file type was correct) or 0 on failure. The return status will indicate failure for files that contain formats that are not supported by the corresponding READ_ routine, even though the file may be valid outside the IDL environment. Info: An anonymous structure containing information about the image. This structure is valid only when the return value of the function is 1. The Info structure for all query routines has the following fields: Field IDL data type Description ----- ------------- ----------- CHANNELS Long Number of samples per pixel DIMENSIONS 2-D long array Size of the image in pixels HAS_PALETTE Integer True if a palette is present NUM_IMAGES Long Number of images in the file IMAGE_INDEX Long Image number for this struct PIXEL_TYPE Integer IDL basic type code for a pixel sample TYPE String String identifying the file format EXAMPLE: To retrieve information from the BMP image file named "foo.bmp" in the current directory, enter: result = QUERY_BMP("foo.bmp", info) IF (result GT 0) THEN BEGIN HELP, /STRUCT, info ENDIF ELSE BEGIN PRINT, 'BMP file not found or file is not a valid BMP format.' ENDELSE MODIFICATION HISTORY: Written June 1998, ACY
(See C:\RSI\IDL52\lib\query_bmp.pro)
NAME: QUERY_DICOM PURPOSE: This function queries image information from a DICOM format file using the IDLffDICOM object interface. CATEGORY: Input/Output CALLING SEQUENCE: Result = QUERY_DICOM(File[, info]) INPUTS: File: The full path name of the file to read. OPTIONAL KEYWORDS: IMAGE_INDEX - Set this keyword to the index of the image to read from the file. OUTPUTS: This function returns 1 if the file can be read as a DICOM file and 0 otherwise OPTIONAL OUTPUTS: Info: An anonymous structure containing information about the image. This structure is valid only when the return value of the function is 1. The Info structure has the following fields: Field IDL data type Description ----- ------------- ----------- CHANNELS Long Number of samples per pixel DIMENSIONS 2-D long array Size of the image in pixels HAS_PALETTE Integer True if a palette is present NUM_IMAGES Long Number of images in the file IMAGE_INDEX Long Image number for this struct PIXEL_TYPE Integer IDL basic type code for a pixel sample TYPE String String identifying the file format KEYWORDS: IMAGE_INDEX: For files containing multiple images this keyword can be used to specify for which image in a multi-image file the information should be returned. SIDE EFFECTS: IO is performed. RESTRICTIONS: Only uncompressed data format is supported (as per current DICOM obj). EXAMPLE: MODIFICATION HISTORY: RJF, RSI. Sep, 1998. Original version. RJF, RSI. Jan, 1999. Filter searches by sequence value.
(See C:\RSI\IDL52\lib\query_dicom.pro)
NAME: QUERY_GIF PURPOSE: Read the header of a GIF format image file and return a structure containing information about the image. CATEGORY: Input/Output. CALLING SEQUENCE: result = QUERY_GIF(File, Info) INPUTS: File: Scalar string giving the name of the GIF file to query. Keyword Inputs: IMAGE_INDEX: For some image query functions this keyword can be used to specify for which image in a multi-image file the information should be returned. For QUERY_GIF this keyword is ignored. OUTPUTS: Result is a long with the value of 1 if the query was successful (and the file type was correct) or 0 on failure. The return status will indicate failure for files that contain formats that are not supported by the corresponding READ_ routine, even though the file may be valid outside the IDL environment. Info: An anonymous structure containing information about the image. This structure is valid only when the return value of the function is 1. The Info structure for all query routines has the following fields: Field IDL data type Description ----- ------------- ----------- CHANNELS Long Number of samples per pixel DIMENSIONS 2-D long array Size of the image in pixels HAS_PALETTE Integer True if a palette is present NUM_IMAGES Long Number of images in the file IMAGE_INDEX Long Image number for this struct PIXEL_TYPE Integer IDL basic type code for a pixel sample TYPE String String identifying the file format RESTRICTIONS: This routine only retrieves information on the first image in a file (the format allows many). Local colormaps are not supported. Only 8 bit images are supported. The Graphics Interchange Format(c) is the Copyright property of CompuServ Incorporated. GIF(sm) is a Service Mark property of CompuServ Incorporated. EXAMPLE: To retrieve information from the GIF image file named "foo.gif" in the current directory, enter: result = QUERY_GIF("foo.gif", info) IF (result GT 0) THEN BEGIN HELP, /STRUCT, info ENDIF ELSE BEGIN PRINT, 'GIF file not found or file is not a valid GIF format.' ENDELSE MODIFICATION HISTORY: Written June 1998, ACY
(See C:\RSI\IDL52\lib\query_gif.pro)
NAME: QUERY_PICT PURPOSE: Read the header of a PICT format image file and return a structure containing information about the image. CATEGORY: Input/Output. CALLING SEQUENCE: result = QUERY_PICT(File, Info) INPUTS: File: Scalar string giving the name of the PICT file to query. Keyword Inputs: IMAGE_INDEX: For some image query functions this keyword can be used to specify for which image in a multi-image file the information should be returned. For QUERY_PICT this keyword is ignored. OUTPUTS: Result is a long with the value of 1 if the query was successful (and the file type was correct) or 0 on failure. The return status will indicate failure for files that contain formats that are not supported by the corresponding READ_ routine, even though the file may be valid outside the IDL environment. Info: An anonymous structure containing information about the image. This structure is valid only when the return value of the function is 1. The Info structure for all query routines has the following fields: Field IDL data type Description ----- ------------- ----------- CHANNELS Long Number of samples per pixel DIMENSIONS 2-D long array Size of the image in pixels HAS_PALETTE Integer True if a palette is present NUM_IMAGES Long Number of images in the file IMAGE_INDEX Long Image number for this struct PIXEL_TYPE Integer IDL basic type code for a pixel sample TYPE String String identifying the file format COMMON BLOCKS: write_pict_rev EXAMPLE: To retrieve information from the PICT image file named "foo.pict" in the current directory, enter: result = QUERY_PICT("foo.pict", info) IF (result GT 0) THEN BEGIN HELP, /STRUCT, info ENDIF ELSE BEGIN PRINT, 'PICT file not found or file is not a valid PICT format.' ENDELSE MODIFICATION HISTORY: Written June 1998, ACY
(See C:\RSI\IDL52\lib\query_pict.pro)
NAME: QUERY_PPM PURPOSE: Read the header of a PPM format image file and return a structure containing information about the image. CATEGORY: Input/Output. CALLING SEQUENCE: result = QUERY_PPM(File, Info) INPUTS: File: Scalar string giving the name of the PPM file to query. Keyword Inputs: IMAGE_INDEX: For some image query functions this keyword can be used to specify for which image in a multi-image file the information should be returned. For QUERY_PPM this keyword is ignored. Keyword Outputs: MAXVAL: Set this keyword to a named variable to retrieve the maximum pixel value in the image. OUTPUTS: Result is a long with the value of 1 if the query was successful (and the file type was correct) or 0 on failure. The return status will indicate failure for files that contain formats that are not supported by the corresponding READ_ routine, even though the file may be valid outside the IDL environment. Info: An anonymous structure containing information about the image. This structure is valid only when the return value of the function is 1. The Info structure for all query routines has the following fields: Field IDL data type Description ----- ------------- ----------- CHANNELS Long Number of samples per pixel DIMENSIONS 2-D long array Size of the image in pixels HAS_PALETTE Integer True if a palette is present NUM_IMAGES Long Number of images in the file IMAGE_INDEX Long Image number for this struct PIXEL_TYPE Integer IDL basic type code for a pixel sample TYPE String String identifying the file format In addition, QUERY_PPM has the additional field: MAXVAL Long The maximum pixel value in the image. EXAMPLE: To retrieve information from the PPM image file named "foo.ppm" in the current directory, enter: result = QUERY_PPM("foo.ppm", info) IF (result GT 0) THEN BEGIN HELP, /STRUCT, info ENDIF ELSE BEGIN PRINT, 'PPM file not found or file is not a valid PPM format.' ENDELSE MODIFICATION HISTORY: Written June 1998, ACY
(See C:\RSI\IDL52\lib\query_ppm.pro)
NAME: QUERY_SRF PURPOSE: Read the header of a SRF format image file and return a structure containing information about the image. CATEGORY: Input/Output. CALLING SEQUENCE: result = QUERY_SRF(File, Info) INPUTS: File: Scalar string giving the name of the SRF file to query. Keyword Inputs: IMAGE_INDEX: For some image query functions this keyword can be used to specify for which image in a multi-image file the information should be returned. For QUERY_SRF this keyword is ignored. OUTPUTS: Result is a long with the value of 1 if the query was successful (and the file type was correct) or 0 on failure. The return status will indicate failure for files that contain formats that are not supported by the corresponding READ_ routine, even though the file may be valid outside the IDL environment. Info: An anonymous structure containing information about the image. This structure is valid only when the return value of the function is 1. The Info structure for all query routines has the following fields: Field IDL data type Description ----- ------------- ----------- CHANNELS Long Number of samples per pixel DIMENSIONS 2-D long array Size of the image in pixels HAS_PALETTE Integer True if a palette is present NUM_IMAGES Long Number of images in the file IMAGE_INDEX Long Image number for this struct PIXEL_TYPE Integer IDL basic type code for a pixel sample TYPE String String identifying the file format EXAMPLE: To retrieve information from the SRF image file named "foo.srf" in the current directory, enter: result = QUERY_SRF("foo.srf", info) IF (result GT 0) THEN BEGIN HELP, /STRUCT, info ENDIF ELSE BEGIN PRINT, 'SRF file not found or file is not a valid SRF format.' ENDELSE MODIFICATION HISTORY: Written June 1998, ACY
(See C:\RSI\IDL52\lib\query_srf.pro)
NAME: RANKS PURPOSE: This function computes the magnitude-based ranks of a sample population X. Elements of identical magnitude "ties" are ranked according to the mean of the ranks that would otherwise be assigned. The result is a vector of ranks equal in length to X. CATEGORY: Statistics. CALLING SEQUENCE: Result = Ranks(X) INPUTS: X: An n-element vector of type integer, float or double. The elements of this vector must be in ascending order based on their magnitude. EXAMPLE: Define an n-element sample population. x = [-0.8, 0.1, -2.3, -0.6, 0.2, 1.1, -0.3, 0.6, -0.2, 1.1, -0.7, $ -0.2, 0.6, 0.4, -0.1, 1.1, -0.3, 0.3, -1.3, 1.1] Allocate a two-column, n-row array to store the results. array = fltarr(2, n_elements(x)) Sort the sample population and store in the 0th column of ARRAY. array[0, *] = x[sort(x)] Compute the ranks of the sorted sample population and store in the 1st column of ARRAY. array[1, *] = ranks[x[sort(x)]] Display the sorted sample population and corresponding ranks with a two-decimal format. print, array, format = '(2(5x, f5.2))' The result should be: -2.30 1.00 -1.30 2.00 -0.80 3.00 -0.70 4.00 -0.60 5.00 -0.30 6.50 -0.30 6.50 -0.20 8.50 -0.20 8.50 -0.10 10.00 0.10 11.00 0.20 12.00 0.30 13.00 0.40 14.00 0.60 15.50 0.60 15.50 1.10 18.50 1.10 18.50 1.10 18.50 1.10 18.50 REFERENCE: PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition) Ronald E. Walpole & Raymond H. Myers ISBN 0-02-424170-9 MODIFICATION HISTORY: Written by: GGS, RSI, November 1994
(See C:\RSI\IDL52\lib\ranks.pro)
NAME: RDPIX PURPOSE: Interactively display the X position, Y position, and pixel value of the cursor. CATEGORY: Image display. CALLING SEQUENCE: RDPIX, Image [, X0, Y0] INPUTS: Image: The array that represents the image being displayed. This array may be of any type. Rather reading pixel values from the display, they are taken from this parameter, avoiding scaling difficulties. OPTIONAL INPUT PARAMETERS: X0, Y0: The location of the lower-left corner of the image area on screen. If these parameters are not supplied, they are assumed to be zero. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The X, Y, and value of the pixel under the cursor are continuously displayed. RESTRICTIONS: None. PROCEDURE: Instructions are printed and the pixel values are printed as the cursor is moved over the image. Press the left or center mouse button to create a new line of output, saving the previous line. Press the right mouse button to exit the procedure. MODIFICATION HISTORY: DMS, Dec, 1987. Rob Montgomery (rob@hao.ucar.edu), 9/21/92; Correct indices for case of !order = 1
(See C:\RSI\IDL52\lib\rdpix.pro)
NAME: READ_ASCII PURPOSE: Read data from an ASCII file into IDL. CATEGORY: Input/Output. CALLING SEQUENCE: data = READ_ASCII(file) INPUTS: file - Name of file to read. INPUT KEYWORD PARAMETERS: record_start - 1st sequential "record" (see DESCRIPTION) to read. Default = 0 (the first record of the file). num_records - Number of records to read. Default = Read up to and including the last record. template - ASCII file template (e.g., generated by function ASCII_TEMPLATE) describing attributes of the file to read. Specific attributes contained in the template may be overridden by keywords below. Default = (see the keywords below). data_start - Number of lines of header to skip. Default (if no template) = 0L. delimiter - Character that delimits fields. Default (if no template) = '' = use fields(*).loc. missing_value - Value to replace any missing/invalid data. Default (if no template) = !VALUES.F_NAN. comment_symbol - String identifying comments (from comment_symbol to the next end-of-line). Default (if no template) = '' = no comments. [Note: The 'fields' keyword has not been implemented yet.] fields - Descriptions of the data fields, formatted as an array of structures containing the tags: name = name of the field (string) type = type of field as returned by SIZE (long) loc = offset from the beginning of line to the start of the field (long) group = sequential group the field is in (int) Default (if no template) = {name:'field', type:4L, loc:0L, group:0}. verbose - If set, print runtime messages. Default = Do not print them. OUTPUT KEYWORD PARAMETERS: header - The header read (string array of length data_start). If no header, empty string returned. count - The number of records read. OUTPUTS: The function returns an anonymous structure, where each field in the structure is a "field" of the data read (see DESCRIPTION). If no records are read, 0 is returned. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: See DESCRIPTION. DESCRIPTION: ASCII files handled by this routine consist of an optional header of a fixed number of lines, followed by columnar data. Files may also contain comments, which exist between a user-specified comment string and the corresponding end-of-line. One or more rows of data constitute a "record." Each data element within a record is considered to be in a different column, or "field." Adjacent fields may be "grouped" into multi-column fields. The data in one field must be of, or promotable to, a single type (e.g., FLOAT). EXAMPLES: ; Using default file attributes. data = READ_ASCII(file) ; Setting specific file attributes. data = READ_ASCII(file, DATA_START=10) ; Using a template to define file attributes. data = READ_ASCII(file, TEMPLATE=template) ; Using a template to define file attributes, ; and overriding some of those attributes. data = READ_ASCII(file, TEMPLATE=template, DATA_START=10) ; Using the ASCII_TEMPLATE GUI to generate a template in place. data = READ_ASCII(file, TEMPLATE=ASCII_TEMPLATE(file)) [Note: The 'fields' keyword has not been implemented yet.] ; An example defining fields by hand. fields = REPLICATE({name:'', type:0L, loc:0L, group:0}, 2, 3) num = N_ELEMENTS(fields) fields(*).name = 'field' + STRTRIM(STRING(INDGEN(num) + 1), 2) fields(*).type = REPLICATE(4L, num) fields(*).loc = [0L,10L, 0L,15L, 0L,12L] fields(*).group = INDGEN(num) data = READ_ASCII(file, FIELDS=fields) [Note: The 'fields' keyword has not been implemented yet.] ; Another example defining fields by hand. void = {sMyStructName, name:'', type:0L, loc:0L, group:0} fields = [ [ {sMyStructName, 'frog', (SIZE(''))(1), 0L, 0}, $ {sMyStructName, 'bird', (SIZE(0 ))(1), 15L, 1} ], $ [ {sMyStructName, 'fish', (SIZE(0.))(1), 0L, 2}, $ {sMyStructName, 'bear', (SIZE(0D))(1), 15L, 3} ], $ [ {sMyStructName, 'boar', (SIZE(0B))(1), 0L, 4}, $ {sMyStructName, 'nerd', (SIZE(OL))(1), 15L, 5} ] ] data = READ_ASCII(file, FIELDS=fields) DEVELOPMENT NOTES: - See ???,xxx in the code. - Error check input 'delimiter' to be a string (not a byte). - Implement the 'fields' keyword. MODIFICATION HISTORY: AL & RPM, 8/96 - Written.
(See C:\RSI\IDL52\lib\read_ascii.pro)
NAME: READ_BMP PURPOSE: This function reads a Microsoft Windows Version 3 device independent bitmap file (.BMP). CATEGORY: Input/Output CALLING SEQUENCE: Result = READ_BMP(File [, R, G, B [, IHDR]]) INPUTS: File: The full path name of the bitmap file to read. OUTPUTS: This function returns a byte array containing the image from the bitmap file. In the case of 4-bit or 8-bit images, the dimensions of the resulting array are [biWidth, biHeight]; for 16 and 24-bit decomposed color images the dimensions are [3, biWidth, biHeight]. Dimensions are taken from the BITMAPINFOHEADER of the file. NOTE: for 24 bit images, unless the RGB keyword is supplied, color interleaving is blue, green, red; i.e. result[0,i,j] = blue, result[1,i,j] = green, etc. OPTIONAL OUTPUTS: R, G, B: Color tables from the file. There 16 elements each for 4 bit images, 256 elements each for 8 bit images. Not defined or used for 16 and 24 bit images. Ihdr: A structure containing BITMAPINFOHEADER from file. Tag names are as defined in the MS Windows Programmer's Reference Manual, Chapter 7. KEYWORDDS: RGB: If this keyword is supplied, and a 16 or 24-bit image is read, color interleaving of the result is R, G, B, rather than BGR. Result[0,i,j] = red, Result[1,i,j] = green, and Result[2,i,j] = blue. SIDE EFFECTS: IO is performed. RESTRICTIONS: DOES NOT HANDLE: 1 bit deep images, or compressed images. Is not fast for 4 bit images. Works best on images where the number of bytes in each scan-line is evenly divisible by 4. PROCEDURE: Straightforward. Will work on both big endian and little endian machines. EXAMPLE: TV, READ_BMP('c:\windows\party.bmp', r, g, b) ;Read & display image TVLCT, r, g, b ;Load it's colors MODIFICATION HISTORY: DMS, RSI. March 1993. Original version. DMS, RSI. May, 1993. Now works on all machines... DMS, RSI. Nov, 1996 Added support for 16-bit RGB and RGB keyword.
(See C:\RSI\IDL52\lib\read_bmp.pro)
NAME: READ_DICOM PURPOSE: This function reads an image from a DICOM format file using the IDLffDICOM object interface. CATEGORY: Input/Output CALLING SEQUENCE: Result = READ_DICOM(File) INPUTS: File: The full path name of the file to read. [Red, Green, Blue] = Vectors which return the color palette (if any) OPTIONAL KEYWORDS: IMAGE_INDEX - Set this keyword to the index of the image to read from the file. OUTPUTS: This function returns a 2D array containing the image data from the file. KEYWORDS: None SIDE EFFECTS: IO is performed. RESTRICTIONS: Only uncompressed data format is supported (as per current DICOM obj). EXAMPLE: MODIFICATION HISTORY: RJF, RSI. Sep, 1998. Original version. RJF, RSI. Jan, 1999. Filter searches by sequence value.
(See C:\RSI\IDL52\lib\read_dicom.pro)
NAME: READ_GIF PURPOSE: Read the contents of a GIF format image file and return the image and color table vectors (if present) in the form of IDL variables. CATEGORY: Input/Output. CALLING SEQUENCE: READ_GIF, File, Image [, R, G, B] INPUTS: File: Scalar string giving the name of the rasterfile to read Keyword Inputs: CLOSE = if set, closes any open file and returns if the MULTIPLE images per file mode was used. This keyword is used without additional parameters. MULTIPLE = if set, read files containing multiple images per file. Each call to READ_GIF returns the next image, with the file remaining open between calls. The File parameter is ignored after the first call. Reading past the last image returns a scalar value of -1 in IMAGE, and closes the file. When reading the 2nd and subsequent images, R, G, and B are not returned. OUTPUTS: Image: The 2D byte array to contain the image. OPTIONAL OUTPUT PARAMETERS: R, G, B: The variables to contain the Red, Green, and Blue color vectors if the rasterfile containes colormaps. SIDE EFFECTS: None. COMMON BLOCKS: READ_GIF_COMMON. RESTRICTIONS: This routine only reads in the first image in a file (the format allows many). Local colormaps are not supported. Only 8 bit images are supported. The Graphics Interchange Format(c) is the Copyright property of CompuServ Incorporated. GIF(sm) is a Service Mark property of CompuServ Incorporated. EXAMPLE: To open and read the GIF image file named "foo.gif" in the current directory, store the image in the variable IMAGE1, and store the color vectors in the variables R, G, and B, enter: READ_GIF, "foo.gif", IMAGE1, R, G, B To load the new color table and display the image, enter: TVLCT, R, G, B TV, IMAGE1 MODIFICATION HISTORY: Written June 1992, JWG Added GIF89a and interlaced format, Jan, 1995, DMS. Added MULTIPLE and CLOSE, Aug, 1996.
(See C:\RSI\IDL52\lib\read_gif.pro)
NAME: READ_INTERFILE PURPOSE: Simplistic Interfile (v3.3) reader. Can only read a series of images containing byte,int,long,float or double data where all images have the same height and with. Result is returned in a 3-D array. CATEGORY: Input/Output. CALLING SEQUENCE: READ_INTERFILE, File, Data INPUTS: File: Scalar string containing the name of the Interfile to read. Note: if the Interfile has a header file and a data file, this should be the name of the header file (also called the administrative file). OUTPUTS: Data: A 3-D array of data as read from the file. Assumed to be a series of 2-D images. RESTRICTIONS: This is a simplistic reader. It does not get additional keyword information above and beyond what is needed to read in the image data. If any problems occur reading the file, READ_INTERFILE prints a message and stops. If the data is stored in on a bigendian machine and read on a littleendian machine (or vice versa) the order of bytes in each pixel element may be reversed, requiring a call to BYTEORDER PROCEDURE: Generates keyword table and initializes it on the fly. Read in administrative data. Read in binary data. Clean up keyword processing information. EXAMPLE: READ_INTERFILE, '0_11.hdr', X MODIFICATION HISTORY: Written by: J. Goldstein, Oct 1993 12/22/93 JWG,TH Bug fixes. Added byte swapping for short data 10/29/97 RJF Patched to handle the case of image data in the header file itself.
(See C:\RSI\IDL52\lib\read_interfile.pro)
NAME: READ_PICT PURPOSE: Reads limited types of image files written in the PICT Version 2 Format. This format is used by the Apple Macintosh Computers. CATEGORY: CALLING SEQUENCE: READ_PICT, FILE, IMAGE ;Reads PICT file into IMAGE READ_PICT, FILE, IMAGE, R, G, B ;Reads Image and loads color vectors INPUTS: FILE = Scalar string giving the name of the PICT file to read. IMAGE = 2D matrix to be input. OPTIONAL INPUT PARAMETERS: R, G, B = The Red, Green, and Blue color vectors to be read with IMAGE. If not specified, the color table associated with the picture is ignored. OUTPUTS: IMAGE - the image that is read in from the file. R, G, B - the color vectors from the PICT file. SIDE EFFECTS: A file is opened, UnPackData is called, I/O is performed RESTRICTIONS: Only creates Version 2 PICT files. Not intended to read all PICT files. Known to work with IDL PICT files written with write_pict routine in IDL. PROCEDURE: Read in the header, size, and the following quickdraw opcodes. MODIFICATION HISTORY: Written 19 November 1990, Steve Richards. 19 November 1992, Steve Richards, Fixed a problem where the color vectors returned were integer and not bytes. Jul 1994, DMS, RSI. Added code for both big and little endian byte ordering. Previous version would not work on little endian machines.
(See C:\RSI\IDL52\lib\read_pict.pro)
NAME: READ_PPM PURPOSE: Read the contents of a PGM (gray scale) or PPM (portable pixmap for color) format image file and return the image in the form of an IDL variable. PPM/PGM format is supported by the PMBPLUS and Netpbm packages. PBMPLUS is a toolkit for converting various image formats to and from portable formats, and therefore to and from each other. CATEGORY: Input/Output. CALLING SEQUENCE: READ_PPM, File, Image INPUTS: File: Scalar string giving the name of the PGM or PPM file. OUTPUTS: Image: The 2D byte array to contain the image. In the case of a PPM file, a [3, n, m] array is returned. KEYWORD Parameters: MAXVAL = returned maximum pixel value. SIDE EFFECTS: None. RESTRICTIONS: Should adhere to the PGM/PPM "standard". Accepts: P2 = graymap ASCII, P5 graymap RAWBITS, P3 true-color ASCII pixmaps, and P6 true-color RAWBITS pixmaps. Maximum pixel values are limited to 255. Images are always stored with the top row first. (ORDER=1) EXAMPLE: To open and read the PGM image file named "foo.pgm" in the current directory, store the image in the variable IMAGE1 enter: READ_PPM, "foo.gif", IMAGE1 MODIFICATION HISTORY: Written Nov, 1994, DMS.
(See C:\RSI\IDL52\lib\read_ppm.pro)
NAME: READ_SPR PURPOSE: This function reads a row-indexed sparse matrix from a specified file and returns it as the result. Row-indexed sparse matrices are created by using the Numerical Recipes routine NR_SPRSIN. CATEGORY: Sparse Matrix File I/O CALLING SEQUENCE: result = READ_SPR('Filename') INPUTS: Filename: Name of file containing a row-indexed sparse matrix KEYWORD PARAMETERS; NONE OUTPUTS: result: Row-indexed sparse matrix MODIFICATION HISTORY: Written by: BMH, 1/94.
(See C:\RSI\IDL52\lib\read_spr.pro)
NAME: READ_SRF PURPOSE: Read the contents of a Sun rasterfile and return the image and color table vectors (if present) in the form of IDL variables. CATEGORY: Input/Output. CALLING SEQUENCE: READ_SRF, File, Image [, R, G, B] INPUTS: File: Scalar string giving the name of the rasterfile to read OUTPUTS: Image: The 2D byte array to contain the image. OPTIONAL OUTPUT PARAMETERS: R, G, B: The variables to contain the Red, Green, and Blue color vectors if the rasterfile containes colormaps. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: This routine only handles 1, 8, 24, and 32-bit rasterfiles of type RT_OLD and RT_STANDARD. See the file /usr/include/rasterfile.h for the structure of Sun rasterfiles. EXAMPLE: To open and read the Sun rasterfile named "sun.srf" in the current directory, store the image in the variable IMAGE1, and store the color vectors in the variables R, G, and B, enter: READ_SRF, "sun.srf", IMAGE1, R, G, B To load the new color table and display the image, enter: TVLCT, R, G, B TV, IMAGE1 MODIFICATION HISTORY: Written fall 1987, AB 3/1/90, Added 24 bit images, DMS. 7/8/90, Added 32 bit images, DMS. 1/22/92, the colors within 24 bit images were not ordered correctly, DMS. 5/7/96, Corrected bug in the color vector order for 24 bit images. As per the "Encyclopedia of Graphics File formats", O'Rielly & Ass., 24 bit pixel data is in BGR format rather that RGB. This was verified thru the use of XV. Also the 32 big reading section did perform the color correction correctly. kdb.
(See C:\RSI\IDL52\lib\read_srf.pro)
NAME: READ_SYLK PURPOSE: Reads the contents of a sylk (Symbolic Link) format spreadsheet data file and returns a cell data range (if present) in the form of an IDL variable. CATEGORY: Input/Output. CALLING SEQUENCE: ReturnData = READ_SYLK(InFile [, STARTROW, STARTCOL, NROWS, NCOLS, ARRAY, COLMAJOR, USEDOUBLES, USELONGS]) INPUT: InFile: Scalar string with the name of the sylk file to read. OUTPUT: ReturnData: The table (vector of structs) or matrix (2D array) that will contain the spreadsheet cell data. The size and type of this return variable is set using the optional input parameters (keywords) below. OPTIONAL INPUT PARAMETERS: STARTROW: The starting (0-based) row of spreadsheet cells to read. If not specified, this value defaults to the first row of cells found in the file. STARTCOL: The starting (0-based) column of spreadsheet cells to read. If not specified, this value defaults to the first column of cells found in the file. NROWS: The number of spreadsheet rows to read in. If not specified, this defaults to all of the cell rows found in the file. NCOLS: The number of spreadsheet columns to read in. If not specified, this value defaults to all of the cell columns found in the file. ARRAY: Boolean flag. If TRUE, the data type returned will be an IDL array. Note that the data in the cell range must be of the same type to successfully return an array. If this flag is not set, the routine will return a table (vector of structs) instead. The tags of this struct will be labelled "Col0", "Col1", ..., "ColN" for a row major table and "Row0", "Row1", ..., "RowN" for a column major table. COLMAJOR: Boolean flag. If TRUE, the range of spreadsheet cell data is transposed and then read into an IDL variable. This flag should be set when importing spreadsheet data which has column major organization (ie., listings by column rather than row). The default is row major format. USEDOUBLES: Boolean flag. If TRUE, any floating point cell data will be read in and returned as a double precision rather than the default float type. USELONGS: Boolean flag. If TRUE, any integer cell data will be read in and returned as a long rather than the default int type. SIDE EFFECTS: None. RESTRICTIONS: This routine *only* reads in numerical and string sylk data. It igonores all spreadsheet and cell formatting information such as cell width, text justification, font type, date, time, and monetary notations, etc. In addition, only attempts to read spreadsheet tables, like-typed cell rows, columns, or subsets thereof will succeed. EXAMPLES: Consider the following row major spreadsheet table with the upper left cell (value = "Index") at location [0, 0] that has been output to the sylk file "foo.slk": Index Name Gender Platform 1 Beth F Unix 2 Kirk M VMS 3 Mark M Windows 4 Dave M Macintosh Note that the data format of the title row (STRING, STRING, STRING, STRING) is inconsistant with the following four rows (INT, STRING, STRING, STRING) in the table. It is impossible to read all of the table into a single IDL variable, but you could make two calls to READ_SYLK to import all of the data: strTitle = READ_SYLK("foo.slk", NROWS = 1) arrstrTable = READ_SYLK("foo.slk", STARTROW = 1) The return data are as follows: IDL> HELP, strTitle STRTITLE STRUCT = ->Array[1] IDL> PRINT, strTitle { Index Name Gender Platform} IDL> HELP, arrstrTable ARRSTRTABLE STRUCT = -> Array[4] IDL> PRINT, arrstrTable { 1 Beth F Unix}{ 2 Kirk M VMS}{ 3 Mark M Windows}{ 4 Dave M Macintosh} Further, consider the following call from the same sylk file: arrszNames = READ_SYLK("foo.slk", /ARRAY, STARTROW = 1, STARTCOL = 1, $ NCOLS = 1) The return data is now: IDL> HELP, arrszNames ARRSZTABLE STRING = Array[4] IDL> PRINT, arrszNames Beth Kirk Mark Dave If the COLMAJOR keyword flag is set the return value differs in type: arrszNames = READ_SYLK("foo.slk", /ARRAY, /COLMAJOR, STARTROW = 1, $ STARTCOL = 1, NCOLS = 1) The return data is now: IDL> HELP, arrszNames ARRSZTABLE STRING = Array[1, 4] IDL> PRINT, arrszNames Beth Kirk Mark Dave MODIFICATION HISTORY: Written October 1994, AJH Converted from handles to pointers, 17 December 1996, AB Modified Feb, 1998, SVP Added FATAL_MESSAGE and FATAL_CleanUp to produce a catchable error.
(See C:\RSI\IDL52\lib\read_sylk.pro)
NAME: READ_WAVE PURPOSE: READ a .wave or .bwave file created by the Advanced Data Visualizer into an series of IDL variables. CALLING SEQUENCE: READ_WAVE, FILE, VARIABLES, NAMES, DIMENSIONS INPUTS: FILE = Scalar string giving the name of the Wavefront file to write. KEYWORD PARAMETERS: MESHNAMES = The name of the mesh used in the Wavefront file for each variable. OUTPUTS: VARIABLES = Upon return, this variable contains a block of the variables contained in the wavefront file. Since each variable in a wavefront file can have more than one field (for instance, a vector variable has 3 fields), the fields of each variable make up the major index into the variable block. For instance, if a Wavefront file had one scalar variable and one vector variable, the scalar would be extracted as follows: vector_scalar = variables[0,*,*,*] and the vector variable would be extracted as follows: vector_variable = variables[1:3,*,*,*] To find the dimensions of the returned variable, see the description below regarding DIMENSIONS NAMES = Upon return, this variable contains the string names of each variable contained in the file. DIMENSIONS = Upon return, this variable is a long array that describes how many fields in the large returned variable block each variable occupies. In the above example of one scalar variable followed by a vector variable, the dimension variable would be: DIMENSIONS = [1,3] So the first field of the returned variable block would be the scalar variable and the following 3 fields would comprise the vector variable. RESTRICTIONS: This routine only preserved the structure of the variables if they are regularly grided variables. MODIFICATION HISTORY: Written July 16, 1991, by Steve Richards.
(See C:\RSI\IDL52\lib\read_wave.pro)
NAME: READ_X11_BITMAP PURPOSE: Read bitmaps stored in the X11 format. The X Windows bitmap(1) program produces a C header file containing the definition of a bitmap produced by that program. This procedure reads such a file and creates an IDL byte array containing the bitmap. This procedure is used primarily to read bitmaps to be used as IDL widget button labels. CATEGORY: Bitmaps, X Windows, widgets. CALLING SEQUENCE: READ_X11_BITMAP, File, Bitmap [, X, Y] INPUTS: File: The name of the file containing the bitmap. KEYWORD PARAMETERS: EXPAND_TO_BYTES: return a 2-D array which has one bit per byte (0 for a 0 bit), (255 for a 1 bit) instead. (See example) OUTPUTS: Bitmap: The variable in which to store the bitmap. This variable is returned as a byte array. OPTIONAL OUTPUT PARAMETERS: X: The width of the bitmap is returned in this variable. Y: The height of the bitmap is returned in this variable. COMMON BLOCKS: None. EXAMPLE: To open and read the X11 bitmap file named "my.x11" in the current directory, store the bitmap in the variable BITMAP1, and the width and height in the variables X and Y, enter: READ_X11_BITMAP, "my.x11", BITMAP1, X, Y To display the new bitmap, enter: READ_X11_BITMAP, "my.x11", Image, /EXPAND_TO_BYTES TV, Image, /ORDER MODIFICATION HISTORY: 10 January 1991, AB 1 Apr, 1992, CF fixed bug with bitmaps larger than 32k bytes. 24 March 1993, JWG fixed EXPAND_TO_BYTES option
(See C:\RSI\IDL52\lib\read_x11_bitmap.pro)
NAME: READ_XWD PURPOSE: Read the contents of files created by the XWD (X Windows Dump) command and return the image and color table vectors in the form of IDL variables. CATEGORY: Input/Output. CALL: Result = READ_XWD(File_Name [, R, G, B]) INPUTS: File_Name: Scalar string giving the name of the xwd file to read OUTPUTS: READ_XWD returns a 2D byte array containing the image. If the file cannot be open or read, the return value is zero. OPTIONAL OUTPUT PARAMETERS: R, G, B: The variables to contain the Red, Green, and Blue color vectors if the XWD file contains color tables. COMMON BLOCKS: None. SIDE EFFECTS: I/O is performed. RESTRICTIONS: This function is intended to be used only on files containing 8-bit pixmaps. It is not intended to be used with all XWD files. No guarantees are made that all XWD files will work with this routine. This routine will not work with XWD files with version less than 6. PROCEDURE: The header is read into a structure and the bytes are reversed if necessary. Then the colormap and image portions of the file are read into their respective variables. EXAMPLE: To open and read the X Windows Dump file named "my.xwd" in the current directory, store the image in the variable IMAGE1, and store the color vectors in the variables, R, G, and B, enter: IMAGE1 = READ_XWD("my.xwd", R, G, B) To load the new color table and display the image, enter: TVLCT, R, G, B TV, IMAGE1 MODIFICATION HISTORY: September, 1990 DMS and SMR, Research Systems, Inc.
(See C:\RSI\IDL52\lib\read_xwd.pro)
NAME: RECON3 PURPOSE: This function can reconstruct a 3-dimensional data array from two or more images (or projections) of an object. For example, if you placed a dark object in front of a white background and then photographed it three times (each time rotating the object a known amount) then these three images could be used with RECON3 to approximate a 3-D volumetric representation of the object. RECON3 also works with translucent projections of an object. RECON3 returns a 3-D byte array. RECON3 uses the back-projection method. In medical imaging and other applications, a method known as "Filtered Backprojection" is often desired. This may be accomplished here by first filtering the images as desired, and then using the filtered images for the reconstruction. CATEGORY: Volume Reconstruction CALLING SEQUENCE: vol = RECON3(Images, Obj_Rot, Obj_Pos, Focal, Dist, $ Vol_Pos, Img_Ref, Img_Mag, Vol_Size) INPUTS: Images: The images to use to reconstruct the volume. Execution time increases linearly with more images. Data Type: 8-bit (byte) array with dimensions [x, y, n] where x is the horizontal image dimension, y is the vertical image dimension, and n is the number of images. Obj_Rot: The the amount the object is rotated to make it appear as it does in each image. The object is first rotated about the X axis, then about the Y axis, and finally about the Z axis (with the object's reference point at the origin. Data Type: [3, n] Float array where Obj_Rot[0, *] is the X rotation for each image, Obj_Rot[1, *] is the Y rotation, and Obj_Rot[2, *] is the Z rotation. Obj_Pos: The position of the the object's reference point RELATIVE to the camera lens. The camera lens is located at the coordinate origin and points in the negative Z direction (the view up vector points in the positive Y direction). Obj_Pos should be expressed in this coordinate system. The values for Obj_Pos, Focal, Dist, and Vol_Pos should all be expressed in the same units (mm, cm, m, in, ft, etc.). Data Type: [3, n] Float array where Obj_Pos[0, *] is the X position for each image, Obj_Pos[1, *] is the Y position, and Obj_Pos[2, *] is the Z position. All the values in Obj_Pos[2, *] should be less than zero. Focal: The focal length of the lens for each image. Focal may be set to zero to indicate a parallel image projection (infinite focal length). Data Type: Float array with n elements. Dist: The distance from the camera lens to the image plane (film) for each image. Dist should be greater than Focal. Data Type: Float array with n elements. Vol_Pos: The two opposite corners of a cube that surrounds the object. Vol_Pos should be expressed in the object's coordinate system RELATIVE to the object's reference point. Data Type: [3, 2] Float array where Vol_Pos[*, 0] specifies one corner and Vol_Pos[*, 1] specifies the opposite corner. Img_Ref: The pixel location at which the object's reference point appears in each of the images. Data Type: [2, n] Int or Float array where Img_Ref[0, *] is the X coordinate for each image and Img_Ref[1, *] is the Y coordinate. Img_Mag: The magnification factor for each image. This number is actually the length (in pixels) that a test object would appear in an image if it were N units long and N units distant from the camera lens. Data Type: [2, n] Int or float array where Img_Mag[0, *] is the X dimension (in pixels) of a test object for each image, and Img_Mag[1, *] is the Y dimension. All elements in Img_Mag should be greater than or equal to 1. Vol_Size: The size of the volume to return. The returned volume will be a 3-D byte array with dimensions equal to Vol_Size. Execution time (and resolution) increases exponentially with larger values for Vol_Size. Data Type: Int array with 3 elements where Vol_Size[0] specifies the X dimension of the volume, Vol_Size[1] specifies the Y dimension, and Vol_Size[2] specifies the Z dimension. KEYWORD PARAMETERS: CUBIC: If set, then cubic interpolation is used. The default is to use tri-linear interpolation, which is slightly faster. MISSING: The value for cells in the 3-D volume that do not map to any of the supplied images. The Missing value is passed to the IDL "INTERPOLATE" function. Data Type: Byte. Default : 0B MODE: If Mode is less than zero then each cell in the 3-D volume is the MINIMUM of the corresponding pixels in the images. If Mode is greater than zero then each cell in the 3-D volume is the MAXIMUM of the corresponding pixels in the images. If Mode is equal to zero then each cell in the 3-D volume is the AVERAGE of the corresponding pixels in the images. Mode should usually be (-1) when the images contain a bright object in front of a dark background. Mode should usually be (+1) when the images contain a dark object in front of a light background. AVERAGE mode requires more memory since the volume array must temporarily be kept as an INT array instead of a BYTE array. Data Type: Int Default : 0 (average cells) OUTPUTS: RECON3 returns a 3-D byte array containing the reconstructed object. If the images contain low (dark) values where the object is and high (bright) values where the object isn't, then Mode should be set to (+1). If the above is true then the returned volume will have low values where the object is, and high values where the object isn't. If the images contain high (bright) values where the object is and low (dark) values where the object isn't, then Mode should be set to (-1). If the above is true then the returned volume will have high values where the object is, and low values where the object isn't. RESTRICTIONS: In general, the object must be CONVEX for a good reconstruction to be possible. Concave regions are not easily reconstructed. An empty coffee cup, for example, would be reconstructed as if it were full. The images should show strong light/dark contrast between the object and the background. The more images the better. Images from many different angles will improve the quality of the reconstruction. It is also important to supply images that are parallel and perpendicular to any axes of symmetry. Using the coffee cup as an example, at least one image should be looking through the opening in the handle. Telephoto images are also better for reconstruction purposes than wide angle images. PROCEDURE: A 4x4 transformation matrix is created for each image based upon the parameters Obj_Rot, Obj_Pos, Focal, Dist, and Img_Ref. Each cell in the volume is assigned a 3-D coordinate based upon the parameters Vol_Pos and Vol_Size. These coordinates are multiplied by the transformation matricies to produce x,y image coordinates. Each cell in the volume is assigned a value that is the AVERAGE, MINIMUM, or MAXIMUM of the image values at the x,y position (depending on Mode). EXAMPLE: ------------------------------------------------------------------------------ ; Assumptions for this example : ; The object's major axis is parallel to the Z axis. ; The object's reference point is at its center. ; The camera lens is pointed directly at this reference point. ; The reference point is 5000 mm in front of the camera lens. ; The focal length of the camera lens is 200 mm. ; If the camera is focused on the reference point, then the ; distance from the lens to the camera's image plane must be ; dist = (d * f) / (d - f) = ; (5000 * 200) / (5000 - 200) = (1000000 / 4800) = 208.333 mm ; The object is roughly 600 mm wide and 600 mm high. ; The reference point appears in the exact center of each image. ; If the object is 600 mm high and 5000 mm distant from the camera ; lens, then the object image height must be ; hi = (h * f) / (d - f) = ; (600 * 200) / (5000 - 200) = (120000 / 4800) = 25.0 mm ; The object image appears 200 pixels high so the final magnification ; factor is ; img_mag = (200 / 25) = 8.0 imgy = 256 frames = 3 images = Bytarr(imgx, imgy, frames, /Nozero) obj_rot = Fltarr(3, frames) obj_pos = Fltarr(3, frames) focal = Fltarr(frames) dist = Fltarr(frames) vol_pos = Fltarr(3, 2) img_ref = Fltarr(2, frames) img_mag = Fltarr(2, frames) vol_size = [40, 40, 40] ; The object is 5000 mm directly in front of the camera. obj_pos[0, *] = 0.0 obj_pos[1, *] = 0.0 obj_pos[2, *] = -5000.0 ; The focal length of the lens is constant for all the images. focal[*] = 200.0 ; The distance from the lens to the image plane is also constant. dist[*] = 208.333 ; The cube surrounding the object is 600 mm X 600 mm. vol_pos[*, 0] = [-300.0, -300.0, -300.0] vol_pos[*, 1] = [ 300.0, 300.0, 300.0] ; The image reference point appears at the center of all the images. img_ref[0, *] = imgx / 2 img_ref[1, *] = imgy / 2 ; The image magnification factor is constant for all images. ; (The images haven't been cropped or resized). img_mag[*, *] = 8.0 ; Only the object rotation changes from one image to the next. ; Note that the object is rotated about the X axis first, then Y, ; and then Z. ; Create some fake images for this example. images[30:160, 20:230, 0] = 255 images[110:180, 160:180, 0] = 180 obj_rot[*, 0] = [-90.0, 0.0, 0.0] images[70:140, 100:130, 1] = 255 obj_rot[*, 1] = [-70.0, 75.0, 0.0] images[10:140, 70:170, 2] = 255 images[80:90, 170:240, 2] = 150 obj_rot[*, 1] = [-130.0, 215.0, 0.0] ; Reconstruct the volume. vol = RECON3(images, obj_rot, obj_pos, focal, dist, vol_pos, img_ref, $ img_mag, vol_size, Missing=255B, Mode=(-1)) ------------------------------------------------------------------------------ MODIFICATION HISTORY: Written by: Daniel Carr Thu Feb 4 02:54:29 MST 1993 KDB - 23 Dec., 1993 - Variable dist had a conflict with Userlib function DIST and could cause compile errors. Renamed variable dist to distance. Modified by: Daniel Carr Mon Nov 21 14:21:57 MST 1994 Improved performance and added CUBIC keyword. Modified by: Daniel Carr Tue Nov 22 12:18:15 MST 1994 Fixed bug which affected small focal length images. Improved performance again.
(See C:\RSI\IDL52\lib\recon3.pro)
NAME: REDUCE_COLORS PURPOSE: This procedure reduces the number of colors used in an image by eliminating pixel values without members. CATEGORY: Image display. CALLING SEQUENCE: REDUCE_COLORS, Image, Values INPUTS: Image: The original image array. Note that the input array is replaced by its color-reduced equivalent. KEYWORD PARAMETERS: None. OUTPUTS: Image: The color-reduced image array. Values: A vector of non-zero pixel values. If Image contains pixel values from 0 to M, Values will be an M+1 element vector containing the mapping from the old values to the new. Values[I] contains the new color index of old pixel index I. SIDE EFFECTS: Input array is overwritten. PROCEDURE: The pixel distribution histogram is obtained and the WHERE function is used to find bins with non-zero values. Next, a lookup table is made where table[old_pixel_value] contains new_pixel_value, and then applied to the image. EXAMPLE: To reduce the number of colors and display an image with the original color tables R, G, B: REDUCE_COLORS, Image, V TVLCT, R[V], G[V], B[V] MODIFICATION HISTORY: DMS, RSI, Oct, 1992.
(See C:\RSI\IDL52\lib\reduce_colors.pro)
NAME: REGRESS PURPOSE: Perform a multiple linear regression fit. REGRESS fits the function: Y[i] = Const + A[0]*X[0,i] + A[1]*X[1,i] + ... + A[Nterms-1]*X[Nterms-1,i] CATEGORY: G2 - Correlation and regression analysis. CALLING SEQUENCE: Result = REGRESS(X, Y, Weights, Yfit, Const, Sigma, Ftest, R, Rmul, Chisq) INPUTS: X: The array of independent variable data. X must be dimensioned as an array of Nterms by Npoints, where there are Nterms coefficients (independent variables) to be found and Npoints of samples. Y: The vector of dependent variable points. Y must have Npoints elements. Weights: The vector of weights for each equation. Weights must be a vector of Npoints elements. For instrumental (Gaussian) weighting, W[i] = 1/standard_deviation(Y[i])^2. For statistical (Poisson) weighting, w[i] = 1./Y[i]. For no weighting, set w[i]=1, and also set the RELATIVE_WEIGHT keyword. OUTPUTS: REGRESS returns a column vector of coefficients that has Nterms elements. OPTIONAL OUTPUT PARAMETERS: Yfit: Vector of calculated values of Y with Npoints elements. Const: Constant term. (A0) Sigma: Vector of standard deviations for coefficients. Ftest: The value of F for test of fit. Rmul: The multiple linear correlation coefficient. R: Vector of linear correlation coefficients. Rmul: The multiple linear correlation coefficient. Chisq: Reduced, weighted chi squared. Status: A named variable to receive the status of the INVERT (array inversion) computation. A value of 0 indicates a successful computation. A value of 1 indicates the inversion is invalid due to a singular array. A value of 2 indicates the possibility of an inaccurate result due to the use of a small pivot element. KEYWORDS: RELATIVE_WEIGHT: If this keyword is set, the input weights (W vector) are assumed to be relative values, and not based on known uncertainties in the Y vector. Set this keyword in the case of no weighting, W[*] = 1. PROCEDURE: Adapted from the program REGRES, Page 172, Bevington, Data Reduction and Error Analysis for the Physical Sciences, 1969. MODIFICATION HISTORY: Written, DMS, RSI, September, 1982. Added RELATIVE_WEIGHT keyword W. Landsman August 1991 Fixed bug in invert Bobby Candey 1991 April 22 Added STATUS argument. GGS, RSI, August 1996
(See C:\RSI\IDL52\lib\regress.pro)
NAME: REGRESS1 PURPOSE: Multiple linear regression fit. Fit the function: Y(i) = A0 + A(0)*X(0,i) + A(1)*X(1,i) + ... + A(Nterms-1)*X(Nterms-1,i) CATEGORY: G2 - Correlation and regression analysis. CALLING SEQUENCE: Result = REGRESS(X, Y, W, YFIT, A0, SIGMA, FTEST, R, RMUL, CHISQ) INPUTS: X: array of independent variable data. X must be dimensioned (Nterms, Npoints) where there are Nterms coefficients to be found (independent variables) and Npoints of samples. Y: vector of dependent variable points, must have Npoints elements. W: vector of weights for each equation, must be a Npoints elements vector. For instrumental weighting w(i) = 1/standard_deviation(Y(i)), for statistical weighting w(i) = 1./Y(i). For no weighting set w(i)=1, and also set the RELATIVE_WEIGHT keyword. OUTPUTS: Function result = coefficients = vector of Nterms elements. Returned as a column vector. OPTIONAL OUTPUT PARAMETERS: Yfit: array of calculated values of Y, Npoints elements. A0: Constant term. Sigma: Vector of standard deviations for coefficients. Ftest: value of F for test of fit. Rmul: multiple linear correlation coefficient. R: Vector of linear correlation coefficient. Chisq: Reduced weighted chi squared. KEYWORDS: RELATIVE_WEIGHT: if this keyword is non-zero, the input weights (W vector) are assumed to be relative values, and not based on known uncertainties in the Y vector. This is the case for no weighting W(*) = 1. PROCEDURE: Adapted from the program REGRES, Page 172, Bevington, Data Reduction and Error Analysis for the Physical Sciences, 1969. MODIFICATION HISTORY: Written, DMS, RSI, September, 1982. Added RELATIVE_WEIGHT keyword, W. Landsman, August 1991
(See C:\RSI\IDL52\lib\obsolete\regress1.pro)
NAME: REGRESSION PURPOSE: To augment and display the output of the library function Regress. Additional output includes an anova table to test the hypothesis that all coefficients are zero.A regression table is printed to the screen or user specified file displaying the Coefficients, their standard deviations, and the T statistic to test for each coefficient the hypothesis that it is zero. CATEGORY: Statistics. CALLING SEQUENCE: REGRESSION, X, Y, W,A0, COEFF, Resid, YFit, sigma, FTest, R, RMul, ChiSqr INPUTS: X: Array of independent variable data. X must be dimensioned (NTerms, NPoints) where there are Nterms coefficients to be found and NPoints of sample data. Y = column vector of NPoints dependent variable values. OPTIONAL INPUTS: W: vector of weights for each equation. For instrumental weighing, set w(i) = 1/Variance(Y(i)), for statistical weighting, w(i) = 1./Y(i) KEYWORDS: VARNAMES: A vector of names for the independent variables to be used in the output. NOPRINT: A flag to suppress printing out regression statistics. The default is to print. LIST_NAME: Name of output file. Default is to the screen. MISSING: Missing data value. If undefined, assume no missing data. Listwise handling of missing data. OUTPUTS: Anova table and regression summary written to the screen or to user specified file. OPTIONAL OUTPUT PARAMETERS: A0: Constant term. Coeff: Vector of coefficients. Coeff has NTerm elements. Resid: Vector of residuals - i.e. Y - YFit. Yfit: Array of calculated values of Y, Npoints Sigma: Vector of standard deviations for coefficients. Ftest: Value of F for test of fit. Rmul: Multiple linear correlation coefficient. R: Vector of linear correlation coefficient. ChiSqr: Reduced weighted chi square for fit. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: See documentation for REGRESS in the User's Library.
(See C:\RSI\IDL52\lib\obsolete\regression.pro)
NAME: RESOLVE_ALL PURPOSE: Resolve (by compiling) all procedures and functions. This is useful when preparing .sav files containing all the IDL routines required for an application. CATEGORY: Programming. CALLING SEQUENCE: RESOLVE_ALL INPUTS: None. KEYWORD PARAMETERS: CONTINUE_ON_ERROR = if set, continue when a routine fails to resolve, otherwise throw an error and stop. QUIET = if set, produce no messages. RESOLVE_FUNCTION = a scalar or array of function names to resolve. If the routines are already compiled, no action is performed. If this keyword is included, no other keywords are processed. RESOLVE_PROCEDURE = a scalar or array of procedure names to resolve. If the routines are already compiled, no action is performed. If this keyword is included, no other keywords are processed. SKIP_ROUTINES = an optional string array containing the names of routines to NOT resolve. This is useful when a library file containing the designated routines will be later included. UNRESOLVED = if CONTINUE_ON_ERROR is set, this output parameter will contain the names of the unresolved procedures and functions in a string array. Routines in the SKIP_ROUTINES list are also included in this result. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: RESTRICTIONS: Will not resolve procedures or functions that are called via CALL_PROCEDURE, CALL_FUNCTION, or EXECUTE. Only explicit calls are resolved. If an unresolved procedure or function is not in the IDL search path, an error occurs, and no additional routines are resolved. PROCEDURE: This routine iteratively determines the names of unresolved calls to user-written or library procedures and functions, and then compiles them. The process stops when there are no unresolved routines. EXAMPLE: RESOLVE_ALL. MODIFICATION HISTORY: Written by: DMS, RSI, January, 1995. DMS, RSI, April, 1997, Added SKIP_ROUTINES keyword. AB, RSI, April 1998, Added CONTINUE_ON_ERROR keyword. Reorganized the body of the resolving code. DMS, Aug, 1998. Added UNRESOLVED keyword.
(See C:\RSI\IDL52\lib\resolve_all.pro)
NAME: REVERSE PURPOSE: Reverse the order of rows or columns in an array or vector. CATEGORY: Array manipulation. CALLING SEQUENCE: Result = REVERSE(Array [, Subscript_Index]) INPUTS: Array: The array or vector containing the original data. OPTIONAL INPUT PARAMETERS: Subscript_Index: If this parameter is omitted or 1, the first subscript is reversed (i.e., rows are reversed). Set this parameter to 2 to reverse columns. KEYWORD PARAMETERS: None. OUTPUTS: REVERSE returns a copy of the original array that is reversed about one of its dimensions. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Only works for 1-, 2-, or 3-dimensional arrays. PROCEDURE: Uses the ROTATE function. MODIFICATION HISTORY: Old. Apr, 1991, DMS, Added 3D reversing. Sept, 1992 Mark L. Rivers, added simple return for scaler argument Sept, 1994. Added default for 3D case.
(See C:\RSI\IDL52\lib\reverse.pro)
NAME: RGB_TO_HSV PURPOSE: Convert from the RGB (Red, Green, Blue) color system to the HSV (Hue, Saturation, Value) color system. Note that this procedure has essentially been replaced by the much quicker built-in routine COLOR_CONVERT. CATEGORY: Graphics, color systems. CALLING SEQUENCE: RGB_TO_HSV, Red, Green, Blue, H, S, V INPUTS: Red: Red color value(s), may be scalar or vector. RGB values are in the range 0 to 255. Green: Green color value(s), must have the same number of elements as Red. Blue: Blue color value(s), must have the same number of elements as Red and Green. OUTPUTS: H: Hue output. This vector has the same number of elements as Red. Hue is in the range of [0,360). H is 0 (should really be undefined) if S (Saturation) is 0.0, i.e., red == green == blue. S: Saturation output, in the range of [0,1]. V: Value output, in the range of [0,1]. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Red, Green, and Blue should be scaled into the range 0 to 255. PROCEDURE: Taken from Foley & Van Dam, Fundamentals of Interactive Computer Graphics, 1982. Pg 615. MODIFICATION HISTORY: DMS, Aug, 1989. DMS, Changed to use COLOR_CONVERT (Which really makes this procedure obsolete.)
(See C:\RSI\IDL52\lib\obsolete\rgb_to_hsv.pro)
NAME: RM PURPOSE: Perform formatted input of matrices stored in the IMSL/IDL linear algebra storage scheme from the standard input stream. CATEGORY: Linear Algebra CALLING SEQUENCE: RM, A [, Rows, Columns] INPUTS: A - The named variable into which data will be stored. Rows - The number of 'rows' in A. Columns - The number of 'columns' in A. OUTPUTS: None. COMMON BLOCKS: None. MODIFICATION HISTORY: 13, September 1991, Written by AB (RSI), Mike Pulverenti (IMSL) 31, October 1991, Mike Pulverenti (IMSL)
(See C:\RSI\IDL52\lib\obsolete\rm.pro)
NAME: RMF PURPOSE: Perform formatted input of matrices stored in the IMSL/IDL linear algebra storage scheme from the specified file. CATEGORY: Linear Algebra CALLING SEQUENCE: RMF, UNIT, A [, Rows, Columns] INPUTS: Unit - The input file unit. E1, ... E10 - Expressions to be output. These can be scalar or array and of any type. OUTPUTS: Input is written to the file specified by unit. COMMON BLOCKS: None. MODIFICATION HISTORY: 13, September 1991, Written by AB (RSI), Mike Pulverenti (IMSL)
(See C:\RSI\IDL52\lib\obsolete\rmf.pro)
NAME: ROT PURPOSE: Rotate, magnify or demagnify, and/or translate an image. CATEGORY: Z3 - Image processing, geometric transforms. CALLING SEQUENCE: Result = ROT(A, Angle, [Mag, X0, Y0], MISSING = missing, INTERP = Interp, CUBIC = Cubic) INPUTS: A: The image array to be rotated. This array may be of any type, but it must have two dimensions. ANGLE: Angle of rotation in degrees CLOCKWISE. (Why?, because of an error in the old ROT.) OPTIONAL INPUT PARAMETERS: MAG: Magnification/demagnification factor. A value of 1.0 = no change, > 1 is magnification and < 1 is demagnification. X0: X subscript for the center of rotation. If omitted, X0 equals the number of columns in the image divided by 2. Y0: Y subscript for the center of rotation. If omitted, y0 equals the number of rows in the image divided by 2. KEYWORDS: INTERP: Set this keyword for bilinear interpolation. If this keyword is set to 0 or omitted, nearest neighbor sampling is used. Note that setting this keyword is the same as using the ROT_INT User Library function. This change (and others) essentially makes ROT_INT obsolete. CUBIC: If specified and non-zero, "Cubic convolution" interpolation is used. This is a more accurate, but more time-consuming, form of interpolation. CUBIC has no effect when used with 3 dimensional arrays. If this parameter is negative and non-zero, it specifies the value of the cubic interpolation parameter as described in the INTERPOLATE function. Valid ranges are -1 <= Cubic < 0. Positive non-zero values of CUBIC (e.g. specifying /CUBIC) produce the default value of the interpolation parameter which is -1.0. MISSING: The data value to substitute for pixels in the output image that map outside the input image. PIVOT: Setting this keyword causes the image to pivot around the point X0, Y0, so that this point maps into the same point in the output image. If this keyword is set to 0 or omitted, then the point X0, Y0 in the input image is mapped into the center of the output image. OUTPUTS: ROT returns a rotated, magnified, and translated version of the input image. Note that the dimensions of the output image are always the same as those of the input image. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: The POLY_2D function is used to translate, scale, and rotate the original image. EXAMPLE: Create and display an image. Then display a rotated and magnified version. Create and display the image by entering: A = BYTSCL(DIST(256)) TV, A Rotate the image 33 degrees and magnify it 1.5 times. Use bilinear interpolation to make the image look nice. Enter: B = ROT(A, 33, 1.5, /INTERP) TV, B MODIFICATION HISTORY: June, 1982. Written by DMS, RSI. Feb, 1986. Modified by Mike Snyder, ES&T Labs, 3M Company. Adjusted things so that rotation is exactly on the designated center. October, 1986. Modified by DMS to use the POLY_2D function. Aug, 1988. Added INTERP keyword. Dec, 1992. Added PIVOT keyword, William Thompson, NASA/GSFC. Nov, 1993. Added CUBIC keyword, DMS/RSI.
(See C:\RSI\IDL52\lib\rot.pro)
NAME: ROT_INT PURPOSE: Rotate, magnify or demagnify, and/or translate an image with bilinear interpolation. Note that this function is made obsolete by the new ROT User Library function which supports bilinear interpolation through the use of the INTERP keyword. CATEGORY: Z3 - Image processing, geometric transforms. CALLING SEQUENCE: Result = ROT(A, Angle, [Mag, X0, Y0]) INPUTS: A: The image array to be rotated. This array may be of any type, but it must have two dimensions. ANGLE: Angle of rotation in degrees CLOCKWISE. (Why?, because of an error in the old ROT.) KEYWORD PARAMETERS: CUBIC: If set, uses "Cubic convolution" interpolation. A more accurate, but more time-consuming, form of interpolation. CUBIC has no effect when used with 3 dimensional arrays. OPTIONAL INPUT PARAMETERS: MAG: Magnification/demagnification factor. A value of 1.0 = no change, > 1 is magnification and < 1 is demagnification. X0: X subscript for the center of rotation. If omitted, X0 equals the number of columns in the image divided by 2. Y0: Y subscript for the center of rotation. If omitted, y0 equals the number of rows in the image divided by 2. OUTPUTS: ROT_INT returns a rotated, magnified, and translated version of the input image. Note that the dimensions of the output image are always the same as those of the input image. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: The POLY_2D function is used to translate, scale, and rotate the original image. Note that bilinear interpolation is used by default (rather than the nearest-neighbor method used by default in ROT). EXAMPLE: Create and display an image. Then display a rotated and magnified version. Create and display the image by entering: A = BYTSCL(DIST(256)) TV, A Rotate the image 33 degrees and magnify it 1.5 times. Bilinear interpolation is used to make the image look nice. Enter: B = ROT(A, 33, 1.5) TV, B MODIFICATION HISTORY: June, 1982. Written by DMS, RSI. Feb, 1986. Modified by Mike Snyder, ES&T Labs, 3M Company. Adjusted things so that rotation is exactly on the designated center. October, 1986. Modified by DMS to use the POLY_2D function. Nov, 1993. DMS, RSI, Added CUBIC keyword.
(See C:\RSI\IDL52\lib\obsolete\rot_int.pro)
NAME: ROUTINE_NAME PURPOSE: Tell what your routine does here. I like to start with the words: "This function (or procedure) ..." Try to use the active, present tense. CATEGORY: Put a category (or categories) here. For example: Widgets. CALLING SEQUENCE: Write the calling sequence here. Include only positional parameters (i.e., NO KEYWORDS). For procedures, use the form: ROUTINE_NAME, Parameter1, Parameter2, Foobar Note that the routine name is ALL CAPS and arguments have Initial Caps. For functions, use the form: Result = FUNCTION_NAME(Parameter1, Parameter2, Foobar) Always use the "Result = " part to begin. This makes it super-obvious to the user that this routine is a function! INPUTS: Parm1: Describe the positional input parameters here. Note again that positional parameters are shown with Initial Caps. OPTIONAL INPUTS: Parm2: Describe optional inputs here. If you don't have any, just delete this section. KEYWORD PARAMETERS: KEY1: Document keyword parameters like this. Note that the keyword is shown in ALL CAPS! KEY2: Yet another keyword. Try to use the active, present tense when describing your keywords. For example, if this keyword is just a set or unset flag, say something like: "Set this keyword to use foobar subfloatation. The default is foobar superfloatation." OUTPUTS: Describe any outputs here. For example, "This function returns the foobar superflimpt version of the input array." This is where you should also document the return value for functions. OPTIONAL OUTPUTS: Describe optional outputs here. If the routine doesn't have any, just delete this section. COMMON BLOCKS: BLOCK1: Describe any common blocks here. If there are no COMMON blocks, just delete this entry. SIDE EFFECTS: Describe "side effects" here. There aren't any? Well, just delete this entry. RESTRICTIONS: Describe any "restrictions" here. Delete this section if there are no important restrictions. PROCEDURE: You can describe the foobar superfloatation method being used here. You might not need this section for your routine. EXAMPLE: Please provide a simple example here. An example from the PICKFILE documentation is shown below. Please try to include examples that do not rely on variables or data files that are not defined in the example code. Your example should execute properly if typed in at the IDL command line with no other preparation. Create a PICKFILE widget that lets users select only files with the extensions 'pro' and 'dat'. Use the 'Select File to Read' title and store the name of the selected file in the variable F. Enter: F = PICKFILE(/READ, FILTER = ['pro', 'dat']) MODIFICATION HISTORY: Written by: Your name here, Date. July, 1994 Any additional mods get described here. Remember to change the stuff above if you add a new keyword or something!
(See C:\RSI\IDL52\examples\misc\template.pro)
NAME: RSTRPOS PURPOSE: This function finds the last occurrence of a substring within an object string. If the substring is found in the expression, RSTRPOS returns the character position of the match, otherwise it returns -1. CATEGORY: String processing. CALLING SEQUENCE: Result = RSTRPOS(Expr, SubStr [, Pos]) INPUTS: Expr: The expression string in which to search for the substring. SubStr: The substring to search for. OPTIONAL INPUTS: Pos: The character position before which the search is bugun. If Pos is omitted, the search begins at the last character of Expr. OUTPUTS: Returns the position of the substring, or -1 if the substring was not found within Expr. SIDE EFFECTS: Unlike STRPOS, Expr and SubStr must be strings. EXAMPLE: Expr = 'Holy smokes, Batman!' ; define the expression. Where = RSTRPOS(Expr, 'smokes') ; find position. Print, Where ; print position. 5 ; substring begins at position 5 ; (the sixth character). MODIFICATION HISTORY: JWG, January, 1993 AB, 7 December 1997, Added check for proper number of arguments and ON_ERROR statement to stop in caller in case of error on suggestion of Jack Saba. AB, 18 August 1998, Extended original code to allow Expr to be an array.
(See C:\RSI\IDL52\lib\rstrpos.pro)
NAME: RS_TEST PURPOSE: This function tests the hypothesis that two sample popultions, {X[i], Y[i]}, have the same mean of distribution against the hypothesis that they differ. The result is a two-element vector containing the nearly-normal test statistic Z and the one-tailed probability of obtaining a value of Z or greater. This type of test is often refered to as the Wilcoxon Rank-Sum Test or Mann- Whitney U-Test. CATEGORY: Statistics. CALLING SEQUENCE: Result = RS_test(X, Y) INPUTS: X: An n-element vector of type integer, float or double. Y: An m-element vector of type integer, float or double. KEYWORD PARAMETERS: UX: Use this keyword to specify a named variable which returns the Mann-Whitney statistic for X. UY: Use this keyword to specify a named variable which returns the Mann-Whitney statistic for Y. EXAMPLE: Define the vectors of sample data. x = [-14, 3, 1, -16, -21, 7, -7, -13, -22, -17, -14, -8, $ 7, -18, -13, -9, -22, -25, -24, -18, -13, -13, -18, -5] y = [-18, -9, -16, -14, -3, -9, -16, 10, -11, -3, -13, $ -21, -2, -11, -16, -12, -13, -6, -9, -7, -11, -9] Test the hypothesis that two sample popultions, {X[i], Y[i]}, have the same mean of distribution against the hypothesis that they differ at the 0.05 significance level. result = rs_test(x, y, ux = ux, uy = uy) The result should be the 2-element vector: [1.45134, 0.0733429] The keyword parameters should be returned as: ux = 330.000, uy = 198.000 The computed probability (0.0733429) is greater than the 0.05 significance level and therefore we do not reject the hypothesis that X and Y have the same mean of distribution. PROCEDURE: RS_TEST computes the nonparametric Rank Sum Test for populations of equal or unequal size. The populations X[i] and Y[i] are combined and individual elements are ranked based on magnitude. Elements of identical magnitude are ranked using a rank equal to the mean of the ranks that would otherwise be assigned. The Mann-Whitney statistics (Ux and Uy) are computed and used to determine the nearly-normal test statistic (Z) and the one-tailed probability of obtaining a value of Z or greater. The hypothesis that two sample populations have the same mean of distribution is rejected if Ux and Uy differ with statistical significance. If either population contains 10 or fewer samples, the test statistic (Z) and the one-tailed probability of obtaining a value of Z or greater are returned as zero. In this case, consult published tables such as the ones available in the REFERENCE given below. REFERENCE: PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition) Ronald E. Walpole & Raymond H. Myers ISBN 0-02-424170-9 MODIFICATION HISTORY: Written by: GGS, RSI, August 1994
(See C:\RSI\IDL52\lib\rs_test.pro)
NAME: RUNS_TEST PURPOSE: To test for nonrandomness in a sequence of 0 and 1's by counting the number of runs and computing its probabilty. CATEGORY: Statistics. CALLING SEQUENCE: RUNS_TEST, Sequence1, RunNo, Prob, BinNo, Z, LIST_NAME = Ln INPUTS: Sequence1: The vector of 0's and 1's. OPTIONAL OUTPUT PARAMETERS: RunNo: Total number of rums. Prob: probabilty of total number of runs, if number of 0's and number of 1's both exceeds 10.Otherwise, undefined and -1 is returned in Prob. BinNo: [ number of 0's, number of 1's] Z: Approximately normal test statistic computed when number \ of 0' and number of 1's both exceed 10. RESTRICTIONS: None. COMMON BLOCKS: None. PROCEDURE: If either the number of 0's or the number of 1's does not exceed 10, then the probability must be looked up in a table. Otherwise, it is estimated with the normal distribution. Any nonbinary values are removed from the sequence.
(See C:\RSI\IDL52\lib\obsolete\runs_test.pro)
NAME: R_CORRELATE PURPOSE: This function computes Spearman's (rho) or Kendalls's (tau) rank correlation of two n-element vectors. The result is a two-element vector containing the rank correlation coefficient and the two-sided significance level of its deviation from zero. CATEGORY: Statistics. CALLING SEQUENCE: Result = R_correlate(X, Y) INPUTS: X: An n-element vector of type integer, float or double. Y: An n-element vector of type integer, float or double. KEYWORD PARAMETERS: KENDALL: If set to a nonzero value, Kendalls's (tau) rank correlation is computed. By default, Spearman's (rho) rank correlation is computed. D: Use this keyword to specify a named variable which returns the sum-squared difference of ranks. If the KENDALL keyword is set to a nonzero value, this parameter is returned as zero. ZD: Use this keyword to specify a named variable which returns the number of standard deviations by which D deviates from its null- hypothesis expected value. If the KENDALL keyword is set to a nonzero value, this parameter is returned as zero. PROBD: Use this keyword to specify a named variable which returns the two-sided significance level of ZD. If the KENDALL keyword is set to a nonzero value, this parameter is returned as zero. EXAMPLE Define two n-element vectors of tabulated data. x = [257, 208, 296, 324, 240, 246, 267, 311, 324, 323, 263, 305, $ 270, 260, 251, 275, 288, 242, 304, 267] y = [201, 56, 185, 221, 165, 161, 182, 239, 278, 243, 197, 271, $ 214, 216, 175, 192, 208, 150, 281, 196] Compute Spearman's (rho) rank correlation of x and y. result = r_correlate(x, y, d = d, zd = zd, probd = probd) The result should be the two-element vector: [0.835967, 4.42899e-06] The keyword parameters should be returned as: d = 218.000, zd = -3.64390, probd = 0.000268542 Compute Kendalls's (tau) rank correlation of x and y. result = r_correlate(x, y, /kendall) The result should be the two-element vector: [0.624347 0.000118732] REFERENCE: Numerical Recipes, The Art of Scientific Computing (Second Edition) Cambridge University Press ISBN 0-521-43108-5 MODIFICATION HISTORY: Written by: GGS, RSI, Aug 1994 R_CORRELATE is based on the routines spear.c and kendl1.c described in section 14.6 of Numerical Recipes, The Art of Scientific Computing (Second Edition), and is used by permission.
(See C:\RSI\IDL52\lib\r_correlate.pro)
NAME: R_TEST PURPOSE: This function tests the hypothesis that a binary sequence (a sequence of 1s and 0s) represents a "random sampling". This test is based on the "theory of runs" and is often refered to as the Runs Test for Randomness. The result is a two-element vector containing the nearly-normal test statistic Z and the one-tailed probability of obtaining a value of Z or greater. CATEGORY: Statistics. CALLING SEQUENCE: Result = R_test(X) INPUTS: X: An n-element vector of type integer, float or double. Elements not equal to 0 or 1 are removed and the length of X is correspondingly reduced. KEYWORD PARAMETERS: R: Use this keyword to specify a named variable which returns the number of runs (clusters of 0s and 1s) in X. N0: Use this keyword to specify a named variable which returns the number of 0s in X. N1: Use this keyword to specify a named variable which returns the number of 1s in X. EXAMPLE: Define a vector of 1s and 0s. x = [0,1,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1] Test the hypothesis that x represents a random sampling against the hypothesis that it does not represent a random sampling at the 0.05 significance level. result = r_test(x, r = r, n0 = n0, n1 = n1) The result should be the 2-element vector: [2.26487, 0.0117604] The keyword parameters should be returned as: r = 22.0000, n0 = 16.0000, n1 = 14.0000 The computed probability (0.0117604) is less than the 0.05 significance level and therefore we reject the hypothesis that x represents a random sampling. The results show that there are too many runs, indicating a non-random cyclical pattern. PROCEDURE: R_TEST computes the nonparametric Runs Test for Randomness. A "run" is a cluster of identical symbols within a sequence of two distinct symbols. The binary sequence (x) defined in EXAMPLE has 22 runs (or clusters). The first run contains one 0, the second run contains two 1s, the third run contains one 0, and so on. In general, the randomness hypothesis will be rejected if there are lengthy runs of 0s or 1s or if there are alternating patters of many short runs. REFERENCE: PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition) Ronald E. Walpole & Raymond H. Myers ISBN 0-02-424170-9 MODIFICATION HISTORY: Written by: GGS, RSI, August 1994
(See C:\RSI\IDL52\lib\r_test.pro)
NAME: SCALE3 PURPOSE: Set up transformation and scaling for basic 3D viewing. This procedure is similar to SURFR and SCALE3D, except that the data ranges must be specified and the scaling does not vary with rotation. CATEGORY: Graphics, 3D. CALLING SEQUENCE: SCALE3, XRANGE = xr, YRANGE = yr, ZRANGE = zr [, AX = ax] [, AZ = az] INPUTS: No plain parameters. KEYWORD PARAMETERS: XRANGE: Two-element vector containing the minimum and maximum X values. If omitted, the X-axis scaling remains unchanged. YRANGE: Two-element vector containing the minimum and maximum Y values. If omitted, the Y-axis scaling remains unchanged. ZRANGE: Two-element vector containing the minimum and maximum Z values. If omitted, the Z-axis scaling remains unchanged. AX: Angle of rotation about the X axis. The default is 30 degrees. AZ: Angle of rotation about the Z axis. The default is 30 degrees. OUTPUTS: No explicit outputs. Results are stored in the system variables !P.T, !X.S, !Y.S, and !Z.S. COMMON BLOCKS: None. SIDE EFFECTS: The 4 by 4 matrix !P.T (the 3D-transformation system variable), receives the homogeneous transformation matrix generated by this procedure. The axis scaling variables, !X.S, !Y.S, and !Z.S are set from the data ranges. RESTRICTIONS: Axonometric projections only. PROCEDURE: Set the axis scaling variables from the supplied ranges, then: 1) Translate the unit cube so that the center (.5,.5,.5) is moved to the origin. 2) Scale by 1/SQRT(3) so that the corners do not protrude. 3) Rotate -90 degrees about the X axis to make the +Z axis of the data the +Y axis of the display. The +Y data axis extends from the front of the display to the rear. 4) Rotate about the Y axis AZ degrees. This rotates the result counterclockwise as seen from above the page. 5) Then it rotates about the X axis AX degrees, tilting the data towards the viewer. 6) Translate back to the (0,1) cube. This procedure may be easily modified to affect different rotations transformations. EXAMPLE: Set up a 3D transformation where the data range is 0 to 20 for each of the 3 axes and the viewing area is rotated 20 degrees about the X axis and 55 degrees about the Z axis. Enter: SCALE3, XRANGE=[0, 20], YRANGE=[0, 20], ZRANGE=[0, 20], AX=20, AZ=55 MODIFICATION HISTORY: DMS, June, 1991.
(See C:\RSI\IDL52\lib\scale3.pro)
NAME: SCALE3D PURPOSE: Scale the 3D unit cube (a cube with the length of each side equal to 1) into the viewing area. CATEGORY: Graphics, 3D. CALLING SEQUENCE: SCALE3D INPUTS: No explicit inputs. !P.T is an implicit input. KEYWORD PARAMETERS: None. OUTPUTS: No explicit outputs. !P.T is an implicit output. COMMON BLOCKS: None. SIDE EFFECTS: !P.T is modified. RESTRICTIONS: Doesn't work for all forms of perspective transformations. PROCEDURE: Eight, 3D data points are created at the vertices of the 3D unit cube. They are transformed by !P.T. The system is translated to bring the minimum (x,y,z) point to the origin, and then scaled to make each coordinates maximum value equal to 1. MODIFICATION HISTORY: DMS, May, 1988.
(See C:\RSI\IDL52\lib\scale3d.pro)
NAME: SCRABBLE PURPOSE: Solve Scrabble(R) puzzles. CATEGORY: Games. CALLING SEQUENCE: SCRABBLE, Word [, DOUB = Doub, TRIP = Trip, MINCHAR = Minchar] INPUTS: WORD: A string representing the letters in the rack. This string can be any length, although words of two characters or fewer are not checked. KEYWORDS: DOUBLE: The indices of any double-score letters in WORD where index 0 is the first letter. Omit this keyword if there are no double score letters. This keyword can be set to a scalar or an array if there is more than one double score letter. TRIPLE: Indices of any triple-score letters in WORD where index 0 is the first letter. Omit this keyword if ther are no triple score letters. This keyword can be set to a scalar or an array if there is more than one triple score letter. MINCHAR: The smallest number of characters to consider when matching. The default is 4. OUTPUTS: A list of possible words and their scores is output. EXAMPLE: To work on a rack with the letters "aeimmtw", with the third letter triple, enter: SCRABBLE, "aeimmtw", TRIP=2 COMMON BLOCKS: None. SIDE EFFECTS: Uses the files anagrams.dat and anagrams_ptr.dat. If these files don't exist, they are created by the procedure make_anagram. RESTRICTIONS: Doesn't consider all suffixes. Uses only the words in /usr/dict/words. The remaining letters are printed after the word that's found, sometimes making the suffix obvious. For example, the word "AVIATOR" is not found because the root word in /usr/dict/words is "AVIATE", and there is no "E" in "AVIATOR". Procedure make_anagram is implemented for UNIX only. Thus, in general, SCRABBLE works only on UNIX. PROCEDURE: Uses anagrams. Misses some words in dictionary that end in common suffixes such as "ing", "er", "ed", etc. MODIFICATION HISTORY: DMS, Jan, 1988.
(See C:\RSI\IDL52\examples\misc\scrabble.pro)
NAME: SEARCH2D PURPOSE: This function finds "objects" or regions of similar data values within a 2-D array of data. Given a starting location and a range of values to search for, SEARCH2D will find all the cells within the array that are within the specified range of values, and have some path of connectivity through these cells to the starting location. In addition to searching for cells within a global range of data values, SEARCH2D can also search for adjacent cells whose values deviate from their neighbors within specified tolerances. See the procedure "SEARCH3D" for the three dimensional case. This function returns a list of the array subscripts that define the selected object or region. CATEGORY: Data subsetting. Image manipulation. CALLING SEQUENCE: Region = SEARCH2D(Array, Xpos, Ypos, Min_val, Max_val) INPUTS: Array: The 2-D array of data to search. Data type : Any 2-D array except string or structure. Xpos: The X coordinate (first subscript into the 2-D Array) of the starting cell for the search. Data type : Long. Ypos: The Y coordinate (second subscript into the 2-D Array) of the starting cell for the search. Data type : Long. Min_val: The minimum data value to search for. All cells that are connected to the starting cell, and have a value greater than or equal to Min_val and less that or equal to Max_val, will be considered part of the "object". Max_val: The maximum data value to search for. KEYWORD PARAMETERS: DECREASE: If the DECREASE or INCREASE keywords are specified, then SEARCH2D creates an internal copy of Array. This internal copy is then processed to enhance the object edges by using an algorithm similar to the "SOBEL" edge enhancement process. Any adjacent cells will be found if their corresponding data value in the edge enhanced array is greater than DECREASE and less than INCREASE. In any case, the adjacent cells will NEVER be selected if their data value is not between Min_val and Max_val. The default is 0.0 if INCREASE is specified. Otherwise, the default is no edge checking. Data type : Int or Float (usually less than zero). INCREASE: The maximum value in the edge enhanced array for a cell to be considered part of the selected object. Some savings in execution time and memory usage result when DECREASE and INCREASE are omitted. See DECREASE above. The default is 0.0 if DECREASE is specified. Otherwise, the default is no edge checking. Data type : Int or Float (usually greater than zero). LPF_BAND: This keyword indicates what (if any) Low Pass Filtering is performed on the edge enhanced array before the search begins. If LPF_BAND is set to 3 or higher then the edge enhanced array will be smoothed using LPF_BAND as the width of the smoothing window. If LPF_BAND is less than 3 then no smoothing is performed. This keyword only has effect when the DECREASE or INCREASE keywords are supplied. See DECREASE above. The default is zero (no smoothing). Data type : Int. DIAGONAL: Normally, cells are considered adjacent only when squares surrounding the cells share a common edge. If a non-zero value is passed to DIAGONAL then SEARCH2D will also locate cells meeting the search criteria whose surrounding squares share a common corner. Specifying diagonal search mode requires more memory and execution time. The default is no diagonal searching. Data type : int OUTPUTS: This function returns a list of the indices into the 2-D array that are part of the located object or region. This list is returned as a LONARR(n) where n is the number of cells found. If the returned array of indices is called Region, and the size of the 2-D array of data is size_x by size_y, then the actual X and Y indices can be obtained by using the following algorithm : index_y = Region / size_x index_x = Region - (index_y * size_x) The object within the 2-D Array could then be subscripted as : Array(Region) OR Array(index_x, index_y) EXAMPLE: Find all the indices corresponding to an object contained in a 2-D array of data. ; Create some data. img = FLTARR(512, 512) img(3:503, 9:488) = 0.7 img(37:455, 18:438) = 0.5 img(144:388, 90:400) = 0.7 img(200:301, 1:255) = 1.0 img(155:193, 333:387) = 0.3 ; Display the image. TVSCL, img ; Search for an object starting at (175, 300) whose data values ; are between (0.6) and (0.8). Region = SEARCH2D(img, 175, 300, 0.6, 0.8, /DIAGONAL) ; Scale the background cells into the range 0 to 127. img = BYTSCL(img, TOP=127B) ; Highlight the object region by setting it to 255. img(Region) = 255B ; Display the array with the highlighted object in it. TVSCL, img MODIFICATION HISTORY: Written by: Daniel Carr. Thu Sep 3 15:36:17 MDT 1992
(See C:\RSI\IDL52\lib\search2d.pro)
NAME: SEARCH3D PURPOSE: This function finds "objects" or regions of similar data values within a 3-D array of data. Given a starting location and a range of values to search for, SEARCH3D will find all the cells within the volume that are within the specified range of values, and have some path of connectivity through these cells to the starting location. In addition to searching for cells within a global range of data values, SEARCH3D can also search for adjacent cells whose values deviate from their neighbors within specified tolerances. See the procedure "SEARCH2D" for the two dimensional case. This function returns a list of the array subscripts that define the selected object or region. CATEGORY: Data subsetting. Volume manipulation. CALLING SEQUENCE: Region = SEARCH3D(Array, Xpos, Ypos, Zpos, Min_val, Max_val) INPUTS: Array: The 3-D volume of data to search. Data type : Any 3-D array except string or structure. Xpos: The X coordinate (first subscript into the 3-D Array) of the starting cell for the search. Data type : Long. Ypos: The Y coordinate (second subscript into the 3-D Array) of the starting cell for the search. Data type : Long. Zpos: The Z coordinate (third subscript into the 3-D Array) of the starting cell for the search. Data type : Long. Min_val: The minimum data value to search for. All cells that are connected to the starting cell, and have a value greater than or equal to Min_val and less that or equal to Max_val, will be considered part of the "object". Max_val: The maximum data value to search for. KEYWORD PARAMETERS: DECREASE: If the DECREASE or INCREASE keywords are specified, then SEARCH3D creates an internal copy of Array. This internal copy is then processed to enhance the object edges by using an algorithm similar to the "SOBEL" edge enhancement process (in 3-D). Any adjacent cells will be found if their corresponding data value in the edge enhanced array is greater than DECREASE and less than INCREASE. In any case, the adjacent cells will NEVER be selected if their data value is not between Min_val and Max_val. The default is 0.0 if INCREASE is specified. Otherwise, the default is no edge checking. Data type : Int or Float (usually less than zero). INCREASE: The maximum value in the edge enhanced array for a cell to be considered part of the selected object. Some savings in execution time and memory usage result when DECREASE and INCREASE are omitted. See DECREASE above. The default is 0.0 if DECREASE is specified. Otherwise, the default is no edge checking. Data type : Int or Float (usually greater than zero). LPF_BAND: This keyword indicates what (if any) Low Pass Filtering is performed on the edge enhanced array before the search begins. If LPF_BAND is set to 3 or higher then the edge enhanced array will be smoothed using LPF_BAND as the width of the smoothing window. If LPF_BAND is less than 3 then no smoothing is performed. This keyword only has effect when the DECREASE or INCREASE keywords are supplied. See DECREASE above. The default is zero (no smoothing). Data type : Int. DIAGONAL: Normally, cells are considered adjacent only when cubes surrounding the cells share a common face. If a non-zero value is passed to DIAGONAL then SEARCH3D will also locate cells meeting the search criteria whose surrounding cubes share a common edge or corner. Specifying diagonal search mode requires more memory and execution time. The default is no diagonal searching. Data type : int OUTPUTS: This function returns a list of the indices into the 3-D array that are part of the located object or region. This list is returned as a LONARR(n) where n is the number of cells found. If the returned array of indices is called Region, and the size of the 3-D volume of data is size_x by size_y by size_z, then the actual X, Y, and Z indices can be obtained by using the following algorithm : index_z = Region / (size_x * size_y) index_y = (Region - (index_z * size_x * size_y)) / size_x index_x = (Region - (index_z * size_x * size_y)) - (index_y * size_x) The object within the 3-D Array could then be subscripted as : Array(Region) OR Array(index_x, index_y, index_z) EXAMPLE: Find all the indices corresponding to an object contained in a 3-D volume of data. ; Create some data. vol = RANDOMU(s, 40, 40, 40) vol(3:13, 1:15, 17:33) = 1.3 vol(15:25, 5:25, 15:25) = 0.2 vol(5:30,17:38,7:28) = 1.3 vol(9:23, 16:27, 7:33) = 1.5 ; Search for an object starting at (6, 22, 16) whose data values ; are between (1.2) and (1.4).. Region = SEARCH3D(vol, 6, 22, 16, 1.2, 1.4, /DIAGONAL) ; Scale the background cells into the range 0 to 127. vol = BYTSCL(vol, TOP=127B) ; Highlight the object region by setting it to 255. vol(Region) = 255B ; Set up a 3-D view. Window, 0, Xsize=640, Ysize=512, Retain=2 Create_View, Xmax=39, Ymax=39, Zmax=39, ax=(-30), az=30, zoom=0.8 ; Display the volume with the highlighted object in it. TVSCL, PROJECT_VOL(vol, 64, 64, 40, Depth_Q=0.4) MODIFICATION HISTORY: Written by: Daniel Carr. Thu Sep 3 17:36:04 MDT 1992
(See C:\RSI\IDL52\lib\search3d.pro)
NAME: SEL_OBJ PURPOSE: This procedure demonstrates how to perform selections of views, models, and graphic atoms using object graphics. This procedure creates a simple widget application that allows the user to click the mouse within views to make selections. The user may choose between model selections or graphic atom selections. The current selection(s) are identified for the user. CATEGORY: Object graphics. CALLING SEQUENCE: SEL_OBJ MODIFICATION HISTORY: Written by: DD, February 1997.
(See C:\RSI\IDL52\examples\object\sel_obj.pro)
NAME: SETUP_KEYS PURPOSE: Set up function keys for use with IDL. Under Unix, the number of function keys, their names, and the escape sequences they send to the host computer vary enough between various keyboards that IDL cannot be written to understand all keyboards. Therefore, it provides a very general routine named DEFINE_KEY that allows the user to specify the names and escape sequences of function keys. SETUP_KEYS uses user input (via keywords), the TERM environment variable and the type of machine the current IDL is running on to determine what kind of keyboard you are using, and then uses DEFINE_KEY to enter the proper definitions for the function keys. The need for SETUP_KEYS has diminished in recent years because most Unix terminal emulators have adopted the ANSI standard for function keys, as represented by VT100 terminals and their many derivatives, as well as xterm and the newer CDE based dtterm. The current version of IDL already knows the function keys of such terminals, so SETUP_KEYS is not required. However, SETUP_KEYS is still needed to define keys on non-ANSI terminals such as the Sun shelltool, SGI iris-ansi terminal emulator, or IBM's aixterm. CATEGORY: Misc. CALLING SEQUENCE: SETUP_KEYS INPUTS: None. KEYWORD PARAMETERS: NOTE: If no keyword is specified, SETUP_KEYS uses the TERM environment variable and !VERSION to make an educated guess of the keyboard being used. This guess is not foolproof, but is usually correct). ANSI: VT200: Establish function key definitions for a DEC VT200. The VT200 is a superset of the ANSI standard and can be used for ANSI based terminal emulators such as xterm. EIGHTBIT: When establishing VT200 function key definitions, use the 8-bit versions of the escape codes instead of the default 7-bit. HP9000: Establish function key definitions for an HP 9000 series 300 keyboard. Although the HP 9000 series 300 supports both xterm and hpterm windows, IDL supports only user-definable key definitions in xterm windows - hpterm windows use non-standard escape sequences which IDL does not attempt to handle. IBM Establish function key definitions for an IBM keyboard. MIPS: Establish function key definitions for a Mips RS series keyboard. SGI: Establish function key definitions for SGI keyboards. SUN: Establish function key definitions for a Sun shelltool terminal emulator, as well as some definitions for the obsolete Sun3 keyboard. APP_KEYPAD: Will define escape sequences for the group of keys in the numeric keypad, enabling these keys to be programmed within IDL. NUM_KEYPAD: Will disable programmability of the numeric keypad. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The definitions for the function keys are entered. The new keys can be viewed using the command HELP, /KEYS. MODIFICATION HISTORY: AB, 26 April 1989 TJA, July 1990. Added key definitions for HP 9000 series 300, as well as Mips RS series; also rearranged code into separate files. SMR, April, 1991. Added key definitions for SGI and PSTERM AB, 22 November 1994, Added key definitions for IBM. AB, 5 March 1997, Update for the current state of keyboards, which increasingly emulate ANSI behavior. This simplifies things. Added the ANSI keyword. Removed the PSTERM keyword because Sun's psterm program no longer exists. Added code that uses the TERM environment variable to better diagnose the keyboard. General cleanup.
(See C:\RSI\IDL52\lib\setup_keys.pro)
NAME: SET_SCREEN PURPOSE: Emulate the Version I VMS/IDL SET_SCREEN procedure. Sets the default position and size of the plot data window. Uses device coordinates, rather than normalized coords. CATEGORY: Plotting. CALLING SEQUENCE: SET_SCREEN, Xmin, Xmax [, Ymin, Ymax] INPUTS: Xmin: Minimum X device coordinate of the plotting data window. Xmax: Maximum X device coordinate of the plotting data window. OPTIONAL INPUT PARAMETERS: Ymin: Minimum Y device coordinate of the plotting data window. Ymax: Maximum Y device coordinate of the plotting data window. KEYWORD PARAMETERS: None. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: The system variable !P.POSITION is set. RESTRICTIONS: None. PROCEDURE: Straightforward. !P.POSITION is directly set. MODIFICATION HISTORY: DMS, June, 1989.
(See C:\RSI\IDL52\lib\obsolete\set_screen.pro)
NAME: SET_VIEW PURPOSE: This procedure sets a default VIEWPLANE_RECT for a given view and destination. The viewplane rect is calculated to hold the models that are currently contained within the view. CATEGORY: Object graphics. CALLING SEQUENCE: SET_VIEW, oView, oDest INPUTS: oView: An instance of an IDLgrView. oDest: An instance of an IDLgrWindow or IDLgrPrinter. KEYWORD PARAMETERS: DO_ASPECT: Set this keyword to a nonzero value if you would like to maintain aspect ratio of the bounds of the models within the viewport. ISOTROPIC: Set this keyword to a nonzero value if you would like the bounds of the models to be isotropic. XRANGE: Set this keyword to a two-element vector [xmin,xmax] to use as the bounds of the models. YRANGE: Set this keyword to a two-element vector [ymin,ymax] to use as the bounds of the models. ZRANGE: Set this keyword to a two-element vector [zmin,zmax] to use as the bounds of the models. MODIFICATION HISTORY: Written by: DD, February 1997.
(See C:\RSI\IDL52\examples\object\set_view.pro)
NAME: SET_VIEWPORT PURPOSE: Emulate the Version I, VMS/IDL SET_VIEWPORT procedure. Sets the default position and size of the plot data window. CATEGORY: Plotting. CALLING SEQUENCE: SET_VIEWPORT, Xmin, Xmax [, Ymin, Ymax] INPUTS: Xmin: Minimum X normalized coordinate of the plotting data window. Xmax: Maximum X normalized coordinate of the plotting data window. OPTIONAL INPUT PARAMETERS: Ymin: Minimum Y normalized coordinate of the plotting data window. Ymax: Maximum Y normalized coordinate of the plotting data window. KEYWORD PARAMETERS: None. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: Sets !P.POSITION. RESTRICTIONS: None. PROCEDURE: Straightforward. !P.POSITION is directly set. MODIFICATION HISTORY: DMS, June, 1989. Modified, April, 1991 to restore defaults if called with no parameters.
(See C:\RSI\IDL52\lib\obsolete\set_viewport.pro)
NAME: SET_XY PURPOSE: This procedure emulates the Version I, VMS/IDL SET_XY procedure to set the default axis ranges. CATEGORY: Plotting. CALLING SEQUENCE: SET_XY, Xmin, Xmax [, Ymin, Ymax] INPUTS: Xmin: Minimum X data coordinate of the plotting data window. Xmax: Maximum X data coordinate of the plotting data window. OPTIONAL INPUT PARAMETERS: Ymin: Minimum Y data coordinate of the plotting data window. Ymax: Maximum X data coordinate of the plotting data window. KEYWORD PARAMETERS: None. OUTPUTS: No explicit outputs. SIDE EFFECTS: Sets the RANGE, CRANGE, and S fields of !X and !Y. RESTRICTIONS: SET_XY should only be used to emulate VMS Version I of IDL. This procedure does a number of things which generally should not be done. PROCEDURE: Straightforward. MODIFICATION HISTORY: DMS, June, 1989.
(See C:\RSI\IDL52\lib\obsolete\set_xy.pro)
NAME: SFIT PURPOSE: This function determines a polynomial fit to a surface. CATEGORY: Curve and surface fitting. CALLING SEQUENCE: Result = SFIT(Data, Degree) INPUTS: Data: The two-dimensional array of data to fit. The sizes of the dimensions may be unequal. Degree: The maximum degree of fit (in one dimension). OUTPUT: This function returns a fitted array. OUTPUT KEYWORDS: Kx: The array of coefficients for a polynomial function of x and y to fit data. This parameter is returned as a (Degree+1) by (Degree+1) element array. PROCEDURE: Fit a 2D array Z as a polynomial function of x and y. The function fitted is: F(x,y) = Sum over i and j of kx(j,i) * x^i * y^j where kx is returned as a keyword. MODIFICATION HISTORY: July, 1993, DMS Initial creation
(See C:\RSI\IDL52\lib\sfit.pro)
NAME: SHADE_SURF_IRR PURPOSE: Make a shaded surface representation of an irregulary gridded elevation dataset. The data must be representable as an array of quadrilaterals. This routine should be used when the (X, Y, Z) arrays are too irregular to be drawn by SHADE_SURF, but are still semi-regular. CATEGORY: Graphics, surface plotting. CALLING SEQUENCE: SHADE_SURF_IRR, Z, X, Y INPUTS: Z: A 2D array of elevations. This array must be dimensioned as [NX, NY]. X: A 2D array containing the X location of each Z value. This array must be dimensioned as [NX, NY]. Y: A 2D array containing the Y location of each Z value. This array must be dimensioned as [NX, NY]. KEYWORD PARAMETERS: AX: The angle of rotation about the X axis. The default is 30 degrees. This parameter is passed to SURFR. This keyword value is ignored if the T3D keyword is set to a nonzero value. AZ: The angle of rotation about the Z axis. The default is 30 degrees. This parameter is passed to SURFR. This keyword value is ignored if the T3D keyword is set to a nonzero value. IMAGE: Set this keyword to an array that will contain the resulting shaded surface image. The variable is returned as a byte array of the same size as the currently selected graphics device. PLIST: Set this keyword to an array that will contain the polygon list on return. This feature is useful when you want to make a number of images from the same set of vertices and polygons. T3D: Set this keyword to a nonzero value to indicate that the generalized transformation matrix in !P.T is to be used (in which case the keyword values for AX and AZ are ignored). OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: The currently selected display is modified. RESTRICTIONS: The grid described by X and Y must consist of quadrilaterals, must be semi-regular, and must be in "CLOCKWISE" order: i.e., each cell must be defined by the vertices: v[i,j], v[i+1,j],v[i+1,j+1], and v[i,j+1]. Clockwise ordering: x[i,j] <= x[i+1, j] ... for all j and y[i,j] <= y[i, j+1] ... for all i. WARNING: This restriction is not checked. PROCEDURE: First, SURFR is called to establish the 3D to 2D transformation. Then the vertex and polygon data structures required by the POLYSHADE function are built and passed that function. POLYSHADE returns the shaded image which is then displayed by TV. This simple procedure can be modified to use and/or accept additional keywords. MODIFICATION HISTORY: Oct, 1989, DMS. DMS, Modified to use SURFR instead of SURFACE. and to return the polygon list. Nov, 1996, DLD: Added T3D keyword.
(See C:\RSI\IDL52\lib\shade_surf_irr.pro)
NAME: SHOW3 PURPOSE: Show a 2D array three ways in a display that combines SURFACE, CONTOUR, and an image (color/gray scale pixels). CATEGORY: Display, graphics. CALLING SEQUENCE: SHOW3, Image [, INTERP = Interp, SSCALE = Sscale] INPUTS: Image: The 2-dimensional array to display. OPTIONAL INPUTS: X = a vector containing the X values of each column of Image. If omitted, columns have X values 0, 1, ..., Ncolumns-1. Y = a vector containing the Y values of each row of Image. If omitted, columns have Y values 0, 1, ..., Nrows-1. KEYWORD PARAMETERS: INTERP: Set this keyword to use bilinear interpolation on the pixel display. This technique is slightly slower, but for small images, it makes a better display. SSCALE: Reduction scale for surface. The default is 1. If this keyword is set to a value other than 1, the array size is reduced by this factor for the surface display. That is, the number of points used to draw the wire-mesh surface is reduced. If the array dimensions are not an integral multiple of SSCALE, the image is reduced to the next smaller multiple. E_CONTOUR: a structure containing additional keyword parameters that are passed to the CONTOUR procedure. See the example below. E_SURFACE: a structure containing additional keyword parameters that are passed to the SURFACE procedure. See the example below. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: A new plot is generated. RESTRICTIONS: The display gets too "busy" when displaying larger (say 50 by 50), images, especially if they are noisy. It can be helpful to use the SSCALE keyword or the SMOOTH and/or REBIN functions to smooth the surface plot. You might want to modify the calls to CONTOUR and SURFACE slightly to customize the display to your tastes, i.e., with different colors, skirts, linestyles, contour levels, etc. PROCEDURE: First, do a SURFACE with no data to establish the 3D to 2D scaling. Then convert the coordinates of the corner pixels of the array to 2D. Use POLYWARP to get the warping polynomial to warp the 2D image into the area underneath the SURFACE plot. Output the image, output the surface (with data) and then output the contour plot at the top (z=1). EXAMPLES: A = BESELJ(SHIFT(DIST(30,20), 15, 10)/2.,0) ;Array for example SHOW3, A ;Show it with default display. SHOW3, A, SQRT(FINDGEN(30)) ;Make X axis proportional to sqrt SHOW3, A, E_CONTOUR={C_CHARSIZE:2, DONW:1} ;Label CONTOUR lines with double size characters, and include downhill tick marks. SHOW3, A, E_SURFACE={SKIRT:-1, ZRANGE:[-2,2]} ;Draw a surface with a skirt and scale Z axis from -2 to 2. MODIFICATION HISTORY: DMS. Jan, 1988. Added fudges for PostScript, April, 1988. Fixed bug where contour plot was occasionally clipped. Dec, 1990. Added optional axis variables, and _EXTRA keywords for CONTOUR, and SURFACE. Jan, 1996. DD. Added code to ignore !ORDER for the TV of the image. Mar 1997. SJL Fixed bug from scaling with polywarp. July, 1998.
(See C:\RSI\IDL52\lib\show3.pro)
NAME: SHOW3_TRACK PURPOSE: This procedure serves as an example of using the trackball object to manipulate a composite object. CATEGORY: Object graphics. CALLING SEQUENCE: SHOW3_TRACK[, Data] OPTIONAL INPUTS: Data: A two-dimensional array representing the data to be displayed as a combination of an image, a surface, and a contour. By default, a BESEL function is displayed. MODIFICATION HISTORY: Written by: DLD, July 1998
(See C:\RSI\IDL52\examples\object\show3_track.pro)
NAME: SHOWFONT PURPOSE: This procedure displays a vector-drawn font on the current graphics device. CATEGORY: Fonts. CALLING SEQUENCE: SHOWFONT, Font, Name INPUTS: Font: The index number of the font (may range from 3 to 29) or, if the TT_FONT keyword is set, a string representing the name of the TrueType font to display. Name: Title text to appear at top of display. KEYWORD PARAMETERS: ENCAPSULATED: If this keyword is set, and if the current graphics device is "PS", makes encapsulated PostScript output. TT_FONT: If this keyword is set, the Font argument is interpreted as the name of a TrueType font. OUTPUTS: No explicit outputs. SIDE EFFECTS: A display is made. RESTRICTIONS: Not very flexible. PROCEDURE: Straightforward. EXAMPLE: To create a display of Font 3 for PostScript: SET_PLOT, 'PS' SHOWFONT, 3, "Simplex Roman" To create a display of the Times Roman TrueType font: SHOWFONT, 'Times', 'Times Roman', /TT_FONT MODIFICATION HISTORY: Written by: DMS, Nov, 1992 WSO, 1/95, Updated for new directory structure DD, 12/97, Updated to handle TrueType fonts
(See C:\RSI\IDL52\lib\showfont.pro)
NAME: SIGMA PURPOSE: Calculate the standard deviation value of an array, or calculate the standard deviation over one dimension of an array as a function of all the other dimensions. CATEGORY: Statistics. CALLING SEQUENCE: Result = SIGMA(Array) Result = SIGMA(Array, N_Par) Result = SIGMA(Array, N_Par, Dimension) INPUTS: Array: The input array of any type except string. OPTIONAL INPUT PARAMETERS: N_Par: The number of parameters. The default value is zero. The number of degrees of freedom is N_ELEMENTS(Array) - N_Par. The value of sigma varies as one over the square root of the number of degrees of freedom. Dimension: The dimension to do standard deviation over. OUTPUTS: SIGMA returns the standard deviation value of the array when called with one parameter. If DIMENSION is passed, then the result is an array with all the dimensions of the input array except for the dimension specified, each element of which is the standard deviation of the corresponding vector in the input array. For example, if A is an array with dimensions of (3,4,5), then the command: B = SIGMA(A,N,1) is equivalent to B = FLTARR(3,5) FOR J = 0,4 DO BEGIN FOR I = 0,2 DO BEGIN B(I,J) = SIGMA(A(I,*,J), N) ENDFOR ENDFOR COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: The dimension specified must be valid for the array passed, otherwise the input array is returned as the output array. PROCEDURE: When DIMENSION is passed, then the function SUM is used. MODIFICATION HISTORY: William Thompson Applied Research Corporation July, 1986 8201 Corporate Drive Landover, MD 20785 DMS, May, 1993 Removed AVG fcn, use new features of TOTAL.
(See C:\RSI\IDL52\lib\obsolete\sigma.pro)
NAME: SIGN_TEST PURPOSE: To test the null hypothesis that two populations have the same distribution -i.e. F(x) = G(x) against the alternative that their distributions differ in location- i.e F(x) = G(x+a).Sign_test pairwise tests the populations in Data. CATEGORY: Statistics. CALLING SEQUENCE: SIGN_TEST, Data, [Diff,Prob,Names=Names] INPUTS: Data: Two-dimensional array. Data(i,j) = the jth observation from the ith population. KEYWORDS: NAMES: Vector of user supplied names for the populations to be used in the output. LIST_NAME: Name of output file. Default is to the screen. MISSING: Value used as a place holder for missing data. Pairwise handling of missing data. NOPRINT: Flag, if set, to suppress output to the screen. OUTPUT: Table written to the screen showing for each pair of populations the number of positive differences in observations. Also, table of probabilties for each population pair giving the two-tailed significance of the results in the first table. OPTIONAL OUTPUT PARAMETERS: Diff: Two-dimensional array of positive differences. Diff(i,j) = number of observations in population i greater than the corresponding observation in population j. Prob: Two-dimensional array. Prob(i,j) = probability of Diff(i,j) or something more extreme. RESTRICTIONS: All populations have the same sample size. COMMON BLOCKS: None. PROCEDURE: For each pair of populations, the diffence between corresponding observations is computed and a count is made of the positive and negative differences. The probability of the count is computed under the assumption that the distributions are the same - i.e. the probability of a negative difference = the probability of a positive difference = .5. For sample size > 25, the binomial distribution is approximated with a normal distribution for computing Prob.
(See C:\RSI\IDL52\lib\obsolete\sign_test.pro)
NAME: SIMPSON PURPOSE: Numerically approximate the definite integral of a function with limits [A, B]. CATEGORY: Mathematical functions, general. CALLING_SEQUENCE: Result = SIMPSON(Funct, A, B, Count, TOL = Tol) INPUTS: Funct: A character string that contains the name of the function to be integrated. The user should write this function to accept a single scalar argument. A: The lower limit of the integral. B: The upper limit of the integral. KEYWORD PARAMETERS: TOL: The error tolerance. The default is .001. COMPLEX: Set this keyword if Funct returns complex values. PLOT_IT: Set this keyword to plot the points where the integrand is evaluated. OUTPUT: SIMPSON returns the approximation to the integral of Funct for the limits [A, B]. OUTPUT PARAMETERS: Count: On return, this variable contains the number of function evaluations needed to approximate the integral. COMMON BLOCKS: SIMP2 SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: This function uses the recursive adaptive Simpson's rule. MODIFICATION HISTORY: 1991, Ann Bateson.
(See C:\RSI\IDL52\lib\obsolete\simpson.pro)
NAME: SKEWNESS PURPOSE: This function computes the statistical skewness of an N-element vector. If the variance of the vector is zero, the skewness is not defined, and SKEWNESS returns !VALUES.F_NAN as the result. CATEGORY: Statistics. CALLING SEQUENCE: Result = SKEWNESS(X) INPUTS: X: An N-element vector of type integer, float or double. KEYWORD PARAMETERS: DOUBLE: IF set to a non-zero value, computations are done in double precision arithmetic. NAN: If set, treat NaN data as missing. EXAMPLE: Define the N-element vector of sample data. x = [65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71, 66, 65, 70] Compute the mean. result = SKEWNESS(x) The result should be: -0.0942851 PROCEDURE: SKEWNESS calls the IDL function MOMENT. REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Written by: GSL, RSI, August 1997
(See C:\RSI\IDL52\lib\skewness.pro)
NAME: SKEY_DEC PURPOSE: Under Unix, the number of function keys, their names, and the escape sequences they send to the host computer vary enough between various keyboards that IDL cannot be written to understand all keyboards. Therefore, it provides a very general routine named DEFINE_KEY that allows the user to specify the names and escape sequences. This routine uses DEFINE_KEY to enter the keys for a DEC VT200-style keyboard, as well as keyboards based around ANSI-standard escape sequences such as xterm and dtterm. Note: SKEY_DEC is primarily designed to be called by SETUP_KEYS, which attempts to automatically detect the correct keyboard type in use, and define the keys accordingly. Nonetheless, SKEY_DEC can be called as a standalone routine. This procedure is for Unix systems - NOT VMS. CATEGORY: Misc. CALLING SEQUENCE: SKEY_DEC INPUTS: None. KEYWORD PARAMETERS: EIGHTBIT: When establishing VT200 function key definitions, use the 8-bit versions of the escape codes instead of the default 7-bit. APP_KEYPAD: Defines escape sequences for the group of keys in the numeric keypad, enabling these keys to be programmed within IDL. NUM_KEYPAD: Disables programmability of the numeric keypad. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The definitions for the function keys have been entered, and can be viewed using the command HELP, /KEYS . MODIFICATION HISTORY: AB, 26 April 1989 TJA, July 1990, setup_keys_dec created by the "breakup" of setup_keys into separate files. Also, keywords added to enable and disable programmability of the numeric keypad. AB, 21 September 1992,renamed from SETUP_KEYS_DEC to SKEY_DEC to avoid DOS filename limitations. AB, 16 June 1993, The IDL scanner used to treat octal string escapes in a manner similar to the C language, but this ability was removed to make the MS DOS port possible (conflicts with file path specifications). Removed all uses of that here. AB, 5 March 1997, Added definitions for F1-F5.
(See C:\RSI\IDL52\lib\skey_dec.pro)
NAME: SKEY_HP PURPOSE: Under Unix, the number of function keys, their names, and the escape sequences they send to the host computer vary enough between various keyboards that IDL cannot be written to understand all keyboards. Therefore, it provides a very general routine named DEFINE_KEY that allows the user to specify the names and escape sequences. This routine uses DEFINE_KEY to enter the keys for the HP 9000 series 300 keyboard. Note: SKEY_HP is primarily designed to be called by SETUP_KEYS, which attempts to automatically detect the correct keyboard type in use, and define the keys accordingly. Nonetheless, SKEY_HP can be called as a standalone routine. CATEGORY: Misc. CALLING SEQUENCE: SKEY_HP INPUTS: None. KEYWORD PARAMETERS: APP_KEYPAD: Defines escape sequences for the group of keys in the numeric keypad, enabling these keys to be programmed within IDL. NUM_KEYPAD: Disables programmability of the numeric keypad. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The definitions for the function keys have been entered, and can be viewed using HELP,/KEYS . The upper right-hand group of four keys (at the same height as the function keys) are called "BLANK1" through "BLANK4", since they have no written labels. Keys defined to have labels beginning with a capital "K" belong to the numeric keypad group. For example, "K9" refers to keypad key "9". Although the HP 9000 series 300 can create both xterm and hpterm windows, IDL supports only user-definable key definitions in xterm windows - hpterm windows use non-standard escape sequences which IDL does not attempt to handle. MODIFICATION HISTORY: TJA & AB, July 1990, setup_keys_hp created, and call to setup_keys_hp placed in procedure setup_keys AB, 21 September 1992,renamed from SETUP_KEYS_HP to SKEY_HP to avoid DOS filename limitations. AB, 16 June 1993, The IDL scanner used to treat octal string escapes in a manner similar to the C language, but this ability was removed to make the MS DOS port possible (conflicts with file path specifications). Removed all uses of that here.
(See C:\RSI\IDL52\lib\skey_hp.pro)
NAME: SKEY_IBM PURPOSE: Under Unix, the number of function keys, their names, and the escape sequences they send to the host computer vary enough between various keyboards that IDL cannot be written to understand all keyboards. Therefore, it provides a very general routine named DEFINE_KEY that allows the user to specify the names and escape sequences. This routine uses DEFINE_KEY to enter the keys for a Sun keyboard. Note: SKEY_IBM is primarily designed to be called by SETUP_KEYS, which attempts to automatically detect the correct keyboard type in use, and define the keys accordingly. Nonetheless, SKEY_IBM may be called as a standalone routine. CATEGORY: Misc. CALLING SEQUENCE: SKEY_IBM INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The definitions for the function keys have been entered, and can be viewed using HELP,/KEYS . MODIFICATION HISTORY: ACY, Oct 1994, skey_ibm created, based on skey_sgi
(See C:\RSI\IDL52\lib\skey_ibm.pro)
NAME: SKEY_MIPS PURPOSE: Under Unix, the number of function keys, their names, and the escape sequences they send to the host computer vary enough between various keyboards that IDL cannot be written to understand all keyboards. Therefore, it provides a very general routine named DEFINE_KEY that allows the user to specify the names and escape sequences. This routine uses DEFINE_KEY to enter the keys for the MIPS RS series keyboard. Note: SKEY_MIPS is primarily designed to be called by SETUP_KEYS, which attempts to automatically detect the correct keyboard type in use, and define the keys accordingly. Nonetheless, SKEY_MIPS can be called as a standalone routine. CATEGORY: Misc. CALLING SEQUENCE: SKEY_MIPS INPUTS: None. KEYWORD PARAMETERS: APP_KEYPAD: Defines escape sequences for the group of keys in the numeric keypad, enabling these keys to be programmed within IDL. NUM_KEYPAD: Disables programmability of the numeric keypad. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The definitions for the function keys have been entered, and can be viewed using HELP,/KEYS . The, , and keys are not defined, as they do not generate standard escape sequences. The same is true for , , and in the grouping of six keys above the arrow keys; however, the other three in the group ARE defined. Keys defined to have labels beginning with a capital "K" belong to the numeric keypad group. For example, "K9" refers to keypad key "9". The key is the only one within the keypad which is not defined. MODIFICATION HISTORY: TJA , July 1990. SETUP_KEYS_MIPS created, and call to SETUP_KEYS_MIPS placed in procedure SETUP_KEYS. AB, 21 September 1992,renamed from SETUP_KEYS_MIPS to SKEY_MIPS to avoid DOS filename limitations. AB, 16 June 1993, The IDL scanner used to treat octal string escapes in a manner similar to the C language, but this ability was removed to make the MS DOS port possible (conflicts with file path specifications). Removed all uses of that here.
(See C:\RSI\IDL52\lib\skey_mips.pro)
NAME: SKEY_SGI PURPOSE: Under Unix, the number of function keys, their names, and the escape sequences they send to the host computer vary enough between various keyboards that IDL cannot be written to understand all keyboards. Therefore, it provides a very general routine named DEFINE_KEY that allows the user to specify the names and escape sequences. This routine uses DEFINE_KEY to enter the keys for a Sun keyboard. Note: SKEY_SGI is primarily designed to be called by SETUP_KEYS, which attempts to automatically detect the correct keyboard type in use, and define the keys accordingly. Nonetheless, SKEY_SGI may be called as a standalone routine. CATEGORY: Misc. CALLING SEQUENCE: SKEY_SGI INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The definitions for the function keys have been entered, and can be viewed using HELP,/KEYS . MODIFICATION HISTORY: AB, 26 April 1989 TJA, July 1990, setup_keys_sun created by the "breakup" of setup_keys into separate files. SMR, April 1991, setup_keys_sgi created by modifying setup_keys_sun AB, 21 September 1992,renamed from SETUP_KEYS_SGI to SKEY_SGI to avoid DOS filename limitations. AB, 16 June 1993, The IDL scanner used to treat octal string escapes in a manner similar to the C language, but this ability was removed to make the MS DOS port possible (conflicts with file path specifications). Removed all uses of that here.
(See C:\RSI\IDL52\lib\skey_sgi.pro)
NAME: SKEY_SUN PURPOSE: Under Unix, the number of function keys, their names, and the escape sequences they send to the host computer vary enough between various keyboards that IDL cannot be written to understand all keyboards. Therefore, it provides a very general routine named DEFINE_KEY that allows the user to specify the names and escape sequences. This routine uses DEFINE_KEY to enter the keys for a Sun keyboard. Note: SKEY_SUN is primarily designed to be called by SETUP_KEYS, which attempts to automatically detect the correct keyboard type in use, and define the keys accordingly. Nonetheless, SKEY_SUN can be called as a standalone routine. CATEGORY: Misc. CALLING SEQUENCE: SKEY_SUN INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The definitions for the function keys have been entered, and can be viewed using the command HELP, /KEYS . MODIFICATION HISTORY: AB, 26 April 1989 TJA, July 1990, SETUP_KEYS_SUN created by the "breakup" of SETUP_KEYS into separate files. AB, 21 September 1992,renamed from SETUP_KEYS_SUN to SKEY_SUN to avoid DOS filename limitations. AB, 16 June 1993, The IDL scanner used to treat octal string escapes in a manner similar to the C language, but this ability was removed to make the MS DOS port possible (conflicts with file path specifications). Removed all uses of that here. AB, 5 March 1997, The psterm doesn't exist anymore, so I changed the routine to accept the PSTERM keyword and silently ignore it.
(See C:\RSI\IDL52\lib\skey_sun.pro)
NAME: SLICER PURPOSE: Widget based application to show 3D volume slices and isosurfaces. CATEGORY: Volume display / rendering. CALLING SEQUENCE: COMMON VOLUME_DATA, A A = your_volume_data SLICER INPUTS: Variable A in VOLUME_DATA common contains volume data. See EXAMPLE section below. KEYWORD PARAMETERS: COMMANDS: An optional string array of commands to execute before entering the interactive mode. Commands are in the form of a keyword optionally followed one or more numeric, blank-separated parameters. For example: "COMMAND P1 P2 P3 ... Pn" Keywords and parameters are: UNDO: Undo previous operation. ORI X_Axis Y_Axis Z_axis X_Rev Y_Rev Z_Rev X_Rot Z_Rot Asp This command sets the orientation for the SLICER display. X_Axis, Y_Axis, and Z_Axis should be 0 for data x, 1 for data y, and 2 for data z. X_Rev, Y_Rev, and Z_Rev should be 0 for normal, 1 for reversed. Asp is the Z axis aspect ratio w/ respect to X, Y. X_Rot and Z_Rot are the rotations of the X and Z axes in degrees (30 is the default). For example, to interchange the X and Z axes and reverse the Y use the string: ORI 2 1 0 0 1 0 30 30 TRANS On_Off Threshold: Use this command to turn transparency on or off and set the transparency threshold value. 1 means on, 0 means off. Threshold is expressed in percent of data range (0 = min data value, 100 = max data value). SLICE Axis Value Interp 0: Draw an orthogonal slice along the given axis (0=x, 1=y, 2=z) at Value. Set Interp equal to 1 for interpolation, 0 for nearest neighbor. Expose = 1 to remove, 0 for normal slice. SLICE Azimuth, Elev, Interp, Expose, 1, x0, y0, z0: Draw an oblique slice. The oblique plane crosses the XY plane at angle Azimuth, with an elevation of Elev. It passes thru the point (x0, y0, z0). COLOR Table_Index Low High Shading: Set the color tables. Table_Index is the pre-defined color table number (see LOADCT), or -1 to retain the present table. Low, High and Shading are expressed in percent. ISO Threshold Hi_Lo: Draw an iso-surface. Threshold is the isosurface threshold value. Hi_Lo should be set to 1 to view the low side, 0 for the high side. ERASE: Erase the display. CUBE Mode Cut_Ovr Interp X0 Y0 Z0 X1 Y1 Z1: Draw cube (mode = 1) or cut-out (mode = 0). Cut_Ovr should be set to 1 for cut-over, 0 for cut-thru. Interp should be 1 for interpolation, 0 for nearest neighbor. (X0,Y0,Z0) is the lower corner of the cube. (X1,Y1,Z1) is the upper corner. (X0 < X1, etc.) WAIT Secs: Wait the designated time (in seconds). NO_BLOCK:Set this keyword to zero to have XMANAGER block when this application is registered. By default NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting NO_BLOCK=0 will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. CMD_FILE: A string that contains the name of a file containing SLICER commands to execute as described above. DETACHED: if set, put the drawable in a separate window. (Good for large windows.) GROUP: The base ID of the widget that calls SLICER. When this keyword is specified, the death of the caller results in the death of the SLICER. RANGE: A two-element array containing minimum and maximum data values of interest. If this keyword is omitted, the data is scanned for the minimum and maximum. MODAL: If set, then the slicer runs in modal mode. RESOLUTION: a two element vector giving the width and height of the drawing window. Default = 55% by 44% of screen width. OUTPUTS: No explicit outputs. COMMON BLOCKS: COMMON VOLUME_DATA, A ;Used to pass in the volume data. COMMON SLICER_COMMON ;Used internally. COMMON SLICER_COMMON1 ;Used internally. SIDE EFFECTS: On exit, the Z-buffer contains the most recent image generated by SLICER. The image may be redisplayed on a different device by reading the Z-buffer contents, plus the current color table. Widgets are created on the X window display. RESTRICTIONS: Widgets are required. The volume data must fit in memory. PROCEDURE: The slicer program has the following modes: Slices: Displays orthogonal slices thru the data volume. Block: Displaces the surfaces of a selected block inside the volume. Cutout: Cuts blocks from previously drawn objects. Isosurface: Draws an isosurface contour. Probe: Displays the position and value of objects using the mouse. Colors: Manipulates the color tables and contrast. Rotations: Sets the orientation of the display. EXAMPLE: Data is transferred to the SLICER via the VOLUME_DATA common block instead of as an argument. This technique is used because volume datasets can be very large and hence, the duplication that occurs when passing values as arguments is a waste of memory. Suppose that you want to read some data from the file "head.dat" into IDL for use in the SLICER. Before you read the data, establish the VOLUME_DATA common block with the command: COMMON VOLUME_DATA, VOL The VOLUME_DATA common block has just one variable in it. The variable can have any name. Here, we're using the name "VOL". Now read the data from the file into VOL. For example: OPENR, 1, "head.dat" VOL = FLTARR(20, 30, 42) READU, 1, VOL CLOSE, 1 Now you can run the SLICER widget application by entering: SLICER The data stored in VOL is the data being worked on by the SLICER. To obtain the image in the slicer window after slicer is finished: (Use the image with the current color tables). SET_PLOT, 'Z' ;Use the Z buffer graphics device a = TVRD() ;Read the image MODIFICATION HISTORY: DMS - RSI, Oct, 1991. DMS - RSI, Mar, 1992. Added Journaling and expose mode. Fixed bug with 24 bit color. DMS - RSI, Jan, 1993. Added oblique slices. bmh - 10/14/93 - The following minor bug fixes. When no elements are found during an iso-surface display, an error message was displayed to an invalid device name. When no oblique slices are selected, the slicer_oblique should return. DJC - RSI, Jun, 1994. Fixed oblique slice initialization and atan(0,0) problem (on HP). DJC - RSI, Feb, 1995. Added modal keyword. DJC - RSI, Feb, 1995. Changed "poly" variable to "polyv" to avoid clash with math "poly" function. DJC - RSI, Mar, 1995. Fixed shading values for iso-surface.
(See C:\RSI\IDL52\lib\obsolete\slicer.pro)
NAME: SLICER3 PURPOSE: Widget based application to visualize 3D data. This program superseeds the "SLICER" program. CATEGORY: Volume display / rendering. CALLING SEQUENCE: SLICER3 [, hData3D] INPUTS: hData3D: A pointer to the 3D data, or an array of pointers to multiple 3D arrays. If multiple arrays are specified, they all must have the same X, Y, and Z dimensions. This parameter is optional. The default is to use a 3D array created from BYTARR(2,2,2). While running SLICER3, the user may interactively load data via the file menu (see example). If data is loaded in this fashion, any data passed to SLICER3 via a pointer (or pointers) is deleted, and the pointers become invalid. KEYWORD PARAMETERS: DETACH: If set, then the drawing area is placed in a base that is detached from the control panel. The drawing area can only be detached if Slicer3 is not run in modal mode. MODAL: If set, then Slicer3 will block user interaction with all other widgets (and block the command line) until the user quits Slicer3. If Slicer3 is started from some other widget-based application, then it is usually advisable to run Slicer3 in Modal mode. GROUP: This keyword specifies a widget ID of the group leader. If the specified widget is destroyed, Slicer3 is also destroyed. If Slicer3 is started from a widget application, then GROUP should ALWAYS be specified. See example. DATA_NAMES: A string array of names for the data. The names appear on the droplist widget for the current data. If the number of elements of DATA_NAMES is less than the number of elements in hData3D then default names will be generated for the unnamed data. COMMON BLOCKS: COMMON colors, r, g, b, cur_red, cur_green, cur_blue These common variables are used by the "STRETCH", "LOADCT", and "XLOADCT" commands. SIDE EFFECTS: Slicer3 modifies the current color table, the device's decomposed setting (on 24-bit displays), as well as various elements of the plotting system (ie, the "!X", "!Y", "!Z", and "!P" system variables). If the "MODAL" keyword is set (usually a good idea), then SLICER3 will, upon exit, restore these system variables, settings, and the color tables to the values they had when SLICER3 was started. Slicer3 sets the position for the light source and enables back-facing polygons to be drawn (see the IDL "SET_SHADING" command). Slicer3 overwrites the existing contents of the Z-buffer. Upon exiting Slicer3, the Z-buffer contents are the same as what was last displayed by Slicer3. Slicer3 breaks the color table into 6 "bands", based upon the number of available colors (max_color=!D.N_COLORS on 8-bit displays, and max_color=256 on 24-bit displays) : Band start index: Band end index: Used for: ----------------- --------------- --------- 0 nColor-1 X Slices. nColor (2*nColor)-1 Y Slices. 2*nColor (3*nColor)-1 Z Slices. 3*nColor (4*nColor)-1 Iso-surfaces. 4*nColor (5*nColor)-1 Projections. Where: nColor = (max_color - 9) / 5 Note that the value of !D.N_Colors can vary from machine to machine, and from run to run, depending upon available system resources. Also, !D.N_Colors is usually not set by IDL until the first window has been created (or realized) in that IDL session. Annotation colors are the last "band", and they are set up as : Color index: Color: ------------- ------ max_color - 1 White. max_color - 2 Yellow. max_color - 3 Cyan. max_color - 4 Purple. max_color - 5 Red. max_color - 6 Green. max_color - 7 Blue. max_color - 8 Black. On 24-bit displays, improved performance can often be gained by running Slicer3 in 8-bit mode. This can be accomplished (on some platforms) by entering the following command at the start of the IDL session (before any windows are created): Device, Pseudo_Color=8 See the documentation for additional information. RESTRICTIONS: The data used by Slicer3 must meet the following conditions: * The data must have three dimensions. * The minimum size of the data array must be 2x2x2. * If multiple volumes are loaded, they all must have the same dimensions. PROCEDURE: "File" menu: "Load": Select a file containing a 3D array (or arrays) to load into Slicer3. The file must have been written in a certain binary format. For each data array in the file, the following values are present: data item data type bytes -------------------------- ---------- ------ Number of dimensions long 4 in array. Note that this is always 3 for valid Slicer3 data. Size of first dimension. long 4 Size of second dimension. long 4 Size of third dimension. long 4 If multiple arrays are present in the file, they must all have the same dimensions. Data type (1 through 5) long 4 (see the IDL "SIZE" function for types). Total number of elements. long 4 (dimX*dimY*dimZ). Note that the all of the above values are the exact output of the IDL "SIZE" function. Number of characters long 4 in data name. Note that the above value is the output from the IDL "STRLEN" function. Data name. byte strlen() 3D data. varies varies Note that the 3D data type and number of bytes is specified by the "size" information above. Any number of 3D datasets can be concatenated into a single file of this type (as long as they all have the same dimensions). (See EXAMPLE, below.) NOTE: Files saved by the "Save Subset" operation (see below) are suitable for input via the "Load" operation. Data files that are moved from one platform to another may not load as expected, due to differing byte order. See the "BYTEORDER" and "SWAP_ENDIAN" IDL commands for details. "Save / Save Subset": Slicer3 must be in "Block" mode for this operation to be available. When selected, a subset of the 3D data enclosed in the current block is written to the chosen save file. This subset can then be loaded back into Slicer3 at any time. If multiple 3D arrays are currently available in Slicer3, then multiple subsets are saved to the file. "Save / Save Tiff Image": When selected, a tiff image of the current Slicer3 contents is saved to the chosen file. When running in 8-bit mode, a "Class P" palette color Tiff file is created. In 24-bit mode, a "Class R" (interleaved by image) Tiff file is created. "Quit": Exits Slicer3. "Tools" menu: "Erase": Erases the display window and deletes all the objects in the display list. "Delete / ...": As graphical objects are created, they are added to the display list. The "Delete" menu allows the user to delete a specific object from the list. When an object is deleted, the screen is redrawn with the remaining objects. "Colors / Reset Colors": Selecting this will cause the original color scheme to be restored. "Colors / Differential Shading": This allows the user to change the percentage of differential shading applied to the X, Y, and Z slices. "Colors / Slice/Block": This allows the user to use the "XLOADCT" operation to modify the colors used for slices and blocks. In some cases, the new colors will not be visible until the user selects "Done" in the XLOADCT tool. "Colors / Surface": This allows the user to use the "XLOADCT" operation to modify the colors used for iso-surfaces. "Colors / Projection": This allows the user to use the "XLOADCT" operation to modify the colors used for projections. Note that on some platforms, the selected colors may not become visible until after the "XLOADCT" tool is exited. "Options": This brings up a panel allowing the user to set: The axis visibility. The wire-frame cube visibility. The display window size (the X and Y dimensions are always the same). If the user selects "Ok", then the display is redrawn. "About" menu: "About Slicer": Brings up help information about Slicer3. "Data:" pull-down menu: If multiple datasets are currently available in Slicer3, this menu allows the selection of the current data. Slices, blocks, iso-surfaces, etc. are created from the currently selected data. If only one dataset is currently loaded, then this menu is inactive. "Mode:" pull-down menu: This menu is used to select the current mode of operation. Main Draw Window: Interaction in the main draw window is dependent upon the currently selected mode ("Slice", "Block", "Surface", etc., see below). In general, when coordinate input is required from the user, it is performed by clicking a mouse button on the "surface" of the wire-frame cube that surrounds the data. This 3D location is then used as the basis for whatever input is needed. In most cases, the "front" side of the cube is used. In a few cases, the coordinate input is on the "back" side of the cube. "Slice" mode: To display a slice, click and drag the left mouse button on the wire-frame cube. When the button is released, a slice through the data will be drawn at that location. "Draw" mode: When in Draw mode, new slices will be merged into the current Z-buffer contents. "Expose" mode: When in Expose mode, new slices will be drawn in front of everything else. "Orthogonal" mode: When in Orthogonal mode, use the left mouse button in the big window to position and draw an orthogonal slicing plane. Clicking the right mouse button in the big window (or any mouse button in the small window) will toggle the slicing plane orientation. "X": This sets the orthogonal slicing plane orientation to be perpendicular to the X axis. "Y": This sets the orthogonal slicing plane orientation to be perpendicular to the Y axis. "Z": This sets the orthogonal slicing plane orientation to be perpendicular to the Z axis. "Oblique" mode: Clicking any mouse button in the small window will reset the oblique slicing plane to its default orientation. "Normal" mode: When in this mode, click and drag the left mouse button in the big window to set the surface normal for the oblique slicing plane. "Center" mode: When in this mode, click and drag the left mouse button in the big window to set the center point for the surface normal. "Display": Clicking this button will cause an oblique slicing plane to be drawn. "Block" mode: When in Block mode, use the left mouse button in the big window to set the location for the "purple" corner of the block. Use the right mouse button to locate the opposite "blue" corner of the block. When in Block mode, the "Save Subset" operation under the main "File" menu is available. "Add" mode: When in this mode, the block will be "added" to the current Z-buffer contents. "Subtract" mode: When in this mode, the block will be "subtracted" from the current Z-buffer contents. Subtract mode is only effective when the block intersects some other object in the display (such as an iso-surface). "Display": Clicking this button will cause the block to be drawn. "Surface" mode: In iso-surface is like a contour line on a contour map. On one side of the line, the elevation is higher than the contour level, and on the other side of the line, the elevation is lower than the contour level. An iso-surface, however, is a 3D surface that passes through the data such that the data values on one side of the surface are higher than the threshold value, and on the other side of the surface, the data values are lower than the threshold value. When in Surface mode, a logarithmic histogram plot of the data is displayed in the small draw window. Click and drag a mouse button on this plot to set the iso-surface threshold value. This value is also shown in the text widget below the plot. The threshold value may also be set by typing a new value in this text widget. The histogram plot is affected by the current threshold settings. (See Threshold mode, below). "Low": Selecting this mode will cause the iso-surface polygon facing to face towards the lower data values. Usually, this is the mode to use when the iso-surface is desired to surround high data values. "High": Selecting this mode will cause the iso-surface polygon facing to face towards the higher data values. Usually, this is the mode to use when the iso-surface is desired to surround low data values. "Shading" pull-down menu: Iso-surfaces are normally rendered with light-source shading. If multiple datasets are currently loaded, then this menu allows the selection of a different 3D array for the source of the iso-surface shading values. If only one dataset is currently loaded, then this menu is inactive. "Display": Clicking this button will cause the iso-surface to be created and drawn. Iso-surfaces often consist of tens of thousands of polygons, and can sometimes take considerable time to create and render. "Projection" mode: A "voxel" projection of a 3D array is the projection of the data values within that array onto a viewing plane. This is similar to taking an X-ray image of a 3D object. "Max" mode: Select this mode for a Maximum intensity projection. "Avg" mode: Select this mode for an Average intensity projection. "Low" mode: Select this mode for a Low resolution projection. "Med" mode: Select this mode for a Medium resolution projection. "High" mode: Select this mode for a High resolution projection. "Depth Queue %": Use the slider to set the depth queue percent. A value of 50, for example, indicates that the farthest part of the projection will be 50 % as bright as the closest part of the projection. "Display": Clicking this button will cause the projection to be calculated and drawn. Projections can sometimes take considerable time to display. Higher resolution projections take more computation time. "Threshold" mode: When in Threshold mode, a logarithmic histogram plot of the data is displayed in the small draw window. Click and drag the left mouse button on this plot to set the minimum and maximum threshold values. To expand a narrow range of data values into the full range of available colors, set the threshold range before displaying slices, blocks, or projections. The threshold settings also affect the histogram plot in "Surface" mode. The minimum and maximum threshold values are also shown in the text widgets below the histogram plot. Click and drag the right mouse button on the histogram plot to set the transparency threshold. Portions of any slice, block, or projection that are less than the transparency value are not drawn (clear). Iso-surfaces are not affected by the transparency threshold. The transparency threshold value is also shown in a text widget below the histogram plot. "Min": In this text widget, a minimum threshold value can be entered. "Max": In this text widget, a maximum threshold value can be entered. "Transp.": In this text widget, a transparency threshold value can be entered. "Profile" mode: In Profile mode, a plot is displayed showing the data values along a line. This line is also shown superimposed on the data in the main draw window. The bottom of the plot corresponds to the "purple" end of the line, and the top of the plot corresponds to the "blue" end of the line. "Orthogonal" mode: Click and drag the left mouse button to position the profile line, based upon a point on the "front" faces of the wire-frame cube. Click and drag the right mouse button to position the profile line, based upon a point on the "back" faces of the wire-frame cube. As the profile line is moved, The profile plot is dynamically updated. "Oblique" mode: Click and drag the left mouse button to position the "purple" end of the profile line on one of the "front" faces of the wire-frame cube. Click and drag the right mouse button to position the "blue" end of the profile line on one of the "back" faces of the wire-frame cube. As the profile line is moved, The profile plot is dynamically updated. "Probe" mode: In Probe mode, click and drag a mouse button over an object in the main draw window. The actual X-Y-Z location within the data volume is displayed in the three text widgets. Also, the data value at that 3D location is displayed in the status window, above the main draw window. If the cursor is inside the wire-frame cube, but not on any object, then the status window displays "No data value", and the three text widgets are empty. If the cursor is outside the wire-frame cube, then the status window and text widgets are empty. "X": Use this text widget to enter the X coordinate for the probe. "Y": Use this text widget to enter the Y coordinate for the probe. "Z": Use this text widget to enter the Z coordinate for the probe. "View" mode: In view mode, a small window shows the orientation of the data cube in the current view. As view parameters are changed, this window is dynamically updated. The main draw window is then updated when the user clicks on "Display", or exits View mode. "Display": Clicking on this button will cause the objects in the main view window to be drawn in the new view. If any view parameters have been changed since the last time the main view was updated, the main view will be automatically redrawn when the user exits View mode. 1st Rotation: Use this slider to set the angle of the first view rotation (in degrees). The droplist widget adjacent to the slider indicates which axis this rotation is about. 2nd Rotation: Use this slider to set the angle of the second view rotation (in degrees). The droplist widget adjacent to the slider indicates which axis this rotation is about. "Zoom %": Use this slider to set the zoom factor percent. Depending upon the view rotations, Slicer3 may override this setting to ensure that all eight corners of the data cube are within the window. "Z %": Use this slider to set a scale factor for the Z axis (to compensate for the data's aspect ratio). EXAMPLE: Example 1: ---------- Create a data save file suitable for dynamic loading into Slicer3. ; Store some 3D data in a variable called "data_1". data_1 = INDGEN(20,30,40) ; Store some 3D data in a variable called "data_2". data_2 = FINDGEN(20,30,40) ; Define the names for the datasets (their names will ; appear in the "Data:" pull-down menu in Slicer3. data_1_name = 'Test Data 1' data_2_name = 'Data 2' ; Select a data file name. dataFile = PICKFILE() ; Write the file. GET_LUN, lun OPENW, lun, dataFile WRITEU, lun, SIZE(data_1) WRITEU, lun, STRLEN(data_1_name) WRITEU, lun, BYTE(data_1_name) WRITEU, lun, data_1 WRITEU, lun, SIZE(data_2) WRITEU, lun, STRLEN(data_2_name) WRITEU, lun, BYTE(data_2_name) WRITEU, lun, data_2 CLOSE, lun FREE_LUN, lun Example 2: ---------- Run Slicer3 with data passed to it at startup. ; Create some 3D data. data = INDGEN(20,30,40) ; Create a pointer to the data, and use the "/NO_COPY" ; keyword to save memory. h_data = PTR_NEW(data, /NO_COPY) ; Start up Slicer3. SLICER3, h_data, /MODAL ; If the user did not interactively load any data into ; Slicer3 (via the "File/Load" menu), then the original ; pointer to the data still exists (and the original data ; will still reside in memory). To free it, use: if PTR_VALID(h_data) then PTR_FREE, h_data ; If the pointer is no longer valid, then that indicates ; that the user interactively loaded data into Slicer3. ; Any data that is loaded interactively is automatically ; deleted when the user exits Slicer3. ; Note that the last contents of the main view window in ; Slicer3 still resides in the Z-buffer. To access this ; image after exiting Slicer3, perform the following actions: current_device = !D.Name SET_PLOT, 'Z' image_buffer = TVRD() depth_buffer = TVRD(CHANNEL=1, /WORDS) SET_PLOT, current_device TV, image_buffer ; Note that the image contained in "image_buffer" will look ; "correct" only if the colors loaded by Slicer3 have not ; been changed since the user exited Slicer3. MODIFICATION HISTORY: Daniel Carr - RSI, Fri Nov 22 15:43:36 MST 1996 Daniel Carr - RSI, Fri Jan 10 12:08:01 MST 1997 Fixed bugs and added muti-dataset capability. Alan Youngblood, Daniel Carr - RSI, Wed Feb 11 10:07:32 MST 1998 Modified routine to use pointers.
(See C:\RSI\IDL52\lib\slicer3.pro)
NAME: SLIDE_IMAGE PURPOSE: Create a scrolling graphics window for examining large images. By default, 2 draw widgets are used. The left draw widget shows a reduced version of the complete image, while the draw widget on the right displays the actual image with scrollbars that allow sliding the visible window. CALLING SEQUENCE: SLIDE_IMAGE [, Image] INPUTS: Image: The 2-dimensional image array to be displayed. If this argument is not specified, no image is displayed. The FULL_WINDOW and SCROLL_WINDOW keywords can be used to obtain the window numbers of the 2 draw widgets so they can be drawn into at a later time. KEYWORDS: CONGRID: Normally, the image is processed with the CONGRID procedure before it is written to the fully visible window on the left. Specifying CONGIRD=0 will force the image to be drawn as is. FULL_WINDOW: A named variable in which to store the IDL window number of \ the non-sliding window. This window number can be used with the WSET procedure to draw to the scrolling window at a later point. GROUP: The widget ID of the widget that calls SLIDE_IMAGE. If this keyword is specified, the death of the caller results in the death of SLIDE_IMAGE. BLOCK: Set this keyword to have XMANAGER block when this application is registered. By default the Xmanager keyword NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting BLOCK for this application will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. ORDER: This keyword is passed directly to the TV procedure to control the order in which the images are drawn. Usually, images are drawn from the bottom up. Set this keyword to a non-zero value to draw images from the top down. REGISTER: Set this keyword to create a "Done" button for SLIDE_IMAGE and register the widgets with the XMANAGER procedure. The basic widgets used in this procedure do not generate widget events, so it is not necessary to process events in an event loop. The default is therefore to simply create the widgets and return. Hence, when register is not set, SLIDE_IMAGE can be displayed and the user can still type commands at the "IDL>" prompt that use the widgets. RETAIN: This keyword is passed directly to the WIDGET_DRAW function, and controls the type of backing store used for the draw windows. If not present, a value of 2 is used to make IDL handle backing store. SLIDE_WINDOW: A named variable in which to store the IDL window number of the sliding window. This window number can be used with the WSET procedure to draw to the scrolling window at a later time. TITLE: The title to be used for the SLIDE_IMAGE widget. If this keyword is not specified, "Slide Image" is used. TOP_ID: A named variable in which to store the top widget ID of the SLIDE_IMAGE hierarchy. This ID can be used to kill the hierarchy as shown below: SLIDE_IMAGE, TOP_ID=base, ... . . . WIDGET_CONTROL, /DESTROY, base XSIZE: The maximum width of the image that can be displayed by the scrolling window. This keyword should not be confused with the visible size of the image, controlled by the XVISIBLE keyword. If XSIZE is not specified, the width of Image is used. If Image is not specified, 256 is used. XVISIBLE: The width of the viewport on the scrolling window. If this keyword is not specified, 256 is used. YSIZE: The maximum height of the image that can be displayed by the scrolling window. This keyword should not be confused with the visible size of the image, controlled by the YVISIBLE keyword. If YSIZE is not present the height of Image is used. If Image is not specified, 256 is used. YVISIBLE: The height of the viewport on the scrolling window. If this keyword is not present, 256 is used. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: Widgets for displaying a very large image are created. The user typically uses the window manager to destroy the window, although the TOP_ID keyword can also be used to obtain the widget ID to use in destroying it via WIDGET_CONTROL. RESTRICTIONS: Scrolling windows don't work correctly if backing store is not provided. They work best with window-system-provided backing store (RETAIN=1), but are also usable with IDL provided backing store (RETAIN=2). Various machines place different restrictions on the size of the actual image that can be handled. MODIFICATION HISTORY: 7 August, 1991, Written by AB, RSI. 10 March, 1993, ACY, Change default RETAIN=2 23 Sept., 1994 KDB, Fixed Typo in comments. Fixed error in Congrid call. xvisible was used instead of yvisible.
(See C:\RSI\IDL52\lib\slide_image.pro)
NAME: SPEARMAN PURPOSE: To compute the correlation matrix where Spearman's correlation coefficient is computed between pairs of ranked variables. No assumptions are made about the probabilty distribution of the variable values. CATEGORY: Statistics. CALLING SEQUENCE: SPEARMAN, Data, CorMatrix INPUTS: Data: Two-dimensional array. Data(i,j) = the jth value of the ith variable. KEYWORDS: NAMES: Vector of user supplied names for the variables to be used in the output. LIST_NAME: Name of output file. Default is to the screen. MISSING: Value used as a place holder for missing data. Pairwise handling of missing data. NOPRINT: A flag, if set, to suppress output to the screen. OUTPUT: Correlation matrix written to the screen OPTIONAL OUTPUT PARAMETERS: CORMATRIX: Two-dimensional correlation array. CorMatrix(i,j) = spearman correlation coeffiecient computed for variables i and j. RESTRICTIONS: None. COMMON BLOCKS: None. PROCEDURE: Variables are pairwised ranked with ties averaged. Correlation coefficient is computed using the rankings.
(See C:\RSI\IDL52\lib\obsolete\spearman.pro)
NAME: SPH_4PNT PURPOSE: Given four 3-dimensional points, this procedure returns the center and radius necessary to define the unique sphere passing through those points. CATEGORY: Analytic Geometry. CALLING SEQUENCE: SPH_4PNT, X, Y, Z, Xc, Yc, Zc, R INPUTS: X: A 4-element vector containing the X coordinates of the points. Y: A 4-element vector containing the Y coordinates of the points. Z: A 4-element vector containing the Z coordinates of the points. Note: X, Y, and Z should be floating-point or double-precision vectors. OUTPUTS: Xc: The sphere's center x-coordinate. Yc: The sphere's center y-coordinate. Zc: The sphere's center z-coordinate. R: The sphere's radius. RESTRICTIONS: Points may not coincide. EXAMPLE: Find the center and radius of the unique sphere passing through the points: (1, 1, 0), (2, 1, 2), (1, 0, 3), (1, 0, 1) Define the floating-point vectors containing the x, y and z coordinates of the points. X = [1, 2, 1, 1] + 0.0 Y = [1, 1, 0, 0] + 0.0 Z = [0, 2, 3, 1] + 0.0 Compute the sphere's center and radius. SPH_4PNT, X, Y, Z, Xc, Yc, Zc, R Print the results. PRINT, Xc, Yc, Zc, R MODIFICATION HISTORY: Written by: GGS, RSI, Jan 1993 Modified: GGS, RSI, March 1994 Rewrote documentation header. Uses the new Numerical Recipes NR_LUDCMP/NR_LUBKSB. Modified: GGS, RSI, November 1994 Changed internal array from column major to row major. Changed NR_LUDCMP/NR_LUBKSB to LUDC/LUSOL Modified: GGS, RSI, June 1995 Added DOUBLE keyword. Modified: GGS, RSI, April 1996 Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\sph_4pnt.pro)
NAME: SPH_SCAT PURPOSE: Interpolate to a regular grid given scattered samples on the surface of a sphere. CATEGORY: Interpolation. CALLING SEQUENCE: Result = SPH_SCAT(lon, lat, f) INPUTS: lon = sample longitudes, a vector, in degrees. lon, lat, and f must have the same number of points. lat = sample latitudes, a vector, in degreees. f = data values measured at lon and lat. f(i) = sample value at lon(i), lat(i). KEYWORD PARAMETERS: GS: If present, GS must be a two-element vector [XS, YS], where XS is the spacing between grid points in longitude, and YS is the spacing in latitude. The default is based on the extents of lon and lat. If the grid starts at longitude Lonmin and ends at Lonmax, then the default horizontal spacing is (Lonmax - Lonmin)/(NX-1). YS is computed in the same way. The default grid size, if neither NX or NY are specified, is 26 by 26. BOUNDS: If present, BOUNDS must be a four element array containing the grid limits in longitude and latitude of the output grid: [Lonmin, Latmin, Lonmax, Latmax]. If not specified, the grid limits are set to the extent of lon and lat. Warning: to cover all longitudes, you must directly specify BOUNDS. NX: The output grid size in the longitude direction. NX need not be specified if the size can be inferred from GS and BOUNDS. The default value is 26. NY: The output grid size in the latitude direction. See NX. BOUT: the actual extent of the regular grid, arranged as in bounds. An optional output parameter. GOUT: The actual grid spacing, a two element optional output array. OUTPUTS: Result = regularly interpolated result. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Timing. on a Sun SPARCstation LX producing a 36 x 36 output grid (1296 points), t is ~ .578 + .00368 * N + 2.39e-06 * N^2. For example: N 16 64 256 1024 4096 Time .7 .8 1.6 6.6 56 Output points are produced at a rate of approximately 2000 points per second. PROCEDURE: This routine is a convenience interface to the Spherical gridding and interpolation provided by TRIANGULATE and TRIGRID. The methods are based on the work of Robert Renka, Interpolation of Data on the Surface of a Sphere, Oak Ridge Natl Lab Technical Paper CSD-108. The procedure consists of generating a triangulation of the scattered data points, estimating the gradients with a local method, and then constructing a triangle based interpolant of the data and gradient estimates. The interpolant is C(1) continuous. EXAMPLE: Create 50 random longitudes and latitudes, make a function value, and then interpolate, obtaining a 360 x 360 array of 10 degree by 5 degree resolution that covers the sphere: lon = randomu(seed, 50) * 360. -180. ;Make random scattered points lat = randomu(seed, 50) * 180. -90. z = sin(lat*!DTOR) ;Make a function to fit c = cos(lat*!DTOR) x = cos(lon*!DTOR) * c y = sin(lon*!DTOR) * c f = sin(x+y) * sin(x*z) ;The dependent variable ** Now, given lon, lat, and f, interpolate the data: result = sph_scat(lon, lat, f, bounds=[0, -90, 350, 85], gs=[10,5]) MODIFICATION HISTORY: DMS, November, 1994. Written.
(See C:\RSI\IDL52\lib\sph_scat.pro)
NAME: SPIRO PURPOSE: A Widget front end to draw "Spirograph" (TM) patterns CATEGORY: Line Drawing, widgets CALLING SEQUENCE: SPIRO OUTPUTS: None. COMMON BLOCKS: None. RESTRICTIONS: None. SIDE EFFECTS: Draws a "Spirograph" (TM) pattern on the current window. As the original C program states: "The pattern is produced by rotating a circle inside of another circle with a pen a set distance inside the center of the rotating circle". MODIFICATION HISTORY: 22, December, 1989, A.B. Inspired by a C program posted to the Internet by Paul Schmidt (2/2/1988). 2, February, 1995, WSO Updated the UI and added cams to help visualize spirograph drawing.
(See C:\RSI\IDL52\examples\misc\spiro.pro)
NAME: SPLINE PURPOSE: This function performs cubic spline interpolation. CATEGORY: Interpolation - E1. CALLING SEQUENCE: Result = SPLINE(X, Y, T [, Sigma]) INPUTS: X: The abcissa vector. Values MUST be monotonically increasing. Y: The vector of ordinate values corresponding to X. T: The vector of abcissae values for which the ordinate is desired. The values of T MUST be monotonically increasing. OPTIONAL INPUT PARAMETERS: Sigma: The amount of "tension" that is applied to the curve. The default value is 1.0. If sigma is close to 0, (e.g., .01), then effectively there is a cubic spline fit. If sigma is large, (e.g., greater than 10), then the fit will be like a polynomial interpolation. OUTPUTS: SPLINE returns a vector of interpolated ordinates. Result(i) = value of the function at T(i). RESTRICTIONS: Abcissa values must be monotonically increasing. EXAMPLE: The commands below show a typical use of SPLINE: X = [2.,3.,4.] ;X values of original function Y = (X-3)^2 ;Make a quadratic T = FINDGEN(20)/10.+2 ;Values for interpolated points. ;twenty values from 2 to 3.9. Z = SPLINE(X,Y,T) ;Do the interpolation. MODIFICATION HISTORY: Author: Walter W. Jones, Naval Research Laboratory, Sept 26, 1976. Reviewer: Sidney Prahl, Texas Instruments. Adapted for IDL: DMS, Research Systems, March, 1983.
(See C:\RSI\IDL52\lib\spline.pro)
NAME: SPLINE_P PURPOSE: This procedure performs parameteric cubic spline interpolation. CATEGORY: Interpolation - E1. CALLING SEQUENCE: SPLINE_P, X, Y, Xr, Yr INPUTS: X: The abcissa vector (should be floating or double). Y: The vector of ordinate values corresponding to X. Neither X or Y need be monotonic. KEYWORD PARAMETERS: INTERVAL: The interval in XY space between interpolants. If omitted, approximately 8 interpolants per XY segment will result. TAN0: The tangent to the spline curve at X[0], Y[0]. If omitted, the tangent is calculated to make the curvature of the result zero at the beginning. This is a two element vector, containing the X and Y components of the tangent. TAN1: The tangent to the spline curve at X[N-1], Y[N-1].If omitted, the tangent is calculated to make the curvature of the result zero at the end. This is a two element vector, containing the X and Y components of the tangent. OUTPUTS: XR: The abcissa values of the interpolated function. This may NOT be the same variable as either X or Y. YR: The ordinate values of the interpolated function. This may NOT be the same variable as either X or Y. RESTRICTIONS: X and Y should be floating or double. PROCEDURE: Cubic spline interpolation with relaxed or clamped end conditions as used in the Numerical Recipes. This routine is both more general and faster than the user's library function SPLINE. One call to SPLINE_P is equivalent to two calls to SPLINE, as both the X and Y are interpolated with splines. It is suited for interpolating between randomly placed points, and the abcissae values need not be monotonic. In addition, the end conditions may be optionally specified via tangents. EXAMPLE: The commands below show a typical use of SPLINE_P: X = [0.,1,0,-1,0] ;Abcissae for square with a vertical diagonal Y = [0.,1,2,1,0] ;Ordinates SPLINE_P, X, Y, XR, YR ;Interpolate with relaxed end conditions PLOT, XR, YR ;Show it As above, but with setting both the beginning and end tangents: SPLINE_P, X, Y, XR, YR, TAN0=[1,0], TAN1=[1,0] This yields approximately 32 interpolants. As above, but with setting the interval to 0.05, making more interpolants, closer together: SPLINE_P, X, Y, XR, YR, TAN0=[1,0], TAN1=[1,0], INTERVAL=0.05 This yields 116 interpolants and looks close to a circle. MODIFICATION HISTORY: DMS, RSI. August, 1993. Written. DMS, RSI. Jan, 1994. Modified to use NR_ spline routines.
(See C:\RSI\IDL52\lib\spline_p.pro)
NAME: Spring PURPOSE: This example demonstrates the fundamental principles of statistical time-series analysis. MAJOR TOPICS: Surface Drawing and Widgets. CALLING SEQUENCE: Spring PROCEDURE: Spring computes ... MAJOR FUNCTIONS and PROCEDURES: COMMON BLOCKS and STRUCTURES: springCommon : This common block contains... MODIFICATION HISTORY: Written by: DMS, RSI, March 1991 Modified by: WSO, RSI, January 1995
(See C:\RSI\IDL52\examples\misc\spring.pro)
NAME: STANDARDIZE PURPOSE: This function computes standardized variables from an array of M variables (columns) and N observations (rows). The result is an M-column, N-row array where all columns have a mean of zero and a variance of one. CATEGORY: Statistics CALLING SEQUENCE: Result = Standardize(A) INPUTS: A: An M-column, N-row array of type float or double. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE: Define an array with 4 variables and 20 observations. array = $ [[19.5, 43.1, 29.1, 11.9], $ [24.7, 49.8, 28.2, 22.8], $ [30.7, 51.9, 37.0, 18.7], $ [29.8, 54.3, 31.1, 20.1], $ [19.1, 42.2, 30.9, 12.9], $ [25.6, 53.9, 23.7, 21.7], $ [31.4, 58.5, 27.6, 27.1], $ [27.9, 52.1, 30.6, 25.4], $ [22.1, 49.9, 23.2, 21.3], $ [25.5, 53.5, 24.8, 19.3], $ [31.1, 56.6, 30.0, 25.4], $ [30.4, 56.7, 28.3, 27.2], $ [18.7, 46.5, 23.0, 11.7], $ [19.7, 44.2, 28.6, 17.8], $ [14.6, 42.7, 21.3, 12.8], $ [29.5, 54.4, 30.1, 23.9], $ [27.7, 55.3, 25.7, 22.6], $ [30.2, 58.6, 24.6, 25.4], $ [22.7, 48.2, 27.1, 14.8], $ [25.2, 51.0, 27.5, 21.1]] Compute the mean and variance of each variable using the MOMENT function. Note: The skewness and kurtosis are also computed. IDL> for k = 0, 3 do print, MOMENT(array[k,*]) 25.3050 25.2331 -0.454763 -1.10028 51.1700 27.4012 -0.356958 -1.19516 27.6200 13.3017 0.420289 0.104912 20.1950 26.0731 -0.363277 -1.24886 Compute the standardized variables. IDL> result = STANDARDIZE(array) Compute the mean and variance of each standardized variable using the MOMENT function. Note: The skewness and kurtosis are also computed. IDL> for k = 0, 3 do print, MOMENT(result[k,*]) -7.67130e-07 1.00000 -0.454761 -1.10028 -3.65451e-07 1.00000 -0.356958 -1.19516 -1.66707e-07 1.00000 0.420290 0.104913 4.21703e-07 1.00000 -0.363278 -1.24886 MODIFICATION HISTORY: Written by: GGS, RSI, February 1996
(See C:\RSI\IDL52\lib\standardize.pro)
NAME: STDDEV PURPOSE: This function computes the stddev of an N-element vector. CATEGORY: Statistics. CALLING SEQUENCE: Result = stddev(X) INPUTS: X: An N-element vector of type integer, float or double. KEYWORD PARAMETERS: DOUBLE: IF set to a non-zero value, computations are done in double precision arithmetic. NAN: If set, treat NaN data as missing. EXAMPLE: Define the N-element vector of sample data. x = [65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71, 66, 65, 70] Compute the standard deviation. result = stddev(x) The result should be: 8.16292 PROCEDURE: STDDEV calls the IDL function MOMENT. REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Written by: GSL, RSI, August 1997
(See C:\RSI\IDL52\lib\stddev.pro)
NAME: STDEV PURPOSE: Compute the standard deviation and, optionally, the mean of any array. CATEGORY: G1- Simple calculations on statistical data. CALLING SEQUENCE: Result = STDEV(Array [, Mean]) INPUTS: Array: The data array. Array may be any type except string. OUTPUTS: STDEV returns the standard deviation (sample variance because the divisor is N-1) of Array. OPTIONAL OUTPUT PARAMETERS: Mean: Upon return, this parameter contains the mean of the values in the data array. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Mean = TOTAL(Array)/N_ELEMENTS(Array) Stdev = SQRT(TOTAL((Array-Mean)^2/(N-1))) MODIFICATION HISTORY: DMS, RSI, Sept. 1983.
(See C:\RSI\IDL52\lib\obsolete\stdev.pro)
NAME: STEPWISE PURPOSE: To select the locally best set of independent variables to be used in a regression analysis to predict Y. CATEGORY: Statistics. CALLING SEQUENCE: STEPWISE, X, Y [,InEQ, Alpha, Alphar] INPUT: X: A 2-dimensional array of observed variable values. X(i,j) = the value of the ith variable in the jth observation. Y: A column vector of observed dependent variable values. X and Y must have the same number of rows. OPTIONAL INPUTS: InEq: Vector of indices of equations to be forced into the equation. Alpha: Significance level for including a variable. The default is 0.05. Alphar: Significance level for removing a variable from the regression equation. The default is equal to Alpha. KEYWORDS: VARNAMES: A vector of names for the independent variables to be used in the output. REPORT: A flag to print out regression statistics as each a variable enters or leaves the equation. LIST_NAME: A string that contains the name of output file. Default is to the screen. MISSING: Value of missing data. If this keyword is not set, assume no missing data. Listwise handling of missing data. OUTPUT: Regression statistics for the final equation. OPTIONAL OUTPUT PARAMETERS: InEq: Vector of indices of variables in final equation. RESTRICTIONS: None. COMMON BLOCKS: None. SIDE EFFECTS: None. PROCEDURE: Adapted from an algorithm from Statistical Analysis, a Computer Oriented Approach, by A.A. Afifi and S.P. Azen. The procedure successively picks the best predictor of the dependent variable Y given the variables already entered (via a statistic based on the partial correlation coefficient). Variables may be removed from the equation if their significance falls below a given level.
(See C:\RSI\IDL52\lib\obsolete\stepwise.pro)
NAME: STRETCH PURPOSE: Stretch the image display color tables so the full range runs from one color index to another. CATEGORY: Image processing, point operations. CALLING SEQUENCE: STRETCH, Low, High [, /CHOP] INPUTS: Low: The lowest pixel value to use. If this parameter is omitted, 0 is assumed. Appropriate values range from 0 to the number of available colors-1. High: The highest pixel value to use. If this parameter is omitted, the number of colors-1 is assumed. Appropriate values range from 0 to the number of available colors-1. OPTIONAL INPUTS: Gamma: Gamma correction factor. If this value is omitted, 1.0 is assumed. Gamma correction works by raising the color indices to the Gamma power, assuming they are scaled into the range 0 to 1. KEYWORD PARAMETERS: CHOP: If this keyword is set, color values above the upper threshold are set to color index 0. Normally, values above the upper threshold are set to the maximum color index. OUTPUTS: No explicit outputs. COMMON BLOCKS: COLORS: The common block that contains R, G, and B color tables loaded by LOADCT, HSV, HLS and others. SIDE EFFECTS: Image display color tables are loaded. RESTRICTIONS: Common block COLORS must be loaded before calling STRETCH. PROCEDURE: New R, G, and B vectors are created by linearly interpolating the vectors in the common block from Low to High. Vectors in the common block are not changed. If NO parameters are supplied, the original color tables are restored. EXAMPLE: Load the STD GAMMA-II color table by entering: LOADCT, 5 Create and display and image by entering: TVSCL, DIST(300) Now adjust the color table with STRETCH. Make the entire color table fit in the range 0 to 70 by entering: STRETCH, 0, 70 Notice that pixel values above 70 are now colored white. Restore the original color table by entering: STRETCH MODIFICATION HISTORY: DMS, RSI, Dec, 1983. DMS, April, 1987. Changed common. DMS, October, 1987. For unix. DMS, RSI, Nov., 1990. Added GAMMA parameter.
(See C:\RSI\IDL52\lib\stretch.pro)
NAME: STR_SEP PURPOSE: This routine cuts a string into pieces which are separated by the separator string. CATEGORY: String processing. CALLING SEQUENCE: arr = STR_SEP(str, separator) INPUTS: str - The string to be separated. separator - The separator. KEYWORDS: ESC = escape character. Only valid if separator is a single character. Characters following the escape character are treated literally and not interpreted as separators. For example, if the separator is a comma, and the escape character is a backslash, the character sequence 'a\,b' is a single field containing the characters 'a,b'. REMOVE_ALL = if set, remove all blanks from fields. TRIM = if set, remove only leading and trailing blanks from fields. OUTPUT: An array of strings as function value. COMMON BLOCKS: None SIDE EFFECTS: No known side effects. RESTRICTIONS: None. EXAMPLE: array = STR_SEP ("ulib.usca.test", ".") MODIFICATION HISTORY: July 1992, AH, CreaSo Created. December, 1994, DMS, RSI Added TRIM and REMOVE_ALL.
(See C:\RSI\IDL52\lib\str_sep.pro)
NAME: STUDENT1_T PURPOSE: STUDENT1_T returns the probability that an observed value from the Student's t distribution with DF degrees of freedom is less than |X|. CATEGORY: Statistics. CALLING SEQUENCE: Result = STUDENT1_T(X, DF) INPUTS: X: Cutoff. DF: Degrees of freedom. OUTPUT: The probability of |X| or something smaller.
(See C:\RSI\IDL52\lib\obsolete\student1_t.pro)
NAME: STUDENT_T PURPOSE: STUDENT_T returns the cutoff value v such that Probability(X > v) = a1 where X is a random variable from the Student t's distribution with DF degrees of freedom. CATEGORY: Statistics. CALLING SEQUENCE: Result = STUDENT_T(A, DF) INPUT: A1: The probability for which a cutoff is desired. DF: The degrees of freedom OUTPUT: The cutoff value if a is beween 0 and 1 inclusively. Otherwise, -1.
(See C:\RSI\IDL52\lib\obsolete\student_t.pro)
NAME: STUDRANGE PURPOSE: Approximate the quantile P for a studentized range distribution with V degrees of freedom and R samples. P must be between .9 and .90. CATEGORY: Statistics. CALLING SEQUENCE: Result = STUDENT_RANGE(P, V, R) INPUT: P: The probability. .9 <= P <= .99. V: Degrees of freedom. V >=1. R: The number of samples. R > 1. OUTPUT: The cutoff point of the student_range for probability P, degrees of freedom V and sample size R.
(See C:\RSI\IDL52\lib\obsolete\studrange.pro)
NAME: SURFACE_FIT PURPOSE: Determine a polynomial fit to a surface. This function uses POLYWARP to determine the coefficients of the polynomial, then evaluates the polynomial to yield the fit surface. CATEGORY: E2 - Curve and surface fitting. CALLING SEQUENCE: Result = SURFACE_FIT(Data_Surface, Degree) INPUTS: Data_Surface: The two-dimensional array of data to be fit to. The sizes of each dimension may be unequal. Degree: The maximum degree of fit (in one dimension). OPTIONAL INPUT PARAMETERS: None. OUTPUTS: SURFACE_FIT returns a two-dimensional array of values from the evaluation of the polynomial fit. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: The number of data points in data_surface must be greater or equal to (Degree+1)^2. PROCEDURE: Generate coordinate arrays for POLYWARP using the indices as coordinates. The yi and ky arrays for POLYWARP are, in this usage, redundant, so they are sent as dummies. The coefficients returned from POLYWARP are then used in evaluating the polynomial fit to give the surface fit. MODIFICATION HISTORY: Written by: Leonard Sitongia, LASP, University of Colorado, April, 1984. Modified by: Mike Jone, LASP, Sept. 1985. July 1993: JIY, RSI: became obsolete; use SFIT function
(See C:\RSI\IDL52\lib\obsolete\surface_fit.pro)
NAME: SURFR PURPOSE: Set up 3D transformations. This procedure duplicates the rotation, translation, and scaling features of the SURFACE routine. CATEGORY: Graphics, 3D. CALLING SEQUENCE: SURFR [, AX = ax] [, AZ = az] INPUTS: No plain parameters. KEYWORD PARAMETERS: AX: Angle of rotation about the X axis. The default is 30 degrees. AZ: Angle of rotation about the Z axis. The default is 30 degrees. OUTPUTS: No explicit outputs. Results are stored in !P.T. COMMON BLOCKS: None. SIDE EFFECTS: The 4 by 4 matrix, !P.T, the 3D transformation system variable, receives the homogeneous transformation matrix generated by this procedure. RESTRICTIONS: Axonometric projections only. PROCEDURE: 1. Translate the unit cube so that the center (.5,.5,.5) is moved to the origin. 2. Rotate -90 degrees about the X axis to make the +Z axis of the data the +Y axis of the display. The +Y data axis extends from the front of the display to the rear. 3. Rotate about the Y axis AZ degrees. This rotation is counterclockwise as seen from above the page. 4. Rotate about the X axis AX degrees, tilting the data toward the viewer. 5. Translate back to the origin and scale the data so that the data are still contained within the unit cube after transformation. This step uses the user procedure SCALE3D. MODIFICATION HISTORY: DMS, may, 1988.
(See C:\RSI\IDL52\lib\surfr.pro)
NAME: SURF_TRACK PURPOSE: This procedure serves as an example of using the trackball object to manipulate a surface object. CATEGORY: Object graphics. CALLING SEQUENCE: SURF_TRACK, [zData] OPTIONAL INPUTS: zData: A two-dimensional floating point array representing the data to be displayed as a surface. By default, a BESEL function is displayed. MODIFICATION HISTORY: Written by: DD, June 1996
(See C:\RSI\IDL52\examples\object\surf_track.pro)
NAME: SVDFIT PURPOSE: Perform a general least squares fit with optional error estimates. This version uses the Numerical Recipies (2nd Edition) function SVDFIT. A user-supplied function or a built-in polynomial or legendre polynomial is fit to the data. CATEGORY: Curve fitting. CALLING SEQUENCE: Result = SVDFIT(X, Y, [M]) INPUTS: X: A vector representing the independent variable. Y: Dependent variable vector. This vector must be same length as X. OPTIONAL INPUTS: M: The number of coefficients in the fitting function. For polynomials, M is equal to the degree of the polynomial + 1. If not specified and the keyword A is set, then M = N_ELEMENTS(A). INPUT KEYWORDS: A: The inital estimates of the desired coefficients. If M is specified, then A must be a vector of M elements. If A is specified, then the input M can be omitted and M=N_ELEMENTS(A). If not specified, the initial value of each coefficient is taken to be 1.0. If both M and A are specified, them must agree as to the number of paramaters. DOUBLE: Set this keyword to force double precision computations. This is helpful in reducing roundoff errors and improves the chances of function convergence. WEIGHTS: A vector of weights for Y[i]. This vector must be the same length as X and Y. If this parameter is ommitted, 1's (No weighting) are assumed. The error for each term is weighted by Weight[i] when computing the fit. Gaussian or instrumental uncertianties should be weighted as Weight = 1/Sigma where Sigma is the measurement error or standard deviations of Y. For Poisson or statistical weighting use Weight=1/sqrt(Y), since Sigma=sqrt(Y). FUNCTION_NAME: A string that contains the name of an optional user-supplied basis function with M coefficients. If omitted, polynomials are used. The function is called: R=SVDFUNCT(X,M) where X and M are scalar values, and the function value is an M element vector evaluated at X with the M basis functions. M is the degree of the polynomial +1 if the basis functions are polynomials. For example, see the function SVDFUNCT or SVDLEG, in the IDL User Library: For more examples, see Numerical Recipes in C, second Edition, page 676-681. The basis function for polynomials, is R[j] = x)^j. The function must be able to return R as a FLOAT vector or a DOUBLE vector depending on the input type of X. LEGENDRE: Set this keyword to use the IDL function SVDLEG in the lib directory to fit the data to an M element legendre polynomial. This keyword overrides the FUNCTION_NAME keyword. OUTPUTS: SVDFIT returns a vector of the M coefficients fitted to the supplied function. OPTIONAL OUTPUT PARAMETERS: CHISQ: Sum of squared errors multiplied by weights if weights are specified. COVAR: Covariance matrix of the coefficients. VARIANCE: Sigma squared in estimate of each coeff(M). That is sqrt(VARIANCE) equals the 1 sigma deviations of the returned coefficients. SIGMA: The 1-sigma error estimates of the returned parameters, SIGMA=SQRT(VARIANCE). SINGULAR: The number of singular values returned. This value should be 0. If not, the basis functions do not accurately characterize the data. YFIT: Vector of calculated Y's. COMMON BLOCKS: None. SIDE EFFECTS: None. MODIFICATION HISTORY: Adapted from SVDFIT, from the book Numerical Recipes, Press, et. al., Page 518. minor error corrected April, 1992 (J.Murthy) Completely rewritten to use the actual Numerical Recipes routines of the 2nd Edition (V.2.06). Added the DOUBLE, SIGMA, A, and LEGENDRE keywords. Also changed Weight to Weights to match the other fitting routines. EXAMPLE:
(See C:\RSI\IDL52\lib\svdfit.pro)
NAME: SWAP_ENDIAN PURPOSE: This fucntion reverses the byte ordering of arbitrary scalars, arrays or structures. It may be used, for example, to make little endian numbers big, or big endian numbers little. CATEGORY: Utility. CALLING SEQUENCE: Result = SWAP_ENDIAN(A) INPUTS: A: The scalar, array, or structure to be swapped. OUTPUTS: Result: The same type and structure as the input, with the pertinent bytes reversed. PROCEDURE: Swap arrays and scalars directly using BYTEORDER. Swap structures recursively. EXAMPLE: A = SWAP_ENDIAN(A) ;Reverses the "endianness" of A MODIFICATION HISTORY: DMS, RSI, May, 1993. Written. DMS, RSI, July, 1993. Added double complex. AB, RSI, 5 October 1998, Fixed double complex case and updated for pointer, object reference, unsigned 16, 32, and 64-bit integers, and 64-bit signed integers.
(See C:\RSI\IDL52\lib\swap_endian.pro)
NAME: S_TEST PURPOSE: This function tests the hypothesis that two sample popultions, {X[i], Y[i]}, have the same mean of distribution against the hypothesis that they differ. The result is a two-element vector containing the maximum number of signed differences between corresponding pairs of X[i] and Y[i] and the one-tailed level of significance. This type of test is often refered to as the Sign Test. CATEGORY: Statistics. CALLING SEQUENCE: Result = S_test(X, Y) INPUTS: X: An n-element vector of type integer, float or double. Y: An n-element vector of type integer, float or double. KEYWORD PARAMETERS: ZDIFF: Use this keyword to specify a named variable which returns the number of differences between corresponding pairs of X[i] and Y[i] resulting in zero. Paired data resulting in a difference of zero are excluded from the ranking and the sample size is correspondingly reduced. EXAMPLE: Define the n-element vectors of sample data. x = [47, 56, 54, 49, 36, 48, 51, 38, 61, 49, 56, 52] y = [71, 63, 45, 64, 50, 55, 42, 46, 53, 57, 75, 60] Test the hypothesis that two sample popultions, {X[i], Y[i]}, have the same mean of distribution against the hypothesis that they differ at the 0.05 significance level. result = s_test(x, y, zdiff = zdiff) The result should be the 2-element vector: [9.00000, 0.0729981] The keyword parameter should be returned as: zdiff = 0 The computed probability (0.0729981) is greater than the 0.05 significance level and therefore we do not reject the hypothesis that X and Y have the same mean of distribution. PROCEDURE: S_TEST computes the nonparametric Sign Test. Differences between corresponding pairs of X[i] and Y[i] are ranked as either positive or negative with equal probability of occurance. Differences between pairs of X[i] and Y[i] that result in zero are excluded from the ranking and the sample size is correspondingly reduced. The result is a two-element vector [diff, p] containing the maximum number of signed differences between corresponding pairs of X[i] and Y[i] and the one- tailed level of significance. Using the Binomial random variable X, we can accept of reject the proposed hypothesis. If the sample size exceeds 25, then the Gaussian distribution is used to approximate the cumulative Binomial distribution. The one-tailed probability of obtaining at least (diff) signed differences in an n-element sample is equal to (p). Prob(X >= diff) = p. The hypothesis that two sample popultions have the same mean of distribution is rejected if the number of positive ranks and the number of negative ranks differ with statistical significance. REFERENCE: PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition) Ronald E. Walpole & Raymond H. Myers ISBN 0-02-424170-9 MODIFICATION HISTORY: Written by: GGS, RSI, August 1994
(See C:\RSI\IDL52\lib\s_test.pro)
NAME: T3D PURPOSE: Implement three-dimensional transforms. This routine accumulates one or more sequences of translation, scaling, rotation, perspective, and oblique transformations and stores the result in !P.T, the 3D transformation system variable. All the IDL graphic routines use this [4,4] matrix for output. CATEGORY: Graphics. CALLING SEQUENCE: T3D [, /RESET, TRANSLATE = T, SCALE = S, ROTATE = R, ... ] INPUTS: No non-keyword inputs. KEYWORDS: All inputs to T3D are in the form of keywords. Any, all, or none of the following keywords can be present in a call to T3D. The order of the input parameters does not matter. The transformation specified by each keyword is performed in the order of their descriptions below (e.g., if both TRANSLATE and SCALE are specified, the translation is done first): RESET: Set this keyword to reset the transformation to the default identity matrix. TRANSLATE: A three-element vector of the translations in the X, Y, and Z directions. SCALE: A three-element vector of scale factors for the X, Y, and Z axes. ROTATE: A three-element vector of the rotations, in DEGREES, about the X, Y, and Z axes. Rotations are performed in the order of X, Y, and then Z. PERSPECTIVE: Perspective transformation. This parameter is a scalar (p) that indicates the Z distance of the center of the projection. Objects are projected into the XY plane at Z=0, and the "eye" is at point [0,0,p]. OBLIQUE: A two-element vector of oblique projection parameters. Points are projected onto the XY plane at Z=0 as follows: x' = x + z(d COS(a)), and y' = y + z(d SIN(a)). where OBLIQUE[0] = d, and OBLIQUE[1] = a. XYEXCH: Exchange the X and Y axes. XZEXCH: Exchange the X and Z axes. YZEXCH: Exchange the Y and Z axes. MATRIX: Input/Output, If supplied as a 4 x 4 matrix on input, MATRIX contains the starting transformation matrix. If supplied as either a non-zero scalar, or as a 4x4 matrix, the result is returned in this parameter and !P.T is not modified. OUTPUTS: The 4 by 4 transformation matrix !P.T is updated with the resulting transformation, unless the keyword MATRIX is supplied, in which case the result is returned in MATRIX and !P.T is not affected. !P.T3D is NOT set, so for the transformations to have effect you must set !P.T3D = 1 (or set the T3D keyword in subsequent calls to graphics routines). COMMON BLOCKS: None. SIDE EFFECTS: !P.T is changed if the keyword MATRIX is not set. RESTRICTIONS: This routine implements general rotations about the three axes. The routines SURFACE and SHADE_SURF may only be used in conjunction with T3D rotations that project the Z axis in 3 dimensions to a line parallel to the Y axis in 2 dimensions. PROCEDURE: This program follows that of Foley & Van Dam, "Fundamentals of Interactive Computer Graphics", Chapter 8, "Viewing in Three Dimensions". The matrix notation is reversed from the normal IDL sense, i.e., here, the first subscript is the column, the second is the row, in order to conform with the above reference. A right-handed system is used. Positive rotations are COUNTER- CLOCKWISE when looking from a positive axis to the origin. EXAMPLES: To reset the transformation, rotate 30 degs about the X axis and do perspective transformation with the center of the projection at Z = -3, X=0, and Y=0, enter: T3D, /RESET, ROT = [ 30,0,0], PERS = 3. Transformations may be cascaded, for example: T3D, /RESET, TRANS = [-.5,-.5,0], ROT = [0,0,45] T3D, TRANS = [.5,.5,0] The first command resets, translates the point [.5,.5,0] to the center of the viewport, then rotates 45 degrees counterclockwise about the Z axis. The second call to T3D moves the origin back to the center of the viewport. MODIFICATION HISTORY: DMS, Nov, 1987. DMS, June 1990. Fixed bug that didn't scale or translate matrices with perspective properly. DMS, July, 1996. Added MATRIX keyword.
(See C:\RSI\IDL52\lib\t3d.pro)
NAME: TBALL PURPOSE: This object translates widget events for draw widgets into transformations that emulate a virtual trackball (for transforming object graphics in three dimensions). CATEGORY: Object Graphics. CALLING SEQUENCE: To initially create: oTrackball = OBJ_NEW('Trackball', Center, Radius) To update the trackball state based on a widget event: oTrackball->Update, sEvent To re-initialize the trackball state: oTrackball->Reset, Center, Radius To destroy: OBJ_DESTROY, oTrackball INPUTS: TBALL::INIT: Center: A two-dimensional vector, [x,y], representing the requested center (measured in device units) of the trackball. Radius: The requested radius (measured in device units) of the trackball. TBALL::UPDATE: sEvent: The widget event structure. The event type indicates how the trackball state should be updated. TBALL::RESET: Center: A two-dimensional vector, [x,y], representing the requested center (measured in device units) of the trackball. Radius: The requested radius (measured in device units) of the trackball. KEYWORD PARAMETERS: TBALL::INIT: AXIS: Set this keyword to indicate the axis about which rotations are to be constrained if the CONSTRAIN keyword is set to a nonzer value. Valid values include: 0 = X-Axis 1 = Y-Axis 2 = Z-Axis (default) CONSTRAIN: Set this keyword to a nonzero value to indicate that the trackball transformations are to be constrained about a given axis (as specified by the AXIS keyword). The default is zero (no constraints). MOUSE: Set this keyword to a bitmask to indicate which mouse button to honor for trackball events. The least significant bit represents the leftmost button, the next highest bit represents the middle button, and the next highest bit represents the right button. The default is 1b, for the left mouse button. TBALL::UPDATE: TRANSFORM: Set this keyword to a named variable that upon return will contain a floating point 4x4 array if a transformations matrix is calculated as a result of the widget event. TBALL::RESET: AXIS: Set this keyword to indicate the axis about which rotations are to be constrained if the CONSTRAIN keyword is set to a nonzer value. Valid values include: 0 = X-Axis 1 = Y-Axis 2 = Z-Axis (default) CONSTRAIN: Set this keyword to a nonzero value to indicate that the trackball transformations are to be constrained about a given axis (as specified by the AXIS keyword). The default is zero (no constraints). MOUSE: Set this keyword to a bitmask to indicate which mouse button to honor for trackball events. The least significant bit represents the leftmost button, the next highest bit represents the middle button, and the next highest bit represents the right button. The default is 1b, for the left mouse button. OUTPUTS: TBALL::UPDATE: This function returns a 1 if a transformation matrix is calculated as a result of the widget event, or 0 otherwise. EXAMPLE: Create a trackball centered on a 512x512 pixel drawable area, and a view containing the model to be manipulated: xdim = 512 ydim = 512 wBase = WIDGET_BASE() wDraw = WIDGET_DRAW(wBase, XSIZE=xdim, YSIZE=ydim, $ GRAPHICS_LEVEL=2, /BUTTON_EVENTS, $ /MOTION_EVENTS, /EXPOSE_EVENTS, RETAIN=0 ) WIDGET_CONTROL, wBase, /REALIZE WIDGET_CONTROL, wDraw, GET_VALUE=oWindow oTrackball = OBJ_NEW('Trackball', [xdim/2.,ydim/2.], xdim/2.) oView = OBJ_NEW('IDLgrView') oModel = OBJ_NEW('IDLgrModel') oView->Add, oModel XMANAGER, 'TrackEx', wBase In the widget event handler, handle trackball updates. As the trackball transformation changes, update the transformation for a model object (instance of IDLgrModel), and redraw the view: PRO TrackEx_Event, sEvent ... bHaveXform = oTrackball->Update( sEvent, TRANSFORM=TrackXform ) IF (bHaveXform) THEN BEGIN oModel->GetProperty, TRANSFORM=ModelXform oModel->SetProperty, TRANSFORM=ModelXform # TrackXform oWindow->Draw, oView ENDIF ... END MODIFICATION HISTORY: Written by: DD, December 1996
(See C:\RSI\IDL52\examples\doc\ActiveX\VBObjGraph\Tball__define.pro)
NAME: TEK_COLOR PURPOSE: Load a color table similar to the default Tektronix 4115 color table. CATEGORY: Graphics. CALLING SEQUENCE: TEK_COLOR [[, Start_index] , Ncolors] INPUTS: Start_index = optional starting index of palette. If omitted, use 0. Ncolors = Number of colors to load. 32 is the max and the default. KEYWORD PARAMETERS: None. OUTPUTS: No explicit outputs. COMMON BLOCKS: Colors. SIDE EFFECTS: Ncolors color indices, starting at Start_index are loaded with the Tektronix 4115 default color map. RESTRICTIONS: None. PROCEDURE: Just copy the colors. This table is useful for the display of graphics in that the colors are distinctive. Basic colors are: 0 - black, 1 - white, 2 - red, 3 - green, 4 - blue, 5 - cyan, 6 - magenta, 7 - yellow, 8 - orange, etc. MODIFICATION HISTORY: DMS, Jan, 1989. DMS, June, 1992. Added colors common. DMS, Apr, 1993, Added start_index and ncolors.
(See C:\RSI\IDL52\lib\tek_color.pro)
NAME: TEST_HP PURPOSE: Generate HP-GL output to test features of the driver. CATEGORY: Graphics Drivers. CALLING SEQUENCE: TEST_HP INPUTS: None. KEYWORD PARAMETERS: EVASDROP - If this keyword *and* SMART are present, the output is sent directly to the terminal with an evasdrop configuration assummed. SMART - If this keyword is present, it is assummed that the plotter has a sheet feeder and is able to do polygon filling. The HP7550A is an example of such a plotter. OUTPUTS: If the SMART keyword is present, a file named hpdemo.1 is created containing 4 pages of plotter output. If SMART and EVASDROP are present, the output goes to the terminal. Otherwise, three files named hpdemo.1, hpdemo.2, and hpdemo.3 are created containing one page of output each. RESTRICTIONS: Expects the plotter to have 6 pens. SIDE EFFECTS: Output file(s) are created. MODIFICATION HISTORY: AB, July, 1989.
(See C:\RSI\IDL52\lib\test_hp.pro)
Procedure to load a group of 16, 8, or 4 (depending on keyword) colors for the LJ-250 . If 8 or fewer colors are to be defined, it is assumed that 180 dpi resolution mode will be accessed. In this case, selection is from a pre-defined set of 8 colors. For 16 colors, any combination of the 256 available LJ-250 colors may be selected. The group chosen here is an attempt to select a table which uses a variety of colors, while maintaining some gradation between color intensities.
(See C:\RSI\IDL52\lib\test_lj.pro)
Procedure to test the basic plotting capabilities of the LJ-250 driver, including color selection.
(See C:\RSI\IDL52\lib\test_lj.pro)
Procedure to test the monochrome linestyle capability of the IDL LJ-250 driver.
(See C:\RSI\IDL52\lib\test_lj.pro)
Procedure to generate a series of TV images on a page, for an LJ-250 driver test. Monochrome (depth=1) is used, so that the dithering may be tested.
(See C:\RSI\IDL52\lib\test_lj.pro)
Procedure to test landscape and portrait graphics using both 90 and 180 dpi LJ-250 resolutions. A total of four output files will be generated.
(See C:\RSI\IDL52\lib\test_lj.pro)
Procedure to create two disk files illustrating different depth (bit plane) renditions available on the LJ-250 .
(See C:\RSI\IDL52\lib\test_lj.pro)
Procedure to create an output file for use on the LJ-250, which will use the library procedure SHOW3.
(See C:\RSI\IDL52\lib\test_lj.pro)
NAME: test_lj PURPOSE: To exercise and demonstrate various aspects of the IDL driver for the Digital Equipment Corporation LJ-250 color printer. CATEGORY: Graphics Drivers. CALLING SEQUENCE: test_lj - Calls all test procedures, which may also be individually called: lj_plot_test - plot, contour, surface, plots, and vector fonts lj_line_test - test of linestyles lj_image_test - raster image output, for various dithering options lj_resolution_test - test the two available resolutions (90 and 180dpi) lj_depth_test - test different depth (bit plane) renditions lj_show3_test - test the output using the SHOW3 procedure INPUTS: None OPTIONAL INPUT PARAMETERS: None KEYWORD PARAMETERS: None OUTPUTS: Creates LJ-250 compatible disk files: lj_plot_test.lj, lj_line_test.lj, lj_image_test.lj, lj_90*.lj, lj_180*.lj, lj_depth123_test.lj, lj_depth4_test.lj, and lj_show3_test.lj . These files are not automatically submitted for printing; neither are they deleted automatically. To print the .lj files properly on a VMS system, it is recommended that the /PASSALL qualifier be used with the PRINT command, to pass all file information directly to the lj printer. OPTIONAL OUTPUT PARAMETERS: None COMMON BLOCKS: None SIDE EFFECTS: Many .lj files will be created and left in the default directory. RESTRICTIONS: Designed for IDL Version 2; not compatible with VMS IDL Version 1. PROCEDURE: The called routines try different permutations of the allowable keywords to the DEVICE procedure for the LJ-250. Vector plotting, contour, line drawing, and surface plots are generated, as well as a series of images which test all dithering methods. The two resolutions of the LJ-250 are tested, and specific color maps are used and tested. MODIFICATION HISTORY: Written, August 1990, TJA (derived from demo_pcl)
(See C:\RSI\IDL52\lib\test_lj.pro)
Procedure to test the basic plotting capabilities of the pcl driver
(See C:\RSI\IDL52\lib\test_pcl.pro)
Procedure to generate a series of TV images on a page, for a pcl driver test
(See C:\RSI\IDL52\lib\test_pcl.pro)
Procedure to test the linestyle capability of the IDL pcl driver
(See C:\RSI\IDL52\lib\test_pcl.pro)
Procedure to test landscape and portrait graphics using all three optimization methods. A total of six output files will be generated. Note: All three optimization levels (0,1,2) are used; since not all devices will support all levels, garbage could result.
(See C:\RSI\IDL52\lib\test_pcl.pro)
NAME: test_pcl PURPOSE: To exercise and demonstrate various aspects of the HP PCL (Printer Command Language) IDL driver. CATEGORY: Graphics Drivers. CALLING SEQUENCE: test_pcl - Calls all test procedures, which may also be individually called: pcl_plot_test - plot, contour, surface, plots, and vector fonts pcl_line_test - test of linestyles pcl_image_test - raster image output, with various dithering options pcl_optimize_test - test file compression (optimization) methods INPUTS: None OPTIONAL INPUT PARAMETERS: None KEYWORD PARAMETERS: None OUTPUTS: Creates PCL disk files: pcl_plot_test.pcl, pcl_line_test.pcl, pcl_image_test.pcl, pcl_opt*_land.pcl, and pcl_opt*_port.pcl. These files are not automatically submitted for printing; neither are they deleted automatically. To print the .pcl files properly on a VMS system, it is recommended that the /PASSALL qualifier be used with the PRINT command, to pass all file information directly to the pcl printer. OPTIONAL OUTPUT PARAMETERS: None COMMON BLOCKS: None SIDE EFFECTS: Many .pcl files will be created and left in the default directory. RESTRICTIONS: Designed for IDL Version 2; not compatible with VMS IDL Version 1. Procedure pcl_optimize_test uses all three (0,1,2) optimization levels; since some devices do not support all of these levels, garbage may result. Specifically, the HP LaserJet II does not support optimization level 1; optimization 2 was primarily designed for it. The HP DeskJet Plus supports all three optimizations. PROCEDURE: The called routines try different permutations of the allowable keywords to the DEVICE procedure for PCL. Vector plotting, contour, line drawing, and surface plots are generated, as well as a series of gray-scale images which test all dithering methods. File optimization options are also tested. MODIFICATION HISTORY: Written, June 1990, TJA
(See C:\RSI\IDL52\lib\test_pcl.pro)
NAME: THREED PURPOSE: Plot a 2D array as a pseudo 3D plot. CATEGORY: J7 Plotting, graphics, multi-dimensional. CALLING SEQUENCE: THREED, A [, Sp] INPUTS: A: The two-dimensional array to plot. OPTIONAL INPUT PARAMETERS: Sp: Spacing between plot lines. If sp is omitted, the spacing is set to: (MAX(A)-MIN(A))/ROWS If Sp is negative, hidden lines are not removed. KEYWORDS: TITLE: The main plot title. XTITLE: The X axis title. YTITLE: The Y axis title. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: A plot is produced on the currently selected graphics device. RESTRICTIONS: Orientation of data is fixed. Use the built-in procedure SURFACE for a more comprehensive surface plotting routine. PROCEDURE: Straightforward. A vector is maintained of the previous maximum plotted Y. The PLOT and OPLOT procedures are used. MODIFICATION HISTORY: VERSION 1.2, CREATED BY D. LINDLER, AUGUST 5,1980 VERSION 1.3, CREATED BY I. DEAN AHMAD, JANUARY 28, 1981 MODIFIED FOR VAX, DMS, SEPT, 1982. Modified for Unix, DMS, 2/15/88.
(See C:\RSI\IDL52\lib\threed.pro)
NAME: TIFF_DUMP PURPOSE: Dump the Image File Directories of a TIFF File. This procedure is used mainly for debugging. CATEGORY: Input/output. CALLING SEQUENCE: TIFF_DUMP, Filename INPUTS: Filename: string containing the name of file to read. The default extension is ".TIF". OUTPUTS: All output is to the terminal. Each TIFF Image File Directory entry is printed. COMMON BLOCKS: TIFF_COM. Only for internal use. SIDE EFFECTS: A file is read. RESTRICTIONS: Not all of the tags have names encoded. In particular, Facsimile, Document Storage and Retrieval, and most no-longer recommended fields are not encoded. PROCEDURE: The TIFF file Header and the IFD (Image File Directory) are read and listed. MODIFICATION HISTORY: DMS, Apr, 1991. Extracted from TIFF_READ. DMS, Dec, 1994. Added private tags
(See C:\RSI\IDL52\lib\obsolete\tiff_dump.pro)
NAME: TIFF_READ PURPOSE: Read TIFF format images. CATEGORY: Input/output. CALLING SEQUENCE: Result = TIFF_READ(Filename [,R, G, B]) INPUTS: Filename: A string containing the name of file to read. The default extension is ".TIF". OUTPUTS: TIFF_READ returns an 8, 16, or 32-bit array containing the image data. The dimensions of the result are the same as defined in the TIFF file: [Columns, Rows]. The data type of the image is same as the type of samples in the image file. For TIFF images that are RGB interleaved by pixel, the output dimensions are [3, Cols, Rows]. For TIFF images that are RGB interleaved by image, on output Planarconfig is set to 2, and the result is the integer value zero. In this case, three separate images are returned in the R, G, and B output parameters. OPTIONAL OUTPUTS: R, G, B: Variables to hold the Red, Green, and Blue color vectors extracted from TIFF Class P, Palette Color images. For TIFF images that are RGB interleaved by image (Planarconfig returned as 2) the R, G, and B variables each hold an image with the dimensions [Columns, Rows]. KEYWORDS: UNSIGNED: If set, return TIFF files containing unsigned 16-bit integers as signed 32-bit longword arrays. If not set, return a signed 16-bit integer for these files. In this case, data values between 32768 and 65535 are returned as negative values between -32768 and -1. This keyword has no effect if the input file does not contain 16-bit integers. To manually convert unsigned 16-bit to 32-bit: l32 = long(u16) neg = where(l32 lt 0, count) if count ne 0 then l32[neg] = 65536 + l32[neg] The following keywords are used for output parameters only: ORDER: The order parameter from the TIFF File. This parameter is returned as 0 for images written bottom to top, and 1 for images written top to bottom. If the Orientation parameter does not appear in the TIFF file, an order of 1 is returned. PLANARCONFIG: This parameter is returned as 1 for TIFF files that are GrayScale, Palette, or RGB color interleaved by pixel. This parameter is returned as 2 for RGB color TIFF files interleaved by image. COMMON BLOCKS: TIFF_COM. Only for internal use. SIDE EFFECTS: A file is read. RESTRICTIONS: Handles TIFF classes G, P, and R. One image per file. EXAMPLE: Read the file "my.tiff" in the current directory into the variable IMAGE, and save the color tables in the variables, R, G, and B by entering: IMAGE = TIFF_READ("my.tiff", R, G, B) To view the image, load the new color table and display the image by entering: TVLCT, R, G, B TV, IMAGE MODIFICATION HISTORY: DMS, Written for VMS in 1985. DMS, April, 1991. Rewrote and added class R and P images. DMS, Jan, 1992. Fixed bug for images without a RowsPerStrip field. DJC, Nov, 1993. Fixed doc header. DMS, Dec, 1994. Fixed bug with private tags. MWR, Mar, 1995. Fixed bug when opening non-existent file. DMS, Aug, 1995. Added support for 16 and 32 bit samples. DMS, Aug, 1996. Added UNSIGNED keyword.
(See C:\RSI\IDL52\lib\obsolete\tiff_read.pro)
NAME: TIFF_WRITE PURPOSE: Write images in TIFF format. CATEGORY: Input/output. CALLING SEQUENCE: TIFF_WRITE, Filename, Array [, Orientation] INPUTS: Filename: A string containing the name of file to create. Array: The image data to be written. If not already a byte array, it is made a byte array. Array may be either an [n, m] array for Grayscale or Palette classes, or a [3, n, m] array for RGB full color, interleaved by image. If the PLANARCONFIG keyword (see below) is set to 2 then the Array parameter is ignored (and may be omitted). See PROCEDURE below for more information on TIFF classes. OPTIONAL INPUT PARAMETERS: Orientation: This parameter should be 0 if the image is stored from bottom to top (the default). For images stored from top to bottom, this parameter should be 1. WARNING: Not all TIFF readers are capable of reversing the scan line order. If in doubt, first convert the image to top to bottom order (use the IDL REVERSE() function), and set Orientation to 1. OPTIONAL KEYWORD PARAMETERS: RED, GREEN, BLUE: The color table vectors, scaled from 0 to 255 in the case of a Class P, Palette color image. If, PlanarConfig is 2, these parameters must contain the 3 color component image parameters. LONG: If set, write the samples as 32 bit signed numbers. PLANARCONFIG: Set this parameter to 2 if writing an RGB image that is contained in three separate images (color planes), specified in the RED, GREEN, and BLUE parameters. Otherwise, omit this parameter (or set it to 1). SHORT: If set, write the samples as 16 bit signed numbers. If neither SHORT or LONG are specified, write samples as unsigned 8-bit numbers. XRESOL: The horizontal resolution, in pixels per inch. The default is 100. YRESOL: The vertical resolution, in pixels per inch. The default is 100. OUTPUTS: No explicit inputs. COMMON BLOCKS: TIFF_COM. Only for internal use. SIDE EFFECTS: A file is created and written. RESTRICTIONS: This procedure writes images in a single strip, or 3 strips when PLANARCONFIG is set to 2. This procedure may cause readers with memory limitations problems. PROCEDURE/EXAMPLES: Four types of TIFF files can be written: TIFF Class G, Grayscale. Array contains the 8-bit image array. A value of 0 is black, 255 is white. The Red, Green, and Blue keywords are omitted. Example: TIFF_WRITE, 'a.tiff', Array TIFF Class P, Palette Color. Array contains the 8-bit image array. The keyword parameters RED, GREEN, and BLUE contain the color tables, which can have up to 256 elements, scaled from 0 to 255. Example: TIFF_WRITE, 'a.tiff', Array, RED = r, GREEN = g, BLUE = b TIFF Class R, RGB Full Color, color interleaved by pixel. Array contains the byte data, and is dimensioned [3, cols, rows]. Example: TIFF_WRITE, 'a.tiff', Array TIFF Class R, RGB Full Color, color interleaved by image. Input is three separate images, provided in the keyword parameters RED, GREEN, and BLUE. The input parameter "Array" is ignored. The keyword PLANARCONFIG must be set to 2 in this case. Example: TIFF_WRITE, 'a.tiff', RED = r, GREEN = g, BLUE = b, PLAN = 2 MODIFICATION HISTORY: DMS, Written for VMS in 1985. DMS, April, 1991. Rewrote and added class R and P images. DJC, Nov, 1993. Fixed doc header. DMS, Aug, 1995. Added support for 16 and 32 bit samples.
(See C:\RSI\IDL52\lib\obsolete\tiff_write.pro)
NAME: TIME_TEST PURPOSE: General purpose IDL benchmark program that performs approximately 20 common operations and prints the time required. CATEGORY: Miscellaneous. CALLING SEQUENCE: TIME_TEST [, Filename] OPTIONAL INPUTS: Filename: The string containing the name of output file for the results of the time test. KEYWORD PARAMETERS: NoFileIO = Optional keyword when set disables file Input/Output operations. Results from tests run in demo mode may be compared to those run in full mode with this keyword set. OUTPUTS: No explicit outputs. Results of the test are printed to the screen or to a file. OPTIONAL OUTPUT PARAMETERS: None. COMMON BLOCKS: TIMER_COMMON SIDE EFFECTS: Many operations are performed. Files are written, etc. RESTRICTIONS: Could be more complete, and could segregate integer, floating point and file system IO times into separate figures. PROCEDURE: Straightforward. See also the procedure GRAPHICS_TEST, in this file, which times a few of the common graphics operations. We make no claim that these times are a fair or accurate measure of computer performance. In particular, different versions of IDL were used. Graphics performance varies greatly, depending largely on the window system, or lack of thereof. Typical times obtained to date include: (where Comp. = computational tests Graphics = graphics tests Geo. Avg. = geometric average) Machine / OS / Memory Comp. Geo. Avg. Graphics Geo. Avg. MicroVAX II, VMS 5.1, 16MB 637 14.4 39.9 6.57 MicroVAX II, Ultrix 3.0, 16MB 616 13.9 58.1 8.27 Sun 3/110, SunOS 4.0, 12MB 391 8.19 32.0 7.81 Sun 3/80, 12MB, 24 bit color 282 6.03 89.3 21.7 PC 386 25MHz, 80387, MSDOS, 4MB 276 6.9 29.5 5.94 Mips R2030, RISC/os 4.1, 8MB 246 3.67 14.6 2.62 VAXStation 3100, VMS 5.1, 16MB 235 5.13 24.3 3.71 HP 9000, Model 375, ?? ?? 163 4.14 20.8 3.37 DecStation 3100, UWS 2.1, 16MB 150 4.00 17.6 3.23 486 33mhz Clone, MS Windows, 8MB 70 1.81 12.9 3.00 Sun 4/65, SunOS 4.1, 16MB 66 1.81 7.0 1.64 Silicon Graphics 4D/25, ?? 51 1.38 19.4 2.44 Sun 4/50 IPX, 16MB 40 1.03 7.7 0.80 IBM 6000 Model 325 24MB 40 0.87 5.8 1.21 HP 9000 / 720 48 MB 20 0.52 5.0 0.70 SGI Indigo XS4000, 32MB 20 0.46 2.1 0.44 SGI Indigo2, 150Mhz, 32MB 16 0.32 2.4 0.51 DEC Alpha 3000/500, 224MB 13 0.30 2.3 0.43 MODIFICATION HISTORY: DMS, 1986. DMS, Revised July 1990, Increased the size of arrays and the number of repetitions to make most of the tests take longer. This is to eliminate the effect of clock granularity and to acknowledge that machines are becoming faster. Many of the tests were made longer by a factor of 10. MWR, Jan 1995, Modified to run in demo mode. All routines except TIME_COMPARE now run in demo mode. Added platform and version information. Added NoFileIO keyword.
(See C:\RSI\IDL52\lib\time_test.pro)
NAME: TIME_TEST2 PURPOSE: This is a wrapper on the procedure TIME_TEST2_INTERNAL contained in the file time_test.pro. Please see that file for further information. The reason for doing it this way is so that the various time_test and graphics_test routines can stay in a single file while still being easily callable.
(See C:\RSI\IDL52\lib\time_test2.pro)
NAME: TIME_TEST3 PURPOSE: This is a wrapper on the procedure TIME_TEST3_INTERNAL contained in the file time_test.pro. Please see that file for further information. The reason for doing it this way is so that the various time_test and graphics_test routines can stay in a single file while still being easily callable.
(See C:\RSI\IDL52\lib\time_test3.pro)
NAME: TM_TEST PURPOSE: This function computes the Student's t-statistic and the probability that two vectors of sampled data have significantly different means. The default assumption is that the data is drawn from populations with the same true variance. This type of test is often refered to as the T-means Test. CATEGORY: Statistics. CALLING SEQUENCE: Result = TM_TEST(X, Y) INPUTS: X: An n-element vector of type integer, float or double. Y: An m-element vector of type integer, float or double. If the PAIRED keyword is set, X and Y must have the same number of elements. KEYWORD PARAMETERS: PAIRED: If set to a non-zero value, X and Y are assumed to be paired samples and must have the same number of elements. UNEQUAL: If set to a non-zero value, X and Y are assumed to be from populations with unequal variances. EXAMPLE Define two n-element vectors of tabulated data. X = [257, 208, 296, 324, 240, 246, 267, 311, 324, 323, 263, 305, $ 270, 260, 251, 275, 288, 242, 304, 267] Y = [201, 56, 185, 221, 165, 161, 182, 239, 278, 243, 197, 271, $ 214, 216, 175, 192, 208, 150, 281, 196] Compute the Student's t-statistic and its significance assuming that X and Y belong to populations with the same true variance. The result should be the two-element vector [5.5283890, 2.5245510e-06], indicating that X and Y have significantly different means. result = tm_test(X, Y) PROCEDURE: TM_TEST computes the t-statistic of X and Y as the ratio; (difference of sample means) / (standard error of differences) and its significance (the probability that |t| could be at least as large large as the computed statistic). X and Y may be of different lengths. The result is a two-element vector containing the t-statistic and its significance. The significance is a value in the interval [0.0, 1.0]; a small value (0.05 or 0.01) indicates that X and Y have significantly different means. REFERENCE: Numerical Recipes, The Art of Scientific Computing (Second Edition) Cambridge University Press ISBN 0-521-43108-5 MODIFICATION HISTORY: Written by: GGS, RSI, Aug 1994 TM_TEST is based on the routines: ttest.c, tutest.c and tptest.c described in section 14.2 of Numerical Recipes, The Art of Scientific Computing (Second Edition), and is used by permission.
(See C:\RSI\IDL52\lib\tm_test.pro)
NAME: TRACE PURPOSE: This function computes the trace of an N by N array. CATEGORY: Linear Algebra. CALLING SEQUENCE: Result = TRACE(A) INPUTS: A: An N by N real or complex array. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE: Define an array, A. A = [[ 2.0, 1.0, 1.0, 1.5], $ [ 4.0, -6.0, 0.0, 0.0], $ [-2.0, 7.0, 2.0, 2.5], $ [ 1.0, 0.5, 0.0, 5.0]] Compute the trace of A. Result = TRACE(A) The result should be: 3.00000 REFERENCE: ADVANCED ENGINEERING MATHEMATICS (seventh edition) Erwin Kreyszig ISBN 0-471-55380-8 MODIFICATION HISTORY: Written by: GGS, RSI, January 1996
(See C:\RSI\IDL52\lib\trace.pro)
NAME: TRACKBALL PURPOSE: This object translates widget events for draw widgets into transformations that emulate a virtual trackball (for transforming object graphics in three dimensions). CATEGORY: Object Graphics. CALLING SEQUENCE: To initially create: oTrackball = OBJ_NEW('Trackball', Center, Radius) To update the trackball state based on a widget event: oTrackball->Update, sEvent To re-initialize the trackball state: oTrackball->Reset, Center, Radius To destroy: OBJ_DESTROY, oTrackball INPUTS: TRACKBALL::INIT: Center: A two-dimensional vector, [x,y], representing the requested center (measured in device units) of the trackball. Radius: The requested radius (measured in device units) of the trackball. TRACKBALL::UPDATE: sEvent: The widget event structure. The event type indicates how the trackball state should be updated. TRACKBALL::RESET: Center: A two-dimensional vector, [x,y], representing the requested center (measured in device units) of the trackball. Radius: The requested radius (measured in device units) of the trackball. KEYWORD PARAMETERS: TRACKBALL::INIT: AXIS: Set this keyword to indicate the axis about which rotations are to be constrained if the CONSTRAIN keyword is set to a nonzer value. Valid values include: 0 = X-Axis 1 = Y-Axis 2 = Z-Axis (default) CONSTRAIN: Set this keyword to a nonzero value to indicate that the trackball transformations are to be constrained about a given axis (as specified by the AXIS keyword). The default is zero (no constraints). MOUSE: Set this keyword to a bitmask to indicate which mouse button to honor for trackball events. The least significant bit represents the leftmost button, the next highest bit represents the middle button, and the next highest bit represents the right button. The default is 1b, for the left mouse button. TRACKBALL::UPDATE: MOUSE: Set this keyword to a bitmask to indicate which mouse button to honor for trackball events. The least significant bit represents the leftmost button, the next highest bit represents the middle button, and the next highest bit represents the right button. The default is 1b, for the left mouse button. TRANSFORM: Set this keyword to a named variable that upon return will contain a floating point 4x4 array if a transformations matrix is calculated as a result of the widget event. TRANSLATE: Set this keyword to indicate that the trackball movement should be constrained to x and y translation rather than rotation about an axis. TRACKBALL::RESET: AXIS: Set this keyword to indicate the axis about which rotations are to be constrained if the CONSTRAIN keyword is set to a nonzer value. Valid values include: 0 = X-Axis 1 = Y-Axis 2 = Z-Axis (default) CONSTRAIN: Set this keyword to a nonzero value to indicate that the trackball transformations are to be constrained about a given axis (as specified by the AXIS keyword). The default is zero (no constraints). MOUSE: Set this keyword to a bitmask to indicate which mouse button to honor for trackball events. The least significant bit represents the leftmost button, the next highest bit represents the middle button, and the next highest bit represents the right button. The default is 1b, for the left mouse button. OUTPUTS: TRACKBALL::UPDATE: This function returns a 1 if a transformation matrix is calculated as a result of the widget event, or 0 otherwise. EXAMPLE: Create a trackball centered on a 512x512 pixel drawable area, and a view containing the model to be manipulated: xdim = 512 ydim = 512 wBase = WIDGET_BASE() wDraw = WIDGET_DRAW(wBase, XSIZE=xdim, YSIZE=ydim, $ GRAPHICS_LEVEL=2, /BUTTON_EVENTS, $ /MOTION_EVENTS, /EXPOSE_EVENTS, RETAIN=0 ) WIDGET_CONTROL, wBase, /REALIZE WIDGET_CONTROL, wDraw, GET_VALUE=oWindow oTrackball = OBJ_NEW('Trackball', [xdim/2.,ydim/2.], xdim/2.) oView = OBJ_NEW('IDLgrView') oModel = OBJ_NEW('IDLgrModel') oView->Add, oModel XMANAGER, 'TrackEx', wBase In the widget event handler, handle trackball updates. As the trackball transformation changes, update the transformation for a model object (instance of IDLgrModel), and redraw the view: PRO TrackEx_Event, sEvent ... bHaveXform = oTrackball->Update( sEvent, TRANSFORM=TrackXform ) IF (bHaveXform) THEN BEGIN oModel->GetProperty, TRANSFORM=ModelXform oModel->SetProperty, TRANSFORM=ModelXform # TrackXform oWindow->Draw, oView ENDIF ... END MODIFICATION HISTORY: Written by: DD, December 1996
(See C:\RSI\IDL52\lib\trackball__define.pro)
NAME: TRI_SURF PURPOSE: This function Interpolates a regularly or irregularly gridded set of points with a smooth quintic surface. CATEGORY: Mathematical functions, Interpolation, Surface Fitting CALLING SEQUENCE: Result = TRI_SURF(Z [, X, Y]) INPUTS: X, Y, Z: arrays containing the X, Y, and Z coordinates of the data points on the surface. Points need not be regularly gridded. For regularly gridded input data, X and Y are not used: the grid spacing is specified via the XGRID and YGRID (or XVALUES and YVALUES) keywords, and Z must be a two dimensional array. For irregular grids, all three parameters must be present and have the same number of elements. KEYWORD PARAMETERS: Input grid description: REGULAR: if set, the Z parameter is a two dimensional array of dimensions [N,M], containing measurements over a regular grid. If any of XGRID, YGRID, XVALUES, YVALUES are specified, REGULAR is implied. REGULAR is also implied if there is only one parameter, Z. If REGULAR is set, and no grid (_VALUE or _GRID) specifications are present, the respective grid is set to (0, 1, 2, ...). XGRID: contains a two element array, [xstart, xspacing], defining the input grid in the X direction. Do not specify both XGRID and XVALUES. XVALUES: if present, XVALUES[i] contains the X location of Z[i,j]. XVALUES must be dimensioned with N elements. YGRID: contains a two element array, [ystart, yspacing], defining the input grid in the Y direction. Do not specify both YGRID and YVALUES. YVALUES: if present, YVALUES[i] contains the Y location of Z[i,j]. YVALUES must be dimensioned with N elements. Output grid description: GS: If present, GS must be a two-element vector [XS, YS], where XS is the horizontal spacing between grid points and YS is the vertical spacing. The default is based on the extents of X and Y. If the grid starts at X value Xmin and ends at Xmax, then the default horizontal spacing is (Xmax - Xmin)/(NX-1). YS is computed in the same way. The default grid size, if neither NX or NY are specified, is 26 by 26. BOUNDS: If present, BOUNDS must be a four element array containing the grid limits in X and Y of the output grid: [Xmin, Ymin, Xmax, Ymax]. If not specified, the grid limits are set to the extent of X and Y. NX: The output grid size in the X direction. NX need not be specified if the size can be inferred from GS and BOUNDS. The default value is 26. NY: The output grid size in the Y direction. See NX. Others: EXTRAPOLATE: If set, extrapolate the surface to points outside the convex hull of input points. Has no effect if input points are regularly gridded. MISSING: If set, points outside the convex hull of input points are set to this value. Default is 0. Has no effect if input points are regularly gridded. LINEAR: If set, linear interpolation, rather than quintic is used. Gradient estimates are not used. This is faster and numerically stable, but does not extrapolate. OUTPUTS: This function returns a two-dimensional floating point array containing the interpolated surface, sampled at the grid points. RESTRICTIONS: The output grid must enclose convex hull of the input points. PROCEDURE: This routine is similar to MIN_CURVE_SURF but the surface fitted is a smooth surface, not a minimum curvature surface. This routine has the advantage of being much more efficient for larger numbers of points. The built-in IDL routines TRIANGULATE and TRIGRID(/QUINTIC) are used. EXAMPLES: Example 1: Irregularly gridded cases Make a random set of points that lie on a gaussian: n = 15 ;# random points x = RANDOMU(seed, n) y = RANDOMU(seed, n) z = exp(-2 * ((x-.5)^2 + (y-.5)^2)) ;The gaussian get a 26 by 26 grid over the rectangle bounding x and y: r = TRI_SURF(z, x, y) ;Get the surface. Or: get a surface over the unit square, with spacing of 0.05: r = TRI_SURF(z, x, y, GS=[0.05, 0.05], BOUNDS=[0,0,1,1]) Or: get a 10 by 10 surface over the rectangle bounding x and y: r = TRI_SURF(z, x, y, NX=10, NY=10) Example 2: Regularly gridded cases Make some random data z = randomu(seed, 5, 6) interpolate to a 26 x 26 grid: CONTOUR, TRI_SURF(z, /REGULAR) MODIFICATION HISTORY: DMS, RSI, October, 1993. Written. DMS, RSI, Jan, 1996. Added LINEAR keyword.
(See C:\RSI\IDL52\lib\tri_surf.pro)
NAME: TS_COEF PURPOSE: This function computes the coefficients used in a Pth order autoregressive time-series forecasting/backcasting model. The result is a P-element vector whose type is identical to X. CATEGORY: Statistics. CALLING SEQUENCE: Result = TS_COEF(X, P) INPUTS: X: An n-element vector of type float or double containing time- series samples. P: A scalar of type integer or long integer that specifies the number of coefficients to be computed. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. MSE: Use this keyword to specify a named variable which returns the mean square error of the Pth order autoregressive model. EXAMPLE: Define an n-element vector of time-series samples. x = [6.63, 6.59, 6.46, 6.49, 6.45, 6.41, 6.38, 6.26, 6.09, 5.99, $ 5.92, 5.93, 5.83, 5.82, 5.95, 5.91, 5.81, 5.64, 5.51, 5.31, $ 5.36, 5.17, 5.07, 4.97, 5.00, 5.01, 4.85, 4.79, 4.73, 4.76] Compute the coefficients of a 5th order autoregressive model. result = TS_COEF(x, 5) The result should be: [1.30168, -0.111783, -0.224527. 0.267629, -0.233363] REFERENCE: The Analysis of Time Series, An Introduction (Fourth Edition) Chapman and Hall ISBN 0-412-31820-2 MODIFICATION HISTORY: Written by: GGS, RSI, November 1994 Modified: GGS, RSI, January 1996 Added DOUBLE keyword. Modified: GGS, RSI, June 1996 Replaced nested FOR loop with vector ops. Faster execution for values of P > 100.
(See C:\RSI\IDL52\lib\ts_coef.pro)
NAME: TS_DIFF PURPOSE: This function recursively computes the forward differences, of an N-element time-series, K times. The result is an N-element differenced time-series with its last K elements as zeros. CATEGORY: Statistics. CALLING SEQUENCE: Result = TS_Diff(X, K) INPUTS: X: An n-element vector of type integer, float or double containing time-series samples. K: A positive scalar of type integer or long integer in the interval [1, N_ELEMENTS(X) - 1], that specifies the number of times X is differenced. KEYWORD PARAMETERS: DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE: Define an n-element vector of time-series samples. x = [389, 345, 303, 362, 412, 356, 325, 375, $ 410, 350, 310, 388, 399, 362, 325, 382, $ 399, 382, 318, 385, 437, 357, 310, 391] Compute the second forward differences of X. result = TS_DIFF(x, 2) The result should be: [ 2, 101, -9, -106, 25, 81, -15, -95, $ 20, 118, -67, -48, 0, 94, -40, -34, $ -47, 131, -15, -132, 33, 128, 0, 0] REFERENCE: The Analysis of Time Series (Fourth Edition) C. Chatfield ISBN 0-412-31820-2 MODIFICATION HISTORY: Written by: GGS, RSI, December 1994 Modified: GGS, RSI, July 1996 Added DOUBLE keywork.
(See C:\RSI\IDL52\lib\ts_diff.pro)
NAME: TS_FCAST PURPOSE: This function computes future or past values of a stationary time- series (X) using a Pth order autoregressive model. The result is an Nvalues-element vector whose type is identical to X. CATEGORY: Statistics. CALLING SEQUENCE: Result = TS_FCAST(X, P, Nvalues) INPUTS: X: An n-element vector of type float or double containing time- series samples. P: A scalar of type integer or long integer that specifies the number of actual time-series values to be used in the forecast. In general, a larger number of values results in a more accurate result. Nvalues: A scalar of type integer or long integer that specifies the number of future or past values to be computed. KEYWORD PARAMETERS: BACKCAST: If set to a non-zero value, "backcasts" (backward-forecasts) are computed. DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. EXAMPLE: Define an n-element vector of time-series samples. x = [6.63, 6.59, 6.46, 6.49, 6.45, 6.41, 6.38, 6.26, 6.09, 5.99, $ 5.92, 5.93, 5.83, 5.82, 5.95, 5.91, 5.81, 5.64, 5.51, 5.31, $ 5.36, 5.17, 5.07, 4.97, 5.00, 5.01, 4.85, 4.79, 4.73, 4.76] Compute five future and five past values of the time-series using a 10th order autoregressive model. resultF = ts_fcast(x, 10, 5) resultB = ts_fcast(x, 10, 5, /backcast) The forecast (resultF) should be: [4.65870, 4.58380, 4.50030, 4.48828, 4.46971] The backcast (resultB) should be: [6.94862, 6.91103, 6.86297, 6.77826, 6.70282] REFERENCE: The Analysis of Time Series, An Introduction (Fourth Edition) Chapman and Hall ISBN 0-412-31820-2 MODIFICATION HISTORY: Written by: GGS, RSI, November 1994 Modified: GGS, RSI, January 1996 Added DOUBLE keyword. Added BACKCAST keyword. Modified: GGS, RSI, June 1996 Modified keyword checking and use of double precision.
(See C:\RSI\IDL52\lib\ts_fcast.pro)
NAME: TS_SMOOTH PURPOSE: This function computes central, backward or forward moving-averages of an n-element time-series (X). Autoregressive forecasting and backcasting is used to extrapolate the time-series and compute a moving-average for each point of the time-series. The result is an n-element vector whose type is identical to X. CATEGORY: Statistics. CALLING SEQUENCE: Result = TS_SMOOTH(X, Nvalues) INPUTS: X: An n-element vector of type float or double containing time- series samples, where n >= 11. Nvalues: A scalar of type integer or long integer that specifies the number of time-series values used to compute each moving-average. If central-moving-averages are computed (the default), this parameter must be an odd integer of 3 or greater. KEYWORD PARAMETERS: BACKWARD: If set to a non-zero value, backward-moving-averages are computed. The Nvalues parameter must be an integer greater than 1. DOUBLE: If set to a non-zero value, computations are done in double precision arithmetic. FORWARD: If set to a non-zero value, forward-moving-averages are computed. The Nvalues parameter must be an integer greater than 1. ORDER: A scalar of type integer or long integer that specifies the order of the autoregressive model used to compute the forecasts and backcasts of the time-series. Central-moving- averages require Nvalues/2 forecasts and Nvalues/2 backcasts. Backward-moving-averages require Nvalues-1 backcasts. Forward-moving-averages require Nvalues-1 forecasts. A time-series with a length in the interval [11, 219] will use an autoregressive model with an order of 10. A time-series with a length greater than 219 will use an autoregressive model with an order equal to 5% of its length. The ORDER keyword is used to override this default. EXAMPLE: Define an n-element vector of time-series samples. x = [6.63, 6.59, 6.46, 6.49, 6.45, 6.41, 6.38, 6.26, 6.09, 5.99, $ 5.92, 5.93, 5.83, 5.82, 5.95, 5.91, 5.81, 5.64, 5.51, 5.31, $ 5.36, 5.17, 5.07, 4.97, 5.00, 5.01, 4.85, 4.79, 4.73, 4.76] Compute the 11-point central-moving-averages of the time-series. result = ts_smooth(x, 11) REFERENCE: The Analysis of Time Series, An Introduction (Fourth Edition) Chapman and Hall ISBN 0-412-31820-2 MODIFICATION HISTORY: Written by: GGS, RSI, September 1995 Modified: GGS, RSI, July 1996 Modified keyword checking and use of Double precision.
(See C:\RSI\IDL52\lib\ts_smooth.pro)
NAME: T_CVF PURPOSE: This function computes the cutoff value (v) such that: Probability(X > v) = p where X is a random variable from the Student's t distribution with (df) degrees of freedom. CATEGORY: Statistics. CALLING SEQUENCE: Result = t_cvf(P, DF) INPUTS: P: A non-negative scalar, in the interval [0.0, 1.0], of type float or double that specifies the probability of occurance or success. DF: A positive scalar of type integer, float or double that specifies the degrees of freedom of the Student's t distribution. EXAMPLE: Compute the cutoff value (v) such that Probability(X > v) = 0.025 from the Student's t distribution with (df = 5) degrees of freedom. The result should be 2.57058 result = t_cvf(0.025, 5) REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Modified by: GGS, RSI, July 1994 Minor changes to code. New documentation header.
(See C:\RSI\IDL52\lib\t_cvf.pro)
NAME: T_PDF PURPOSE: This function computes the probabilty (p) such that: Probability(X <= v) = p where X is a random variable from the Student's t distribution with (df) degrees of freedom. CATEGORY: Statistics. CALLING SEQUENCE: Result = T_pdf(V, DF) INPUTS: V: A scalar of type integer, float or double that specifies the cutoff value. DF: A positive scalar of type integer, float or double that specifies the degrees of freedom of the Student's t distribution. EXAMPLE: Compute the probability that a random variable X, from the Student's t distribution with (df = 15) degrees of freedom, is less than or equal to 0.691. The result should be 0.749940 result = t_pdf(0.691, 15) REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Modified by: GGS, RSI, July 1994 Minor changes to code. New documentation header.
(See C:\RSI\IDL52\lib\t_pdf.pro)
NAME: UNIQ PURPOSE: Return the subscripts of the unique elements in an array. Note that repeated elements must be adjacent in order to be found. This routine is intended to be used with the SORT function. See the discussion of the IDX argument below. This command is inspired by the Unix uniq(1) command. CATEGORY: Array manipulation. CALLING SEQUENCE: UNIQ(Array [, Idx]) INPUTS: Array: The array to be scanned. The type and number of dimensions of the array are not important. The array must be sorted into monotonic order unless the optional parameter Idx is supplied. OPTIONAL INPUT PARAMETERS: IDX: This optional parameter is an array of indices into Array that order the elements into monotonic order. That is, the expression: Array(Idx) yields an array in which the elements of Array are rearranged into monotonic order. If the array is not already in monotonic order, use the command: UNIQ(Array, SORT(Array)) The expression below finds the unique elements of an unsorted array: Array(UNIQ(Array, SORT(Array))) OUTPUTS: An array of indicies into ARRAY is returned. The expression: ARRAY(UNIQ(ARRAY)) will be a copy of the sorted Array with duplicate adjacent elements removed. COMMON BLOCKS: None. MODIFICATION HISTORY: 1988, AB, Written. 29 July 1992, ACY - Corrected for case of all elements the same. Nov, 1995. DMS, Return a 0 if argument is a scalar.
(See C:\RSI\IDL52\lib\uniq.pro)
NAME: VARIANCE PURPOSE: This function computes the statistical variance of an N-element vector. CATEGORY: Statistics. CALLING SEQUENCE: Result = variance(X) INPUTS: X: An N-element vector of type integer, float or double. KEYWORD PARAMETERS: DOUBLE: IF set to a non-zero value, computations are done in double precision arithmetic. NAN: If set, treat NaN data as missing. EXAMPLE: Define the N-element vector of sample data. x = [65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71, 66, 65, 70] Compute the mean. result = variance(x) The result should be: 7.06667 PROCEDURE: VARIANCE calls the IDL function MOMENT. REFERENCE: APPLIED STATISTICS (third edition) J. Neter, W. Wasserman, G.A. Whitmore ISBN 0-205-10328-6 MODIFICATION HISTORY: Written by: GSL, RSI, August 1997
(See C:\RSI\IDL52\lib\variance.pro)
NAME: VAX_CALL_EXT PURPOSE: The VAX_FLOAT keyword to CALL_EXTERNAL can be used to make the IEEE versions of VMS IDL properly pass floating point data to external code compiled for the VAX floating point format. However, IDL 5.0.x and earlier did not accept this keyword. This makes it difficult to write a CALL_EXTERNAL statement that can be used under both versions at the same time. The VAX_CALL_EXT routine can be used to solve this problem. If you call it instead of CALL_EXTERNAL, your program will be able to specify the VAX_FLOAT keyword in all cases, and the older IDL versions will simply ignore it as a side effect of keyword inheritance. CALLING SEQUENCE: See the documentation on the CALL_EXTERNAL function for allowed arguments and usage. MODIFICATION HISTORY: Written by: Tom Fredian, MIT, February 1998
(See C:\RSI\IDL52\examples\misc\vax_call_ext.pro)
NAME: VAX_CONVERT_FLOAT PURPOSE: For VMS ONLY, allow direct access to the VMS Runtime Library routine CVT$CONVERT_FLOAT. This can be used to convert data types not supported by the IDL BYTEORDER procedure. This routine also serves as an example of using CALL_EXTERNAL to call VMS runtime library functions. To use this routine, it is very helpful to understand CVT$CONVERT_FLOAT. That routine is documented in the "OpenVMS RTL Library (LIB$) Manual". CATEGORY: Data Conversion, Examples CALLING SEQUENCE: Result = VAX_CONVERT_FLOAT(INPUT_VALUE, OUTPUT_VALUE) INPUTS: INPUT_VALUE: A single floating point value to be converted. The type of this value must agree with the that specified by the INPUT_TYPE_CODE keyword. OUTPUT_VALUE: Variable to receive the resulting converted value. The type of this variable must agree with that specified by the OUTPUT_TYPE_CODE keyword. KEYWORDS: INPUT_TYPE_CODE: This is an integer that indicates the type of data contained in INPUT_VALUE, and corresponds directly to the input_type_code argument of CVT$CONVERT_FLOAT. Use the following table to determine the allowed values: CVT$K_VAX_F = 0L ; VAX F Floating point data CVT$K_VAX_D = 1L ; VAX D Floating point data CVT$K_VAX_G = 2L ; VAX G Floating point data CVT$K_VAX_H = 3L ; VAX H Floating point data CVT$K_IEEE_S = 4L ; IEEE S Floating point data CVT$K_IEEE_T = 5L ; IEEE T Floating point data CVT$K_IBM_LONG = 6L ; IBM Long Floating point data CVT$K_IBM_SHORT = 7L ; IBM Short Floating point data CVT$K_CRAY = 8L ; Cray Floating point data CVT$K_IEEE_X = 9L ; IEEE X Floating point data If INPUT_TYPE_CODE is not specified, a default of 0 (CVT$K_VAX_F) is used. OUTPUT_TYPE_CODE: This is an integer that indicates the type of data contained in OUTPUT_VALUE, and corresponds directly to the output_type_code argument of CVT$CONVERT_FLOAT. Use the table from the description of OUTPUT_TYPE_CODE above to determine the allowed values. If OUTPUT_TYPE_CODE is not specified, a default of 0 (CVT$K_VAX_F) is used. OPTION: Conversion option specifier. This keyword corresponds directly to the options argument to CVT$CONVERT_FLOAT and is a mask in which each option bit set causes the corresponding option to be used during the conversion. Use the following table to construct this value: CVT$M_ROUND_TO_NEAREST = 1L CVT$M_TRUNCATE = 2L CVT$M_ROUND_TO_POS = 4L CVT$M_ROUND_TO_NEG = 8L CVT$M_VAX_ROUNDING = 16L CVT$M_BIG_ENDIAN = 32L CVT$M_ERR_UNDERFLOW = 64L If OPTION is not specified, a default of CVT$M_ROUND_TO_NEAREST is used. QUIET: Normally, this routine will print an error message if CVT$CONVERT_FLOAT reports a problem with the conversion. Setting QUIET suppresses this message. RESTRICTIONS: As a direct wrapper to a runtime library function, calling this routine with arguments specified incorrectly can cause memory corruption that can effect the IDL program. MODIFICATION HISTORY: Written by Michael J Whitington, Feb 1998 Modified to fit in the IDL examples directory, AB, Feb 1998
(See C:\RSI\IDL52\examples\misc\vax_convert_float.pro)
NAME: VBLoadct PURPOSE: A graphical interface to the LOADCT user library procedure. VBLoadct displays the current color map and provides an array of buttons, one per availible predefined color table. Using the mouse to press these buttons causes the corresponding color map to be loaded. CATEGORY: Widgets CALLING SEQUENCE: VBLoadct INPUTS: None. KEYWORDS: FILE: If this keyword is set, the file by the given name is used instead of the file colors1.tbl in the IDL directory. This allows multiple IDL users to have their own color table file. GROUP = The widget ID of the widget that calls VBLoadct. When this ID is specified, a death of the caller results in a death of VBLoadct NCOLORS = number of colors to use. Use color indices from BOTTOM to the smaller of !D.TABLE_SIZE-1 and NCOLORS-1. Default = !D.TABLE_SIZE = all available colors. BOTTOM = first color index to use. Use color indices from BOTTOM to BOTTOM+NCOLORS-1. Default = 0. SILENT - Normally, no informational message is printed when a color map is loaded. If this keyword is present and zero, this message is printed. USE_CURRENT: If set, use the current color tables, regardless of the contents of the COMMON block COLORS. MODAL: If set, then VBLoadct runs in "modal" mode, meaning that all other widgets are blocked until the user quits VBLoadct. A group leader must be specified (via the GROUP keyword) for the MODAL keyword to have any effect. The default is to not run in modal mode. NO_BLOCK:Set this keyword to zero to have XMANAGER block when this application is registered. By default NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting NO_BLOCK=0 will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: One of the predefined color maps may be loaded. RESTRICTIONS: This routine uses the LOADCT user library procedure to do the actual work. MODIFICATION HISTORY: 24, August, 1990, Written by AB, RSI. March 1, 1992 Mark Rivers added Reverse Table to options menu. 7/92, DMS, Added new color tables (allows more than 16). 9/92, ACY, Add FILE keyword. 10/1/96, AB, Removed the PICK_ONE keyword. It was broken for 4 years without anyone noticing, and the idea doesn't really fit VBLoadct anymore. 1/10/97, DJC - Fixed color bar display bug, and added "MODAL" keyword. 1/13/96, AB, Improved the saving and restoring of the current graphics window to prevent other applications from drawing on this applications windows. 1/17/97, DJC - Moved group_leader keyword from "XManager" to "WIDGET_BASE". Added check to ignore "MODAL" keyword if a group leader is not specified.
(See C:\RSI\IDL52\examples\doc\ActiveX\VBLoadCt\VBLoadct.pro)
NAME: VBObjGraph PURPOSE: This program demonstrates how to create object graphics from within Visual Basic. The auto events are processed within IDL to rotate an object surface. This procedure demonstrates the use of Object Graphics (including the trackball object) to interactively display a multi-variate volume data set. CATEGORY: Object graphics. CALLING SEQUENCE: VBObjGraph KEYWORD PARAMETERS: MODIFICATION HISTORY: Modified for VB: PJP, Feb 1998.
(See C:\RSI\IDL52\examples\doc\ActiveX\VBObjGraph\VBObjGraph.pro)
NAME: VEL PURPOSE: Draw a velocity (flow) field with arrows following the field proportional in length to the field strength. Arrows are composed of a number of small segments that follow the streamlines. CATEGORY: Graphics, two-dimensional. CALLING SEQUENCE: VEL, U, V INPUTS: U: The X component at each point of the vector field. This parameter must be a 2D array. V: The Y component at each point of the vector field. This parameter must have the same dimensions as U. KEYWORD PARAMETERS: NVECS: The number of vectors (arrows) to draw. If this keyword is omitted, 200 vectors are drawn. XMAX: X axis size as a fraction of Y axis size. The default is 1.0. This argument is ignored when !p.multi is set. LENGTH: The length of each arrow line segment expressed as a fraction of the longest vector divided by the number of steps. The default is 0.1. NSTEPS: The number of shoots or line segments for each arrow. The default is 10. TITLE: A string containing the title for the plot. OUTPUTS: No explicit outputs. A velocity field graph is drawn on the current graphics device. COMMON BLOCKS: None. SIDE EFFECTS: A plot is drawn on the current graphics device. RESTRICTIONS: none PROCEDURE: NVECS random points within the (u,v) arrays are selected. For each "shot" the field (as bilinearly interpolated) at each point is followed using a vector of LENGTH length, tracing a line with NSTEPS segments. An arrow head is drawn at the end. MODIFICATION HISTORY: Neal Hurlburt, April, 1988. 12/2/92 - modified to handle !p.multi (jiy-RSI) 7/12/94 HJM - Fixed error in weighting factors in function vel_mybi() which produced incorrect velocity vectors.
(See C:\RSI\IDL52\lib\vel.pro)
NAME: VELOVECT PURPOSE: Produce a two-dimensional velocity field plot. A directed arrow is drawn at each point showing the direction and magnitude of the field. CATEGORY: Plotting, two-dimensional. CALLING SEQUENCE: VELOVECT, U, V [, X, Y] INPUTS: U: The X component of the two-dimensional field. U must be a two-dimensional array. V: The Y component of the two dimensional field. Y must have the same dimensions as X. The vector at point [i,j] has a magnitude of: (U[i,j]^2 + V[i,j]^2)^0.5 and a direction of: ATAN2(V[i,j],U[i,j]). OPTIONAL INPUT PARAMETERS: X: Optional abcissae values. X must be a vector with a length equal to the first dimension of U and V. Y: Optional ordinate values. Y must be a vector with a length equal to the first dimension of U and V. KEYWORD INPUT PARAMETERS: COLOR: The color index used for the plot. DOTS: Set this keyword to 1 to place a dot at each missing point. Set this keyword to 0 or omit it to draw nothing for missing points. Has effect only if MISSING is specified. LENGTH: Length factor. The default of 1.0 makes the longest (U,V) vector the length of a cell. MISSING: Missing data value. Vectors with a LENGTH greater than MISSING are ignored. OVERPLOT: Set this keyword to make VELOVECT "overplot". That is, the current graphics screen is not erased, no axes are drawn, and the previously established scaling remains in effect. Note: All other keywords are passed directly to the PLOT procedure and may be used to set option such as TITLE, POSITION, NOERASE, etc. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: Plotting on the selected device is performed. System variables concerning plotting are changed. RESTRICTIONS: None. PROCEDURE: Straightforward. Unrecognized keywords are passed to the PLOT procedure. MODIFICATION HISTORY: DMS, RSI, Oct., 1983. For Sun, DMS, RSI, April, 1989. Added TITLE, Oct, 1990. Added POSITION, NOERASE, COLOR, Feb 91, RES. August, 1993. Vince Patrick, Adv. Visualization Lab, U. of Maryland, fixed errors in math. August, 1993. DMS, Added _EXTRA keyword inheritance. January, 1994, KDB. Fixed integer math which produced 0 and caused divide by zero errors. December, 1994, MWR. Added _EXTRA inheritance for PLOTS and OPLOT. June, 1995, MWR. Removed _EXTRA inheritance for PLOTS and changed OPLOT to PLOTS. September, 1996, GGS. Changed denominator of x_step and y_step vars. February, 1998, DLD. Add support for CLIP and NO_CLIP keywords. June, 1998, DLD. Add support for OVERPLOT keyword.
(See C:\RSI\IDL52\lib\velovect.pro)
NAME: VERT_T3D PURPOSE: This function tranforms 3-D points by a 4x4 transformation matrix. The 3-D points are typically an array of polygon vertices that were generated by SHADE_VOLUME or MESH_OBJ. CATEGORY: Graphics. CALLING SEQUENCE: result = VERT_T3D(vertex_list) INPUTS: Vertex_List: A vector of the form [x, y, z], or a [3, n] array of 3-D coordinates to transform. KEYWORD PARAMETERS: Matrix: The 4x4 transformation matrix to use. The default is to use the system viewing matrix (!P.T). (See the "T3D" procedure). No_Copy: Normally, a COPY of Vertex_List is transformed and the original vertex_list is preserved. If No_Copy is set, however, then the original Vertex_List will be undefined AFTER the call to VERT_T3D. Using the No_Copy mode will require less memory. No_Divide: Normally, when a [x, y, z, 1] vector is transformed by a 4x4 matrix, the final homogeneous coordinates are obtained by dividing the x, y, and z components of the result vector by the fourth element in the result vector. Setting the No_Divide keyword will prevent VERT_T3D from performing this division. In some cases (usually when a perspective transformation is involved) the fourth element in the result vector can be very close to (or equal to) zero. Save_Divide: Set this keyword to a named variable to receive the fourth element of the transformed vector(s). If Vertex_List is a vector then Save_Divide is a scalar. If Vertex_List is a [3, n] array then Save_Divide is an array of n elements. This keyword only has effect when the No_Divide keyword is set. OUTPUTS: This function returns the transformed coordinate(s). The returned array has the same size and dimensions as Vertex_List. PROCEDURE: Before performing the transformation, the [3, n] Vertex_List is padded to produce a [4, n] array with 1's in the last column. After the transformation, the first three columns of the array are divided by the fourth column (unless the No_Divide keyword is set). The fourth column is then stripped off (or saved in the Save_Divide keyword) before returning. EXAMPLE: Transform four points representing a square in the x-y plane by first translating +2.0 in the positive X direction, and then rotating 60.0 degrees about the Y axis. points = [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], $ [1.0, 1.0, 0.0], [0.0, 1.0, 0.0]] T3d, /Reset T3d, Translate=[2.0, 0.0, 0.0] T3d, Rotate=[0.0, 60.0, 0.0] points = VERT_T3D(points) MODIFICATION HISTORY: Written by: Daniel Carr, Thu Mar 31 15:58:07 MST 1994
(See C:\RSI\IDL52\lib\vert_t3d.pro)
Name: VMSCODE PURPOSE: Convert between VMS Version 1 and the newer IDL type codes. Type VMS V1 Current ------------------------------- undefined 0 0 byte 2 1 int 4 2 long 16 3 float 8 4 double 32 5 complex 64 6 string 1 7 structure 128 8 CATEGORY: Misc. CALLING SEQUENCE: VMSCODE, Code INPUTS: Code: The type code to be converted. KEYWORDS: FROM_V1VMS: Normally, CODE is taken to be for the current system and is is converted to it's VMS V1 counterpart. If FROM_V1VMS is present and non-zero, the conversion direction is reversed. OUTPUTS: The translated code is returned as an integer. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. MODIFICATION HISTORY: AB, RSI, February 1988
(See C:\RSI\IDL52\lib\obsolete\vmscode.pro)
NAME: VORONOI PURPOSE: This procedure computes the Voronoi polygon of a point within an irregular grid of points, given the Delaunay triangulation. The Voronoi polygon of a point contains the region closer to that point than to any other point. CATEGORY: Gridding. CALLING SEQUENCE: VORONOI, X, Y, I0, C, Xp, Yp, Rect INPUTS: X: An array containing the X locations of the points. Y: An array containing the Y locations of the points. I0: Index of the point of which to obtain the Voronoi polygon. C: A connectivity list from the Delaunay triangulation. This list is produced with the CONNECTIVITY keyword of the TRIANGULATE procedure. Rect the bounding rectangle: [Xmin, Ymin, Xmax, Ymax]. Because the Voronoi polygon (VP) for points on the convex hull extends to infinity, a clipping rectangle must be supplied to close the polygon. This rectangle has no effect on the VP of interior points. If this rectangle does not enclose all the Voronoi vertices, the results will be incorrect. If this parameter, which must be a named variable, is undefined or set to a scalar value, it will be calculated. OUTPUTS: Xp, Yp: The vertices of voroni polygon, VP. RESTRICTIONS: The polygons only cover the convex hull of the set of points. PROCEDURE: For interior points, the polygon is constructed by connecting the midpoints of the lines connecting the point with its Delaunay neighbors. Polygons are traversed in a counterclockwise direction. For exterior points, the set described by the midpoints of the connecting lines, plus the circumcenters of the two triangles that connect the point to the two adjacent exterior points. EXAMPLE: See the example procedure, VORONOI_SHOW, contained in this file. To illustrate Voronoi polygons, after compiling this file (voronoi): VORONOI_SHOW, Npoints (try anywhere from 3 to 1000, default=12) To draw the voroni polygons of each point of an irregular grid: x = randomu(seed, n) ;Random grid of N points y = randomu(seed, n) triangulate, x, y, tr, CONN=c ;Triangulate it rect = 0 for i=0, n-1 do begin voronoi, x, y, i, c, xp, yp, rect ;Get the ith polygon polyfill, xp, yp, color = (i mod 10) + 2 ;Draw it endfor MODIFICATION HISTORY: DMS, RSI. Dec, 1992. Original version. DMS, RSI Feb, 1995. Added bounding rectangle which simplified logic and better illustrated VPs for points on the convex hull.
(See C:\RSI\IDL52\lib\voronoi.pro)
NAME: WARP_TRI PURPOSE: This function warps images using control (tie) points. CATEGORY: Image processing, geometric transformation. CALLING SEQUENCE: Result = WARP_TRI(Xo, Yo, Xi, Yi, Im_in) INPUTS: Xo, Yo: Vectors containing the locations of the tie points in the output image. Xi, Yi: Vectors containing the location of the tie points in the input image (Im_in). Xi, Yi must be the same length as Xo, Y0. Im_in: The image to be warped. May be any type of data. KEYWORD PARAMETERS: OUTPUT_SIZE: A 2-element vector containing the size of the output image. If omitted, the output image is the same size as Im_in. QUINTIC: Set this keyword to use smooth quintic interpolation. Quintic interpolation is slower but the derivatives are continuous across triangles, giving a more pleasing result than the default linear interpolation. EXTRAPOLATE: Set to true to extrapolate outside the convex hull of the tie points. Setting this keyword implies the use of QUINTIC interpolation. OUTPUTS: This function returns an image array with the specified geometric correction applied. Points at locations (Xi, Yi) are shifted to (Xo, Yo). PROCEDURE: The irregular grid defined by (Xo, Yo) is triangulated using TRIANGULATE. Then the surfaces defined by (Xo, Yo, Xi) and (Xo, Yo, Yi) are interpolated using TRIGRID to get the locations in the input image of each pixel in the output image. Finally, INTERPOLATE is called to obtain the result. Linear interpolation is used by default. Smooth quintic interpolation is used if the QUINTIC keyword is set. MODIFICATION HISTORY: DMS, Jan, 1992. DMS, Jul, 1992, added quintic interpolation.
(See C:\RSI\IDL52\lib\warp_tri.pro)
NAME: WEXMASTER.PRO PURPOSE: This routine is the main menu for the "Simple Widget Examples". Click on any of the buttons in the menu to see helpful examples of Widgets programming. The examples under "Simple Widget Examples:" demonstrate the creation and management of just one or two kinds of widgets at one time. For more complex examples, select the examples under "Example Widget Applications". Select "About the Simple Widget Examples" to see a more information on the simple widget examples. Select "Widget Programming Tips and Tech- niques" to see helpful information on programming with the IDL/widgets, and widgets documentation updates. Hope this helps! CATEGORY: Widgets CALLING SEQUENCE: WEXMASTER KEYWORD PARAMETERS: GROUP = The widget ID of the widget that calls WEXMASTER. When this ID is specified, a death of the caller results in a death of WEXMASTER. SIDE EFFECTS: Initiates the XManager if it is not already running. RESTRICTIONS: Only one copy may run at a time to avoid confusion. PROCEDURE: Create and register the widget and then exit. MODIFICATION HISTORY: WEXMASTER and associated examples by Keith R Crosley, August, 1991 Created from a template written by: Steve Richards, January, 1991
(See C:\RSI\IDL52\examples\misc\wexmast\wexmaster.pro)
NAME: WF_DRAW PURPOSE: This procedure draws weather fronts of various types with spline smoothing. CATEGORY: Meterology. CALLING SEQUENCE: WF_DRAW, X, Y INPUTS: X, Y: Vectors of abcissae and ordinates defining the front to be drawn. KEYWORD PARAMETERS: COLD: A cold front. The default is a plain line with no annotations. WARM: A warm front. OCCLUDED: An occluded front. STATIONARY: A stationary front. CONVERGENCE: A convergence line. FRONT_TYPE: Index of type of front to draw, COLD=1, WARM=2, etc. Not required if plain line is desired or if an explicit front type keyword is specified. THICK: Line thickness. The default = 1.0. INTERVAL: The spline interpolation interval, in normalized units. The default = 0.01. Larger values give coarser approximations to curves, smaller values make more interpolted points. COLOR: The color to use. The default = !P.COLOR. DEVICE: If set, X and Y are in device coordinates. DATA: If set, X and Y are in data coordinates. NORM: If set, X and Y are in normalized coordinates. This is the default. PSYM: If set, draw a marker (index = PSYM) on each actual [X, Y] data point. SYM_LEN: The length and spacing factor for front symbols, in normalized units. The default = 0.15. SYM_HT: The height of front symbols, in normalized units. The default = 0.02. OUTPUTS: No explicit outputs. SIDE EFFECTS: Draws objects on current graphics device. PROCEDURE: Uses parametric spline interpolation to smooth the lines. POLYFILL is used to make the annotations on the front lines. EXAMPLE: Draw a front given 3 points: WF_DRAW, [40, 20, 40], [30, 40, 25], /DATA, /COLD MODIFICATION HISTORY: DMS, RSI. August, 1993. Written.
(See C:\RSI\IDL52\lib\wf_draw.pro)
NAME: WIDED PURPOSE: An IDL dialog Editor. Lets one graphically produce a widget hierarchy. CATEGORY: Widgets. CALLING SEQUENCE: WIDED [, File ] OPTIONAL INPUTS: File: Widget builder will read this file. File should be a widget file (.WID) KEYWORD PARAMETERS: None. COMMON BLOCKS: FMagic_Comm -- Store global variable, NoCheck. TestDraw_Comm -- Saves a seed number used in random plot generation WidDirty_Comm -- Save Yes/No/Cancel information in Dirty WidEd_Comm -- Global variables used through the Widget Builder Definition of this common block in in wided.com XPrintf_Comm -- Save I/O state to allow multiple I/O operations to write a single line. FORMAT=(..., $) doesn't work on VMS and this needs to work *EVERYWHERE* SIDE EFFECTS: Builds widget trees. Writes IDL Code. Probably more side effects than you can shake a stick at. RESTRICTIONS: You must have IDL 3.5 or later. This is a graphical program so widgets must be available. PROCEDURE: Add, delete, cut, copy and paste widgets to your hearts delight. Save the results if you want to. EXAMPLE: Please see the "Using the IDL Widget Builder" document. MODIFICATION HISTORY: Written by: Joshua Goldstein, Spring '93 Fall '93 Complete rewrite using widget UVALUEs instead of uniform structures to store hierarchy. Added bitmapped buttons, pull down menus, embedded comments in .PRO files to save user mods. Made adding user classes even easier (add 1 line to widdef.dat). Still need to write class library. Added comments to wided. Hope they help.
(See C:\RSI\IDL52\lib\obsolete\wided.pro)
NAME: WILCOXON PURPOSE: Test the null hypothesis that two populations have the same distribution -i.e. F(x) = G(x) against the alternative that their distributions differ in location- i.e F(x) = G(x+a). Wilcox pairwise tests the populations in Data. It is preferable to the sign_test for non-binary data, since it uses the ranking of data differences and not just the sign. CATEGORY: Statistics. CALLING SEQUENCE: WILCOXON, Data INPUTS: Data: Two-dimensional array. Data(i,j) = the jth observation from the ith population. KEYWORDS: NAMES: Vector of user supplied names for the populations to be used in the output. LIST_NAME: Name of output file. The default is to the screen. MISSING: Value used as a place holder for missing data. Pairwise handling of missing data. TAIL: If set, tail specifies the type of test. If Tail = 1 then a one-tailed test is performed. Likewise, Tail = 2 specifies a two-tailed test. The default is the two-tailed test. NOPRINT: A flag, if set, to suppress output to the screen or a file. OUTPUT: Table written to the screen showing for each pair of populations the total of the rankings. Also, table of probabilities for each population pair giving the significance of the results in the first table. These probabilities are based on normal approximations. For small sample sizes (less than 26), consult a table for the Wilcox Test in any general text on statistics. OPTIONAL OUTPUT PARAMETERS: Rank: Two-dimensional array of ranking sums. Rank(i,j) = sum of ranks of population i where observations in i are ranked with those in population j. Prob: Two-dimensional array. Prob(i,j) = probability of Rank(i,j) or something more extreme. -1 is returned for small (less than 26) populations. RESTRICTIONS: All populations have the same sample size. COMMON BLOCKS: None. PROCEDURE: For each pair of populations, differences between corresponding observations are computed and the absolute values of the differences are ranked. Ranks of positive differences are summed and likewise, those of the negative ones. The probability of the sums is computed under the assumption that the distributions are the same. These probabilities are approximated with an approximately normal test statistic for populations greater than 25.
(See C:\RSI\IDL52\lib\obsolete\wilcoxon.pro)
NAME: WRITE_BMP PURPOSE: This procedure writes a Microsoft Windows Version 3 device independent bitmap file (.BMP). CATEGORY: Input/Output. CALLING SEQUENCE: WRITE_BMP, File, Image [, R, G, B] INPUTS: File: The full path name of the bitmap file to write. Image: The array to write into the new bitmap file. The array should be scaled into a range of bytes for 8 and 24 bit deep images. Scale to 0-15 for 4 bit deep images. If the image has 3 dimensions and the first dimension is 3, a 24 bit deep bitmap file is created. NOTE: for 24 bit images, color interleaving is blue, green, red: image[0,i,j] = blue, image[1,i,j] = green, etc. OPTIONAL INPUTS: R, G, B: Color tables. If omitted, the colors loaded in the COLORS common block are used. KEYWORD PARAMETERS: FOUR_BITS: Set this keyword to write as a four bit device independent bitmap. If omitted or zero, an eight bit deep map is written. IHDR: { BITMAPINFOHEADER } structure containing the file header fields that are not obtained from the image parameter. (The only fields that the user can set are: bi{XY}PelsPerMeter, biClrUsed, and biClrImportant.) OUTPUTS: No explicit outputs. KEYWORD OUTPUT PARAMETERS: HEADER_DEFNIE: Returns an empty BITMAPINFOHEADER structure, containing zeroes. No other actions are performed. This structure may be then modified with the pertinent fields and then passed in via the Ihdr keyword parameter. See the Microsoft Windows Programmers Reference Guide for a description of each field in the structure. NOTE: this parameter must be defined before the call. e.g.: h = 0 WRITE_BMP, HEADER_DEFINE = h COMMON BLOCKS: COLORS: Used with 4- and 8-bit images if no colors are specified. SIDE EFFECTS: IO is performed. RESTRICTIONS: Does not handle 1-bit images or compressed images. Is not fast for 4-bit images. Works best on images where the number of bytes in each scan line is evenly divisible by 4. PROCEDURE: Straightforward. Will work on both big endian and little endian machines. EXAMPLES: Pseudo screen dump from the current window: WRITE_BMP, 'test.bmp', TVRD() Scale an image to 0-15, and then write a four bit BMP file, using a gray scale color table: r = BYTSCL(INDGEN(16)) ;Ramp from 0 to 255. WRITE_BMP, 'test.bmp', BYTSCL(Image, MAX=15), r, r, r, /FOUR MODIFICATION HISTORY: DMS, RSI. March 1993. Original version. DMS, RSI. May, 1993. Now works on all machines...
(See C:\RSI\IDL52\lib\write_bmp.pro)
NAME: WRITE_GIF PURPOSE: Write an IDL image and color table vectors to a GIF (graphics interchange format) file. CATEGORY: CALLING SEQUENCE: WRITE_GIF, File, Image ;Write a given array. WRITE_GIF, File, Image, R, G, B ;Write array with given color tables. INPUTS: Image: The 2D array to be output. OPTIONAL INPUT PARAMETERS: R, G, B: The Red, Green, and Blue color vectors to be written with Image. Keyword Inputs: CLOSE = if set, closes any open file if the MULTIPLE images per file mode was used. If this keyword is present, nothing is written, and all other parameters are ignored. MULTIPLE = if set, write files containing multiple images per file. Each call to WRITE_GIF writes the next image, with the file remaining open between calls. The File parameter is ignored, but must be supplied, after the first call. When writing the 2nd and subsequent images, R, G, and B are ignored. All images written to a file must be the same size. OUTPUTS: If R, G, B values are not provided, the last color table established using LOADCT is saved. The table is padded to 256 entries. If LOADCT has never been called, we call it with the gray scale entry. COMMON BLOCKS: COLORS SIDE EFFECTS: If R, G, and B aren't supplied and LOADCT hasn't been called yet, this routine uses LOADCT to load the B/W tables. COMMON BLOCKS: WRITE_GIF_COMMON. RESTRICTIONS: This routine only writes 8-bit deep GIF files of the standard type: (non-interlaced, global colormap, 1 image, no local colormap) The Graphics Interchange Format(c) is the Copyright property of CompuServ Incorporated. GIF(sm) is a Service Mark property of CompuServ Incorporated. MODIFICATION HISTORY: Written 9 June 1992, JWG. Added MULTIPLE and CLOSE, Aug, 1996.
(See C:\RSI\IDL52\lib\write_gif.pro)
NAME: WRITE_NRIF PURPOSE: Write an IDL image and color table vectors to an NCAR Raster Interchange Format (NRIF) rasterfile. CATEGORY: Input/Output. CALLING SEQUENCE: WRITE_NRIF, File, Image, [R, G, B] INPUTS: File: A string containing the name of the rasterfile to write. Image: The byte array to be output. If Image is dimensioned [n,m] an 8-bit NCAR Raster File with color tables is output. If Image is dimensioned [3,n,m], a 24-bit NCAR Raster File is output, where each byte triple represents the red, green, and blue intensities at [n,m] on a scale from 0 to 255. In either case, IMAGE must be a byte array. The NRIF image will be rendered from bottom to top, in accordance with IDL standards, so the !ORDER variable should not be changed from its default value of zero. OPTIONAL INPUT PARAMETERS: R, G, B: The Red, Green, and Blue color vectors to be used as a color table with 8-bit images. If color vectors are supplied, they are included in the output (8-bit images only). If color vectors are not supplied, the color vectors established by LOADCT or PALETTE are included in the output. If LOADCT or PALETTE have not yet been used to define color vectors, "LOADCT, 0" is called to load the standard grayscale color table. This routine does not recognize color vectors loaded directly using TVLCT, so if a custom color table is desired and it is not convenient to use PALETTE, include the R, G, and B vectors that were used to create the color table. OUTPUTS: No explicit outputs. The specified File will contain header information, color vectors (8-bit images only), and the image, in NCAR Raster Interchange Format (NRIF). COMMON BLOCKS: COLORS: The IDL color table common block. SIDE EFFECTS: If R, G, and B aren't supplied and color tables haven't been previously established by LOADCT or PALETTE, this routine calls "LOADCT, 0" to load the standard gray scale color table. RESTRICTIONS: This routine only writes 8 or 24-bit deep rasterfiles of types "Indexed Color" (for 8-bit) and "Direct Color integrated" for 24-bit. The color map is included only for 8-bit files. FURTHER INFORMATION: See the document "NCAR Raster Interchange Format and TAGS Raster Reference Manual", available from the Scientific Computing Division, National Center for Atmospheric Research, Boulder, CO, 80307-3000, for the structure of NCAR Raster Interchange Format (NRIF) files. MODIFICATION HISTORY: Written February, 1991 by Stan Solomon, LASP, University of Colorado. (Adapted from the WRITE_SRF procedure.)
(See C:\RSI\IDL52\lib\write_nrif.pro)
NAME: WRITE_PICT PURPOSE: Writes image files with the current color palette in the PICT Version 2 Format. This format is used by Apple Macintosh Computers. CATEGORY: CALLING SEQUENCE: WRITE_PICT, FILE ;Writes contents of current window WRITE_PICT, FILE, IMAGE ;Writes given array WRITE_PICT, FILE, IMAGE, R, G, B ;Writes array w/given color table INPUTS: FILE = Scalar string giving the name of the PICT file to write. IMAGE = 2D matrix to be output. If IMAGE is omitted, the entire current window is read into an array and written to the PICT file. OPTIONAL INPUT PARAMETERS: R, G, B = The Red, Green, and Blue color vectors to be written with IMAGE. If not specified, the current color table is used OUTPUTS: FILE contains the image in a PICT version 2 file format. If color vectors were supplied, they are used. Otherwise, the last color tables established by LOADCT are used (If LOADCT hasn't been used to establish color tables yet it is used to load the B/W tables.). SIDE EFFECTS: If R, G, and B aren't supplied and LOADCT hasn't been called yet, this routine uses LOADCT to load the B/W tables. RESTRICTIONS: Only creates Version 2 PICT files. Only works with 8-bit displays PROCEDURE: Write out the header, size, and the following quickdraw opcodes: Version, HeaderOp, DefHilite, Clip, and PackBitsRect Then pack the image data using the QUICKDRAW PackBits run length encoding algorithm. Packing method: Each line is preceeded by a byte if the image width is less than 250 or a integer otherwise. This prefix tells how many bytes are in the packed line to follow. The line following this length descriptor is made up of a series of runs and data as follows: - Runs If there is a run, the high bit of the first byte is set and the other seven bits tell how many elements are in the run. The next byte is then the value of the run. Runs can only be 128 bytes in length so longer runs are broken up into smaller runs if they exceed 128 bytes. The smallest run is three bytes. - Data If there are a series of image values that differ at least every two bytes, they are written out after a byte that describes how many dissimilar data bytes are to follow. As with runs, the length of a run of data can not be longer than 128 without setting the high bit of the length descriptor so long strings of data are broken up into chunks 128 bytes or smaller. MODIFICATION HISTORY: Written 16 November 1990, Steve Richards. SMR, Aug 25, '92 Rewrote the packing routine and fixed bugs. JIY, Mar 30, '92 added fix to work on Ultrix and VMS. SMR, Oct 12, '93 Added changes suggested by Joe Gurman that prevented the clobbering of color vectors on exit from the routine. SMR, Jan 12, '94 Added a case for OSF byte ordering, suggested by Joe Gurman. DMS, Jun 24, 1994 Fixed byte ordering logic. Added code to clip image to # of colors-1
(See C:\RSI\IDL52\lib\write_pict.pro)
NAME: WRITE_PPM PURPOSE: Write an image to a PPM (true-color) or PGM (gray scale) file. PPM/PGM format is supported by the PMBPLUS and Netpbm packages. PBMPLUS is a toolkit for converting various image formats to and from portable formats, and therefore to and from each other. CATEGORY: Input/Output. CALLING SEQUENCE: WRITE_PPM, File, Image ;Write a given array. INPUTS: Image: The 2D (gray scale) or 3D (true-color) array to be output. KEYWORD PARAMETERS: ASCII = if set, formatted ASCII IO is used to write the image data. If omitted, or set to zero, the far more efficient binary IO (RAWBITS) format is used to write the image data. COMMON BLOCKS: None. SIDE EFFECTS: A file is written. RESTRICTIONS: This routine only writes 8-bit deep PGM/PPM files of the standard type. Images should be ordered so that the first row is the top row. If your image is not, use WRITE_PPM, File, REVERSE(Image, 2) MODIFICATION HISTORY: Written Nov, 1994, DMS.
(See C:\RSI\IDL52\lib\write_ppm.pro)
NAME: WRITE_SPR PURPOSE: This procedure writes a row-indexed sparse matrix stucture to a specified file. A row-indexed sparse matrix is created by the Numerical Recipes routine SPRSIN. CATEGORY: Sparse Matrix File I/O CALLING SEQUENCE: WRITE_SPR, AS, 'Filename' INPUTS: AS: row indexed sparse matrix created by SPRSIN Filename: Name of file to contain AS. KEYWORDS: NONE OUTPUTS: NONE EXAMPLE: a = [[3.,0., 1., 0., 0.],$ [0.,4., 0., 0., 0.],$ [0.,7., 5., 9., 0.],$ [0.,0., 0., 0., 2.],$ [0.,0., 0., 6., 5.]] as = SPRSIN(a) WRITE_SPR, as, 'sprs.as' MODIFICATION HISTORY: Written by: BMH, 1/94. Modified: GGS, RSI, July 1996 Changed NR_SPRSIN to SPRSIN.
(See C:\RSI\IDL52\lib\write_spr.pro)
NAME: WRITE_SRF PURPOSE: Write an IDL image and color table vectors to a Sun rasterfile. CATEGORY: CALLING SEQUENCE: WRITE_SRF, File ;Write contents of current window. WRITE_SRF, File, Image ;Write a given array. WRITE_SRF, File, Image, R, G, B ;Write array with given color tables. INPUTS: File: Scalar string giving the name of the rasterfile to write. Image: The 2D array to be output. If Image is dimensioned (3,n,m), a 24-bit Sun Raster File is written. If Image is omitted, the entire current window is read into an array and written to the SRF file. IMAGE should be of byte type, and in top to bottom scan line order. OPTIONAL INPUT PARAMETERS: R, G, B: The Red, Green, and Blue color vectors to be written with Image. KEYWORD PARAMETERS: ORDER: If specified, the image is written from the top down instead of bottom up. This only has effect when writing a file from the current IDL window instead of an image passed as a parameter. WRITE_32: If the input image is a true color image, dimensioned (3,n,m), it is normally written as a 24-bit raster file. Set this keyword to write the result as a 32-bit file. OUTPUTS: FILE contains the image in rasterfile format. If color vectors were supplied, they are used. Otherwise, the last color tables established by LOADCT are used (If LOADCT hasn't been used to establish color tables yet it is used to load the B/W tables.). See the file /usr/include/rasterfile.h for the structure of Sun rasterfiles. COMMON BLOCKS: COLORS SIDE EFFECTS: If R, G, and B aren't supplied and LOADCT hasn't been called yet, this routine uses LOADCT to load the B/W tables. RESTRICTIONS: This routine only writes 32, 24, & 8-bit deep rasterfiles of type RT_STANDARD. Use the Unix command rasfilter8to1(1) to convert these files to 1-bit deep files. MODIFICATION HISTORY: Written 26 June 1988, AB. Added 24 bit color, March 1990, DMS. Added 32 bit color, July, 1990, DMS. Changed to use CURRENT, rather than ORIGINAL colortables, if the color parameter is not provided. Made sure that colortables were written as bytes. April, 1991. Fixed bug that misordered the colors when writing a 24 bit image. Jan, 1992. Fixed bug that had the colors for 24 bit images misordered. The colors were being written as RGB, bug for a standard type of SRF the colors should be in BGR order. This is as per the Ency. of Graphic file formats. Also verfied this with other SRF reading programs. May 7th,1996 kdb. Fixed bug that occurred when byte padding was performed on an odd columned image. The values in the file header didn't reflect this addition of one column to the file. May 7th, 1996 kdb.
(See C:\RSI\IDL52\lib\write_srf.pro)
NAME: WRITE_SYLK PURPOSE: Writes the contents of an IDL variable to a sylk (Symbolic Link) format spreadsheet data file. CATEGORY: Input/Output. CALLING SEQUENCE: fStatus = WRITE_SYLK(OutFile, SourceData [, STARTROW, STARTCOL]) INPUT: OutFile: Scalar string with the name of the sylk file to write. SourceData: A scalar, a vector, or a 2D array to be written to file. OUTPUT: fStatus: Boolean flag. Returns TRUE if function was successful. OPTIONAL INPUT PARAMETERS: STARTROW: The starting (0-based) row of spreadsheet cells to which the routine will write the data. If not specified, this value defaults to row 0. STARTCOL: The starting (0-based) column of spreadsheet cells to which the routine will write the data. If not specified, this value defaults to column 0. SIDE EFFECTS: None. RESTRICTIONS: This routine *only* writes numerical and string sylk data. It connot handle spreadsheet and cell formatting information such as cell width, text justification, font type, date, time, and monetary notations, etc. A particular sylk data file cannot be appended with data blocks through subsequent calls. EXAMPLES: Assume you wished to write the contents of a 2x2 array of floats, arrfltData, to a sylk data file called "bar.slk" such that, when read into a spreadsheet, the matrix would appear with it's upper left data at the cell in the 10th row and the 20th column. The following call would accomplish this task: fStatus = WRITE_SYLK("bar.slk", arrflData, STARTROW = 9, STARTCOL = 19) MODIFICATION HISTORY: Written October 1994, AJH Modified; Feb. 1998, SVP : Added FATAL_MESSAGE and FATAL_Cleanup so that a catchable error is produced.
(See C:\RSI\IDL52\lib\write_sylk.pro)
NAME: WRITE_WAVE PURPOSE: Write a three dimensional IDL array to a .wave or .bwave file for use with the Wavefront Visualizer. CALLING SEQUENCE: WRITE_WAVE, File, Array INPUTS: File: Scalar string giving the name of the Wavefront file to write. Array: 3D matrix to be output. KEYWORD PARAMETERS: BIN: If the BIN keyword is set, the file will be written in Binary mode, otherwise, it is written as a text file. DATANAME: The name of the data inside of the Wavefront file. If not specified, the name used is "idldata". MESHNAME: The name of the mesh used in the Wavefront file. When not specified, the name used is "idlmesh". NOMESHDEF: When set, no mesh definition is included. VECTOR: When set, the variable being written is written as a vector OUTPUTS: FILE contains the array in Wavefront file format. If DATANAME was supplied, the scalar data field in the Wavefront file is given that name. RESTRICTIONS: This routine only writes one scalar field for each Wavefront file that it creates. MODIFICATION HISTORY: Written July 3, 1991, by Steve Richards.
(See C:\RSI\IDL52\lib\write_wave.pro)
NAME: XANIMATE PURPOSE: Display an animated sequence of images using Xwindows Pixmaps, or the SunView display. CATEGORY: Image display. CALLING SEQUENCE: To initialize: XANIMATE, SET = [Sizex, Sizey, Nframes, Show_Window] To load a single image: XANIMATE, IMAGE = Image, FRAME = Frame_Index To load a single image that is already displayed in an existing window: XANIMATE, FRAME = Frame_Index, WINDOW = [ Window [, X0, Y0, Sx, Sy]] (This technique is much faster than reading back from the window.) To display the animation after all the images have been loaded: XANIMATE [, Rate] To stop the display, hit any key. To close and deallocate the pixmap/buffer: XANIMATE, /CLOSE OPTIONAL INPUT PARAMETERS: Rate: The basic display rate in frames per second. The default value is "infinity". Note, however, that the maximum rate of display is limited by the speed of your computer and video hardware. The delay between loading successive images is 1.0/Rate. KEYWORD PARAMETERS: SET: A vector of parameters that initialize XANIMATE. SET should be set to a 3- to 5-element integer vector containing the following parameters: Sizex, Sizey: The X and Y sizes of the images to be displayed, in pixels. Nframes: The number of frames in the animated sequence. Show_Window: The number of the window in which to display the animation. If this parameter is omitted, window 0 is used. This parameter is ignored for Sun (the current window is used.) IMAGE: A 2D array containing an image to be loaded at the position given by FRAME. The FRAME keyword must also be specified. FRAME: The number of the frame to load an image in. FRAME must be in the range 0 to Nframes-1. FRAME is used in conjunction with either the IMAGE or WINDOW keywords. WINDOW: The number of an existing window to copy an image from. When using X windows, this technique is much faster than reading from the display and then calling XANIMATE. The value of this parameter is either a simple window index (in which case the entire window is copied), or a 5-element vector containing the window index, the starting X and Y locations of the area to be copied, and the X and Y sizes of the area to be copied (in pixels). ORDER: Set this keyword if images are to be displayed from top down. Omit it or set it to zero if images go from bottom to top. This keyword is only used when loading images. CLOSE: Set this keyword to delete the pixwin and window and free memory. TITLE: A string to use as the title of the animation window (X only). OUTPUTS: No explicit outputs. COMMON BLOCKS: XANIMATE_COM - private common block. SIDE EFFECTS: A pixmap and window are created. RESTRICTIONS: XANIMATE only works for X windows or Sun View. FOR X: An animation may not have more than approximately 127 frames. FOR SUN: A large 2D memory array is made to contain the images. For large images or a large number of frames, this procedure can be a real memory hog. For SunView, faster operation can be obtained by using a non-retained window. Users of X windows can use an improved, "widgetized" version of this routine called XINTERANIMATE from the IDL widget library. PROCEDURE: When initialized, this procedure creates an approximately square pixmap or memory buffer, large enough to contain Nframes of the requested size. Once the images are loaded using the FRAME and IMAGE or WINDOW keywords, they are displayed by copying the images from the pixmap or buffer to the visible window. MODIFICATION HISTORY: DMS, April, 1990. Modified to use numerous windows under X, DMS, March, 1991. This mod improves virtual memory allocation and the size of animations the VAXen can do.
(See C:\RSI\IDL52\lib\obsolete\xanimate.pro)
NAME: XBM_EDIT PURPOSE: This routine allows users to create and edit bitmaps for use with IDL widgets as icons. The icons can be saved in two different file formats. IDL "array definition files" are text files that can be inserted into IDL programs. "Bitmap array files" are data files that can be read into IDL programs. Bitmap array files are to be used temporarily until the final icon design is determined and then they can be saved as IDL array definitions for inclusion in the final code. This routine does not check the file types of the files being read in and assumes that they are of the correct size and type for reading. CATEGORY: Widgets. CALLING SEQUENCE: XBM_EDIT KEYWORD PARAMETERS: FILENAME: A scalar string that contains the file name to be used. If this argument is not specified, the name "idl.bm" is used. GROUP: The widget ID of the widget that calls XBM_EDIT. When this ID is specified, the death of the caller results in the death of XBM_EDIT. XSIZE: The number of pixels across the bitmap is in the horizontal direction. The default value is 16 pixels. YSIZE: The number of pixels across the bitmap is in the vertical direction. The default value is 16 pixels. BLOCK: Set this keyword to have XMANAGER block when this application is registered. By default the Xmanager keyword NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting BLOCK for this application will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. SIDE EFFECTS: Initiates the XManager if it is not already running. Note that rotating an XSIZE x YSIZE bitmap by 90 net degrees changes it to a YSIZE x XSIZE bitmap. RESTRICTIONS: XBM_EDIT maintains its state in a common block so it is restricted to one working copy at a time. PROCEDURE: Create and register the widget and then exit. MODIFICATION HISTORY: Created from a template written by: Steve Richards, January, 1991 1/96, RPM - fixed bugs so non-square bitmaps can be rotated; fixed bug so doesn't hang if draw a single pixel "line"; fixed bugs so can read bitmap array files that are not square and don't end on byte boundaries; added FREE_LUN and made several other minor fixes.
(See C:\RSI\IDL52\lib\xbm_edit.pro)
NAME: XDICE PURPOSE: The primary purpose of this routine is to serve as an example for the Widgets chapter of the IDL User's Guide. It uses the CW_DICE compound widget (also written as an example) to present a pair of dice. CATEGORY: Widgets CALLING SEQUENCE: XDICE INPUTS: No explicit inputs. KEYWORD PARAMETERS: GROUP - Group leader, as passed to XMANAGER. OUTPUTS: None. PROCEDURE: Two dice are presented, along with "Done" and "Roll" buttons. Pressing either dice rolls that dice. pressing the Roll button rolls both dice. A label widget at the bottom displays the current dice values. Press "Done" to kill the application. MODIFICATION HISTORY: 24 October 1993, AB, RSI
(See C:\RSI\IDL52\examples\doc\xdice.pro)
NAME: XDISPLAYFILE PURPOSE: Display an ASCII text file using widgets and the widget manager. CATEGORY: Widgets. CALLING SEQUENCE: XDISPLAYFILE, Filename INPUTS: Filename: A scalar string that contains the filename of the file to display. The filename can include a path to that file. KEYWORD PARAMETERS: BLOCK: Set this keyword to have XMANAGER block when this application is registered. By default the Xmanager keyword NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting BLOCK for this application will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. DONE_BUTTON: the text to use for the Done button. If omitted, the text "Done with" is used. EDITABLE: Set this keyword to allow modifications to the text displayed in XDISPLAYFILE. Setting this keyword also adds a "Save" button in addition to the Done button. FONT: The name of the font to use. If omitted use the default font. GROUP: The widget ID of the group leader of the widget. If this keyword is specified, the death of the group leader results in the death of XDISPLAYFILE. HEIGHT: The number of text lines that the widget should display at one time. If this keyword is not specified, 24 lines is the default. TEXT: A string or string array to be displayed in the widget instead of the contents of a file. This keyword supercedes the FILENAME input parameter. TITLE: A string to use as the widget title rather than the file name or "XDisplayFile". WIDTH: The number of characters wide the widget should be. If this keyword is not specified, 80 characters is the default. WTEXT: Output parameter, the id of the text widget. This allows setting text selections and cursor positions programmatically. OUTPUTS: No explicit outputs. A file viewing widget is created. SIDE EFFECTS: Triggers the XMANAGER if it is not already in use. RESTRICTIONS: None. PROCEDURE: Open a file and create a widget to display its contents. MODIFICATION HISTORY: Written By Steve Richards, December 1990 Graceful error recovery, DMS, Feb, 1992. 12 Jan. 1994 - KDB If file was empty, program would crash. Fixed. 4 Oct. 1994 MLR Fixed bug if /TEXT was present and /TITLE was not. 2 jan 1997 DMS Added DONE_BUTTON keyword, made Done button align on left, removed padding.
(See C:\RSI\IDL52\lib\xdisplayfile.pro)
NAME: XDISTFILE PURPOSE: Displays ASCII text files from the IDL distribution. Unlike XDISPLAYFILE, this routine understands that under VMS, IDL routines are packed in VMS text libraries. CATEGORY: Widgets. CALLING SEQUENCE: XDISTFILE, Filename, Subdirectory INPUTS: Filename: A scalar string that contains the filename of the file to display NOT INCLUDING the '.pro' extension or any path information. Subdirectory: Subdirectory information in the style of the FILEPATH user library routine. KEYWORD PARAMETERS: Any keywords allowed by XDISPLAYFILE are also allowed. OUTPUTS: No explicit outputs. A file viewing widget is created. SIDE EFFECTS: Triggers the XMANAGER if it is not already in use. RESTRICTIONS: None. PROCEDURE: This is a thin wrapper over the XDISPLAYFILE routine. In the case of VMS text libraries, the last element of the SUBDIRECTORY argument is taken to be the TLB file name, and FILENAME is actually the module name in that library. MODIFICATION HISTORY: 1 June 1994, AB
(See C:\RSI\IDL52\lib\xdistfile.pro)
NAME: XDL PURPOSE: Provide a graphical user interface to the DOC_LIBRARY user library procedure. XDL is different from the "?" command under X windows in that every "user library" type routine in the IDL distribution is displayed in a single list. Also, any ".pro" files in the current directory are scanned for documentation headers and put into the list if they are documented. CATEGORY: Help, documentation, widgets. CALLING SEQUENCE: XDL [, Name] OPTIONAL INPUTS: Name: A scalar string that contains the name of the initial routine for which help is desired. This argument should be a scalar string. KEYWORDS: GROUP: The widget ID of the widget that calls XDL. When this keyword is specified, a death of the caller results in a death of XDL. OUTPUTS: No explicit outputs. A widget interface is used to allow reading the help text. COMMON BLOCKS: XDL_BLOCK - Internal to this module. RESTRICTIONS: This routine does not support many of the keywords supported by the DOC_LIBRARY procedure. This routine uses DOC_LIBRARY to do much of the actual work of finding the documentation text. The alternative would be to duplicate much of DOC_LIBRARY, which is undesirable. However, the use of DOC_LIBRARY leads to messages sometimes being sent to the terminal. MODIFICATION HISTORY: 5 January 1991, AB 9 January 1992, ACY for Jim Pendleton, NWU; handle invalid library 28 April 1992, AB, Modified to only search !PATH for routine names on the first invocation. The names are saved in the XDL_BLOCK common block, so that following invocations start much faster. 15 September 1991, ACY, Correct ls command for IRIX 20 February 1993 Updated for VMS directory Library W. Landsman 27 May 1993, TAC, Send invalid OS message for Windows and Macintosh 25 June 1993, AB, Fixed error in call to DL_VMS, and shortened the list and text widgets slightly to accomodate larger fonts. 1 July 1995, AB, Replaced use of XANNOUNCE with WIDGET_MESSAGE and improved status label sizing.
(See C:\RSI\IDL52\lib\obsolete\xdl.pro)
NAME: XFONT PURPOSE: XFONT is a modal widget for selecting and viewing an X Windows font. CATEGORY: Widgets, Fonts CALLING SEQUENCE: Selected_font = XFONT() INPUTS: No explicit inputs. KEYWORD PARAMETERS: GROUP: The widget ID of the widget that calls XFONT. When this ID is specified, a death of the caller results in a death of XFONT. PRESERVE: If set, XFONT saves the server font directory in common blocks so that subsequent calls to XFONT start-up much faster. If not set, the common block is cleaned. OUTPUTS: A string containing the font name. If nothing is selected, or the CANCEL button is pressed, a null string is returned. COMMON BLOCKS: XFONT_COM. SIDE EFFECTS: Initiates the XManager if it is not already running. Resets the current X Window font. RESTRICTIONS: The current X window font is manipulated without being restored. This routine does not work on non-X Windows platforms (i.e., Windows and Macintosh). PROCEDURE: Create and register the widget and then exit. MODIFICATION HISTORY: Modified from a template written by: Hans-Joachim Bothe, CreaSo GmbH, November, 1991, by DMS, RSI, November, 1992. 1 July 1995, AB, Fixed sizing of toggle buttons. 6 July 1995, MWR, Added platform check to return to caller if running on Windows or Macintosh.
(See C:\RSI\IDL52\lib\xfont.pro)
NAME: XGetData PURPOSE: Retrieves a data file from the images directory in the main IDL directory. The file can be specified when calling the routine or the file can be chosen by the user with a widget that lets them make the selection. CATEGORY: Widgets CALLING SEQUENCE: XGetData, NEWDATA KEYWORD PARAMETERS: ASSOC_IT = When set, this keyword forces the routine to return an associated variable instead of a standard IDL variable. This is more efficient when loading animations for instance as it removes the need to create two copies of the data in memory (one for the animation, one for the load data). DESCRIPTION = This keyword returns the description of the data selected by the XGetData routine (NEWDATA). DIMENSIONS = This keyword returns the dimensions of the data selected by the XGetData routine. These dimensions are the dimensions of the NEWDATA variable. FILENAME = The name of the file that is to be selected from the images subdirectory. If this keyword is set, no user selection widget is created. OFILENAME = name of file selected. ONE_DIM = This keyword is set when the routine is to consider one dimensional data from the data contained in the images subdirectory. TWO_DIM = This keyword is set when the routine is to consider two dimensional data from the data contained in the images subdirectory. When searching for two dimensional data, this routine will use the first slice of any three dimensional data that it encounters. THREE_DIM = This keyword is set when the routine is to consider three dimensional data from the data contained in the images subdirectory. TITLE = The string that will appear in the title portion of the data selection widget. If not specified, the title will be "Please Select Data". OUTPUTS: NEWDATA = the variable that is to be filled with the new data. COMMON BLOCKS: GF - maintains which selection was made when using the data selection widget. SIDE EFFECTS: Desensitizes all the other widgets and is modal in behavior. It forces the user to make a selection before proceeding with other widget functions. RESTRICTIONS: Needs to have directory called images in the main IDL directory (IDL_DIR) and the directory must contain a file called data.txt that describes the contents of the directory. PROCEDURE: If the FILENAME keyword was not set, determine the file name using a widget that lets the user make a selection from the data.txt file and then open that file, read the data, dimensions, and description, and return the data. MODIFICATION HISTORY: Written by Steve Richards, Dec, 1990
(See C:\RSI\IDL52\examples\misc\wexmast\xgetdata.pro)
NAME: XINTERANIMATE PURPOSE: Display an animated sequence of images using X-windows Pixmaps. The speed and direction of the display can be adjusted using the widget interface. CATEGORY: Image display, widgets. CALLING SEQUENCE: To initialize: XINTERANIMATE, SET = [Sizex, Sizey, Nframes] To load a single image: XINTERANIMATE, IMAGE = Image, FRAME = Frame_Index To load a single image that is already displayed in an existing window: XINTERANIMATE, FRAME = Frame_index, $ WINDOW = [Window_Number [, X0, Y0, Sx, Sy]] (This technique is much faster than reading back from the window.) To display the animation after all the images have been loaded: XINTERANIMATE [, Rate] To close and deallocate the pixmap/buffer (which also takes place automatically when the user presses the "Done With Animation" button or closes the window with the window manager): XINTERANIMATE, /CLOSE OPTIONAL INPUTS: Rate: A value between 0 and 100 that represents the speed of the animation as a percentage of the maximum display rate. The fastest animation is with a value of 100 and the slowest is with a value of 0. The default animation rate is 100. The animation must be initialized using the SET keyword before calling XINTERANIMATE with a rate value. KEYWORD PARAMETERS: CLOSE: Set this keyword to delete the offscreen pixwins and Widget, freeing storage. CYCLE: If set, cycle. Normally, frames are displayed going either forward or backwards. If CYCLE is set, reverse direction after the last frame in either direction is displayed. Provide this keyword with the SET keyword. FRAME: The frame number when loading frames. This keyword only has an effect when used in conjunction with the SET keyword. FRAME must be set to a number in the range 0 to Nframes-1. GROUP: The widget ID of the widget that calls XINTERANIMATE. When this ID is specified, the death of the caller results in the death of XINTERANIMATE. IMAGE: A single image to be loaded at the animation position given by FRAME. The keyword parameter FRAME must also be specified. KEEP_PIXMAPS: If TRUE, XINTERANIMATE doesn't destroy the animation pixmaps when it is killed. Calling it again without going through the SET and LOAD steps will cause the same animation to play without the overhead of creating the pixmaps. BLOCK: Set this keyword to have XMANAGER block when this application is registered. By default the Xmanager keyword NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting BLOCK for this application will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. ORDER: Set this keyword to display images from the top down instead of the default bottom up. This keyword is only used when loading images. MODAL: If set, then XINTERANIMATE runs in "modal" mode, meaning that all other widgets are blocked until the user quits XINTERANIMATE. MPEG_OPEN: Set this keyword to open an MPEG file. MPEG_FILENAME: Set this keyword equal to a string for the desired MPEG filename. If not set, idl.mpg is used. MPEG_CLOSE: Set this keyword to write the MPEG file. SHOWLOAD: Set this keyword (in conjunction with the SET keyword) to display each frame and update the frame slider as frames are loaded. SET: This keyword initializes XINTERANIMATE. SET should be equated to a 3-element integer vector containing the following parameters: Sizex, Sizey: The width and height of the images to be displayed, in pixels. Nframes: The number of frames in the animated sequence (since XINTERANIMATE is an animation routine, Nframes must be at least 2 frames). TITLE: A string to be used as the title of the widget. If this keyword is not specified, the title is set to "XInterAnimate" This keyword has an effect only when used in conjunction with the SET keyword). TRACK: If set, the frame slider tracks the current frame. Default is not to track. Provide this keyword with the SET keyword. WINDOW: When this keyword is specified, an image is copied from an existing window to the animation pixmap. When using X windows, this technique is much faster than reading from the display and then calling XINTERANIMATE with a 2D array. The value of this parameter is either an IDL window number (in which case the entire window is copied), or a vector containing the window index and the rectangular bounds of the area to be copied, for example: WINDOW = [Window_Number, X0, Y0, Sx, Sy] XOFFSET: The horizontal offset, in pixels from the left of the frame, of the image in the destination window. YOFFSET: The vertical offset, in pixels from the bottom of the frame, of the image in the destination window. OUTPUTS: No explicit outputs. COMMON BLOCKS: XINTERANIMATE_COM: a private common block. SIDE EFFECTS: A pixmap and widget are created. RESTRICTIONS: Only a single copy of XINTERANIMATE can run at a time. PROCEDURE: When initialized, this procedure creates an approximately square pixmap or memory buffer, large enough to contain Nframes of the requested size. Once the images are loaded, using the IMAGE and FRAME keywords, they are displayed by copying the images from the pixmap or buffer to the visible draw widget. EXAMPLE: Enter the following commands to open the file ABNORM.DAT (a series of images of a human heart) and animate the images it contains using XINTERANIMATE. For a more detailed example of using XINTERANIMATE, see the example in the "Using IDL Widgets" chapter of "IDL Basics". Read the images into the variable H by entering: OPENR, 1, FILEPATH('abnorm.dat', SUBDIR = 'images') H = BYTARR(64, 64, 16) READU, 1, H CLOSE, 1 H = REBIN(H, 128, 128, 16) Initailize XINTERANIMATE with the command: XINTERANIMATE, SET=[128, 128, 16], /SHOWLOAD Load the images into XINTERANIMATE and play the animation by entering: FOR I=0,15 DO XINTERANIMATE, FRAME = I, IMAGE = H[*,*,I] XINTERANIMATE MODIFICATION HISTORY: DMS, April, 1990. SMR, December, 1990. Modified the XANIMATE code to work interactively with widgets. DMS, March, 1991. Modified the routine to use individual pixmaps for each frame of the animation. Also added the ability to read in from current IDL windows directly into offscreen bitmap. SMR, March, 1991. Modified to use new XMANAGER keyword CLEANUP to clean up the offscreen pixmaps when dying. SMR, Jan, 1992. Modified the /CLOSE portion to check for a valid widget before using WIDGET_CONTROL and /DESTROY. AB, June 1992 Rewrite using the new CW_ANIMATE compound widget. Added the KEEP_PIXMAPS keyword. DJE, April, 1996 Replaced XANNOUNCE with DIALOG_MESSAGE SJL, December, 1997 Added MPEG capability. LP, 6/16/98 Added MODAL keyword.
(See C:\RSI\IDL52\lib\xinteranimate.pro)
NAME: XLOADCT PURPOSE: A graphical interface to the LOADCT user library procedure. XLOADCT displays the current color map and provides an array of buttons, one per availible predefined color table. Using the mouse to press these buttons causes the corresponding color map to be loaded. CATEGORY: Widgets CALLING SEQUENCE: XLOADCT INPUTS: None. KEYWORDS: FILE: If this keyword is set, the file by the given name is used instead of the file colors1.tbl in the IDL directory. This allows multiple IDL users to have their own color table file. GROUP = The widget ID of the widget that calls XLoadct. When this ID is specified, a death of the caller results in a death of XLoadct NCOLORS = number of colors to use. Use color indices from BOTTOM to the smaller of !D.TABLE_SIZE-1 and NCOLORS-1. Default = !D.TABLE_SIZE = all available colors. BOTTOM = first color index to use. Use color indices from BOTTOM to BOTTOM+NCOLORS-1. Default = 0. SILENT - Normally, no informational message is printed when a color map is loaded. If this keyword is present and zero, this message is printed. USE_CURRENT: If set, use the current color tables, regardless of the contents of the COMMON block COLORS. MODAL: If set, then XLOADCT runs in "modal" mode, meaning that all other widgets are blocked until the user quits XLOADCT. A group leader must be specified (via the GROUP keyword) for the MODAL keyword to have any effect. The default is to not run in modal mode. BLOCK: Set this keyword to have XMANAGER block when this application is registered. By default the Xmanager keyword NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting BLOCK for this application will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. UPDATECALLBACK: Set this keyword to a string containing the name of a user-supplied procedure that will be called when the color table is updated by XLOADCT. The procedure may optionally accept a keyword called DATA, which will be automatically set to the value specified by the optional UPDATECBDATA keyword. UPDATECBDATA: Set this keyword to a value of any type. It will be passed via the DATA keyword to the user-supplied procedure specified via the UPDATECALLBACK keyword, if any. If the UPDATECBDATA keyword is not set the value accepted by the DATA keyword to the procedure specified by UPDATECALLBACK will be undefined. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: One of the predefined color maps may be loaded. RESTRICTIONS: This routine uses the LOADCT user library procedure to do the actual work. MODIFICATION HISTORY: 24, August, 1990, Written by AB, RSI. March 1, 1992 Mark Rivers added Reverse Table to options menu. 7/92, DMS, Added new color tables (allows more than 16). 9/92, ACY, Add FILE keyword. 10/1/96, AB, Removed the PICK_ONE keyword. It was broken for 4 years without anyone noticing, and the idea doesn't really fit XLOADCT anymore. 1/10/97, DJC - Fixed color bar display bug, and added "MODAL" keyword. 1/13/96, AB, Improved the saving and restoring of the current graphics window to prevent other applications from drawing on this applications windows. 1/17/97, DJC - Moved group_leader keyword from "XManager" to "WIDGET_BASE". Added check to ignore "MODAL" keyword if a group leader is not specified. 8/20/98, ACY - Added UPDATECALLBACK and UPDATECBDATA keywords.
(See C:\RSI\IDL52\lib\xloadct.pro)
NAME: XMANAGER PURPOSE: Provide management for widgets client applications created using IDL. CATEGORY: Widgets. CALLING SEQUENCE: XMANAGER [, Name, ID] OPTIONAL INPUTS: NAME: A string giving the name of the application that is being registered. ID: The widget ID of the top level base of the new client. KEYWORD PARAMETERS: BACKGROUND: ------------------------------------------------------------- | PLEASE NOTE: This keyword is OBSOLETE. It's functionality | | is provided by the TIMER keyword to the WIDGET_CONTROL | | procedure. | ------------------------------------------------------------- CATCH: If TRUE, tells XMANAGER to use CATCH when dispatching widget events. If FALSE, CATCH is not used and execution halts on error. The default is TRUE. If CATCH is specified, the internal state of XMANAGER is updated and it returns immediately without taking any further action. CATCH is only effective if XMANAGER is blocking to dispatch errors. If active command line event dispatching is in use, it has no effect. CLEANUP: This keyword contains a string that is the name of the routine called when the widget dies. If not specified, no routine is called. The cleanup routine must accept one parameter which is the widget id of the dying widget. This routine is set as the KILL_NOTIFY routine for the widget. EVENT_HANDLER: The name of the event handling routine that is to be called when a widget event occurs in the registered application. If this keyword is not supplied, the Xmanager will construct a default name by adding the "_EVENT" suffix to the NAME argument. See below for a more detailed explanation. GROUP_LEADER: The widget id of the group leader for the application being registered. When the leader dies, all widgets that have that leader will also die. For example, a widget that views a help file for a demo widget would have that demo widget as it's leader. When the help widget is registered, it sets the keyword GROUP_LEADER to the widget id of the demo widget. If the demo widget is destroyed, the help widget led by the it would be killed by the XMANAGER. JUST_REG: This keyword tells the manager to just register the widget but not to start doing the event processing. This is useful when you want to register a group of related top level widgets but need to regain control immediately afterwards. NOTE: JUST_REG does not do the same thing as NO_BLOCK. This is explained in detail below under "SIDE EFFECTS". MODAL: -------------------------------------------------------------- | PLEASE NOTE: This keyword is OBSOLETE. It's functionality | | is provided by the MODAL keyword to the WIDGET_BASE | | procedure. | -------------------------------------------------------------- When this keyword is set, the widget that is being registered traps all events and desensitizes all the other widgets. It is useful when input from the user is necessary before continuing. Once the modal widget dies, the others are resensitized and the normal event processing is restored. XMANAGER is therefore using sensitivity to provide the illusion of modality. The WIDGET_BASE keyword is a newer IDL feature that provides the real thing. NO_BLOCK: If set, tells XMANAGER that the registering client does not require XMANAGER to block if active command line event processing is available. If active command line event processing is available *AND* every current XMANAGER client specifies NO_BLOCK, then XMANAGER will not block and the user will have access to the command line while widget applications are running. NOTE: NO_BLOCK does not do the same thing as JUST_REG. This is explained in detail below under "SIDE EFFECTS". OUTPUTS: No outputs. COMMON BLOCKS: MANAGED XMANAGER_LOCAL: Common blocks used for module state maintenance. These common blocks are considered private to this module and should not be referenced outside RSI supplied routines. They are subject to change without notice. SIDE EFFECTS: JUST_REG vs NO_BLOCK -------------------- Although their names imply a similar function, the JUST_REG and NO_BLOCK keywords perform very different services. It is important to understand what they do and how they differ. JUST_REG tells XMANAGER that it should simply register a client and then return immediately. The result is that the client becomes known to XMANAGER, and that future calls to XMANAGER will take this client into account. Therefore, JUST_REG only controls how the registering call to XMANAGER should behave. The registered client can still be registered as requiring XMANAGER to block by not setting NO_BLOCK. In this case, future calls to XMANAGER will block. NO_BLOCK tells XMANAGER that the registered client does not require XMANAGER to block if the command processing front end is able to support active command line event processing (described below). XMANAGER remembers this attribute of the client until the client exits, even after the call to XMANAGER that registered the client returns. NO_BLOCK is just a "vote" on how XMANAGER should behave. The final decision is made by XMANAGER by considering the NO_BLOCK attributes of all of its current clients as well as the ability of the command front end in use to support the active command line. Blocking vs Non-blocking ------------------------ The issue of blocking in XMANAGER requires some explanation. IDL places incoming widget events into a queue of pending events. The only way to get these events processed and dispatched is to call the WIDGET_EVENT function. Arranging for WIDGET_EVENT to be called properly is the primary job of XMANAGER. XMANAGER offers two different modes of operation: - The first (outermost) XMANAGER processes events by calling WIDGET_EVENT as necessary until no managed clients remain on the screen. This is referred to as "blocking", because XMANAGER does not return to the caller until it is done, and the IDL command line is not available. - XMANAGER does not block, and instead, the part of IDL that reads command input also watches for widget events and calls WIDGET_EVENT as necessary while also reading command input. This is referred to as "non-blocking" or "active command line" mode. The default is to block. However, if every currently active application specified the NO_BLOCK keyword to XMANAGER, non-blocking mode is used, if possible. There are currently 5 separate IDL command input front end implementations: - Apple Macintosh IDE - Microsoft Windows IDE - Motif IDE (Unix and VMS) - Unix plain tty - VMS plain tty Except for the VMS plain tty, all of these front ends are able to support the non-blocking active command line. VMS users can have an active command line by using the IDLde interface. The decision on whether XMANAGER blocks to process widget events is determined by the following rules, in order of precedence: - Use of the MODAL keyword will cause XMANAGER to block. - Setting JUST_REG to 1 ensures that XMANAGER will not block. - If using the VMS plain tty interface, XMANAGER will block. - If none of the previous rules apply, XMANAGER will block if any of its currently active clients were registered without specifying NO_BLOCK. If NO_BLOCK is specified for every client, XMANAGER will not block and will instead return and allow active command line processing to take place. When possible, applications should set the NO_BLOCK keyword. This allows the IDL command line to be active while events are being processed, which is highly desirable. RESTRICTIONS: The implementation of XMANAGER may change in the future. Details of its internal implementation must not be relied upon --- only its external definition can be considered stable. XMANAGER uses several undocumented features provided by the internal WIDGET routines. These features are private to RSI, and are not guaranteed to remain in IDL or to remain unchanged. They exist only to support XMANAGER and should not be used elsewhere: WIDGET_CONTROL, /XMANAGER_ACTIVE_COMMAND WIDGET_CONTROL, /MODAL WIDGET_EVENT, /BREAK_ON_EXPOSE WIDGET_EVENT, /EVENT_BREAK WIDGET_EVENT, /XMANAGER_BLOCK WIDGET_INFO, /XMANAGER_BLOCK These features are undocumented because they are not considered permanent. Research Systems reserves the right to remove or alter these features at any time. EXAMPLE USE: To create a widget named Example that is just a base widget with a done button using the XMANAGER you would do the following: ;------ first - the event handler routine ------; PRO example_event, ev ;this is the routine that ;deals with the events in the ;example widget. WIDGET_CONTROL, ev.id, GET_UVALUE = uv ;the uservalue is retrieved ;from the widget where the ;event occurred if(uv eq 'DONE') then $ ;if the event occurred in the WIDGET_CONTROL, ev.top, /DESTROY ;done button then kill the END ;widget example ;------ second - the main routine ------; PRO example ;this is the main routine ;that builds the widget and ;registers it with the Xmanager base = WIDGET_BASE(TITLE = 'Example') ;first the base is created done = WIDGET_BUTTON(base, $ ;next the done button is TITLE = 'DONE', $ ;created and it's user value UVALUE = 'DONE') ;set to "DONE" WIDGET_CONTROL, base, /REALIZE ;the widget is realized XManager, 'example', base ;finally the example widget ;is registered with the ;Xmanager END notes: First the event handler routine is listed. The handler routine has the same name as the main routine with the characters "_event" added. If you would like to use another event handler name, you would need to pass it's name in as a string to the EVENT_HANDLER keyword. Also notice that the event routine is listed before the main routine. This is because the compiler will not compile the event routine if it was below the main routine. This is only needed if both routines reside in the same file and the file name is the same as the main routine name with the ".pro" extension added. PROCEDURE: When the first widget is registered, initialize the lists and then start processing events. Continue registering widgets and dispatching events until all the widgets have been destroyed. When a widget is killed, destroy all widgets that list the destroyed widget as their leader, if any. RELATED FUNCTIONS AND PROCEDURES: XREGISTERED, XMTOOL MODIFICATION HISTORY: Written by Steve Richards, November, 1990 SMR, Mar, 1991 Added a cleanup routine keyword to allow dying widgets to clean themselves up when dying. SMR, May, 1991 Fixed a bug found by Diane Parchomchuk where an error occurred when registering a widget ight after destroying another. SMR & ACY, July, 1991 Fixed a bug found by Debra Wolkovitch where lone widgets being destroyed and new ones created caused problems. SMR, Sept, 1991 Changed cleanup to use the new WIDGET_INFO routine. SMR & ACY, Oct, 1991 Fixed a bug where a background event that unregistered itself after a time would result in an XMANAGER error. SMR, Mar. 1992 Changed XMANAGER to use enhanced widget functions for event processing. SMR, Nov. 1992 Changed modal widget handling allowing nesting of modal widgets. The first modal desensitizes all current widgets and subsequent modals only desensitize the modal that called them. JIY, Apr. 1993 Changed modal widget handling process to not run the event loop for nested modal widgets. Allowed for multiple modal widgets. AB & SMR, 17 November 1993 Added ID validity checking to desensitizing of modal widgets to fix a bug where already dead widgets were being accessed. DJE, Feb, 1995 Made it so that non-modal widgets created from a modal widget have events processed in the modal widget's event loop. This fixes a bug where xmanager wouldn't return immediately if there was a modal widget somewhere in the nesting, even though a non-modal widget was being added. The nesting level could get _very_ deep. DJE, Apr 1995 Pass a local variable to WIDGET_EVENT in the MODAL case, instead of passing the common block variable modalList. This avoids a bug where modalList gets changed behind WIDGET_EVENT's back. DJE, Apr 1996 Changes for handling asynchronous widget event dispatching. Complete rewrite. Background tasks are no longer supported. The MODAL keyword is now obsolete. Added CATCH and BLOCK keywords. AB, May 1996 Made changes so that XMANAGER always blocks under VMS with the non-GUI interface. This is due to the fact that the SMG$ system routines used by IDL in the plain tty case cannot support interleaving of X events with tty input. AB, 9 January 1997 Changed the meaning of the CATCH keyword so that catching is the default. Removed BLOCK and replaced with NO_BLOCK. Switched default action back to blocking from unblocking based on feedback from the IDL 5 beta. Added the ability to block only as long as a client without NO_BLOCK is running, and then revert to the active command line. AB, 10 February 1997 Cleaned up code to make it easier to understand and maintain. Also cleaned up the distinction between real modality (MODAL keyword to WIDGET_BASE) and XMANAGER's older fake modality (MODAL keyword to XMANAGER), and fixed bugs in the current implementation of fake modality.
(See C:\RSI\IDL52\lib\xmanager.pro)
NAME: XMENU PURPOSE: This procedure simplifies setting up widget menus. XMENU accepts a string array of menu labels, creates a widget base, and populates the base with buttons containing the specified labels. CALLING SEQUENCE: XMENU, Values [, Parent] INPUTS: Values: An array of labels for the butons (menu items). If VALUES is a string array, then it is a 1-D array of labels. If it a byte array, it is a 3-D array of bitmaps, where the 1st 2 dimensions are the width and height of each bitmap. Parent: The widget ID of parent base widget. If this argument is omitted, the menu base is a top-level base. KEYWORDS: BASE: A named variable to recieve the widget ID of the created base. BUTTONS: A named variable to recieve the widget ID of the created buttons. This return value is a longword array, with each element matching the corresponding element in Values. COLUMN: This keyword specifies that the buttons should be layed out in columns. The value specified gives the number of columns desired. EXCLUSIVE: Set this keyword to make each menu selection an exclusive button. Exclusive buttons have both selected and unselected states and only one button at a time can be selected. FONT: A string containing the name of the font for the button labels. FRAME: If this keyword is specified, it represents the thickness (in pixels) of the frame drawn around the base. The default is no frame. NONEXCLUSIVE: Set this keyword to make each menu selection a non-exclusive button. Non-exclusive buttons have both selected and un-selected states. More that one button can be selected at one time. NO_RELEASE: Set this keyword to prevent the buttons from returning release events. Normally, buttons return both selection and release events. ROW: This keyword specifies that the buttons should be layed out in rows. The value specified gives the number of rows desired. SCROLL: Set this keyword to give the base scrollbars to allow a large number of buttons to be viewed in a small region. SPACE: The space, in pixels, to be left around the edges of the base. TITLE: If PARENT is not specified, TITLE specifies the MENU title. If PARENT is specified, a framed base is created and a label with the value TITLE is added before the menu. XPAD: The horizontal space, in pixels, to be left between the buttons. YPAD: The vertical space, in pixels, to be left between the buttons. UVALUE: An array of user values to be set into the UVALUE of the buttons. This array must have the same number of elements as VALUES. X_SCROLL_SIZE: The width of the scrolling viewport. This keyword implies SCROLL. Y_SCROLL_SIZE: The height of the scrolling viewport. This keyword implies SCROLL. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: A widget base containing buttons is created, but not realized. EXAMPLE: For an example of using XMENU to create menus see the "Non-Exclusive Menu" and "Exclusive Menu" examples in the "Simple Widget Examples". The simple widget examples menu can be seen by entering WEXMASTER at the IDL prompt. MODIFICATION HISTORY: 16 January 1991, AB, RSI 5 September 1991, SMR, RSI Fixed bug where titles were ignored when no base specified. 21 January 1992, ACY, RSI Added FONT keyword.
(See C:\RSI\IDL52\lib\obsolete\xmenu.pro)
NAME: XMNG_TMPL PURPOSE: This routine is a template for widgets that use the XManager. Use this template instead of writing your widget applications from "scratch". This documentation should be altered to reflect the actual implementation of the XMNG_TMPL widget. Use a global search and replace to replace the word "Xmng_tmpl" with the name of the routine you would like to use. The name should be no longer than "XMng_tmpl". All the comments with a "***" in front of them should be read, decided upon and removed for your final copy of the XMng_tmpl widget routine. CATEGORY: Widgets. CALLING SEQUENCE: XMNG_TMPL INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: GROUP: The widget ID of the widget that calls XMng_tmpl. When this ID is specified, the death of the caller results in the death of Xmng_tmpl. BLOCK: Set this keyword to have XMANAGER block when this application is registered. By default the Xmanager keyword NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting BLOCK for this application will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: Initiates the XMANAGER if it is not already running. RESTRICTIONS: PROCEDURE: Create and register the widget and then exit. MODIFICATION HISTORY: Created from a template written by: Steve Richards, January, 1991.
(See C:\RSI\IDL52\lib\xmng_tmpl.pro)
NAME: XMTOOL PURPOSE: Provide a tool for viewing Widgets currently being managed by the XMANAGER. CATEGORY: Widgets. CALLING SEQUENCE: XMTOOL KEYWORD PARAMETERS: GROUP: The widget ID of the group leader that the XMANAGERTOOL is to live under. If the group is destroyed, the XMANAGERTOOL is also destroyed. BLOCK: Set this keyword to have XMANAGER block when this application is registered. By default the Xmanager keyword NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting BLOCK for this application will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. SIDE EFFECTS: This procedure creates a widget that has the ability to destroy other widgets being managed by the XManager. RESTRICTIONS: Only one instance of the XMANAGERTOOL can run at one time. PROCEDURE: Initiate the widget and then let the timer routine update the lists as the widgets being managed by the XMANAGER are changed. MODIFICATION HISTORY: Written by Steve Richards, Dec, 1990. SMR - 6/93 Modified the routine to work with a timer instead of the obsolete background tasks.
(See C:\RSI\IDL52\lib\xmtool.pro)
NAME: XNOTHING PURPOSE: A demonstration of all the IDL widgets. This routine demonstrates everything without actually doing anything useful. CATEGORY: Widgets, demo. CALLING SEQUENCE: XNOTHING OUTPUTS: None. COMMON BLOCKS: None. RESTRICTIONS: None. MODIFICATION HISTORY: October, 1990, A.B. Revised to work with XMANAGER, 3 January 1991 Modified to handle changed event names.
(See C:\RSI\IDL52\examples\misc\xnothing.pro)
NAME: XPALETTE PURPOSE: Interactively create color tables using the RGB, CMY, HSV, and HLS color systems using the mouse, three sliders, and a cell for each color index. Single colors can be defined or multiple color indices between two endpoints can be interpolated. CATEGORY: Color tables, widgets. CALLING SEQUENCE: XPALETTE INPUTS: No explicit inputs. The current color table is used as a starting point. KEYWORD PARAMETERS: BLOCK: Set this keyword to have XMANAGER block when this application is registered. By default the Xmanager keyword NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting BLOCK for this application will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. UPDATECALLBACK: Set this keyword to a string containing the name of a user-supplied procedure that will be called when the color table is updated by XLOADCT. The procedure may optionally accept a keyword called DATA, which will be automatically set to the value specified by the optional UPDATECBDATA keyword. UPDATECBDATA: Set this keyword to a value of any type. It will be passed via the DATA keyword to the user-supplied procedure specified via the UPDATECALLBACK keyword, if any. If the UPDATECBDATA keyword is not set the value accepted by the DATA keyword to the procedure specified by UPDATECALLBACK will be undefined. OUTPUTS: None. COMMON BLOCKS: COLORS: Contains the current RGB color tables. XP_COM: Private to this module. SIDE EFFECTS: XPALETTE uses two colors from the current color table as drawing foreground and background colors. These are used for the RGB plots on the left, and the current index marker on the right. This means that if the user set these two colors to the same value, the XPALETTE display could become unreadable (like writing on black paper with black ink). XPALETTE minimizes this possibility by noting changes to the color map and always using the brightest available color for the foreground color and the darkest for the background. Thus, the only way to make XPALETTE's display unreadable is to set the entire color map to a single color, which is highly unlikely. The only side effect of this policy is that you may notice XPALETTE redrawing the entire display after you've modified the current color. This simply means that the change has made XPALETTE pick new drawing colors. The new color tables are saved in the COLORS common and loaded to the display. PROCEDURE: The XPALETTE widget has the following controls: Left: Three plots showing the current Red, Green, and Blue vectors. Center: A status region containing: 1) The total number of colors. 2) The current color. XPALETTE allows changing one color at a time. This color is known as the "current color" and is indicated in the color spectrum display with a special marker. 3) The current mark index. The mark is used to remember a color index. It is established by pressing the "Set Mark Button" while the current color index is the desired mark index. 4) The current color. The special marker used in color spectrum display prevents the user from seeing the color of the current index, but it is visible here. A panel of control buttons, which do the following when pressed: Done: Exits XPALETTE. Predefined: Starts XLOADCT to allow selection of one of the predefined color tables. Help: Supplies help information similar to this header. Redraw: Completely redraws the display using the current state of the color map. Set Mark: Set the value of the mark index to the current index. Switch Mark: Exchange the mark and the current index. Copy Current: Every color lying between the current index and the mark index (inclusive) is given the current color. Interpolate: The colors lying between the current index and the mark index are interpolated linearly to lie between the colors of two endpoints. Three sliders (R, G, and B) that allow the user to modify the current color. Right: A display which shows the current color map as a series of squares. Color index 0 is at the upper left. The color index increases monotonically by rows going left to right and top to bottom. The current color index is indicated by a special marker symbol. There are 4 ways to change the current color: 1) Press any mouse button while the mouse pointer is over the color map display. 2) Use the "By Index" slider to move to the desired color index. 3) Use the "Row" Slider to move the marker vertically. 4) Use the "Column" Slider to move the marker horizontally. MODIFICATION HISTORY: July 1990, AB. Based on the PALETTE procedure, which does similar things using only basic IDL graphics commands. 7 January 1991, Re-written for general use. 1 April 1992, Modified to use the CW_RGBSLIDER and CW_COLORSEL compound widgets. The use of color systems other than RGB is now supported. 15 June 1992, Modified to use the CW_FIELD and CW_BGROUP compound widgets. 7 April 1993, Removed state caching. Fixed a bug where switching the current index and the mark would fail to update the current index label. 10 March 1997, Added !X.TYPE and !Y.TYPE to saved state. 8/20/98, ACY - Added UPDATECALLBACK and UPDATECBDATA keywords.
(See C:\RSI\IDL52\lib\xpalette.pro)
NAME: XPCOLOR PURPOSE: The primary purpose of this routine is to serve as an example for the Widgets chapter of the IDL User's Guide. XPCOLOR allows the user to adjust the value of the current foreground plotting color, !P.COLOR. For a more flexible color editor, try the XPALETTE User Library Procedure. CATEGORY: Color tables, widgets. CALLING SEQUENCE: XPCOLOR INPUTS: No explicit inputs. The current color table and the value of !P.COLOR are used. KEYWORD PARAMETERS: GROUP - Group leader, as passed to XMANAGER. OUTPUTS: None. COMMON BLOCKS: COLORS: Contains the current RGB color tables. SIDE EFFECTS: The new plotting foreground color is saved in the COLORS common and loaded to the display. PROCEDURE: Three sliders (R, G, and B) allow the user to modify the current color. MODIFICATION HISTORY: 20 October 1993, AB, RSI
(See C:\RSI\IDL52\examples\misc\xpcolor.pro)
NAME: XPDMENU PURPOSE: This procedure implifies setting up widget pulldown menus. XPDMENU reads a description of the menu to be generated, and calls the appropriate widget creation functions to generate it. CALLING SEQUENCE: XPDMENU, Desc, Parent INPUTS: DESC: Either the name of a file that contains the description of the pulldown menu to be generated, or a string array that contains the description. The rules for a pull-down menu description are as follows: Leading and trailing whitespace is ignored. Lines starting with the '#' character or blank lines are ignored. All other lines contain 2 fields, a button label and a value. The label should be quoted with any desired delimiter, usually single or double quotes. The value can be omitted, in which case the label is used as the value. To make a menu choice reveal another pull-down menu, place a '{' character in its value field. Such a pulldown is terminated by a line containing a '}' in the label field. Example: "Colors" { "Red" "Green" "Blue" { "Light" "Medium" "Dark" "Navy" "Royal" } "Cyan" "Magenta" } "Quit" DONE This example builds a menu bar with 2 buttons, named "Colors" and "Quit". "Colors" is a pulldown containing "Red", "Green", "Blue", "Cyan", and "Magenta". "Blue" is a sub-pulldown containing shades of blue. Such sub-menus can be nested to any desired level. Most of the lines don't specify an explicit value. The exception is "Quit", which has the value "DONE". It can be instructive to run the following small program: a = WIDGET_BASE() XPDMENU, a, 'test' ; Test contains the above widget_control, /REALIZE, a uvalue='' repeat begin event = widget_event(a) WIDGET_CONTROL, get_uvalue=uvalue, event.id print, uvalue end until uvalue eq "EXIT" WIDGET_CONTROL, /destroy, a end Note that if you choose to make DESC be a string array, the arrays contents must be exactly the same as the file would be (including the quotes around the fields). Each element of the array corresponds to one line of a file. PARENT: Widget ID of the parent base widget for the pulldown menu. If this argument is omitted, the menu base is a top-level base. KEYWORDS: BASE: A named variable to recieve the widget ID of the created base. COLUMN: If set, the buttons will be arranged in a column. If unset, the buttons will be arranged in a row. FRAME: The width, in pixels of the frame drawn around the base. The default is no frame. TITLE: If PARENT is not supplied, TITLE can be set a string to be used as the title for the widget base. FONT: A string that contains the name of the font to use for the menu buttons. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: A pulldown menu widget heirarchy is created, but not realized. Each button has the label specified by the first field of the corresponding pulldown menu description line. Each button has a user value (uvalue) specified by the second field. RESTRICTIONS: Very little syntax checking is done on the description file. Incorrectly formated input can lead to unexpected results. EXAMPLE: For an example of using XPDMENU, see the "Pull-Down Menu" example in the "Simple Widget Examples". To create the simple widget examples main menu, enter WEXMASTER from the IDL prompt. MODIFICATION HISTORY: 4 October 1990, AB, RSI. 16 January 1991, AB Added the option of DESC being a string array containing the description.
(See C:\RSI\IDL52\lib\obsolete\xpdmenu.pro)
NAME: XREGISTERED PURPOSE: This function returns non-zero if the widget named as its argument is currently registered with the XMANAGER as an exclusive widget, otherwise this routine returns false. CATEGORY: Widgets. CALLING SEQUENCE: Result = XREGISTERED(Name) INPUTS: Name: A string containing the name of the widget in question. KEYWORD PARAMETERS: NOSHOW: If the widget in question is registered, it is brought to the front of all the other windows by default. Set this keyword to keep the widget from being brought to the front. OUTPUTS: If the named widget is registered, XREGISTERED returns the number of instances of that name in the list maintained by XMANAGER. Otherwise, XREGISTERED returns 0. COMMON BLOCKS: MANAGED SIDE EFFECTS: Brings the widget to the front of the desktop if it finds one. RESTRICTIONS: None. PROCEDURE: Searches the list of exclusive widget names and if a match is found with the one in question, the return value is modified. MODIFICATION HISTORY: Written by Steve Richards, November, 1990 Jan, 92 - SMR Fixed a bug where an invalid widget was being referenced with WIDGET_CONTROL and the /SHOW keyword. 17 November 1993 - AB and SMR. Added ID validity checking to fix a bug where already dead widgets were being accessed. Apr, 96 - DJE Rewrite for asynchronous widget event handling.
(See C:\RSI\IDL52\lib\xregistered.pro)
NAME: XSQ_TEST PURPOSE: This function computes the chi-squared goodness-of-fit test between observed frequencies and the expected frequencies of a theoretical distribution. The result is a two-element vector containing the chi-squared test statistic X2 and probability of obtaining a value of X2 or greater. CATEGORY: Statistics. CALLING SEQUENCE: Result = XSQ_TEST(OBFREQ, EXFREQ) INPUTS: OBFREQ: An n-element vector of type integer, float or double containing observed frequencies. EXFREQ: An n-element vector of type integer, float or double containing expected frequencies. KEYWORD PARAMETERS: OBCELL: Use this keyword to specify a named variable which returns a vector of observed frequencies used to formulate the chi- squared test statistic. The elements of this vector are often refered to as the "cells" of the observed frequencies. The length of this vector is determined by the length of EXCELL described below. EXCELL: Use this keyword to specify a named variable which returns a vector of expected frequencies used to formulate the chi- squared test statistic. If each of the expected frequencies contained in the n-element input vector, EXFREQ, has a magnitude of 5 or greater, then this vector is identical to EXFREQ. If EXFREQ contains elements of magnitude less than 5, adjacent expected frequencies are combined. The identical combinations are performed on the corresponding elements of OBFREQ. RESIDUAL: Use this keyword to specify a named variable which returns a vector of signed differences between corresponding cells of observed frequencies and expected frequencies. RESIDUAL(i) = OBCELL(i) - EXCELL(i). The length of this vector is determined by the length of EXCELL described above. EXAMPLE: Define the vectors of observed and expected frequencies. obfreq = [2, 1, 4, 15, 10, 5, 3] exfreq = [0.5, 2.1, 5.9, 10.3, 10.7, 7.0, 3.5] Test the hypothesis that the given observed frequencies are an accurate approximation to the expected frequency distribution. result = $ xsq_test(obfreq, exfreq, obcell = obcell, excell = excell) The result should be the two-element vector [3.05040, 0.383920]. Since the vector of expected frequencies contains elements of magnitude less than 5, adjacent expected frequencies are combined resulting in fewer cells. The identical combinations are performed on the corresponding elements of observed frequencies. The cells used to formulate the chi-squared test statistic are contained in the keyword parameters, obcell and excell. They should contain the values, [7, 15, 10, 8] and [8.5, 10.3, 10.7, 10.5], respectively. The computed value of 0.383920 indicates that there is no reason to reject the proposed hypothesis at the 0.05 significance level. PROCEDURE: XSQ_TEST computes chi-squared goodness-of-fit test between observed frequencies and the expected frequencies of a theoretical distribution. Expected frequencies of magnitude less than 5 are combined with adjacent elements resulting in a reduction of cells used to formulate the chi-squared test statistic. If the observed frequencies differ significantly from the expected frequencies, the chi-squared test statistic will be large and the fit is poor. This situation requires the rejection of the hypothesis that the given observed frequencies are an accurate approximation to the expected frequency distribution. REFERENCE: PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition) Ronald E. Walpole & Raymond H. Myers ISBN 0-02-424170-9 MODIFICATION HISTORY: Written by: GGS, RSI, August 1994
(See C:\RSI\IDL52\lib\xsq_test.pro)
NAME: XSURFACE PURPOSE: 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. CATEGORY: Widgets. CALLING SEQUENCE: XSURFACE, Data INPUT PARAMETERS: Data: The two-dimensional array to display as a wire-mesh or shaded surface. KEYWORD PARAMETERS: GROUP: The widget ID of the widget that calls XSURFACE. When this keyword is specified, the death of the caller results in the death of XSURFACE. BLOCK: Set this keyword to have XMANAGER block when this application is registered. By default the Xmanager keyword NO_BLOCK is set to 1 to provide access to the command line if active command line processing is available. Note that setting BLOCK for this application will cause all widget applications to block, not only this application. For more information see the NO_BLOCK keyword to XMANAGER. SIDE EFFECTS: The XMANAGER is initiated if it is not already running. RESTRICTIONS: XSURFACE does not accept any of the keywords that the IDL command SURFACE does. PROCEDURE: Create and register the widget with the XMANAGER and then exit. MODIFICATION HISTORY: Created from a template written by: Steve Richards, January, 1991.
(See C:\RSI\IDL52\lib\xsurface.pro)
NAME: XVAREDIT PURPOSE: This routine provides an editor for any IDL variable. CATEGORY: Widgets CALLING SEQUENCE: XVAREDIT, VAR INPUTS: VAR = The variable that is to be edited. KEYWORD PARAMETERS: NAME = The NAME of the variable. This keyword is overwritten with the structure name if the variable is a structure. GROUP = The widget ID of the widget that calls XVarEdit. When this ID is specified, a death of the caller results in a death of XVarEdit. X_SCROLL_SIZE = The X_SCROLL_SIZE keyword allows you to set the width of the scrolling viewport in columns. Default is 4. Y_SCROLL_SIZE = The Y_SCROLL_SIZE keyword allows you to set the height of the scrolling viewport in rows. Default is 4. OUTPUTS: VAR= The variable that has been edited, or the original when the user selects the "Cancel" button in the editor. COMMON BLOCKS: None. SIDE EFFECTS: Initiates the XManager if it is not already running. RESTRICTIONS: None known. PROCEDURE: Create and register the widget and then exit. If the user selects "accept", the values in the editor are written to the variable passed in, otherwise, they are ignored. MODIFICATION HISTORY: Written by: Steve Richards, February, 1991 Modified: September 96, LP - rewritten with TABLE widget
(See C:\RSI\IDL52\lib\xvaredit.pro)
NAME: ZOOM PURPOSE: Display part of an image (or graphics) from the current window enlarged in another window. The cursor is used to mark the center of the zoom. CATEGORY: Image display. CALLING SEQUENCE: ZOOM [, FACT = Fact, /INTERP, XSIZE = Xs, YSIZE = Ys, /CONTINUOUS, $ /KEEP, ZOOM_WINDOW=Zoom_Win, /NEW_WINDOW ] INPUTS: All input parameters are passed as keywords. KEYWORDS: FACT: Zoom factor. This parameter must be an integer. The default zoom factor is 4. INTERP: Set this keyword to use bilinear interpolation, otherwise pixel replication is used. XSIZE: The X size of the zoom window. The default is 512. YSIZE: The Y size of the zoom window. The default is 512. CONTINUOUS: Set this keyword to make the zoom window track the mouse without requiring the user to press the left mouse button. This feature only works well on fast computers. KEEP: Keep the zoom window after exiting the procedure. ZOOM_WINDOW: When used with KEEP, returns the index of the zoom window. Otherwise, if KEEP is not set, then -1 is returned. NEW_WINDOW: Normally, if ZOOM is called with /KEEP and then called again, it will use the same window to display the zoomed image. Calling ZOOM with /NEW_WINDOW forces it to create a new window for this purpose. OUTPUTS: No explicit outputs. A new window is created if necessary. It is destroyed upon exit if KEEP is not specified. COMMON BLOCKS: None. SIDE EFFECTS: A window is created/destroyed. When ZOOM is reusing a zoom window from a previous call to ZOOM,/KEEP, then the XSIZE and YSIZE parameters are reset to the actual size of the window. RESTRICTIONS: ZOOM only works with color systems. PROCEDURE: Straightforward. MODIFICATION HISTORY: ? William Thompson, March 1992, added common block ZOOM_WINDOW and KEEP keyword. William Thompson, 20 May 1993, added ZOOM_WINDOW and NEW_WINDOW keywords.
(See C:\RSI\IDL52\lib\zoom.pro)
NAME: ZOOM_24 PURPOSE: Display part of a 24-bit color image from the current window expanded in another window. (This procedure was modified from the 8-bit procedure ZOOM). The cursor and left mouse button are used to mark the center of the zoom. The cursor can be moved into the zoom window to determine the coordinates (in the original image) and color values of individual pixels. In the zoom window, the right mouse button returns you to the mode for selecting a new zoom window or magnification factor from the original image. The center mouse button is used in the original picture window to bring up the magnification-factor selector. The mouse button erases the zoom window and pixel window and exits. CATEGORY: Image display. CALLING SEQUENCE: ZOOM_24 [, XSIZE = Xsize, YSIZE = Ysize, FACT = Fact, /RIGHT] INPUTS: All input parameters are passed as keywords. KEYWORDS: XSIZE: The X size of the zoom window. The default is 512. YSIZE: The Y size of zoom window. The default is 512. FACT: The zoom enlargement factor. The default is 4. RIGHT: Position keyword (0 = left screen, 1 = right screen). OUTPUTS: No explicit outputs. Two new windows are created, and both are destroyed when the procedure is exited. COMMON BLOCKS: None. SIDE EFFECTS: Two windows are created/destroyed. An auxiliary image array is created. RESTRICTIONS: ZOOM_24 only works with 24-bit color systems. PROCEDURE: Straightforward. MODIFICATION HISTORY: Original: 9-March-1990 W. T. Vetterling Michael Stauffer: 06/23/97 - Add checks for out of range values from TVRDC on the Macintosh. Handle !ORDER properly.
(See C:\RSI\IDL52\lib\zoom_24.pro)