This page is a listing of the entire contents of this library for IDL. This listing is the long version. Viewing the much more compact listing may be handier.
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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/arrow.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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/bar_plot.pro)
$Id: base_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $
WidBase
Base object class definition.
Copyright (c) 1993, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
MODIFICATION HISTORY
Written by: Joshua Goldstein, 12/93
BASE_Icon
Return the base toolbar icon
UNCTION BASE_Icon
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/base_alloc.pro)
$Id: betai.pro,v 1.1 1993/04/02 18:54:39 idl Exp $ Copyright (c) 1991-1993, Research Systems Inc. All rights reserved. Unauthorized reproduction prohibited. unction betac, a,b,x
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/betai.pro)
$Id: bgroup_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $
WidBGroup
Widget Button Group (CW_BGROUP) class library
Copyright (c) 1993, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
MODIFICATION HISTORY
Written by: Joshua Goldstein, 12/93
BGROUP_Icon
Return the button group icon
UNCTION BGROUP_Icon
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/bgroup_alloc.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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/bilinear.pro)
NAME: BINOMIAL PURPOSE: Binomial implements the cumulative binomial distribution. CATEGORY: Statistics. CALLING SEQUENCE: Result = BINOMIAL(X, N, P) INPUTS: X: The number of successes. N: The number of trials. P: The success probability. OUTPUT: Binomial returns the probability of x or more successes in a binomial experiment with n trials and success probability p. If n exceeds 25, the Gaussian approximation is computed.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/bin_date.pro)
NAME:
BLK_CON
PURPOSE:
This function convolves an input signal with an impulse-response
sequence.
CATEGORY:
Digital Signal Processing
CALLING SEQUENCE:
Result = BLK_CON(Filter, Signal, B_length=B_length)
INPUTS:
Filter = The impulse-response sequence of length P.
Signal = The discrete signal samples.
OUTPUTS:
The filtered signal with the same number of elements as Signal.
KEYWORD PARAMETERS:
B_length = (Block Length) A scalar 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.
OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
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 a filter of length P=32 ---
FILTER = REPLICATE(1.0,32) ;Set all pnts 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)-.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.
REFERENCE:
Oppenheim, A.V. and Schafer, R.W.
DIGITAL SIGNAL PROCESSING
Prentice-Hall, 1975
MODIFICATION HISTORY:
Written by: ggs@RSI, MAY 1993
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/blk_con.pro)
$Id: bmpbtn_alloc.pro,v 1.11 1994/06/01 23:08:48 ali Exp $
WidBmpBtn
Widget Bitmap Button class library
Copyright (c) 1993, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
MODIFICATION HISTORY
Written by: Joshua Goldstein, 12/93
BMPBTN_Icon
Return the bitmapped button toolbar icon
UNCTION BMPBTN_Icon
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/bmpbtn_alloc.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.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/box_cursor.pro)
$Id: button_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $
WidButton
Widget Button class library
Copyright (c) 1993, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
MODIFICATION HISTORY
Written by: Joshua Goldstein, 12/93
BUTTON_Icon
Return the button toolbar icon
UNCTION BUTTON_Icon
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/button_alloc.pro)
NAME: CALDAT PURPOSE: Return the month, day and year corresponding to a given julian date. This is the inverse of the function JULDAY. CATEGORY: Misc. CALLING SEQUENCE: CALDAT, Julian, Month, Day, Year 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: MONTH: Number of the desired month (1 = January, ..., 12 = December). DAY: Number of day of the month. YEAR: Number of the desired year. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. 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.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/chebyshev.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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cir_3pnt.pro)
NAME:
COMPLEXROUND
PURPOSE:
This function rounds a complex array.
CATEGORY:
Numerical Analysis.
CALLING SEQUENCE:
Result = COMPLEXROUND(Input)
INPUTS:
Input: The complex array to be rounded.
OUTPUTS:
This function returns a rounded version of the Input array.
RESTRICTIONS:
The Input array must be complex.
PROCEDURE:
This function rounds the real and imaginary
components of the input array.
EXAMPLE:
X = [COMPLEX(1.245, 3.88), COMPLEX(9.1, 0.3345)]
Z = COMPLEXROUND(X)
PRINT, Z
( 1.00000, 4.00000)( 9.00000, 0.00000)
MODIFICATION HISTORY:
Written by: GGS, SEPTEMBER, 1992
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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.
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.
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
internal double-precision 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.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 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.
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.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/coord2to3.pro)
NAME: CORRELATE PURPOSE: Compute the simple correlation coefficient of two arrays. CATEGORY: G2 - Correlation and regression analysis. CALLING SEQUENCE: Result = CORRELATE(X, Y) INPUTS: X, Y: Input arrays that may be of any type except string. Both arrays must have the same number of points. OUTPUTS: Returns the simple correlation coefficient of X and Y. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Input arrays must have the same number of data elements. PROCEDURE: R = TOTAL(xx*yy)/SQRT(TOTAL(xx^2)*TOTAL(yy^2)) MODIFICATION HISTORY: DMS, RSI, Sept, 1983.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/correl_matrix.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
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/crossp.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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 where the partial derivatives are known or can be approximated. CATEGORY: E2 - Curve and Surface Fitting. CALLING SEQUENCE: Result = CURVEFIT(X, Y, W, A, SIGMAA, FUNCTION_NAME = name) INPUTS: X: A row vector of independent variables. Y: A row vector of dependent variable, the same length as x. W: A row vector of weights, the same length as x and y. For no weighting, w(i) = 1.0. For instrumental weighting, w(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. 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. OUTPUTS: Returns a vector of calculated values. A: A vector of parameters containing fit. OPTIONAL OUTPUT PARAMETERS: Sigmaa: 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 = Vector of NPOINT independent variables, input. A = Vector of NTERMS function parameters, input. F = Vector of NPOINT values of function, y(i) = funct(x(i)), 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. 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 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 0.1% or until 20 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: pro gfunct, x, a, f, pder f=a(0)*exp(a(1)*x)+a(2) pder=findgen(10, 3) end pro fit_curve x=float(indgen(10)) y=[12.0, 11.0,10.2,9.4,8.7,8.1,7.5,6.9,6.5,6.1] w=1.0/y a=[10.0,-0.1,2.0] yfit=curvefit(x,y,w,a,sigmaa,function_name='gfunct') 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)
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/curvefit.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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 initialize:
widget = CW_ANIMATE(PARENT, 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_RUN, 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_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.
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.
NO_KILL: If set, make no kill button.
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.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_bgroup.pro)
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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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.
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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_field.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.
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.
WIDGET_CONTROL, id, GET_VALUE=var can be used to obtain the current
value displayed by the widget.
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.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_fslider.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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 structures, each of which has the following
definition:
{ CW_PDMENU_S, flags:0, name:'' }
The name tag gives the name of button. The flags
field is a bitmask that controls how the button is
interpreted:
Bit 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.
3 This button is the root of a sub-pulldown
menu, but it is also the last entry of
the current level.
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.
IDS: A named variable into which the button IDs will
be stored as a longword vector.
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, 1, 'Blue' }, $
{ 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, 0, 'Cyan' }, $
{ CW_PDMENU_S, 2, 'Magenta' }, $
{ CW_PDMENU_S, 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
MODIFICATION HISTORY:
18 June 1992, AB
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_rgbslider.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
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/cw_zoom.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.
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/defroi.pro)
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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/demo_mode.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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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:
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
(See /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/determ.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 /host/bluemoon/usr2/idllib/../rsi/idl_3.6/lib/ALL/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,