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_4/lib/annotate.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_4/lib/arrow.pro)
NAME:
A_CORRELATE
PURPOSE:
This function computes the autocorrelation Px(L) or autocovariance
Rx(L) of a sample population X as a function of the lag (L).
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = A_correlate(X, Lag)
INPUTS:
X: An n-element vector of type integer, float or double.
LAG: A scalar or n-element vector, in the interval [-(n-2), (n-2)],
of type integer that specifies the absolute distance(s) between
indexed elements of X.
KEYWORD PARAMETERS:
COVARIANCE: If set to a non-zero value, the sample autocovariance
is computed.
EXAMPLE
Define an n-element sample population.
x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57]
Compute the autocorrelation of X for LAG = -3, 0, 1, 3, 4, 8
lag = [-3, 0, 1, 3, 4, 8]
result = a_correlate(x, lag)
The result should be:
[-0.0303311, 1.00000, 0.784758, -0.0303311, -0.350930, -0.112325]
PROCEDURE:
See computational formula published in IDL manual.
REFERENCE:
INTRODUCTION TO STATISTICAL TIME SERIES
Wayne A. Fuller
ISBN 0-471-28715-6
MODIFICATION HISTORY:
Written by: GGS, RSI, October 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/a_correlate.pro)
NAME:
BAR_PLOT
PURPOSE:
Create a bar graph, or overplot on an existing one.
CATEGORY:
Graphics.
CALLING SEQUENCE:
BAR_PLOT, Values
INPUTS:
Values: A vector containing the values to be represented by the bars.
Each element in VALUES corresponds to a single bar in the
output.
KEYWORD PARAMETERS:
BASELINES: A vector, the same size as VALUES, that contains the
base value associated with each bar. If not specified,
a base value of zero is used for all bars.
COLORS: A vector, the same size as VALUES, containing the color index
to be used for each bar. If not specified, the colors are
selected based on spacing the color indices as widely as
possible within the available colors (specified by D.N_COLORS).
BARNAMES: A string array, containing one string label per bar.
If the bars are vertical, the labels are placed beneath
them. If horizontal (rotated) bars are specified, the labels
are placed to the left of the bars.
TITLE: A string containing the main title to for the bar plot.
XTITLE: A string containing the title for the X axis.
YTITLE: A string containing the title for the Y axis.
BASERANGE: A floating-point scalar in the range 0.0 to 1.0, that
determines the fraction of the total available plotting area
(in the direction perpendicular to the bars) to be used.
If not specified, the full available area is used.
BARWIDTH: A floating-point value that specifies the width of the bars
in units of "nominal bar width". The nominal bar width is
computed so that all the bars (and the space between them,
set by default to 20% of the width of the bars) will fill the
available space (optionally controlled with the BASERANGE
keyword).
BARSPACE: A scalar that specifies, in units of "nominal bar width",
the spacing between bars. For example, if BARSPACE is 1.0,
then all bars will have one bar-width of space between them.
If not specified, the bars are spaced apart by 20% of the bar
width.
BAROFFSET: A scalar that specifies the offset to be applied to the
first bar, in units of "nominal bar width". This keyword
allows, for example, different groups of bars to be overplotted
on the same graph. If not specified, the default offset is
equal to BARSPACE.
OUTLINE: If set, this keyword specifies that an outline should be
drawn around each bar.
OVERPLOT: If set, this keyword specifies that the bar plot should be
overplotted on an existing graph.
BACKGROUND: A scalar that specifies the color index to be used for
the background color. By default, the normal IDL background
color is used.
ROTATE: If set, this keyword indicates that horizontal rather than
vertical bars should be drawn. The bases of horizontal bars
are on the left, "Y" axis and the bars extend to the right.
OUTPUTS:
A bar plot is created, or an existing one is overplotted.
EXAMPLE:
By using the overplotting capability, it is relatively easy to create
stacked bar charts, or different groups of bars on the same graph.
For example, if ARRAY is a two-dimensional array of 5 columns and 8
rows, it is natural to make a plot with 5 bars, each of which is a
"stacked" composite of 8 sections. First, create a 2D COLORS array,
equal in size to ARRAY, that has identical color index values across
each row to ensure that the same item is represented by the same color
in all bars.
With ARRAYS and COLORS defined, the following code fragment
illustrates the creation of stacked bars (note that the number of rows
and columns is arbitrary):
!Y.RANGE = [0,ymax] ; Scale range to accommodate the total bar lengths.
BASE = INTARR(NROWS)
FOR I = 0, NROWS-1 DO BEGIN
BAR_PLOT, ARRAY(*,I), COLORS=COLORS(*,I), BASELINES=BASE, $
BARWIDTH=0.75, BARSPACE=0.25, OVER=(I GT 0)
BASE = BASE + ARRAY(*,I)
ENDFOR
To plot each row of ARRAY as a clustered group of bars within the same
graph, use the BASERANGE keyword to restrict the available plotting
region for each set of bars. The sample code fragment below
illustrates this method:
FOR I = 0, NROWS-1 DO $
BAR_PLOT, ARRAY(*,I), COLORS=COLORVECT, BARWIDTH=0.8,BARSPACE=0.2, $
BAROFFSET=I*((1.0+BARSPACE)*NCOLS), OVER=(I GT 0), BASERANGE=0.19
where NCOLS is the number of columns in ARRAY, and COLORVECT is a
vector containing the color indices to be used for each group of
bars. (In this example, each group uses the same set of colors, but
this could easily be changed.)
MODIFICATION HISTORY:
August 1990, T.J. Armitage, RSI, initial programming. Replacement
for PLOTBAR and OPLOTBAR routines written by William Thompson.
September 1990, Steve Richards, RSI, changed defaults to improve the
appearance of the bar plots in the default mode. Included
spacing the bars slightly.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/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_4/lib/base_alloc.pro)
NAME:
BETA
PURPOSE:
The introduction of the BETA function as a built in system routine
in IDL 4.0 caused inconvenience to customers with existing code
in which BETA had been used as a variable, because IDL system
routines have precedence over variable names. To minimize this
problem, RSI has renamed BETA back to NR_BETA (its old name).
This wrapper serves to make NR_BETA available under the name
BETA as documented in the IDL Reference Manual. However, since
IDL library routines have lower precedence than variables, programs
that use BETA as a variable name will work as before.
See the documentation for BETA in the IDL Reference manual for details
on arguments, keywords, and results.
MODIFICATION HISTORY:
3 July 1995, AB, RSI.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/beta.pro)
$Id: bgroup_alloc.pro,v 1.8 1995/01/20 19:41:01 tonyh 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_4/lib/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_4/lib/bilinear.pro)
NAME:
BINOMIAL
PURPOSE:
This function computes the probabilty (bp) such that:
Probability(X => v) = bp
where X is a random variable from the cumulative binomial distribution
(Bernouli distribution).
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = Binomial(V, N, P)
INPUTS:
V: A non-negative integer specifying the minimal number of
times an event E occurs in (N) independent performances.
N: A non-negative integer specifying the number of performances.
If the number of performances exceeds 25, the Gaussian
distribution is used to approximate the cumulative binomial
distribution.
P: A non-negative scalar, in the interval [0.0, 1.0], of type
float or double that specifies the probability of occurance
or success of a single independent performance.
EXAMPLES:
Compute the probability of obtaining at least two 6s in rolling a
die four times. The result should be 0.131944
result = binomial(2, 4, 1./6.)
Compute the probability of obtaining exactly two 6s in rolling a
die four times. The result should be 0.115741
result = binomial(2, 4, 1./6.) - binomial(3, 4, 1./6.)
Compute the probability of obtaining three or fewer 6s in rolling
a die four times. The result should be 0.999228
result = (binomial(0, 4, 1./6.) - binomial(1, 4, 1./6.)) + $
(binomial(1, 4, 1./6.) - binomial(2, 4, 1./6.)) + $
(binomial(2, 4, 1./6.) - binomial(3, 4, 1./6.)) + $
(binomial(3, 4, 1./6.) - binomial(4, 4, 1./6.))
PROCEDURE:
BINOMIAL computes the probability that an event E occurs at least
(V) times in (N) independent performances. The event E is assumed
to have a probability of occurance or success (P) in a single
performance.
REFERENCE:
ADVANCED ENGINEERING MATHEMATICS (seventh edition)
Erwin Kreyszig
ISBN 0-471-55380-8
MODIFICATION HISTORY:
Modified by: GGS, RSI, July 1994
Minor changes to code. Rewrote documentation header.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/binomial.pro)
NAME: BIN_DATE PURPOSE: This function converts a standard form ascii date/time string to a binary string. CATEGORY: Date/time functions. CALLING SEQUENCE: Result = BIN_DATE(Asc_time) INPUTS: Asc_time: the date/time to convert in standard ascii format. If omitted, use the current date/time. Standard form is a 24 character string: DOW MON DD HH:MM:SS YYYY where: DOW = day of week, MON = month, DD=day of month, HH:MM:SS = hour/minute/second, YYYY = year. OUTPUTS: This function returns a 6 element integer array containing: Element 0 = year e.g. 1992 1 = month 1-12 2 = day 1-31 3 = hour 0-23 4 = minute 0-59 5 = second 0-59 SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Straightforward. MODIFICATION HISTORY: Written by: DMS /RSI, Jul, 1992.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/bin_date.pro)
NAME:
BISECT_PDF
PURPOSE:
This function computes the cutoff value x such that the probabilty
of an observation from the given distribution, less than x, is a(0).
u and l are the upper and lower limits for x, respectively.
a(1) and a(2) are degrees of freedom, if appropriate.
funct is a string specifying the probability density function.
BISECT_PDF is not intended to be a user-callable function.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/bisect_pdf.pro)
NAME:
BLK_CON
PURPOSE:
This function computes a "fast convolution" of a digital signal
and an impulse-response sequence.
CATEGORY:
Digital Signal Processing
CALLING SEQUENCE:
Result = BLK_CON(Filter, Signal, B_length = B_length)
INPUTS:
Filter = A P-element floating-point vector containing the impulse-
response sequence of the digital filter.
Signal = An N-element floating-point vector containing the discrete
signal samples.
KEYWORD PARAMETERS:
B_length = (Block Length) An integer specifying the length of
the subdivided signal segments. If this paramter is
not specified, a near-optimal value is chosen by the
algorithm based upon the length of the impulse-response
sequence, P. If P is a value less than 11 or greater
than 377, then B_length must be specified.
RESTRICTIONS:
1) The block length must be greater than the filter length.
B_length > P
2) The block length must be less than the number of signal samples.
B_length < N_elements(Signal)
EXAMPLE:
Create an impulse-response sequence of length P = 32.
filter = replicate(1.0, 32) ;Set all points to 1.0
filter(2*indgen(16)) = 0.5 ;Set even points to 0.5
Create a sampled signal with random noise.
signal = sin((findgen(1000)/35.0)^2.5)
noise = (randomu(SEED,1000)-0.5)/2
signal = signal + noise
Convolve the filter and signal using block convolution.
result = BLK_CON(filter, signal)
PROCEDURE:
Implementation of the "overlap-save" method in the frequency domain.
The discrete signal samples are divided into overlapping segments of
a length specified by the parameter B_length. B_length may be supplied
by the user as an optional keyword parameter or determined by the
algorithm to a near-optimal value. Each input segment consists of P-1
samples from the previous input segment and (B_length-P+1) new signal
samples, where P is the length of the filter. Each of these segments
is processed in the frequency domain and then 'reassembled' in the
time domain. The first and last input segments are handled differently.
The result is an N-element floating-point vector containing the
filtered signal.
REFERENCE:
Oppenheim, A.V. and Schafer, R.W.
DIGITAL SIGNAL PROCESSING
Prentice-Hall, 1975
MODIFICATION HISTORY:
Written by: GGS, RSI, May 1993
Modified: GGS, RSI, June 1994
Added long indexing into vectors. Minor changes in
the use of intermediate variables reduces memory
allocation in certain instances. Made slight changes
to the documentation header.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/blk_con.pro)
$Id: bmpbtn_alloc.pro,v 1.12 1995/01/20 19:41:01 tonyh 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_4/lib/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_4/lib/box_cursor.pro)
$Id: button_alloc.pro,v 1.8 1995/01/20 19:41:01 tonyh 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_4/lib/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_4/lib/caldat.pro)
NAME: CALENDAR PURPOSE: Display a calandar for a month or an entire year using IDL's plotting subsystem. This IDL routine imitates the Unix cal command. CATEGORY: Misc. CALLING SEQUENCE: CALENDAR CALENDAR, YEAR CALENDAR, MONTH, YEAR INPUTS: If called without arguments, CALENDAR draws a calendar for the current month. MONTH: The number of the month for which a calandar is desired (1 is January, 2 is February, ..., 12 is December). YEAR: The number of the year for which a calendar should be drawn. If YEAR is provided without MONTH, a calendar for the entire year is drawn. OPTIONAL INPUT PARAMETERS: None. OUTPUTS: The specified calandar is drawn on the current graphics device. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. MODIFICATION HISTORY: AB, September, 1988
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/calendar.pro)
NAME: CDF_EXISTS PURPOSE: Test for the existence of the CDF library CATEGORY: File Formats CALLING SEQUENCE: Result = CDF_EXISTS() INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: Returns TRUE (1) if the CDF data format library is supported. Returns FALSE(0) if it is not. EXAMPLE: IF cdf_exists() EQ 0 THEN Fail,"CDF not supported on this machine" MODIFICATION HISTORY Written by: Joshua Goldstein, 12/8/92
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cdf_exists.pro)
NAME: CHEBYSHEV PURPOSE: Implements forward and reverse Chebyshev polynomial expansion of a set of data. CATAGORY: Mathematics. CALLING SEQUENCE: Result = CHEBYSHEV(D, N) INPUT: D: A vector containing the values at the zeros of Chebyshev polynomial. N: A flag that, if set to -1, returns a set of Chebyshev polynomials. If set to +1, the original data is returned. OUTPUT: Returns either the set of Chebyshev polynomials or the original data depending on the value of N. COMMON BLOCKS: None. SIDE EFFECTS: Results from this function are subject to roundoff error given discontinuous data. RESTRICTIONS: Unknown. PROCEDURE: Straightforward implementation of recursion formula. REVISION HISTORY: Jan, 1986 Written by Leonard Kramer, U. of Maryland University Research Foundation
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/chebyshev.pro)
NAME:
CHISQR_CVF
PURPOSE:
This function computes the cutoff value (v) such that:
Probability(X > v) = p
where X is a random variable from the Chi-square distribution
with (df) degrees of freedom.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = chisqr_cvf(P, DF)
INPUTS:
P: A non-negative scalar, in the interval [0.0, 1.0], of type
float or double that specifies the probability of occurance
or success.
DF: A positive scalar of type integer, float or double that
specifies the degrees of freedom of the Chi-square distribution.
EXAMPLE:
Compute the cutoff value (v) such that Probability(X > v) = 0.100
from the Chi-square distribution with (DF = 3) degrees of freedom.
The result should be 6.25139
result = chisqr_cvf(0.100, 3)
REFERENCE:
ADVANCED ENGINEERING MATHEMATICS (seventh edition)
Erwin Kreyszig
ISBN 0-471-55380-8
MODIFICATION HISTORY:
Modified by: GGS, RSI, July 1994
Minor changes to code. New documentation header.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/chisqr_cvf.pro)
NAME:
CHISQR_PDF
PURPOSE:
This function computes the probabilty (p) such that:
Probability(X <= v) = p
where X is a random variable from the Chi-square distribution
with (df) degrees of freedom.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = chisqr_pdf(V, DF)
INPUTS:
V: A scalar of type integer, float or double that specifies
the cutoff value.
DF: A positive scalar of type integer, float or double that
specifies the degrees of freedom of the Chi-square distribution.
EXAMPLES:
Compute the probability that a random variable X, from the Chi-square
distribution with (DF = 3) degrees of freedom, is less than or equal
to 6.25. The result should be 0.899939
result = chisqr_pdf(6.25, 3)
Compute the probability that a random variable X, from the Chi-square
distribution with (DF = 3) degrees of freedom, is greater than 6.25.
The result should be 0.100061
result = 1 - chisqr_pdf(6.25, 3)
REFERENCE:
ADVANCED ENGINEERING MATHEMATICS (seventh edition)
Erwin Kreyszig
ISBN 0-471-55380-8
MODIFICATION HISTORY:
Modified by: GGS, RSI, July 1994
Minor changes to code. New documentation header.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/chisqr_pdf.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_4/lib/cir_3pnt.pro)
NAME:
COMFIT
PURPOSE:
This function fits the paired data {X(i), Y(i)} to one of six common
types of appoximating models using a gradient-expansion least-squares
method. The result is a vector containing the model parameters.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = COMFIT(X, Y, A0)
INPUTS:
X: An n-element vector of type integer, float or double.
Y: An n-element vector of type integer, float or double.
A0: A vector of initial estimates for each model parameter. The length
of this vector depends upon the type of model selected.
KEYWORD PARAMETERS:
EXPONENTIAL: If set to a non-zero value, the parameters of the
exponential model are computed. Y = a0 * a1^x + a2.
GEOMETRIC: If set to a non-zero value, the parameters of the
geometric model are computed. Y = a0 * x^a1 + a2.
GOMPERTZ: If set to a non-zero value, the parameters of the
Gompertz model are computed. Y = a0 * a1^(a2*x) + a3.
HYPERBOLIC: If set to a non-zero value, the parameters of the
hyperbolic model are computed. Y = 1./(a0 + a1*x)
LOGISTIC: If set to a non-zero value, the parameters of the
logistic model are computed. Y = 1./(a0 * a1^x + a2)
LOGSQUARE: If set to a non-zero value, the parameters of the
logsquare model are computed.
Y = a0 + a1*alog10(x) + a2 * alog10(x)^2
SIGMA: Use this keyword to specify a named variable which
returns a vector of standard deviations for the computed
model parameters.
WEIGHTS: An n-element vector of weights. If the WEIGHTS vector
is not specified, an n-element vector of 1.0s is used.
YFIT: Use this keyword to specify a named variable which
returns n-element vector of y-data corresponding to the
computed model parameters.
EXAMPLE:
Define two n-element vectors of paired data.
x = [2.27, 15.01, 34.74, 36.01, 43.65, 50.02, 53.84, 58.30, 62.12, $
64.66, 71.66, 79.94, 85.67, 114.95]
y = [5.16, 22.63, 34.36, 34.92, 37.98, 40.22, 41.46, 42.81, 43.91, $
44.62, 46.44, 48.43, 49.70, 55.31]
Define a 3-element vector of initial estimates for the logsquare model.
a0 = [1.5, 1.5, 1.5]
Compute the model parameters of the logsquare model, a(0), a(1), & a(2).
result = comfit(x, y, a0, sigma = sigma, yfit = yfit, /logsquare)
The result should be the 3-element vector:
[1.42494, 7.21900, 9.18794]
REFERENCE:
APPLIED STATISTICS (third edition)
J. Neter, W. Wasserman, G.A. Whitmore
ISBN 0-205-10328-6
MODIFICATION HISTORY:
Written by: GGS, RSI, September 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/comfit.pro)
NAME:
COMPLEXROUND
PURPOSE:
This function rounds a complex scalar or array.
CATEGORY:
Numerical Analysis.
CALLING SEQUENCE:
Result = Complexround(z)
INPUTS:
Z: A complex scalar or array.
RESTRICTIONS:
The input argument must be complex.
PROCEDURE:
This function rounds the real and imaginary components of the
complex input argument.
EXAMPLE:
;Define a complex array.
z = [[complex(1.245, 3.880), complex( 1.245, -3.880)], $
[complex(1.499, 5.501), complex(-1.355, -2.115)]]
;Round it.
result = complexround(z)
MODIFICATION HISTORY:
Written by: GGS, RSI, September 1992
Modified: GGS, RSI, September 1994
Added support for double-precision complex inputs.
Uses IDL's intrinsic ROUND function.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/complexround.pro)
NAME:
COND
PURPOSE:
This function computes the condition number of an N by N array.
CATEGORY:
Complex Linear Algebra.
CALLING SEQUENCE:
Result = COND(A)
INPUTS:
A: An N by N real or complex array.
KEYWORD PARAMETERS:
DOUBLE: If set to a non-zero value, computations are done in
double precision arithmetic.
EXAMPLE:
Define a complex array (a).
a = [[complex(1, 0), complex(2,-2), complex(-3,1)], $
[complex(1,-2), complex(2, 2), complex(1, 0)], $
[complex(1, 1), complex(0, 1), complex(1, 5)]]
Compute the condition number of the complex array (a) using
double-precision complex arithmetic.
result = cond(a, /double)
PROCEDURE:
This function returns the condition number of an N x N real or
complex array (A) by explicitly computing, norm(A)*norm(A_inverse).
If A is real and A_inverse is invalid (due to the singularity of A
or floating-point errors in the nr_invert function), the condition
number is returned as a -1. If A is complex and A_inverse is invalid
(due to the singularity of A), calling COND.PRO results in floating-
point errors.
REFERENCE:
ADVANCED ENGINEERING MATHEMATICS (seventh edition)
Erwin Kreyszig
ISBN 0-471-55380-8
MODIFICATION HISTORY:
Written by: GGS, RSI, April 1992
Modified: GGS, RSI, February 1994
Accepts complex inputs. Added DOUBLE keyword.
Modified: GGS, RSI, November 1994
Added support for double-precision complex inputs.
Changed NR_INVERT to INVERT.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cond.pro)
NAME:
CONGRID
PURPOSE:
Shrink or expand the size of an array by an arbitrary amount.
This IDL procedure simulates the action of the VAX/VMS
CONGRID/CONGRIDI function.
This function is similar to "REBIN" in that it can resize a
one, two, or three dimensional array. "REBIN", however,
requires that the new array size must be an integer multiple
of the original size. CONGRID will resize an array to any
arbitrary size (REBIN is somewhat faster, however).
REBIN averages multiple points when shrinking an array,
while CONGRID just resamples the array.
CATEGORY:
Array Manipulation.
CALLING SEQUENCE:
array = CONGRID(array, x, y, z)
INPUTS:
array: A 1, 2, or 3 dimensional array to resize.
Data Type : Any type except string or structure.
x: The new X dimension of the resized array.
Data Type : Int or Long (greater than or equal to 2).
OPTIONAL INPUTS:
y: The new Y dimension of the resized array. If the original
array has only 1 dimension then y is ignored. If the
original array has 2 or 3 dimensions then y MUST be present.
z: The new Z dimension of the resized array. If the original
array has only 1 or 2 dimensions then z is ignored. If the
original array has 3 dimensions then z MUST be present.
KEYWORD PARAMETERS:
INTERP: If set, causes linear interpolation to be used.
Otherwise, the nearest-neighbor method is used.
CUBIC: If 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_4/lib/congrid.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_4/lib/coord2to3.pro)
NAME:
CORRELATE
PURPOSE:
This function computes the linear Pearson correlation coefficient
of two n-element vectors or the Correlation Matrix of an M x N
array. Alternatively, this function computes the covariance of two
n-element vectors or the Covariance Matrix of an M x N array.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = Correlate(X [,Y])
INPUTS:
X: An n-element vector or an M x N array of type integer, float
or double.
Y: An n-element vector of type integer, float or double. If X is
an M x N array, this parameter should not be supplied in the
calling sequence.
KEYWORD PARAMETERS:
COVARIANCE: If set to a non-zero value, the sample covariance is
computed.
RESTRICTIONS:
If X is an n-element vector, then Y must also be supplied as an
n-element vector; Result = Correlate(X, Y)
If X is an M x N array, then Y should not be supplied;
Result = Correlate(X)
EXAMPLES:
Define the n-element data vectors.
x = [65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71]
y = [68, 66, 68, 65, 69, 66, 68, 65, 71, 67, 68, 70]
Compute the linear Pearson correlation coefficient of x and y.
result = correlate(x, y)
The result should be 0.702652
Compute the covariance of x and y.
result = correlate(x, y, /covariance)
The result should be 3.66667
Define an array with x and y as its columns.
a = transpose([[x],[y]])
Compute the correlation matrix.
result = correlate(a)
The result should be [[1.000000, 0.702652]
[0.702652, 1.000000]]
Compute the covariance matrix.
result = correlate(a, /covariance)
The result should be [[7.69697, 3.66667]
[3.66667, 3.53788]]
PROCEDURE:
CORRELATE computes the linear Pearson correlation coefficient of
two n-element vectors. If X is an M x N array, M-columns by N-rows,
the result will be an M x M array of linear Pearson correlation
coefficients with the iTH column and jTH row element corresponding
to the correlation of the iTH and jTH columns of the M x N array.
The M x M array of linear Pearson correlation coefficients (also
known as the Correlation Matrix) is always symmetric and contains
1s on the main diagonal. The Covariance Matrix is also symmetric.
REFERENCE:
APPLIED STATISTICS (third edition)
J. Neter, W. Wasserman, G.A. Whitmore
ISBN 0-205-10328-6
MODIFICATION HISTORY:
Written by: DMS, RSI, Sept 1983
Modified: GGS, RSI, July 1994
Added COVARIANCE keyword.
Included support for matrix input.
New documentation header.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/correlate.pro)
NAME:
CRAMER
PURPOSE:
This function solves an n by n linear system of equations
using Cramer's rule.
CATEGORY:
Linear Algebra.
CALLING SEQUENCE:
Result = CRAMER(A, B)
INPUTS:
A: An N by N array of type: float, or double.
B: An N-element vector of type: float, or double.
KEYWORD PARAMETERS:
DOUBLE: If set to a non-zero value, computations are done in
double precision arithmetic.
ZERO: Use this keyword to set the value of floating-point
zero. A floating-point zero on the main diagonal of
a triangular matrix results in a zero determinant.
A zero determinant results in a 'Singular matrix'
error and stops the execution of CRAMER.PRO.
For single-precision inputs, the default value is
1.0e-6. For double-precision inputs, the default value
is 1.0e-12.
EXAMPLE:
Define an array (a).
a = [[ 2.0, 1.0, 1.0], $
[ 4.0, -6.0, 0.0], $
[-2.0, 7.0, 2.0]]
And right-side vector (b).
b = [3.0, 10.0, -5.0]
Compute the solution of the system, ax = b.
result = cramer(a, b)
PROCEDURE:
CRAMER.PRO uses ratios of column-wise permutations of the array (a)
to calculate the solution vector (x) of the linear system, ax = b.
REFERENCE:
ADVANCED ENGINEERING MATHEMATICS (seventh edition)
Erwin Kreyszig
ISBN 0-471-55380-8
MODIFICATION HISTORY:
Written by: GGS, RSI, February 1994
Modified: GGS, RSI, November 1994
Added support for double precision results.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cramer.pro)
NAME:
CREATE_VIEW
PURPOSE:
This procedure sets the various system variables required to
define a coordinate system and a 3-D view. This procedure
builds the system viewing matrix (!P.T) in such a way that the
correct aspect ratio of the data is maintained even if the
display window is not square.
CREATE_VIEW also sets the "Data" to "Normal" coordinate
conversion factors (!X.S, !Y.S, and !Z.S) so that center of
the unit cube will be located at the center of the display
window.
CATEGORY:
Viewing.
CALLING SEQUENCE:
CREATE_VIEW
INPUTS:
None.
KEYWORD PARAMETERS:
XMIN: The minimum data value on the X axis.
The default is (0.0).
Data type : Any scalar numeric value.
XMAX: The maximum data value on the X axis.
The default is (1.0).
Data type : Any scalar numeric value.
YMIN: The minimum data value on the Y axis.
The default is (0.0).
Data type : Any scalar numeric value.
YMAX: The maximum data value on the Y axis.
Data type : Any scalar numeric value.
The default is (1.0).
ZMIN: The minimum data value on the Z axis.
The default is (0.0).
Data type : Any scalar numeric value.
ZMAX: The maximum data value on the Z axis.
The default is (1.0).
Data type : Any scalar numeric value.
AX: The orientation (X rotation) of the view.
The default is (0.0).
Data type : Float.
AY: The orientation (Y rotation) of the view.
The default is (0.0).
Data type : Float.
AZ: The orientation (Z rotation) of the view.
The default is (0.0).
Data type : Float.
WINX: The X size, in pixels, of the window that the
view is being set up for.
The default is (640).
Data type : Long.
WINY: The Y size, in pixels, of the window that the
view is being set up for.
The default is (512).
Data type : Long.
ZOOM: The view zoom factor. If zoom is a single
value then the view will be zoomed equally in
all 3 dimensions. If zoom is a 3 element vector
then the view will be scaled zoom(0) in X,
zoom(1) in Y, and zoom(2) in Z.
The default is (1.0).
Data type : Float or Fltarr(3).
ZFAC: Use this keyword to expand or contract the view
in the Z dimension.
The default is (1.0).
Data type : Float.
PERSP: The perspective projection distance. A value of
(0.0) indicates an isometric projection (NO per-
spective).
The default is (0.0).
Data type : Float.
RADIANS: Set this keyword to a non-zero value if the values
passed to AX, AY, and AZ are in radians.
The default is degrees.
Data type : Int.
SIDE EFFECTS:
This procedure sets the following IDL system variables :
!P.T, !P.T3D, !P.Position, !P.Clip, !P.Region
!X.S, !X.Style, !X.Range, !X.Margin
!Y.S, !Y.Style, !Y.Range, !Y.Margin
!Z.S, !Z.Style, !Z.Range, !Z.Margin
PROCEDURE:
This procedure sets the 4x4 system viewing matrix (!P.T) by
calling T3D with the following parameters :
; Reset (!P.T) to the identity matrix.
T3D, /RESET
; Translate the center of the unit cube to the origin.
T3D, TRANSLATE=[(-0.5), (-0.5), (-0.5)]
; Zoom the view.
T3D, SCALE=ZOOM
; Scale the view to preserve the correct aspect ratio.
xrange = xmax - xmin
yrange = ymax - ymin
zrange = (zmax - zmin) * zfac
max_range = xrange > yrange > zrange
T3D, SCALE=([xrange, yrange, zrange] / max_range)
; Rotate the view.
T3D, ROTATE=[0.0, 0.0, AZ]
T3D, ROTATE=[0.0, AY, 0.0]
T3D, ROTATE=[AX, 0.0, 0.0]
; Define a perspective projection (if any).
IF (p_proj) THEN T3D, PERSPECTIVE=PERSP
; Compensate for the aspect ratio of the display window.
T3D, SCALE=[xfac, yfac, 1.0]
; Translate the unit cube back to its starting point.
T3D, TRANSLATE=[(0.5), (0.5), (0.5)]
EXAMPLE:
Set up a view to display an iso-surface from volumetric data.
; Create some data.
vol = FLTARR(40, 50, 30)
vol(3:36, 3:46, 3:26) = RANDOMU(s, 34, 44, 24)
FOR i=0, 10 DO vol = SMOOTH(vol, 3)
; Generate the iso-surface.
SHADE_VOLUME, vol, 0.2, polygon_list, vertex_list, /LOW
; Set up the view.
; Note that the subscripts into the Vol array range from
; 0 to 39 in X, 0 to 49 in Y, and 0 to 29 in Z. As such,
; the 3-D coordinates of the iso-surface (vertex_list) may
; range from 0.0 to 39.0 in X, 0.0 to 49.0 in Y,
; and 0.0 to 29.0 in Z. Set XMIN, YMIN, and ZMIN to
; zero (the default), and set XMAX=39, YMAX=49, and ZMAX=29.
WINDOW, XSIZE=600, YSIZE=400
CREATE_VIEW, XMAX=39, YMAX=49, ZMAX=29, AX=(-60.0), AZ=(30.0), $
WINX=600, WINY=400, ZOOM=(0.7), PERSP=(1.0)
; Display the iso surface in the specified view.
img = POLYSHADE(polygon_list, vertex_list, /DATA, /T3D)
TVSCL, img
MODIFICATION HISTORY:
Written by: Daniel Carr. Wed Sep 2 16:40:47 MDT 1992
Modified the way the view is compensated for the data aspect ratio.
Daniel Carr. Tue Dec 8 17:53:54 MST 1992
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/create_view.pro)
NAME: CROSSP PURPOSE: Evaluate the vector or cross-product of vectors v1 and v2. CATEGORY: Vector mathematics. CALLING SEQUENCE: Result = CROSSP(v1, v2) INPUTS: v1, v2: Three-element vectors. OUTPUTS: Returns a 3-element, floating-point vector. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Vectors must have 3 elements. PROCEDURE: v1 X v2 = | i j k | = (b1c2 - b2c1)i + (c1a2-c2a1)j + (a1b2-a2b1)k | a1 b1 c1 | | a2 b2 c2 | MODIFICATION HISTORY: Written, DMS, Aug, 1983;
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/crossp.pro)
NAME:
CTI_TEST
PURPOSE:
This function constructs a "contingency table" from an array of
observed frequencies and tests the hypothesis that the rows and
columns are independent using an extension of the chi-squared
goodness-of-fit test. The result is a two-element vector contain-
ing the chi-squared test statistic X2 and probability of obtaining
a value of X2 or greater.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = CTI_TEST(OBFREQ)
INPUTS:
OBFREQ: An array of c-columns and r-rows of type integer, float
or double containing observed frequencies.
KEYWORD PARAMETERS:
COEFF: Use this keyword to specify a named variable which returns
the Coefficient of Contingency. A non-negative scalar,
in the interval [0.0, 1.0], which measures the degree
of dependence within a contingency table. The larger the
value of COEFF, the greater the degree of dependence.
CORRECTED: If set to a nonzero value, the "Yate's Correction for
Continuity" is used to compute the chi-squared test
statistic, X2. The Yate's correction always decreases the
magnitude of the chi-squared test statistic, X2. In general,
this keyword should be set for small sample sizes.
CRAMV: Use this keyword to specify a named variable which returns
Cramer's V. A non-negative scalar, in the interval [0.0, 1.0],
which measures the degree of dependence within a contingency
table.
DF: Use this keyword to specify a named variable which returns
the degrees of freedom used to compute the probability of
obtaining the value of the chi-squared test statistic or
greater. DF = (r - 1) * (c - 1) where r and c are the
number of rows and columns of the contingency table,
respectively.
EXFREQ: Use this keyword to specify a named variable which returns
an array of c-columns and r-rows containing expected
frequencies. The elements of this array are often refered
to as the "cells" of the expected frequencies. The expected
frequency of each cell is computed as the product of row
and column marginal frequencies divided by the overall
total of observed frequencies.
RESIDUAL: Use this keyword to specify a named variable which returns
an array of c-columns and r-rows containing signed differences
between corresponding cells of observed frequencies and
expected frequencies.
EXAMPLE:
Define the 5-column and 4-row array of observed frequencies.
obfreq = [[748, 821, 786, 720, 672], $
[ 74, 60, 51, 66, 50], $
[ 31, 25, 22, 16, 15], $
[ 9, 10, 6, 5, 7]]
Test the hypothesis that the rows and columns of "obfreq" contain
independent data at the 0.05 significance level.
result = cti_test(obfreq, coeff = coeff)
The result should be the two-element vector [14.3953, 0.276181].
The computed value of 0.276181 indicates that there is no reason to
reject the proposed hypothesis at the 0.05 significance level.
The Coefficient of Contingency returned in the parameter "coeff"
(coeff = 0.0584860) also indicates the lack of dependence between
the rows and columns of the observed frequencies. Setting the
CORRECTED keyword returns the two-element vector [12.0032, 0.445420]
and (coeff = 0.0534213) resulting in the same conclusion of
independence.
PROCEDURE:
CTI_TEST constructs a "contingency table" from a 2-dimensional
input array of observed frequencies and applies the principles of
the chi-squared goodness-of-fit test to determine the independence
of the rows and columns. For small sample sizes, a correction for
absolute differences between observed and expected frequencies may
be applied by setting the CORRECTED keyword.
REFERENCE:
PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition)
Ronald E. Walpole & Raymond H. Myers
ISBN 0-02-424170-9
MODIFICATION HISTORY:
Written by: GGS, RSI, August 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cti_test.pro)
NAME: CT_LUMINANCE PURPOSE: Calculate the luminance of colors. CATEGORY: Color tables CALLING SEQUENCE: L = CT_LUMINANCE(R, G, B) INPUTS: R = Red color table. If omitted, use the color values from either the COLORS common block, or the current color table. G = Green color table, optional parameter. B = Blue color table, optional parameter. KEYWORD PARAMETERS: BRIGHT=var - Stores the index of the brightest color in the current colortable into var. DARK=var - Stores the index of the darkest color in the current colortable into var. READ_TABLES = if set and parameters are not specified, read directly from color tables, using TVLCT, /GET. Do not use the COLORS common block. OUTPUTS: This function returns an array containing the luminance values of the specified colors. If the R,G,B parameters are not specified, or if R is of integer, byte or long type, the result is a longword array. Otherwise, the result is a floating point array. COMMON BLOCKS: COLORS: Contains the current RGB color tables. MODIFICATION HISTORY: April 1, 1992, AB When splitting XPALETTE into widget clusters, this code became necessary in multiple places. This routine encapsulates it. May 15, 1994, DMS Process colors from parameters or current color table.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/ct_luminance.pro)
NAME:
CURVEFIT
PURPOSE:
Non-linear least squares fit to a function of an arbitrary
number of parameters. The function may be any non-linear
function. If available, partial derivatives can be calculated by
the user function, else this routine will estimate partial derivatives
with a forward difference approximation.
CATEGORY:
E2 - Curve and Surface Fitting.
CALLING SEQUENCE:
Result = CURVEFIT(X, Y, W, A, SIGMAA, FUNCTION_NAME = name, $
ITMAX=ITMAX, ITER=ITER, TOL=TOL, /NODERIVATIVE)
INPUTS:
X: A row vector of independent variables. This routine does
not manipulate or use values in X, it simply passes X
to the user-written function.
Y: A row vector containing the dependent variable.
W: A row vector of weights, the same length as 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.
ITMAX: Maximum number of iterations. Default = 20.
ITER: The actual number of iterations which were performed
TOL: The convergence tolerance. The routine returns when the
relative decrease in chi-squared is less than TOL in an
interation. Default = 1.e-3.
CHI2: The value of chi-squared on exit
NODERIVATIVE: If this keyword is set then the user procedure will not
be requested to provide partial derivatives. The partial
derivatives will be estimated in CURVEFIT using forward
differences. If analytical derivatives are available they
should always be used.
OUTPUTS:
Returns a vector of calculated values.
A: A vector of parameters containing fit.
OPTIONAL OUTPUT PARAMETERS:
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 = Variable passed into CURVEFIT. It is the job of the user-written
function to interpret this variable.
A = Vector of NTERMS function parameters, input.
F = Vector of NPOINT values of function, y(i) = funct(x), output.
PDER = Array, (NPOINT, NTERMS), of partial derivatives of funct.
PDER(I,J) = DErivative of function at ith point with
respect to jth parameter. Optional output parameter.
PDER should not be calculated if the parameter is not
supplied in call. If the /NODERIVATIVE keyword is set in the
call to CURVEFIT then the user routine will never need to
calculate PDER.
PROCEDURE:
Copied from "CURFIT", least squares fit to a non-linear
function, pages 237-239, Bevington, Data Reduction and Error
Analysis for the Physical Sciences.
"This method is the Gradient-expansion algorithm which
combines the best features of the gradient search with
the method of linearizing the fitting function."
Iterations are performed until the chi square changes by
only TOL or until ITMAX iterations have been performed.
The initial guess of the parameter values should be
as close to the actual values as possible or the solution
may not converge.
EXAMPLE: Fit a function of the form f(x) = a * exp(b*x) + c to
sample pairs contained in x and y.
In this example, a=a(0), b=a(1) and c=a(2).
The partials are easily computed symbolicaly:
df/da = exp(b*x), df/db = a * x * exp(b*x), and df/dc = 1.0
Here is the user-written procedure to return F(x) and
the partials, given x:
pro gfunct, x, a, f, pder ; Function + partials
bx = exp(a(1) * x)
f= a(0) * bx + a(2) ;Evaluate the function
if N_PARAMS() ge 4 then $ ;Return partials?
pder= [[bx], [a(0) * x * bx], [replicate(1.0, N_ELEMENTS(y))]]
end
x=findgen(10) ;Define indep & dep variables.
y=[12.0, 11.0,10.2,9.4,8.7,8.1,7.5,6.9,6.5,6.1]
w=1.0/y ;Weights
a=[10.0,-0.1,2.0] ;Initial guess
yfit=curvefit(x,y,w,a,sigmaa,function_name='gfunct')
print, 'Function parameters: ', a
print, yfit
end
MODIFICATION HISTORY:
Written, DMS, RSI, September, 1982.
Does not iterate if the first guess is good. DMS, Oct, 1990.
Added CALL_PROCEDURE to make the function's name a parameter.
(Nov 1990)
12/14/92 - modified to reflect the changes in the 1991
edition of Bevington (eq. II-27) (jiy-suggested by CreaSo)
Mark Rivers, U of Chicago, Feb. 12, 1995
- Added following keywords: ITMAX, ITER, TOL, CHI2, NODERIVATIVE
These make the routine much more generally useful.
- Removed Oct. 1990 modification so the routine does one iteration
even if first guess is good. Required to get meaningful output
for errors.
- Added forward difference derivative calculations required for
NODERIVATIVE keyword.
- Fixed a bug: PDER was passed to user's procedure on first call,
but was not defined. Thus, user's procedure might not calculate
it, but the result was then used.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/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_4/lib/cv_coord.pro)
NAME:
CW_ANIMATE
PURPOSE:
This widget displays an animated sequence of images using
X-windows Pixmaps. This is a compound widget, based on the
XINTERANIMATE procedure, with the following advantages:
- It can be included in other applications.
- Multiple copies can be run simultaneously.
The speed and direction of the display can be adjusted using
the widget interface.
CATEGORY:
Image display, compound widgets.
CALLING SEQUENCE:
To initially create:
widget = CW_ANIMATE(PARENT, SIZEX, SIZEY, NFRAMES)
To reinitialize when another animation is loaded:
CW_ANIMATE_INIT, ANIMATEBASE, SIZEX, SIZEY, NFRAMES
To load a single image:
CW_ANIMATE_LOAD, WIDGET, IMAGE = IMAGE, FRAME = FRAME_INDEX
To load a single image that is already displayed in an existing window:
CW_ANIMATE_LOAD, WIDGET, FRAME = FRAME_INDEX, $
WINDOW = [WINDOW_NUMBER [, X0, Y0, SX, SY]]
(This technique is much faster than reading back from the window.)
To display the animation after all the images have been loaded:
CW_ANIMATE, WIDGET [, RATE]
To get a copy of the vector of Pixmaps being used by the widget.
If this routine is called, the widget does not destroy the pixmaps
when it is destroyed. The user can then provide them to a later
call to CW_ANIMATE to re-use them while skipping the Pixmap creation
and rendering step:
CW_ANIMATE_GETP, widget, PIXMAPS
INPUTS:
CW_ANIMATE:
PARENT: The ID of the parent widget.
SIZEX: The width of the displayed image.
SIZEY: The height of the displayed image.
NFRAMES: The number of frames in the animation sequence.
CW_ANIMATE_INIT:
ANIMATEBASE: The ID of the base animation widget.
SIZEX: The width of the displayed image.
SIZEY: The height of the displayed image.
NFRAMES: The number of frames in the animation sequence.
CW_ANIMATE_LOAD:
WIDGET: The ID of the widget (as created with CW_ANIMATE)
into which the image should be loaded.
CW_ANIMATE_RUN:
WIDGET: The ID of the widget (as created with CW_ANIMATE)
into which the image should be loaded.
RATE: A value between 0 and 100 that represents the
speed of the animation as a percentage of the
maximum display rate. The fastest animation has
a value of 100 and the slowest has a value of 0.
The default animation rate is 100.
STOP: If this keyword is set, the animation is stopped.
NFRAMES: Specifies the number of frames to animate, must
<= the number specified in CW_ANIMATE().
KEYWORD PARAMETERS:
CW_ANIMATE:
PIXMAPS: This keyword provides the new widget with a vector
of pre-existing pixmap (off screen window) IDs.
This vector is usually obtained from a call to
CW_ANIMATE_GETP applied to a previous animation
widget.
UVALUE: A user supplied value to be stored in the widget's
user value field.
NO_KILL: If NOT set, an "End Animation" button is added to the
animation base. If set the button is not added.
OPEN_FUNC: A user supplied string that specifies a callback
function name. When a value is specified for this
keyword, an "Open..." pushbutton is added to the
window. When the "Open..." pushbutton is clicked
the OPEN_FUNC function is called to load new
animation data.
CW_ANIMATE_INIT:
PIXMAPS: This keyword provides the new widget with a vector
of pre-existing pixmap (off screen window) IDs.
This vector is usually obtained from a call to
CW_ANIMATE_GETP applied to a previous animation
widget.
CW_ANIMATE_LOAD:
CYCLE: If set, cycle. Normally, frames are displayed
going either forward or backwards. If CYCLE is
set, reverse direction after the last frame in
either direction is displayed.
FRAME: The frame number to be loaded. This is a value
between 0 and NFRAMES. If not supplied, frame 0
is loaded.
IMAGE: The image to be loaded.
ORDER: Set this keyword to display images from the top
down instead of the default bottom up. This keyword
is only used when loading images with the IMAGE
keyword.
TRACK: If set, the frame slider tracks the current frame.
Default is not to track.
WINDOW: When this keyword is specified, an image is copied
from an existing window to the animation pixmap.
When using X windows, this technique is much faster
than reading from the display and then loading with
the IMAGE keyword.
The value of this parameter is either an IDL window
number (in which case the entire window is copied),
or a vector containing the window index and the
rectangular bounds of the area to be copied. For
example:
WINDOW = [Window_Number, X0, Y0, Sx, Sy]
XOFFSET: The horizontal offset, in pixels from the left of
the frame, of the image in the destination window.
YOFFSET: The vertical offset, in pixels from the bottom of
the frame, of the image in the destination window.
OUTPUTS:
No explicit outputs.
SIDE EFFECTS:
If the widget is realized before calls to CW_ANIMATE_LOAD, the frames
are displayed as they are loaded. This provides the user with an
indication of how things are progressing.
When the widget is destroyed, it destroys the pixmaps used in the
animation, unless they were previously obtained via CW_ANIMATE_GETP
and the KILL_ANYWAY keyword was not set.
The only event returned by this widget indicates that the user
has pressed the DONE button. The parent application should use
this as a signal to kill the animation widget via WIDGET_CONTROL.
RESTRICTIONS:
If more than one animation widget is running at a time, they
will fight for resources and run slower.
PROCEDURE:
When initialized, this procedure creates pixmaps containing the
frames of the animation sequence. Once the images are loaded,
they are displayed by copying the images from the pixmap or buffer
to the visible draw widget.
EXAMPLE:
Assume the following event handler procedure exists:
PRO EHANDLER, EV
WIDGET_CONTROL, /DESTROY, EV.TOP
end
Enter the following commands to open the file ABNORM.DAT (a series
of images of a human heart) and load the images it contains into
an array H:
OPENR, 1, FILEPATH('abnorm.dat', SUBDIR = 'images')
H = BYTARR(64, 64, 16)
READU, 1, H
CLOSE, 1
H = REBIN(H, 128, 128, 16)
Create an instance of the animation widget at load the frames:
base = widget_base()
animate = CW_ANIMATE(base, 128, 128, 16)
WIDGET_CONTROL, /REALIZE, base
for i=0,15 do CW_ANIMATE_LOAD, animate, FRAME=i, IMAGE=H(*,*,I)
Start the animation:
CW_ANIMATE_RUN, animate
XMANAGER, "CW_ANIMATE Demo", base, EVENT_HANDLER = "EHANDLER"
Pressing the DONE button kills the application.
MODIFICATION HISTORY:
AB, June 1992 Heavily based on the XINTERANIMATE procedure.
SR, September 1992 Fixed a problem when a paused animation's
frame selection was moved and the resulting
frame change ended up in another animation.
SR, November 1992 Fixed a problem when a single paused animation
would fail when the frame selection slider
event tried to set do a bad drawing window.
DMS/AB, March, 1993 Got rid of state caching. Got rid of
XMANAGER background tasks in favor of new
"WIDGET_CONTROL,timer=" feature.
ACY, October 1993 Set RETAIN=2 for draw widget to prevent
clipping by an overlapping window when
loading frames.
DMS, Dec, 1993 Added STOP and NFRAMES keywords to CW_ANIMATE_RUN.
Added KILL_ANYWAY keyword to CW_ANIMATE_GETP.
WSO, Jan, 1995 Added OPEN_FUNC keyword and updated UI.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cw_animate.pro)
NAME:
CW_ARCBALL
PURPOSE:
CW_ARCBALL is a compound widget for intuitively specifying
three-dimensional orientations.
CATEGORY:
Widget, 3d graphics
CALLING SEQUENCE:
Widget_id = CW_ARCBALL(Parent)
INPUTS:
PARENT: The ID of the parent widget.
KEYWORD PARAMETERS:
FRAME: If set, draws a frame around the widget.
The default is FRAME=0.
LABEL: A string containing the widget's label.
VALUE: An initial value for the 3 x 3 rotation matrix. This
must be a valid rotation matrix (no translation or
perspective) where: transpose(value) = inverse(value).
This can be the upper-left corner of !P.T after executing
the command T3D, /RESET, ROTATE=[x,y,z]. The default
is the identity matrix.
UVALUE: The initial user value for the widget.
SIZE: The size of the square drawable area containing the arcball,
in pixels. Default size = 192.
UPDATE: If set, the widget will send an event each time
the mouse button is released after a drag operation.
Otherwise, an event is only sent when the Update
button is pressed.
COLORS: A 6-element array containing the color indices to be used.
Colors(0) = View axis color
Colors(1) = object axis color,
Colors(2) = XZ plane +Y side (body top) color,
Colors(3) = YZ plane (fin) color,
Colors(4) = XZ plane -Y side (body bottom),
Colors(5) = background color.
Default value = [ 1,7,2,3,7,0], which yields good colors
with the TEK_COLOR table.
(white, yellow, red, green, yellow, black).
RETAIN: Retain parameter for window, 0 = none, 1 = server's default,
2 = use backing store. default = 1.
OUTPUTS:
The ID of the widget is returned.
SIDE EFFECTS:
Events are generated as described above. The current graphics window
is changed.
RESTRICTIONS:
This widget can generate any rotation about any axis.
Not all rotations are compatible with the IDL SURFACE
procedure, which is restricted to rotations that project the
object Z axis parallel to the view Y axis.
PROCEDURE:
This widget is based on "ARCBALL: A User Interface for
Specifying Three-Dimensional Orientation Using a Mouse", by Ken
Shoemake, Computer Graphics Laboratory, University of Pennsylvania,
Philadelphia, PA 19104. "In Arcball, human factors and mathematical
fundamentals come together exceptionally well."
The user drags a simulated track-ball with the mouse to interactively
obtain arbitrary rotations. Sequences of rotations may be cascaded.
The rotations may be unconstrained (about any axis), constrained to
the view X, Y, or Z axes, or to the object's X, Y, or Z axis.
Use the call:
WIDGET_CONTROL, id, /SET_VALUE
to draw the arcball after the widget is initially realized.
Also, the SET_VALUE entry will set the widget's value to the
given 3x3 rotation matrix and redraw the widget.
The WIDGET_CONTROL, id, GET_VALUE=v
call returns the current 3x3 rotation matrix.
EXAMPLE:
See the procedure ARCBALL_TEST, contained in this file.
To test CW_ARCBALL:
.RUN cw_arcball
ARCBALL_TEST
MODIFICATION HISTORY:
DMS, RSI, September, 1993. Written
ACY, RSI, January, 1994. Correct test on initial value.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cw_arcball.pro)
NAME:
CW_BGROUP
PURPOSE:
CW_BGROUP is a compound widget that simplifies creating
a base of buttons. It handles the details of creating the
proper base (standard, exclusive, or non-exclusive) and filling
in the desired buttons. Events for the individual buttons are
handled transparently, and a CW_BGROUP event returned. This
event can return any one of the following:
- The Index of the button within the base.
- The widget ID of the button.
- The name of the button.
- An arbitrary value taken from an array of User values.
CATEGORY:
Compound widgets.
CALLING SEQUENCE:
Widget = CW_BGROUP(Parent, Names)
To get or set the value of a CW_BGROUP, use the GET_VALUE and
SET_VALUE keywords to WIDGET_CONTROL. The value of a CW_BGROUP
is:
-----------------------------------------------
Type Value
-----------------------------------------------
normal None
exclusive Index of currently set button
non-exclusive Vector indicating the position
of each button (1-set, 0-unset)
-----------------------------------------------
INPUTS:
Parent: The ID of the parent widget.
Names: A string array, containing one string per button,
giving the name of each button.
KEYWORD PARAMETERS:
BUTTON_UVALUE: An array of user values to be associated with
each button and returned in the event structure.
COLUMN: Buttons will be arranged in the number of columns
specified by this keyword.
EVENT_FUNCT: The name of an optional user-supplied event function
for buttons. This function is called with the return
value structure whenever a button is pressed, and
follows the conventions for user-written event
functions.
EXCLUSIVE: Buttons will be placed in an exclusive base, with
only one button allowed to be selected at a time.
FONT: The name of the font to be used for the button
titles. If this keyword is not specified, the default
font is used.
FRAME: Specifies the width of the frame to be drawn around
the base.
IDS: A named variable into which the button IDs will be
stored, as a longword vector.
LABEL_LEFT: Creates a text label to the left of the buttons.
LABEL_TOP: Creates a text label above the buttons.
MAP: If set, the base will be mapped when the widget
is realized (the default).
NONEXCLUSIVE: Buttons will be placed in an non-exclusive base.
The buttons will be independent.
NO_RELEASE: If set, button release events will not be returned.
RETURN_ID: If set, the VALUE field of returned events will be
the widget ID of the button.
RETURN_INDEX: If set, the VALUE field of returned events will be
the zero-based index of the button within the base.
THIS IS THE DEFAULT.
RETURN_NAME: If set, the VALUE field of returned events will be
the name of the button within the base.
ROW: Buttons will be arranged in the number of rows
specified by this keyword.
SCROLL: If set, the base will include scroll bars to allow
viewing a large base through a smaller viewport.
SET_VALUE: The initial value of the buttons. This is equivalent
to the later statement:
WIDGET_CONTROL, widget, set_value=value
SPACE: The space, in pixels, to be left around the edges
of a row or column major base. This keyword is
ignored if EXCLUSIVE or NONEXCLUSIVE are specified.
UVALUE: The user value to be associated with the widget.
XOFFSET: The X offset of the widget relative to its parent.
XPAD: The horizontal space, in pixels, between children
of a row or column major base. Ignored if EXCLUSIVE
or NONEXCLUSIVE are specified.
XSIZE: The width of the base.
X_SCROLL_SIZE: The width of the viewport if SCROLL is specified.
YOFFSET: The Y offset of the widget relative to its parent.
YPAD: The vertical space, in pixels, between children of
a row or column major base. Ignored if EXCLUSIVE
or NONEXCLUSIVE are specified.
YSIZE: The height of the base.
Y_SCROLL_SIZE: The height of the viewport if SCROLL is specified.
OUTPUTS:
The ID of the created widget is returned.
SIDE EFFECTS:
This widget generates event structures with the following definition:
event = { ID:0L, TOP:0L, HANDLER:0L, SELECT:0, VALUE:0 }
The SELECT field is passed through from the button event. VALUE is
either the INDEX, ID, NAME, or BUTTON_UVALUE of the button,
depending on how the widget was created.
RESTRICTIONS:
Only buttons with textual names are handled by this widget.
Bitmaps are not understood.
MODIFICATION HISTORY:
15 June 1992, AB
7 April 1993, AB, Removed state caching.
6 Oct. 1994, KDB, Font keyword is not applied to the label.
10 FEB 1995, DJC fixed bad bug in event procedure, getting
id of stash widget.
11 April 1995, AB Removed Motif special cases.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cw_bgroup.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_4/lib/cw_clr_index.pro)
NAME: CW_COLORSEL PURPOSE: CW_COLORSEL is a compound widget that displays all the colors in the current colormap and allows the user to select the color indices via the mouse or with sliders. CATEGORY: Compund widgets. CALLING SEQUENCE: widget = CW_COLORSEL(Parent) INPUTS: Parent: The ID of the parent widget. KEYWORD PARAMETERS: FRAME: If set, a frame is drawn around the widget. UVALUE: The user value for the widget. XOFFSET: The X offset position YOFFSET: The Y offset position OUTPUTS: The ID of the created widget is returned. SIDE EFFECTS: This widget generates event structures containing a field named VALUE, which contains the colormap index selected by the user. PROCEDURE: The COLORSEL widget displays all the colors in the current colormap in a 16x16 (320x320 pixels) grid. To select a color index, the user moves the mouse pointer over the desired color square and presses any mouse button. Alternatively, the color index can be selected by moving one of the three sliders provided around the grid. WIDGET_CONTROL, SET_VALUE=index can be used to set the current color index. WIDGET_CONTROL, SET_VALUE=-1 informs the widget to initialize itself and redraw. It should be called when any of the following happen: - The widget needs redrawing. - The brightest or darkest color has changed. WIDGET_CONTROL, GET_VALUE=var can be used to retrieve the current color index. MODIFICATION HISTORY: March 30, 1992, AB Removed the relevant code from XPALETTE.PRO and modified it to create this reusable widget cluster. September 4, 1992, SR Fixed a bug where the value of the xslider was calculated as negative and WIDGET_CONTROL, SET_VALUE failed. 7 April 1993, AB, Removed state caching. October 20, 1993, KDB Changed return value in function CSEL_GET_VALUE from state.cur_idx to ret 23 May 1994, AB Added NOTIFY_REALIZE routine to eliminate the need to call "WIDGET_CONTROL, SET_VALUE=-1" when the widget is realized.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cw_colorsel.pro)
NAME:
CW_DEFROI
PURPOSE:
Widget to define a region of interest within a widget drawable.
CATEGORY:
Regions of interest, graphics.
CALLING SEQUENCE:
Result = CW_DEFROI(draw)
INPUTS:
Draw = id of drawable to draw the region. The drawable should
have both MOTION and BUTTON events enabled.
KEYWORD PARAMETERS:
IMAGE_SIZE = the size of the underlying array, expressed
as a two element vector: [columns, rows]. Default =
drawable size / zoom.
OFFSET = offset of lower left corner of image within the
drawable. Default = [0,0].
ORDER = if set, return inverted subscripts, as if the array
were output from top to bottom.
RESTORE = Set to restore the drawable to its previous appearance
on exit. Otherwise, the regions remain on the drawable.
ZOOM = if the image array was expanded (via REBIN for example)
specify this two element vector containing the expansion
factor in X and Y. Default = [1,1]. Must be integer.
OUTPUTS:
Result = subscripts of points within the region[s] defined.
If no region was defined, a scalar -1 is returned.
COMMON BLOCKS:
None.
SIDE EFFECTS:
The regions are drawn within the drawable. Set the RESTORE
keyword to undo the damage.
RESTRICTIONS:
This is a MODAL widget. No other widget applications will be
responsive while this widget is in use.
PROCEDURE:
Complicated.
EXAMPLE:
To obtain the average of the counts of a region within a drawable:
Assume A = the array of interest, n columns, m rows, and that
it is displayed in drawable D, at offset X=20, Y=100, and zoomed
with a factor of 2:
TV, REBIN(A, M*2, N*2), 20, 100 ;Display the image
q = CW_DEFROI(D, ZOOM=[2,2], OFFSET=[20,100], IMAGE_SIZE=[m,n])
if q(0) ne -1 then print,'Average = ', total(a(q))/n_elements(q)
MODIFICATION HISTORY:
DMS, RSI, December, 1993. Written.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cw_defroi.pro)
NAME:
CW_DICE
PURPOSE:
CW_DICE is a compound widget that implements a single die.
This widget uses a button with a bitmap label.
The primary purpose of this compound widget is to serve as
a full example of a realistic compound widget for the IDL
User's Guide.
CATEGORY:
Compound widgets.
CALLING SEQUENCE:
Widget = CW_DICE(Parent)
INPUTS:
Parent: The ID of the parent widget.
KEYWORD PARAMETERS:
TUMBLE_CNT: The widget simulates the tumbling of a dice by
changing the bitmap on the dice several times before
settling down to a final value. The number of "tumbles"
is specified by the TUMBLE_CNT keyword. The default is 10.
TUMBLE_PERIOD: The amount of time in seconds between each tumble
of the dice. The default is .05 seconds.
UVALUE: The user value for the widget.
OUTPUTS:
The ID of the created widget is returned.
COMMON BLOCKS
CW_DICE_BLK: Used to store dice faces, and the current
random number generator seed for the CW_DICE class.
SIDE EFFECTS:
This widget generates event structures containing an extra
field named VALUE giving the final value resulting from a dice roll.
Such events are only sent when the user presses the dice button.
PROCEDURE:
The CW_DICE widget consists of a single pushbutton that
displays its current dice value as a bitmask. If the user presses
the button, it tumbles for a moment and then the new value is
displayed and an event is issued.
The current value of the dice is available via the
WIDGET_CONTROL,GET_VALUE command.
The current value can be set by issuing the
WIDGET_CONTROL, SET_VALUE command. If the requested value is
outside the range [1,6], then the dice tumbles to a new value
as if the user had pressed the button, but no event is issued.
MODIFICATION HISTORY:
24 October 1993, AB, RSI
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cw_dice.pro)
NAME: CW_FIELD PURPOSE: This widget cluster function manages a data entry field widget. The field consists of a label and a text widget. CW_FIELD's can be string fields, integer fields or floating-point fields. The default is an editable string field. CATEGORY: Widget Clusters. CALLING SEQUENCE: Result = CW_FIELD(Parent) INPUTS: Parent: The widget ID of the widget to be the field's parent. KEYWORD PARAMETERS: TITLE: A string containing the text to be used as the label for the field. The default is "Input Field:". VALUE: The initial value in the text widget. This value is automatically converted to the type set by the STRING, INTEGER, and FLOATING keywords described below. UVALUE: A user value to assign to the field cluster. This value can be of any type. FRAME: The width, in pixels, of a frame to be drawn around the entire field cluster. The default is no frame. RETURN_EVENTS: Set this keyword to make cluster return an event when ais pressed in a text field. The default is not to return events. Note that the value of the text field is always returned when the WIDGET_CONTROL, field, GET_VALUE=X command is used. ALL_EVENTS: Like RETURN_EVENTS but return an event whenever the contents of a text field have changed. COLUMN: Set this keyword to center the label above the text field. The default is to position the label to the left of the text field. ROW: Set this keyword to position the label to the left of the text field. This is the default. XSIZE: An explicit horizontal size (in characters) for the text input area. The default is to let the window manager size the widget. Using the XSIZE keyword is not recommended. YSIZE: An explicit vertical size (in lines) for the text input area. The default is 1. STRING: Set this keyword to have the field accept only string values. Numbers entered in the field are converted to their string equivalents. This is the default. FLOATING: Set this keyword to have the field accept only floating-point values. Any number or string entered is converted to its floating-point equivalent. INTEGER: Set this keyword to have the field accept only integer values. Any number or string entered is converted to its integer equivalent (using FIX). For example, if 12.5 is entered in this type of field, it is converted to 12. LONG: Set this keyword to have the field accept only long integer values. Any number or string entered is converted to its long integer equivalent (using LONG). FONT: A string containing the name of the X Windows font to use for the TITLE of the field. FIELDFONT: A string containing the name of the X Windows font to use for the TEXT part of the field. NOEDIT: Normally, the value in the text field can be edited. Set this keyword to make the field non-editable. OUTPUTS: This function returns the widget ID of the newly-created cluster. COMMON BLOCKS: None. PROCEDURE: Create the widgets, set up the appropriate event handlers, and return the widget ID of the newly-created cluster. EXAMPLE: The code below creates a main base with a field cluster attached to it. The cluster accepts string input, has the title "Name:", and has a frame around it: base = WIDGET_BASE() field = CW_FIELD(base, TITLE="Name:", /FRAME) WIDGET_CONTROL, base, /REALIZE MODIFICATION HISTORY: Written by: Keith R. Crosley June 1992 KRC, January 1993 -- Added support for LONG integers. AB, 7 April 1993, Removed state caching. JWG, August 1993, Completely rewritten to make use of improved TEXT widget functionality ACY, 25 March, 1994, fix usage of FRAME keyword KDB, May 1994, Initial value =0 would result in a null text field. Fixed keyword check.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cw_field.pro)
NAME:
CW_FORM
PURPOSE:
CW_FORM is a compound widget that simplifies creating
forms which contain text, numeric fields, buttons,
and droplists. Event handling is also simplified.
CATEGORY:
Compound widgets.
CALLING SEQUENCE:
widget = CW_FORM([Parent,] Desc)
INPUTS:
Parent: The ID of the parent widget. Omitted for a top level
modal widget.
Desc: A string array describing the form. Each element of the
string array contains two or more comma delimited fields. The
character '\' may be used to escape commas that appear within fields.
To include the backslash character, escape it with a second
backslash.
The fields are defined as follows:
Field 1: Depth: the digit 0, 1, 2, or 3. 0 continues the current
level, 1 begins a new level, 2 denotes the last element of the
current level, and 3 both begins a new level and is the last entry of
the current level. Nesting is used primarily with row or column
bases for layout. See the example below.
Field 2: Item type: BASE, BUTTON, DROPLIST, FLOAT, INTEGER, LABEL, or TEXT.
The items return the following value types:
BUTTON - For single buttons, 0 if clear, 1 if set.
For multiple buttons, also called button groups, that are
exclusive the index of the set button is returned. For
non-exclusive button groups, the value is an array
an element for each button containing 1
if the button is set, 0 otherwise.
DROPLIST - a 0 based index indicating which item is selected.
FLOAT, INTEGER, TEXT - return their respective data type.
Field 3: Initial value. Omitted for bases.
For BUTTON and DROPLIST items, the value field contains one
or more item names, delimited by the | character.
For FLOAT, INTEGER, LABEL, and TEXT items the value field contains the
initial value of the field.
Fields 4 and following: Keywords or Keyword=value pairs that specify
optional attributes or options. Possibilities include:
COLUMN If present, specifies column layout.
EXCLUSIVE If present makes an exclusive set of buttons. The
default is nonexclusive.
FONT= If present, the font for the item is specified.
FRAME: If present, a frame is drawn around the item.
LABEL_LEFT=(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cw_form.pro)
NAME:
CW_FSLIDER
PURPOSE:
The standard slider provided by the WIDGET_SLIDER() function is
integer only. This compound widget provides a floating point
slider.
CATEGORY:
Compound widgets.
CALLING SEQUENCE:
widget = CW_FSLIDER(Parent)
INPUTS:
Parent: The ID of the parent widget.
KEYWORD PARAMETERS:
DRAG: Set this keyword to zero if events should only
be generated when the mouse is released. If it is
non-zero, events will be generated continuously
when the slider is adjusted. Note: On slow systems,
/DRAG performance can be inadequate. The default
is DRAG=0.
EDIT: Set this keyword to make the slider label be
editable. The default is EDIT=0.
FORMAT: Provides the format in which the slider value is
displayed. This should be a format as accepted by
the STRING procedure. The default is FORMAT='(G13.6)'
FRAME: Set this keyword to have a frame drawn around the
widget. The default is FRAME=0.
MAXIMUM: The maximum value of the slider. The default is
MAXIMUM=100.
MINIMUM: The minimum value of the slider. The default is
MINIMUM=0.
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_4/lib/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_4/lib/cw_orient.pro)
NAME:
CW_PDMENU
PURPOSE:
CW_PDMENU is a compound widget that simplifies creating
pulldown menus. It has a simpler interface than the XPDMENU
procedure, which it is intended to replace. Events for the
individual buttons are handled transparently, and a CW_PDMENU
event returned. This event can return any one of the following:
- The Index of the button within the base.
- The widget ID of the button.
- The name of the button.
- The fully qualified name of the button. This allows
different sub-menus to contain buttons with the same
name in an unambiguous way.
CATEGORY:
Compound widgets.
CALLING SEQUENCE:
widget = CW_PDMENU(Parent, Desc)
INPUTS:
Parent: The ID of the parent widget.
Desc: An array of strings or structures. Each element contains
a menu description with two fields, a flag field, and
the name of the item. If a structure, each element
is defined as follows:
{ CW_PDMENU_S, flags:0, name:'' }
The name tag gives the name of button. The flags
field is a two-bit bitmask that controls how the button is
interpreted:
Value Meaning
-------------------------------------------
0 This button is neither the beginning
nor the end of a pulldown level.
1 This button is the root of a
sub-pulldown menu. The sub-buttons
start with the next button.
2 This button is the last button at the
current pulldown level. The next button
belongs to the same level as the current
parent button.
3 This button is the root of a sub-pulldown
menu, but it is also the last entry of
the current level.
If Desc is a string, each element contains the flag field
followed by a backslash character, followed by the menu item's
contents. See the example below.
EVENT PROCEDURES: An event procedure may be specified for an
element and all its children, by including a third field
in Desc, if Desc is a string array. Events for buttons without
an event procedure, are dispatched normally.
See the example below.
KEYWORD PARAMETERS:
DELIMITER: The character used to separate the parts of a
fully qualified name in returned events. The
default is to use the '.' character.
FONT: The name of the font to be used for the button
titles. If this keyword is not specified, the
default font is used.
HELP: If MBAR is specified and one of the buttons on the
menubar has the label "help" (case insensitive) then
that button is created with the /HELP keyword to
give it any special appearance it is supposed to
have on a menubar. For example, Motif expects
help buttons to be on the right.
IDS: A named variable into which the button IDs will
be stored as a longword vector.
MBAR: if constructing a menu-bar pulldown, set this
keyword. In this case, the parent must be the
widget id of the menu bar of a top-level base,
returned by WIDGET_BASE(..., MBAR=mbar).
RETURN_ID: If present and non-zero, the VALUE field of returned
events will be the widget ID of the button.
RETURN_INDEX: If present and non-zero, the VALUE field of returned
events will be the zero-based index of the button
within the base. THIS IS THE DEFAULT.
RETURN_NAME: If present and non-zero, the VALUE field of returned
events will be the name of the selected button.
RETURN_FULL_NAME: If present and non-zero, the VALUE field of returned
events will be the fully qualified name of the
selected button. This means that the names of all
the buttons from the topmost button of the pulldown
menu to the selected one are concatenated with the
delimiter specified by the DELIMITER keyword. For
example, if the top button was named COLORS, the
second level button was named BLUE, and the selected
button was named LIGHT, the returned value would be
COLORS.BLUE.LIGHT
This allows different submenus to have buttons with
the same name (e.g. COLORS.RED.LIGHT).
UVALUE: The user value to be associated with the widget.
XOFFSET: The X offset of the widget relative to its parent.
YOFFSET: The Y offset of the widget relative to its parent.
OUTPUTS:
The ID of the top level button is returned.
SIDE EFFECTS:
This widget generates event structures with the following definition:
event = { ID:0L, TOP:0L, HANDLER:0L, VALUE:0 }
VALUE is either the INDEX, ID, NAME, or FULL_NAME of the button,
depending on how the widget was created.
RESTRICTIONS:
Only buttons with textual names are handled by this widget.
Bitmaps are not understood.
EXAMPLE:
The following is the description of a menu bar with two buttons,
"Colors" and "Quit". Colors is a pulldown containing the colors
"Red", "Green", Blue", "Cyan", and "Magenta". Blue is a sub-pulldown
containing "Light", "Medium", "Dark", "Navy", and "Royal":
; Make sure CW_PDMENU_S is defined
junk = { CW_PDMENU_S, flags:0, name:'' }
; The description
desc = [ { CW_PDMENU_S, 1, 'Colors' }, $
{ CW_PDMENU_S, 0, 'Red' }, $
{ CW_PDMENU_S, 0, 'Green' }, $
{ CW_PDMENU_S, 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 same menu may be defined as a string by equating the Desc parameter
to the following string array:
desc =[ '1\Colors' , $
'0\Red' , $
'0\Green' , $
'1\Blue\BLUE_EVENT_PROC' , $
'0\Light' , $
'0\Medium' , $
'0\Dark' , $
'0\Navy' , $
'2\Royal' , $
'0\Cyan' , $
'2\Magenta\MAGENTA_EVENT_PROC' , $
'2\Quit' ]
The following small program can be used with the above description
to create the specified menu:
base = widget_base()
menu = cw_pdmenu(base, desc, /RETURN_FULL_NAME)
WIDGET_CONTROL, /REALIZE, base
repeat begin
ev = WIDGET_EVENT(base)
print, ev.value
end until ev.value eq 'Quit'
WIDGET_CONTROL, /DESTROY, base
end
Note that independent event procedures were specified for
the multiple Blue buttons (blue_event_proc), and the Magenta button
(magenta_event_proc).
MODIFICATION HISTORY:
18 June 1992, AB
16 Jan 1995, DMS, Added MBAR keyword, event procedures,
and menu descriptor strings.
2 July 1995, AB, Added HELP keyword.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cw_pdmenu.pro)
NAME:
CW_RGBSLIDER
PURPOSE:
CW_RGBSLIDER is a compund widget that provides three sliders for
adjusting color values. The RGB, CMY, HSV, and HLS color systems
can all be used. No matter which color system is in use,
the resulting color is always supplied in RGB, which is the
base system for IDL.
CATEGORY:
Compound widgets.
CALLING SEQUENCE:
Widget = CW_RGBSLIDER(Parent)
INPUTS:
Parent: The ID of the parent widget.
KEYWORD PARAMETERS:
CMY: If set, the initial color system used is CMY.
DRAG: Set to zero if events should only be generated when
the mouse button is released. If this keyword is set,
events will be generated continuously when the sliders
are adjusted. Note: On slow systems, /DRAG performance
can be inadequate. The default is DRAG=0.
FRAME: If set, a frame will be drawn around the widget. The
default is FRAME=0 (no frame drawn).
HSV: If set, the initial color system used is HSV.
HLS: If set, the initial color system used is HLS.
LENGTH: The length of the sliders. The default = 256.
RGB: If set, the initial color system used is RGB.
This is the default.
UVALUE: The user value for the widget.
VERTICAL: If set, the sliders will be oriented vertically.
The default is VERTICAL=0 (horizontal sliders).
COLOR_INDEX: If set, display a small rectangle with the
selected color, using the given index.
The color is updated as the values are changed.
OUTPUTS:
The ID of the created widget is returned.
SIDE EFFECTS:
This widget generates event structures containing a three fields
named 'R', 'G', and 'B' containing the Red, Green, and Blue
components of the selected color.
PROCEDURE:
The CW_RGBSLIDER widget has the following controls:
Color System Selection: A pulldown menu which allows the user
to change between the supported color systems.
Color adjustment sliders: Allow the user to select a new color
value.
By adjusting these controls, the user selects color values which
are reported via the widget event mechanism.
MODIFICATION HISTORY:
April 1, 1992, AB
Based on the RGB code from XPALETTE.PRO, but extended to
support color systems other than RGB.
7 April 1993, AB, Removed state caching.
10 May 1994, DMS, Added Color_index param to display color.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/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
23 November, 1994, ACY, add code to handle cases in which the
set_value image is larger or smaller than the
original image. Also remove scaling on display
operation (only scale the image when it is set.)
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cw_zoom.pro)
NAME:
C_CORRELATE
PURPOSE:
This function computes the cross correlation Pxy(L) or cross
covariance Rxy(L) of two sample populations X and Y as a function
of the lag (L).
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = C_correlate(X, Y, Lag)
INPUTS:
X: An n-element vector of type integer, float or double.
Y: An n-element vector of type integer, float or double.
LAG: A scalar or n-element vector, in the interval [-(n-2), (n-2)],
of type integer that specifies the absolute distance(s) between
indexed elements of X.
KEYWORD PARAMETERS:
COVARIANCE: If set to a non-zero value, the sample cross
covariance is computed.
EXAMPLE
Define two n-element sample populations.
x = [3.73, 3.67, 3.77, 3.83, 4.67, 5.87, 6.70, 6.97, 6.40, 5.57]
y = [2.31, 2.76, 3.02, 3.13, 3.72, 3.88, 3.97, 4.39, 4.34, 3.95]
Compute the cross correlation of X and Y for LAG = -5, 0, 1, 5, 6, 7
lag = [-5, 0, 1, 5, 6, 7]
result = c_correlate(x, y, lag)
The result should be:
[-0.448655, 0.915846, 0.628814, -0.393466, -0.350169, -0.282198]
PROCEDURE:
See computational formula published in IDL manual.
REFERENCE:
INTRODUCTION TO STATISTICAL TIME SERIES
Wayne A. Fuller
ISBN 0-471-28715-6
MODIFICATION HISTORY:
Written by: GGS, RSI, October 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/c_correlate.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_4/lib/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_4/lib/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_4/lib/deriv.pro)
NAME:
DERIVSIG
PURPOSE:
This function computes the standard deviation of a derivative
as found by the DERIV function, using the input variables of
DERIV and the standard deviations of those input variables.
CATEGORY:
Numerical analysis.
CALLING SEQUENCE:
sigDy = Derivsig(sigy) ;sigma(Dy(i)/di), point spacing = 1.
sigDy = Derivsig(X,Y,sigx,sigy) ;sigma(Dy/Dx), unequal point spacing.
INPUTS:
Y: The variable to be differentiated. Omit if X is omitted.
X: The Variable to differentiate with respect to. If omitted,
unit spacing is assumed for Y, i.e. X(i) = i.
sigy: The standard deviation of Y. (Vector if used alone in
call, vector or constant if used with other parameters)
sigx: The standard deviation of X (either vector or constant).
Use "0.0" if the abscissa is exact; omit if X is omitted.
OPTIONAL INPUT PARAMETERS:
As above.
OUTPUTS:
This function returns the standard deviation of the derivative.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
See Bevington, "Data Analysis and Reduction for the Physical
Sciences," McGraw-Hill (1969), Chap 4.
MODIFICATION HISTORY:
Written by Richard Bonomo at the University of Wisconsin - Madison
department of Electrical and Computer Engineering, July, 1991.
"DERIV" written by DMS, Aug, 1984.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/derivsig.pro)
NAME:
DETERM
PURPOSE:
This function computes the determinant of an N by N array.
CATEGORY:
Linear Algebra.
CALLING SEQUENCE:
Result = DETERM(A)
INPUTS:
A: An N by N array of type: float, or double.
KEYWORD PARAMETERS:
CHECK: If set to a non-zero value, A is checked for singularity.
The determinant of a singular array is returned as zero if
this keyword is set. Run-time errors may result if A is
singular and this keyword is not set.
DOUBLE: If set to a non-zero value, computations are done in
double precision arithmetic.
ZERO: Use this keyword to set the value of floating-point
zero. A floating-point zero on the main diagonal of
a triangular matrix results in a zero determinant.
For single-precision inputs, the default value is
1.0e-6. For double-precision inputs, the default value
is 1.0e-12.
EXAMPLE:
Define an array (a).
a = [[ 2.0, 1.0, 1.0], $
[ 4.0, -6.0, 0.0], $
[-2.0, 7.0, 2.0]]
Compute the determinant.
result = determ(a)
Note:
See CRAMER.PRO, in the same directory as this file, for
an application of the determinant function.
PROCEDURE:
LU decomposition is used to represent the input array in
triangular form. The determinant is computed as the product
of diagonal elements of the triangular form. Row interchanges
are tracked during the LU decomposition to ensure the correct
sign, + or - .
REFERENCE:
ADVANCED ENGINEERING MATHEMATICS (seventh edition)
Erwin Kreyszig
ISBN 0-471-55380-8
MODIFICATION HISTORY:
Written by: GGS, RSI, February 1994
Modified: GGS, RSI, November 1994
Added CHECK keyword to check for singular arrays.
Changed NR_LUDCMP to LUDC.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/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_4/lib/digital_filter.pro)
NAME: DISSOLVE PURPOSE: A digital "dissolve" effect for images. Copies the pixels (arranged into square tiles) from the image to the display in pseudo-random order. CATEGORY: Image display. CALLING SEQUENCE: DISSOLVE, Image INPUTS: Image: The image to be displayed. It is assumed that the image is already scaled. Byte-valued images display most rapidly. OPTIONAL INPUT PARAMETERS: None. KEYWORD PARAMETERS: SIZ: Size of square tile. The default is 32 x 32 pixels. X0, Y0: The X and Y offsets of the lower-left corner of the image on screen. The defaults are X0 = 0 and Y0 = 0. DELAY: The wait between displaying tiles. The default is 0.01 secs. ORDER: The Image display order: 0 = default = bottom up. 1 = top-down. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: The image is written to the screen. RESTRICTIONS: None, but the effect is dependent upon the speed of the machine/display. PROCEDURE: An integer pseudo-random number generator is used to decide which tile to display. The algorithm is taken from "Graphics Gems", Andrew Glassner, ed., Academic Press, 1990, Page 221. MODIFICATION HISTORY: DMS, Sept, 1990.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/dissolve.pro)
NAME: DIST PURPOSE: Create a rectangular array in which each element is proportional to its frequency. This array may be used for a variety of purposes, including frequency-domain filtering and making pretty pictures. CATEGORY: Signal Processing. CALLING SEQUENCE: Result = DIST(N [, M]) INPUTS: N = number of columns in result. M = number of rows in result. If omitted, N is used to return a square array. OUTPUTS: Returns an (N,M) floating array in which: R(i,j) = SQRT(F(i)^2 + G(j)^2) where: F(i) = i IF 0 <= i <= n/2 = n-i IF i > n/2 G(i) = i IF 0 <= i <= m/2 = m-i IF i > m/2 SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Straightforward. The computation is done a row at a time. MODIFICATION HISTORY: Very Old. SMR, March 27, 1991 - Added the NOZERO keyword to increase efficiency. (Recomended by Wayne Landsman) DMS, July, 1992. - Added M parameter to make non-square arrays.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/dist.pro)
NAME: DL_DOS PURPOSE: Extract the documentation template of one or more procedures (DOS version). CATEGORY: Help, documentation. CALLING SEQUENCE: DL_DOS ;For prompting. DL_DOS, Name ;Extract documentation for procedure Name using the current !PATH. INPUTS: Name: A string containing the name of the procedure or "*" for all. OPTIONAL INPUT PARAMETERS: PRINT: A keyword parameter which, if set to 1, sends the output of DL_DOS to PRN:. If PRINT is a string, it specifies the name of a file that will contain the documentation. DIRECTORY: The directory to search. If omitted, the current directory and !PATH are used. OUTPUTS: No explicit outputs. Documentation is output using 'more' format unless /PRINT is specified. COMMON BLOCKS: None. SIDE EFFECTS: Output is produced on terminal or printer. If the current directory is also one of the directories specified in !PATH or DIRECTORY, documentation will be output twice for the specified module(s). RESTRICTIONS: ?? PROCEDURE: Straightforward. MODIFICATION HISTORY: SNG, Dec, 1990 - adapted from DOC_LIB_UNIX AB, 21 September 1992, renamed from DOC_LIB_DOS to DL_DOS to avoid DOS filename limitations.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/dl_dos.pro)
NAME:
DL_MAC
PURPOSE:
Extract the documentation template of one or more procedures (Macintosh
version).
CATEGORY:
Help, documentation.
CALLING SEQUENCE:
DL_MAC ;For prompting.
DL_MAC, Name ;Extract documentation for procedure Name using
the current !PATH.
INPUTS:
Name: A string containing the name of the procedure or "*" for all.
OPTIONAL INPUT PARAMETERS:
DIRECTORY: The directory to search. If omitted, the current directory
and !PATH are used.
PRINT: Name of a file to print to.
OUTPUTS:
No explicit outputs. Documentation is output using 'more' format
unless /PRINT is specified.
COMMON BLOCKS:
None.
SIDE EFFECTS:
Output is produced on terminal or to a file. If the current directory
is also one of the directories specified in !PATH or DIRECTORY,
documentation will be output twice for the specified module(s).
RESTRICTIONS:
??
PROCEDURE:
Straightforward.
MODIFICATION HISTORY:
DJE, 14 Nov 1994, adapted from DL_DOS.PRO
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/dl_mac.pro)
NAME: DL_UNIX PURPOSE: Extract the documentation template of one or more IDL modules (procedures or functions). CATEGORY: Help, documentation. CALLING SEQUENCE: DL_UNIX ;For prompting. DL_UNIX, Name ;Extract documentation for procedure Name using the current !PATH. INPUTS: Name: The string containing the name of the procedure or "*" for all. KEYWORDS: PRINT: If set, this keyword sends output of DL_UNIX to lpr. If PRINT is a string, it is interpreted as a shell command used for output with the documentation from DL_UNIX providing standard input (i.e., PRINT="cat > junk"). DIRECTORY: The directory to search. If omitted, the current directory and !PATH are used. MULTI: If set, this flag allows printing of more than one file if the requested module exists in more than one directory in the path and the current directory. OUTPUTS: No explicit outputs. Documentation is piped through "more" unless /PRINT is specified. COMMON BLOCKS: None. SIDE EFFECTS: Output is produced on terminal or printer. RESTRICTIONS: None. PROCEDURE: Straightforward. MODIFICATION HISTORY: DMS, Feb, 1988. AB, 21 September 1992, renamed from DOC_LIB_UNIX to DL_UNIX to avoid DOS filename limitations.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/dl_unix.pro)
NAME: DL_VMS PURPOSE: Extract the documentation template of one or more procedures. CATEGORY: Help, documentation. CALLING SEQUENCE: DL_VMS ;For prompting. DL_VMS, Name ;Extract documentation for procedure Name using the current !PATH. INPUTS: Name: A string containing the name of the procedure. KEYWORDS: FILE: If this keyword is set, the output is sent to the file "userlib.doc", in the current directory. PRINT: If set, this keyword sends the output of DL_VMS to lpr. PATH: An optional directory/library search path. This keyword uses the same format and semantics as !PATH. If omitted, !PATH is used. OUTPUTS: Documentation is output to terminal or printer. COMMON BLOCKS: None. SIDE EFFECTS: Output is produced on terminal or printer. RESTRICTIONS: None. PROCEDURE: Straightforward. MODIFICATION HISTORY: Written, DMS, Sept, 1982. Added library param, Jul 1987. Unix version, Feb, 1988. Revised for VMS Version 2, 15 December 1989 Modified by Jim Pendleton, GRO/OSSE NU, July 30, 1992 to handle !PATH's gt 255 characters. AB, 21 September 1992, renamed from DOC_LIB_VMS to DL_VMS to avoid DOS filename limitations. ACY, 25 January 1993, file should be written with stream mode
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/dl_vms.pro)
NAME:
DOC_LIBRARY
PURPOSE:
Extract the documentation template of one or more IDL modules
(procedures or functions). This command provides a standard interface
to the operating-system specific DL_DOS, DL_UNIX, and
DL_VMS procedures.
CATEGORY:
Help, documentation.
CALLING SEQUENCE:
DOC_LIBRARY ;For prompting.
DOC_LIBRARY, Name ;Extract documentation for procedure Name using
the current !PATH.
INPUTS:
Name: The string containing the name of the procedure.
Under Unix, Name may be "*" to get information on all routines.
KEYWORDS:
PRINT: If set, this keyword sends the output of DOC_LIBRARY to the
default printer. Under Unix, if PRINT is a string, it is
interpreted as a shell command used for output with
the documentation from DOC_LIBRARY providing standard input
(i.e. PRINT="cat > junk").
UNIX KEYWORDS:
DIRECTORY: The directory to search. If omitted, the current directory
and !PATH are used.
MULTI: If set, this flag allows printing of more than one file if the
requested module exists in more than one directory in the path
and the current directory.
VMS KEYWORDS:
FILE: If this keyword is set, the output is left in the file
"userlib.doc", in the current directory.
PATH: An optional directory/library search path. This keyword uses
the same format and semantics as !PATH. If omitted, !PATH is
used.
OUTPUTS:
Documentation is sent to the standard output unless /PRINT
is specified.
COMMON BLOCKS:
None.
SIDE EFFECTS:
Output is produced on terminal or printer.
RESTRICTIONS:
The DIRECTORY and MULTI keywords are ignored under VMS. The
FILE and PATH keywords are ignored under Unix.
EXAMPLE:
To obtain documentation for the User's Library function DIST, enter:
DOC_LIBRARY, 'DIST'
For a graphical interface to DOC_LIBRARY, see the procedure XDL.
MODIFICATION HISTORY:
Written, DMS, Sept, 1982.
Added library param, Jul 1987.
Unix version, DMS, Feb, 1988.
New VMS version, DMS, Dec. 1989
Wrapper procedure to call the correct version
under Unix and VMS, AB, Jan 1990
Added support for DOS, SNG, Dec, 1990
Added support for Macintosh, DJE, Nov, 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/doc_library.pro)
$Id: draw_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $
WidDraw
Widget Draw class library
Copyright (c) 1993, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
MODIFICATION HISTORY
Written by: Joshua Goldstein, 12/93
DRAW_Icon
Return the draw toolbar icon
UNCTION DRAW_Icon
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/draw_alloc.pro)
NAME: EFONT PURPOSE: This widget provides a vector font editor and display. CATEGORY: Fonts. CALLING SEQUENCE: EFONT, Init_font INPUTS: Init_font: The initial font index, from 3 to 29. Default = 3. KEYWORD PARAMETERS: GROUP: The widget group, if part of a hierarchy. OUTPUTS: No explicit outputs. COMMON BLOCKS: efont_com. SIDE EFFECTS: Reads and modifies a local copy of the file hersh1.chr. RESTRICTIONS: A basic editor. PROCEDURE: Call EFONT and press the HELP button for instructions. MODIFICATION HISTORY: DMS Nov, 1992. WSO, 1/95, Updated for new directory structure
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/efont.pro)
NAME:
EIGENVEC
PURPOSE:
This function computes the eigenvectors of an N by N real, non-
symmetric array using inverse subspace iteration. The result is
a complex array with a column dimension equal to N and a row
dimension equal to the number of eigenvalues.
CATEGORY:
Linear Algebra / Eigensystems
CALLING SEQUENCE:
Result = Eigenvec(A, Eval)
INPUTS:
A: An N by N nonsymmetric array of type float or double.
EVAL: An N-element complex vector of eigenvalues.
KEYWORD PARAMETERS:
DOUBLE: If set to a non-zero value, computations are done in
double precision arithmetic.
ITMAX: The number of iterations performed in the computation
of each eigenvector. The default value is 4.
RESIDUAL: Use this keyword to specify a named variable which returns
the residuals for each eigenvalue/eigenvector(lambda/x) pair.
The residual is based on the definition Ax - (lambda)x = 0
and is an array of the same size and type as RESULT. The rows
this array correspond to the residuals for each eigenvalue/
eigenvector pair. This keyword must be initialized to a non-
zero value before calling EIGENVEC if the residuals are
desired.
EXAMPLE:
Define an N by N real, nonsymmetric array.
a = [[1.0, -2.0, -4.0, 1.0], $
[0.0, -2.0, 3.0, 4.0], $
[2.0, -6.0, -1.0, 4.0], $
[3.0, -3.0, 1.0, -2.0]]
Compute the eigenvalues of A using double-precision complex arithmetic.
eval = HQR(ELMHES(a), /double)
Print the eigenvalues. The correct solution should be:
(0.26366259, -6.1925899), (0.26366259, 6.1925899), $
(-4.9384492, 0.0000000), (0.41112397, 0.0000000)
print, eval
Compute the eigenvectors of A. The eigenvectors are returned in the
rows of EVEC. The residual keyword must be initialized as a nonzero
value prior to calling EIGENVEC.
residual = 1
result = EIGENVEC(a, eval, residual = residual)
Print the eigenvectors.
print, evec(*,0), evec(*,1), evec(*,2), evec(*,3)
The accuracy of each eigenvalue/eigenvector (lamda/x)
pair may be checked by printing the residual array. This array is the
same size and type as RESULT and returns the residuals as its rows.
The residual is based on the mathematical definition of an eigenvector,
Ax - (lambda)x = 0. All residual values should be floating-point zeros.
print, residual
PROCEDURE:
EIGENVEC computes the set of eigenvectors that correspond to a given
set of eigenvalues using Inverse Subspace Iteration. The eigenvectors
are computed up to a scale factor and are of Euclidean length. The
existence and uniqueness of eigenvectors are not guaranteed.
MODIFICATION HISTORY:
Written by: GGS, RSI, December 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/eigenvec.pro)
NAME: ERRPLOT PURPOSE: Plot error bars over a previously drawn plot. CATEGORY: J6 - plotting, graphics, one dimensional. CALLING SEQUENCE: ERRPLOT, Low, High ;X axis = point number. ERRPLOT, X, Low, High ;To explicitly specify abscissae. INPUTS: Low: A vector of lower estimates, equal to data - error. High: A vector of upper estimates, equal to data + error. OPTIONAL INPUT PARAMETERS: X: A vector containing the abscissae. KEYWORD Parameters: WIDTH: The width of the error bars. The default is 1% of plot width. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: An overplot is produced. RESTRICTIONS: Logarithmic restriction removed. PROCEDURE: Error bars are drawn for each element. EXAMPLES: To plot symmetrical error bars where Y = data values and ERR = symmetrical error estimates, enter: PLOT, Y ;Plot data ERRPLOT, Y-ERR, Y+ERR ;Overplot error bars. If error estimates are non-symetrical, enter: PLOT,Y ERRPLOT, Upper, Lower ;Where Upper & Lower are bounds. To plot versus a vector of abscissae: PLOT, X, Y ;Plot data (X versus Y). ERRPLOT, X, Y-ERR, Y+ERR ;Overplot error estimates. MODIFICATION HISTORY: DMS, RSI, June, 1983. Joe Zawodney, LASP, Univ of Colo., March, 1986. Removed logarithmic restriction. DMS, March, 1989. Modified for Unix IDL.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/errplot.pro)
NAME: EXPAND PURPOSE: Array magnification (CONGRIDI like except that this really works!) CATEGORY: Z4 - IMAGE PROCESSING CALLING SEQUENCE: EXPAND,A,NX,NY,RESULT [,MAXVAL=MAXVAL,FILLVAL=FILLVAL] INPUTS: A Array to be magnified NX Desired size of X Dimension NY Desired size of Y Dimension Keywords: MAXVAL Largest good value. Elements greater than this are ignored FILLVAL Value to use when elements larger than MAXVAL are encountered. Defaults to -1. OUTPUTS: RESULT Magnified Floating point image of A array (NX by NY) COMMON BLOCKS: NONE SIDE EFFECTS: NONE RESTRICTIONS: A must be two Dimensional PROCEDURE: Bilinear interpolation. Not really fast if you have to swap memory (eg. NX*NY is a big number). OK Postscript users don't forget that postscript pixels are scaleable! MODIFICATION HISTORY: Aug 15, 1989 J. M. Zawodny, NASA/LaRC, MS 475, Hampton VA, 23665. Aug 26, 1992 JMZ, Added maxval and fillval keywords. Sep 30, 1992 DMS, RSI, Rewrote to use INTERPOLATE function. Please send suggestions and bugreports to zawodny@arbd0.larc.nasa.gov
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/expand.pro)
NAME: EXTRAC PURPOSE: The EXTRAC function returns as its result any rectangular sub-matrix or portion of the parameter array. When parts of the specified subsection lie outside the bounds of the array, zeros are entered into these outlying elements. EXTRAC was originally a built-in system procedure in the PDP-11 version of IDL, and was retained in that form in the original VAX/VMS IDL for compatibility. Most applications of the EXTRAC function are more concisely written using subscript ranges (e.g., X(10:15)). In the current release of IDL, EXTRAC has been rewritten as a User Library function that provides the same interface as the previous versions. CATEGORY: Array Manipulation. CALLING SEQUENCE: Result = EXTRAC(Array, C1, C2, ..., Cn, S1, S2, ..., Sn) INPUTS: Array: The array from which the subarray will be copied. Ci: The starting subscript in Array for the subarray. There should be one Ci for each dimension of Array. Si: The size of each dimension. The result will have dimensions of (S1, S2, ..., Sn). There should be one Si for each dimension of Array. OUTPUTS: This function returns a two-dimensional, floating-point, interpolated array. RESTRICTIONS: In order to make the most typical cases run quickly, little error checking is done on the input. In particular, the Ci and Si arguments must all be scalar integers, and the Si must be non-negative. If you know that the subarray will never lie beyond the edges of the array, it is more efficient to use array subscript ranges to extract the data instead of EXTRAC. PROCEDURE: If the subarray lies entirely inside the Array argument, the standard array subscript-range mechanism is used to do the work. Otherwise, a zeroed array of the correct type and size is created, and the overlapping subarray is copied into it. EXAMPLES: EXAMPLE 1: Define a 1000 point vector with each element initialized to its subscript. Extract a 300 pt. vector, starting at A(200) and going to A(499). B(0) will be equal to A(200), B(299) will be equal to A(499). Enter: A = FINDGEN(1000) B = EXTRAC(A, 200, 300) EXAMPLE 2: Here, the first 49 points extracted (B(0) to B(49)) lie outside the bounds of the vector and are set to 0. B(50) is set to A(0), B(51) is set to A(1) which is 1, ... Enter: A = FINDGEN(1000) B = EXTRAC(A, -50, 100) EXAMPLE 3: The following commands illustrate the use of EXTRAC with multi- dimensional arrays. Enter: A = INTARR(64,64) ;Make a 64X64 matrix to play with Take out a 32X32 portion starting at A(20,30) by entering: B = EXTRAC(A, 20, 30, 32, 32) A better way to perform the same operation as the previous line is: B = A(20:51, 30:61) Extract the 20th column and 32nd row of A: B = EXTRAC(A, 19, 0, 1, 64) ; Extract 20th column of A B = EXTRAC(A, 0, 31, 64, 1) ; Extract 32nd row of A Take a 32X32 matrix from A starting at A(40,50). B = EXTRAC(A, 40, 50, 32, 32) NOTE: Those points beyond the boundaries of A are set to 0. REVISION HISTORY: July 18, 1989 Written AB, RSI
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/extrac.pro)
NAME:
EXTRACT_SLICE
PURPOSE:
This function returns a 2-D planar slice extracted from
3-D volumetric data. The slicing plane may be oriented at
any angle, and may pass through any desired location in the
volume.
CATEGORY:
Volume Rendering.
CALLING SEQUENCE:
Slice = EXTRACT_SLICE(Vol, X_size, Y_size, X_center, Y_center, $
Z_center, X_rot, Y_rot, Z_rot)
INPUTS:
Vol: The three dimensional volume of data to slice.
Data type : Any 3-D array except string or structure.
X_size: The size of the returned slice in X (The returned
slice will have the dimensions X_size by Y_size).
Data type : Long.
Y_size: The size of the returned slice in Y. To preserve
the correct aspect ratio of the data, Y_size should
equal X_size. For optimal results, set X_size and
Y_size to be greater than or equal to the largest of
the three dimensions of Vol.
Data type : Long.
X_center: The X coordinate (index) within the volume that the
slicing plane passes through. The center of the
slicing plane passes through Vol at the coordinate
(X_center, Y_Center, Z_center).
Data type : Any scalar numeric value (usually Long).
Y_center: The Y coordinate (index) within the volume that the
slicing plane passes through.
Data type : Any scalar numeric value (usually Long).
Z_center: The Z coordinate (index) within the volume that the
slicing plane passes through.
Data type : Any scalar numeric value (usually Long).
X_rot: The orientation (X rotation) of the slicing plane.
Before transformation, the slicing plane is parallel
to the X-Y plane. The slicing plane transformations
are performed in the following order :
1. Rotate Z_rot degrees about the Z axis.
2. Rotate Y_rot degrees about the Y axis.
3. Rotate X_rot degrees about the X axis.
4. Translate the center of the plane to
X_center, Y_center, Z_center.
Data type : Float.
Y_rot: The orientation (Y rotation) of the slicing plane.
Data type : Float.
Z_rot: The orientation (Z rotation) of the slicing plane.
Data type : Float.
KEYWORD PARAMETERS:
CUBIC: If CUBIC is set, then cubic interpolation is used.
The default is to use tri-linear interpolation.
If the SAMPLE keyword is set, then the CUBIC keyword
is ignored.
OUT_VAL: If OUT_VAL is set, then the portions of the returned
slice that lie outside the original volume are set to
the value passed to OUT_VAL.
Data type : Any scalar numeric value (usually the same
type as Vol).
RADIANS: Set this keyword to a non-zero value to indicate that
X_rot, Y_rot, and Z_rot are in radians. The default
is degrees.
Data type : Int.
SAMPLE: If SAMPLE is set to a non-zero value then nearest
neighbor sampling is used to compute the slice.
Otherwise, tri-linear (or cubic) interpolation is used.
A small reduction in execution time will result if
SAMPLE mode is set and the OUT_VAL keyword is NOT
used.
OUTPUTS:
This function returns the planar slice as a two dimensional
array with the same data type as Vol. The dimensions of the
returned array are X_size by Y_size.
EXAMPLE:
Display an oblique slice through volumetric data.
; Create some data.
vol = RANDOMU(s, 40, 40, 40)
FOR i=0, 10 DO vol = SMOOTH(vol, 3)
vol = BYTSCL(vol(3:37, 3:37, 3:37))
; Extract and display a slice.
slice = EXTRACT_SLICE(vol, 40, 40, 17, 17, 17, 30.0, 30.0, 0.0, $
OUT_VAL=0B)
TVSCL, REBIN(slice, 400, 400)
MODIFICATION HISTORY:
Written by: Daniel Carr. Wed Sep 2 14:47:07 MDT 1992
Modified by: Daniel Carr. Mon Nov 21 14:59:45 MST 1994
Improved speed and added the CUBIC keyword.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/extract_slice.pro)
NAME:
FACTORIAL
PURPOSE:
This function computes the factorial N! as the double-precision
product, (N) * (N-1) * (N-2) * ...... * 3 * 2 * 1.
CATEGORY:
Special Functions.
CALLING SEQUENCE:
Result = Factorial(n)
INPUTS:
N: A non-negative scalar of type integer, float or double.
KEYWORD PARAMETERS:
STIRLING: If set to a non-zero value, Stirling's asymptotic
formula is used to approximate N!.
EXAMPLE:
Compute 20! with and without Stirling's asymptotic formula.
result_1 = factorial(20, /stirling)
result_2 = factorial(20)
Result_1 and result_2 should be 2.4227869e+18 and 2.4329020e+18
respectively.
REFERENCE:
ADVANCED ENGINEERING MATHEMATICS (seventh edition)
Erwin Kreyszig
ISBN 0-471-55380-8
MODIFICATION HISTORY:
Written by: GGS, RSI, November 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/factorial.pro)
$Id: field_alloc.pro,v 1.8 1995/01/20 19:41:01 tonyh Exp $
WidField
Widget Field class library
Copyright (c) 1993, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
MODIFICATION HISTORY
Written by: Joshua Goldstein, 12/93
FIELD_Icon
Return the cw_field toolbar icon
UNCTION FIELD_Icon
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/field_alloc.pro)
NAME:
FILEPATH
PURPOSE:
Given the name of a file in the IDL distribution,
FILEPATH returns the fully-qualified path to use in
opening the file. Operating system dependencies
are taken into consideration. This routine is used by RSI to
make the User Library portable.
CATEGORY:
File Management.
CALLING SEQUENCE:
Result = FILEPATH('filename' [, SUBDIRECTORY = subdir])
INPUTS:
filename: The lowercase name of the file to be opened. No device
or directory information should be included.
KEYWORDS:
ROOT_DIR: The name of the directory from which the resulting path
should be based. If not present, the value of !DIR is used.
This keyword is ignored if TERMINAL or TMP are specified.
SUBDIRECTORY: The name of the subdirectory in which the file
should be found. If this keyword is omitted, the main
directory is used. This variable can be either a scalar
string or a string array with the name of each level of
subdirectory depth represented as an element of the array.
For example, to get a path to the file DETERM in the "userlib"
subdirectory to the IDL "lib" subdirectory, enter:
path = FILEPATH("determ", SUBDIRECTORY = ["lib", "userlib"])
TERMINAL: Return the filename of the user's terminal.
TMP: The file is a scratch file. Return a path to the
proper place for temporary files under the current operating
system.
OUTPUTS:
The fully-qualified file path is returned. If one of the subdirectory
keywords is not specified, the file is assumed to exist in the
main distribution directory.
COMMON BLOCKS:
None.
RESTRICTIONS:
Don't specify more than one of the keywords in a single call.
EXAMPLE:
To get a path to the file DETERM in the "userlib" subdirectory to the
IDL "lib" subdirectory, enter:
path = FILEPATH("determ", SUBDIRECTORY = ["lib", "userlib"])
The variable "path" contains a string that is the fully-qualified file
path for the file DETERM.
MODIFICATION HISTORY:
December, 1989, AB, RSI (Formalized from original by DMS)
October, 1990, SG, RSI (added support for MSDOS)
February, 1991, SMR, RSI (added string array support for multi-level
directories)
21 April 1993, AB, Added ROOT_DIR keyword.
14 July 1994, KDB, RSI - Corrected logic error in VMS section
of the ROOT_DIR keyword. Any
sub-directory specification was
being ignored when using ROOT_DIR. Fixed.
March, 1995, DJE, Add a ':' if root_dir is specified on the Mac.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/filepath.pro)
NAME: FLICK PURPOSE: Flicker between two output images at a given rate. CATEGORY: Image display, animation. CALLING SEQUENCE: FLICK, A, B, Rate INPUTS: A: Byte image number 1, scaled from 0 to 255. B: Byte image number 2, scaled from 0 to 255. OPTIONAL INPUT PARAMETERS: Rate: The flicker rate. The default is 1.0 sec/frame KEYWORD PARAMETERS: None. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: Sunview: Modifies the display, changes the write mask. X and Windows: uses two additional pixmaps. RESTRICTIONS: None. PROCEDURE: SunView: Image A is written to the bottom 4 bits of the display. Image B is written to the top 4 bits. Two color tables are created from the current table, one that shows the low 4 bits using 16 of the original colors, and one that shows the high 4 bits. The color table is changed to switch between images. Other window systems: two off screen pixmaps are used to contain the images. MODIFICATION HISTORY: DMS, 3/ 88. DMS, 4/92, Added X window and MS window optimizations.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/flick.pro)
NAME: FLOW3 PURPOSE: Draw lines representing a 3D flow/velocity field. CATEGORY: Graphics. CALLING SEQUENCE: FLOW3, vx, vy, vz INPUTS: Vx, Vy, Vz = 3D arrays containing X, Y, and Z components of the field. KEYWORD PARAMETERS: Sx, Sy, Sz = Optional vectors containing the starting coordinates of the flow lines. If omitted random starting points are chosen. Nvecs = Number of random flow lines to draw (Default = 200). Only used if Sx, Sy, Sz are not present. Len = Length of each step used to follow flow lines. Default = 2.0 Expressed in units of largest field vector, i.e. the length of the longest step is set to len times the grid spacing. Nsteps = number of steps used to follow the flow lines. Default = largest dimension of vx / 5. Blob = 1 to draw a blob at the beginning of each flow line and suppress the arrows. Arrowsize = size of arrowheads, default = 0.05 OUTPUTS: None. Graphics are produced on the currently selected graphics device. COMMON BLOCKS: None. RESTRICTIONS: Works best with Z buffer output device. PROCEDURE: The 3D scaling system must be set before calling this procedure. For example: scale3, xr=[0,nx-1], yr=[0,ny-1], zr = [0,nz-1] where nx, ny, and nz are the 1st, 2nd, and 3rd dimensions of VX, VY, and VZ. MODIFICATION HISTORY: DMS - RSI, Nov, 1991.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/flow3.pro)
$Id: fslid_alloc.pro,v 1.7 1994/06/01 23:08:48 ali Exp $
WidFslider
Widget Fslider class library
Copyright (c) 1993, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
MODIFICATION HISTORY
Written by: Joshua Goldstein, 12/93
FSLID_Icon
Return the floating point slider toolbar icon
UNCTION FSLID_Icon
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/fslid_alloc.pro)
NAME: FUNCT PURPOSE: Evaluate the sum of a Gaussian and a 2nd-order polynomial and optionally return the value of its partial derivatives. Normally, this function is used by CURVEFIT to fit the sum of a line and a varying background to actual data. CATEGORY: E2 - Curve and surface fitting. CALLING SEQUENCE: FUNCT, X, A, F [, Pder] INPUTS: X: The values of the independent variable. A: The parameters of the equation described in PROCEDURE below. OUTPUTS: F: The value of the function at each X(i). OPTIONAL OUTPUT PARAMETERS: Pder: An array of the size (N_ELEMENTS(X),6) that contains the partial derivatives. Pder(i,j) represents the derivative at the i'th point with respect to j'th parameter. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: F = A(0)*EXP(-Z^2/2) + A(3) + A(4)*X + A(5)*X^2 Z = (X-A(1))/A(2) MODIFICATION HISTORY: WRITTEN, DMS, RSI, SEPT, 1982. Modified, DMS, Oct 1990. Avoids divide by 0 if A(2) is 0.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/funct.pro)
NAME:
FV_TEST
PURPOSE:
This function computes the F-statistic and the probability that two
vectors of sampled data have significantly different variances. This
type of test is often refered to as the F-variances Test.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = FV_TEST(X, Y)
INPUTS:
X: An n-element vector of type integer, float or double.
Y: An m-element vector of type integer, float or double.
EXAMPLE
Define two n-element vectors of tabulated data.
X = [257, 208, 296, 324, 240, 246, 267, 311, 324, 323, 263, 305, $
270, 260, 251, 275, 288, 242, 304, 267]
Y = [201, 56, 185, 221, 165, 161, 182, 239, 278, 243, 197, 271, $
214, 216, 175, 192, 208, 150, 281, 196]
Compute the F-statistic (of X and Y) and its significance.
The result should be the two-element vector [2.48578, 0.0540116],
indicating that X and Y have significantly different variances.
result = fv_test(X, Y)
PROCEDURE:
FV_TEST computes the F-statistic of X and Y as the ratio of variances
and its significance. X and Y may be of different lengths. The result
is a two-element vector containing the F-statistic and its
significance. The significance is a value in the interval [0.0, 1.0];
a small value (0.05 or 0.01) indicates that X and Y have significantly
different variances.
REFERENCE:
Numerical Recipes, The Art of Scientific Computing (Second Edition)
Cambridge University Press
ISBN 0-521-43108-5
MODIFICATION HISTORY:
Written by: GGS, RSI, Aug 1994
FV_TEST is based on the routine: ftest.c described in
section 14.2 of Numerical Recipes, The Art of Scientific
Computing (Second Edition), and is used by permission.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/fv_test.pro)
NAME:
FX_ROOT
PURPOSE:
This function computes real and complex roots (zeros) of
a univariate nonlinear function.
CATEGORY:
Nonlinear Equations/Root Finding
CALLING SEQUENCE:
Result = FX_ROOT(X, Func)
INPUTS:
X : A 3-element initial guess vector of type real or complex.
Real initial guesses may result in real or complex roots.
Complex initial guesses will result in complex roots.
Func: A scalar string specifying the name of a user-supplied IDL
function that defines the univariate nonlinear function.
This function must accept the vector argument X.
KEYWORD PARAMETERS:
DOUBLE: If set to a non-zero value, computations are done in
double precision arithmetic.
ITMAX: Set this keyword to specify the maximum number of iterations
The default is 100.
STOP: Set this keyword to specify the stopping criterion used to
judge the accuracy of a computed root, r(k).
STOP = 0 implements an absolute error criterion between two
successively-computed roots, |r(k) - r(k+1)|.
STOP = 1 implements a functional error criterion at the
current root, |Func(r(k))|. The default is 0.
TOL: Set this keyword to specify the stopping error tolerance.
If the STOP keyword is set to 0, the algorithm stops when
|x(k) - x(k+1)| < TOL.
If the STOP keyword is set to 1, the algorithm stops when
|Func(x(k))| < TOL. The default is 1.0e-4.
EXAMPLE:
Define an IDL function named FUNC.
function FUNC, x
return, exp(sin(x)^2 + cos(x)^2 - 1) - 1
end
Define a real 3-element initial guess vector.
x = [0.0, -!pi/2, !pi]
Compute a root of the function using double-precision arithmetic.
root = FX_ROOT(x, 'FUNC', /double)
Check the accuracy of the computed root.
print, exp(sin(root)^2 + cos(root)^2 - 1) - 1
Define a complex 3-element initial guess vector.
x = [complex(-!pi/3, 0), complex(0, !pi), complex(0, -!pi/6)]
Compute a root of the function.
root = FX_ROOT(x, 'FUNC')
Check the accuracy of the computed root.
print, exp(sin(root)^2 + cos(root)^2 - 1) - 1
PROCEDURE:
FX_ROOT implements an optimal Muller's method using complex
arithmetic only when necessary.
REFERENCE:
Numerical Recipes, The Art of Scientific Computing (Second Edition)
Cambridge University Press
ISBN 0-521-43108-5
MODIFICATION HISTORY:
Written by: GGS, RSI, March 1994
Modified: GGS, RSI, September 1994
Added support for double-precision complex inputs.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/fx_root.pro)
NAME:
F_CVF
PURPOSE:
This function computes the cutoff value (v) such that:
Probability(X > v) = p
where X is a random variable from the F distribution with
(dfn) and (dfd) degrees of freedom.
CALLING SEQUENCE:
Result = f_cvf(P, DFN, DFD)
INPUTS:
P: A non-negative scalar, in the interval [0.0, 1.0], of
type float or double that specifies the probability of
occurance or success.
DFN: A positive scalar of type integer, float or double that
specifies the degrees of freedom of the F distribution
numerator.
DFD: A positive scalar of type integer, float or double that
specifies the degrees of freedom of the F distribution
denominator.
EXAMPLE:
Compute the cutoff value (v) such that Probability(X > v) = 0.100
from the F distribution with (dfn = 10) and (dfd = 6) degrees of
freedom. The result should be 7.87413
result = f_cvf(0.01, 10, 6)
REFERENCE:
APPLIED STATISTICS (third edition)
J. Neter, W. Wasserman, G.A. Whitmore
ISBN 0-205-10328-6
MODIFICATION HISTORY:
Modified by: GGS, RSI, July 1994
Minor changes to code. New documentation header.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/f_cvf.pro)
NAME:
F_PDF
PURPOSE:
This function computes the probabilty (p) such that:
Probability(X <= v) = p
where X is a random variable from the F distribution with
(dfn) and (dfd) degrees of freedom.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = f_pdf(V, DFN, DFD)
INPUTS:
V: A scalar of type integer, float or double that specifies
the cutoff value.
DFN: A positive scalar of type integer, float or double that
specifies the degrees of freedom of the F distribution
numerator.
DFD: A positive scalar of type integer, float or double that
specifies the degrees of freedom of the F distribution
EXAMPLE:
Compute the probability that a random variable X, from the F
distribution with (dfn = 5) and (dfd = 24) degrees of freedom,
is less than or equal to 3.90. The result should be 0.990059
result = f_pdf(3.90, 5, 24)
REFERENCE:
APPLIED STATISTICS (third edition)
J. Neter, W. Wasserman, G.A. Whitmore
ISBN 0-205-10328-6
MODIFICATION HISTORY:
Modified by: GGS, RSI, July 1994
Minor changes to code. New documentation header.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/f_pdf.pro)
NAME:
GAMMA
PURPOSE:
The introduction of the GAMMA function as a built in system routine
in IDL 4.0 caused inconvenience to customers with existing code
in which GAMMA had been used as a variable, because IDL system
routines have precedence over variable names. To minimize this
problem, RSI has renamed GAMMA to NR_GAMMA.
This wrapper serves to make NR_GAMMA available under the name
GAMMA as documented in the IDL Reference Manual. However, since
IDL library routines have lower precedence than variables, programs
that use GAMMA as a variable name will work as before.
See the documentation for GAMMA in the IDL Reference manual for
details on arguments, keywords, and results.
MODIFICATION HISTORY:
3 July 1995, AB, RSI.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/gamma.pro)
NAME:
GAMMA_CT
PURPOSE:
Apply gamma correction to the color table.
CATEGORY:
Image display.
CALLING SEQUENCE:
GAMMA, Gamma
GAMMA, Gamma, /CURRENT
INPUTS:
Gamma: The value of gamma correction. A value of 1.0 indicates a
linear ramp, i.e., no gamma correction. Higher values of
gamma give more contrast. Values less than 1.0 yield lower
contrast.
KEYWORD PARAMETERS:
CURRENT: If this keyword is set, apply correction from the current
table. Otherwise, apply from the original color table. When
CURRENT is set, the color table input to GAMMA_CT
is taken from the R_CURR, G_CURR, and B_CURR variables.
Otherwise, input is from R_ORIG, G_ORIG, and B_ORIG.
The resulting tables are always saved in the "current" table.
INTENSITY: If this keyword is set, correct the individual intensities of
each color in the color table. Otherwise, shift the colors
according to the gamma function.
OUTPUTS:
No explicit outputs. The modified color table vectors
are saved in the COLORS common block, as the variables
r_curr, g_curr, and b_curr variables.
COMMON BLOCKS:
COLORS: The IDL color table common block.
SIDE EFFECTS:
A new color table is loaded, and its contents are placed
in the "current" variables of the COLORS common block.
RESTRICTIONS:
None.
PROCEDURE:
Straightforward. The gamma correction is implemented
as x^gamma, where x is the range of color table indices
scaled from 0 to 1.
MODIFICATION HISTORY:
DMS, Oct, 1990. Added ability shift intensities of colors, rather
than the mapping of the colors. DMS, April, 1991.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/gamma_ct.pro)
NAME: GAUSS2DFIT PURPOSE: Fit a 2 dimensional elliptical gaussian equation to rectilinearly gridded data. Z = F(x,y) where: F(x,y) = A0 + A1*EXP(-U/2) And the elliptical function is: U= (x'/a)^2 + (y'/b)^2 The parameters of the ellipse U are: Axis lengths are 2*a and 2*b, in the unrotated X and Y axes, respectively. Center is at (h,k). Rotation of T radians from the X axis, in the CLOCKWISE direction. The rotated coordinate system is defined as: x' = (x-h) * cos(T) - (y-k) * sin(T)y' = (x-h) * sin(T) + (y-k) * cos(T) The rotation is optional, and may be forced to 0, making the major/ minor axes of the ellipse parallel to the X and Y axes. The coefficients of the function, are returned in a seven element vector: a(0) = A0 = constant term. a(1) = A1 = scale factor. a(2) = a = width of gaussian in X direction. a(3) = b = width of gaussian in Y direction. a(4) = h = center X location. a(5) = k = center Y location. a(6) = T = Theta the rotation of the ellipse from the X axis in radians, counterclockwise. CATEGORY: curve / data fitting CALLING SEQUENCE: Result = GAUSS2DFIT(z, a [,x,y]) INPUTS: Z = dependent variable in a 2D array dimensioned (Nx, Ny). Gridding must be rectilinear. X = optional Nx element vector containing X values of Z. X(i) = X value for Z(i,j). If omitted, a regular grid in X is assumed, and the X location of Z(i,j) = i. Y = optional Ny element vector containing Y values of Z. Y(j) = Y value for Z(i,j). If omitted, a regular grid in Y is assumed, and the Y location of Z(i,j) = j. Optional Keyword Parameters: NEGATIVE = if set, implies that the gaussian to be fitted is a valley (such as an absorption line). By default, a peak is fit. TILT = if set to 1, allow the orientation of the major/minor axes of the ellipse to be unrestricted. The default is that the axes of the ellipse must be parallel to the X-Y axes. In this case, A(6) is always returned as 0. OUTPUTS: The fitted function is returned. OUTPUT PARAMETERS: A: The coefficients of the fit. A is a seven element vector as described under PURPOSE. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Timing: Approximately 4 seconds for a 128 x 128 array, on a Sun SPARC LX. Time required is roughly proportional to the number of elements in Z. PROCEDURE: The peak/valley is found by first smoothing Z and then finding the maximum or minimum respectively. Then GAUSSFIT is applied to the row and column running through the peak/valley to estimate the parameters of the Gaussian in X and Y. Finally, CURVEFIT is used to fit the 2D Gaussian to the data. Be sure that the 2D array to be fit contains the entire Peak/Valley out to at least 5 to 8 half-widths, or the curve-fitter may not converge. EXAMPLE: This example creates a 2D gaussian, adds random noise and then applies GAUSS2DFIT: nx = 128 ;Size of array ny = 100 ;** Offs Scale X width Y width X cen Y cen ** ;** A0 A1 a b h k ** a = [ 5., 10., nx/6., ny/10., nx/2., .6*ny] ;Input function parameters x = findgen(nx) # replicate(1.0, ny) ;Create X and Y arrays y = replicate(1.0, nx) # findgen(ny) u = ((x-a(4))/a(2))^2 + ((y-a(5))/a(3))^2 ;Create ellipse z = a(0) + a(1) * exp(-u/2) ;to gaussian z = z + randomn(seed, nx, ny) ;Add random noise, SD = 1 yfit = gauss2dfit(z,b) ;Fit the function, no rotation print,'Should be:',string(a,format='(6f10.4)') ;Report results.. print,'Is: :',string(b(0:5),format='(6f10.4)') MODIFICATION HISTORY: DMS, RSI, June, 1995.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/gauss2dfit.pro)
NAME: GAUSSFIT PURPOSE: Fit the equation y=f(x) where: F(x) = A0*EXP(-z^2/2) + A3 + A4*x + A5*x^2 and z=(x-A1)/A2 A0 = height of exp, A1 = center of exp, A2 = sigma (the width). A3 = constant term, A4 = linear term, A5 = quadratic term. The parameters A0, A1, A2, A3 are estimated and then CURVEFIT is called. CATEGORY: ?? - fitting CALLING SEQUENCE: Result = GAUSSFIT(X, Y [, A]) INPUTS: X: The independent variable. X must be a vector. Y: The dependent variable. Y must have the same number of points as X. OUTPUTS: The fitted function is returned. OPTIONAL OUTPUT PARAMETERS: A: The coefficients of the fit. A is a six-element vector as described under PURPOSE. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: The peak or minimum of the Gaussian must be the largest or smallest point in the Y vector. PROCEDURE: If the (MAX-AVG) of Y is larger than (AVG-MIN) then it is assumed that the line is an emission line, otherwise it is assumed there is an absorbtion line. The estimated center is the MAX or MIN element. The height is (MAX-AVG) or (AVG-MIN) respectively. The width is found by searching out from the extrema until a point is found less than the 1/e value. MODIFICATION HISTORY: DMS, RSI, Dec, 1983.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/gaussfit.pro)
NAME:
GAUSS_CVF
PURPOSE:
This function computes the cutoff value (v) such that:
Probability(X > v) = p
where X is a random variable from the standard Gaussian (Normal)
distribution with a mean of 0.0 and a variance of 1.0
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = Gauss_cvf(P)
INPUTS:
P: A non-negative scalar, in the interval [0.0, 1.0], of type
float or double that specifies the probability of occurance
or success.
EXAMPLE:
Compute the cutoff value (v) such that Probability(X > v) = 0.025
from the standard Gaussian (Normal) distribution. The result should
be 1.95997
result = gauss_cvf(0.025)
REFERENCE:
ADVANCED ENGINEERING MATHEMATICS (seventh edition)
Erwin Kreyszig
ISBN 0-471-55380-8
MODIFICATION HISTORY:
Modified by: GGS, RSI, July 1994
Minor changes to code. New documentation header.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/gauss_cvf.pro)
NAME:
GAUSS_PDF
PURPOSE:
This function computes the probabilty (p) such that:
Probability(X <= v) = p
where X is a random variable from the standard Gaussian (Normal)
distribution with a mean of 0.0 and a variance of 1.0
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = Gauss_Pdf(V)
INPUTS:
V: A scalar of type integer, float or double that specifies
the cutoff value.
EXAMPLES:
Compute the probability that a random variable X, from the
standard Gaussian (Normal) distribution, is less than or equal
to 2.44. The result should be 0.992656
result = gauss_pdf(2.44)
Compute the probability that a random variable X, from the
standard Gaussian (Normal) distribution, is less than or equal
to 10.0 and greater than or equal to 2.0. The result should be
0.0227501 [i.e. Probability(2.0 <= X <= 10.0)]
result = gauss_pdf(10.0) - gauss_pdf(2.0)
Compute the probability that a random variable X, from the
Gaussian (Normal) distribution with a mean of 0.8 and a variance
of 4.0, is less than or equal to 2.44. The result should be
0.793892
result = gauss_pdf( (2.44 - 0.80)/sqrt(4.0) )
PROCEDURE:
GAUSS_PDF calls GAUSSINT() to evaluate the Gaussian integral.
This function was included to provide consistency with the
other probability functions: CHISQR_PDF(), F_PDF(), and T_PDF().
REFERENCE:
APPLIED STATISTICS (third edition)
J. Neter, W. Wasserman, G.A. Whitmore
ISBN 0-205-10328-6
MODIFICATION HISTORY:
Written by: GGS, RSI, July 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/gauss_pdf.pro)
NAME:
GETHELP
PURPOSE:
This function is used to get information on variables in the
routine that called this function. The function builts a string array
that contains information that follows the format that is used
by the IDL HELP command.
CATEGORY:
Help
CALLING SEQUENCE:
Result = GetHelp([Vname])
INPUTS:
Vname: Optional parameter that contains the name of a variable
the user wants information about.
KEYWORD PARAMETERS:
ONELINE: If a variable name is greater than 15 charaters
it is usally returned as 2 two elements of the
output array (Variable name in 1st element,
variable info in the 2nd element). Setting this
keyword will put all the information in one string,
seperating the name and data with a space.
FULLSTRING: Normally a string that is longer than 45 chars
is truncated and followed by "..." just like
the HELP command. Setting this keyword will cause
the full string to be returned.
PROCEDURES: Setting this keyword will cause the function
to return all current IDL compiled procedures.
FUNCTIONS: Setting this keyword will cause the function
to return all current IDL compiled functions.
SYS_PROCS: Setting this keyword will cause the function
to return the names of all IDL system (built-in)
procedures.
SYS_FUNCS: Setting this keyword will cause the function
to return the names of all IDL system (built-in)
functions.
OUTPUTS:
This function returns a string array that normally contains
variable data that is in the same format as used by the IDL HELP
procedure. The variables in this list are for the routine that
called GetHelp(). If other info is requested via keywords, this
data is returned.
Upon an error or if no data is found the function returns an
Null ('') string.
COMMON BLOCKS:
None
SIDE EFFECTS:
None
RESTRICTIONS:
Due to the diffuculties in determining if a variable is of type
associate, the following conditions will result in the variable
being listed as a structure. These conditions are:
o Associate record type is structure.
o Associated file is opened for update (openu).
o Associate file is not empty.
Another difference between this routine and the IDL help command
is that if a variable is in a common block, the common block name
is not listed next to the variable name. Currently there is no
method available to get the common block names used in a routine.
PROCEDURE:
This function uses the IDL routine Routine_Names() to get the
names and values of the variables contained in the calling
routine. These values are then placed in a string array using
the format of the IDL HELP command. If there are no variables
in the calling routine, a null ('') scalar string is returned.
EXAMPLE:
To obtain a listing in a help "format" of the variables contained
in the current routine you would make the following call:
HelpData = GetHelp()
The variable HelpData would be a string array containing the
requested information.
MODIFICATION HISTORY:
Initial Coding April 1994 - KDB
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/gethelp.pro)
NAME:
GS_ITER
PURPOSE:
This function solves an n by n linear system of equations
using Gauss-Seidel iteration.
CATEGORY:
Linear Algebra.
CALLING SEQUENCE:
Result = GS_ITER(A, B)
INPUTS:
A: An N by N array of type: int, float, or double.
B: An N-element vector of type: int, float, or double.
KEYWORD PARAMETERS:
CHECK: An integer value of 0 or 1 that denies or requests
checking A for a diagonally dominant form.
CHECK = 0 (the default) results in no checking.
CHECK = 1 Checks A and reports if it does not
meet the required condition. This is
just a warning. The algorithm will
proceed on the chance it may converge.
LAMBDA: A scalar value in the range: [0.0, 2.0]
This value determines the amount of 'RELAXATION'.
Relaxation is a weighting technique that is used
to enhance convergence.
1) LAMBDA = 1.0 (the default) no weighting.
2) A value in the range 0.0 <= LAMBDA < 1.0 improves
convergence in oscillatory and non-convergent systems.
3) A value in the range 1.0 < LAMBDA <= 2.0 improves
convergence in systems known to converge.
MAX_ITER: The maximum number of iterations allowable for the
algorithm to converge to the solution. The default
is 30 iterations.
X_0: An N-element vector that provides the algorithm's
starting point. The default is [1.0, 1.0, ... , 1.0].
TOL: The relative error tolerance between current and past
iterates calculated as: ABS( (current-past)/current )
The default is 1.0e-4.
SIDE EFFECTS:
Upon output A and B are divided by the diagonal elements of A.
Integer inputs are converted to floats.
RESTRICTIONS:
The equations must be entered in a DIAGONALLY DOMINANT form
to guarantee convergence.
A system is diagonally dominant if it satisfies the condition:
abs(A(row,row)) > SUM(abs(A(row,col)))
where SUM runs col=1,N excluding col = row and A is in row major.
This restriction on A is known as a sufficient condition. That is,
it is sometimes possible for the algorithm to converge without the
condition being satisfied. But, convergence is guaranteed if the
condition is satisfied.
EXAMPLE:
Define an array (a) in a non-diagonally dominant form.
a = [[ 1.0, 7.0, -4.0], $
[ 4.0, -4.0, 9.0], $
[12.0, -1.0, 3.0]]
And right-side vector (b).
b = [12.0, 2.0, -9.0]
Compute the solution of the system, ax = b.
result = gs_iter(a, b)
Note: This example fails to converge, because A is not in
diagonally dominant form.
Reorder the array given above into diagonally dominant form.
a = [[12.0, -1.0, 3.0], $
[ 1.0, 7.0, -4.0], $
[ 4.0, -4.0, 9.0]]
Make corresponding changes in the ordering of b.
b = [-9.0, 12.0, 2.0]
Compute the solution of the system, ax = b.
result = gs_iter(a, b)
PROCEDURE:
GS_ITER.PRO implements the Gauss-Seidel iterative method with
over- and under- relaxation to enhance convergence.
REFERENCE:
ADVANCED ENGINEERING MATHEMATICS (seventh edition)
Erwin Kreyszig
ISBN 0-471-55380-8
MODIFICATION HISTORY:
Written by: GGS, RSI, April 1993
Modified: GGS, RSI, February 1994
1) Format keyword is no longer supported. The matrix
should be supplied in a row major format.
2) The input/output parameter X has been removed. The
algorithm's initial starting point is an n-element
vector of 1s. The keyword X_0 has been added to
override the default.
3) GS_ITER is now called as a function, x = gs_iter( ).
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/gs_iter.pro)
NAME: HANNING PURPOSE: Window function for Fourier Transform filtering. May be used for both the Hanning and Hamming windows. CATEGORY: Signal, image processing. CALLING SEQUENCE: Result = HANNING(N1) ;For 1 dimension. Result = HANNING(N1, N2) ;For 2 dimensions. INPUTS: N1: The number of columns of the result. N2: The number of rows of the result. Keyword Parameters: Alpha = width parameter of generalized Hamming window. Alpha must be in the range of 0.5 to 1.0. If Alpha = 0.5, the default, the function is called the "Hanning" window. If Alpha = 0.54, the result is called the "Hamming" window. OUTPUTS: Result(i) = 1/2 [1 - COS(2 PI i / (N-1)] For two dimensions, the result is the same except that "i" is replaced with "i*j", where i and j are the row and column subscripts. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Straightforward. MODIFICATION HISTORY: DMS, May, 1987. DMS, Jan, 1994. Added generalized width parameter.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/hanning.pro)
NAME: HDF_EXISTS PURPOSE: Test for the existence of the HDF library CATEGORY: File Formats CALLING SEQUENCE: Result = HDF_EXISTS() INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: Returns TRUE (1) if the HDF data format library is supported. Returns FALSE(0) if it is not. EXAMPLE: IF hdf_exists() EQ 0 THEN Fail,"HDF not supported on this machine" MODIFICATION HISTORY Written by: Joshua Goldstein, 12/21/92
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/hdf_exists.pro)
NAME: HILBERT PURPOSE: Return a series that has all periodic terms shifted by 90 degrees. CATEGORY: G2 - Correlation and regression analysis A1 - Real arithmetic, number theory. CALLING SEQUENCE: Result = HILBERT(X [, D]) INPUT: X: A floating- or complex-valued vector containing any number of elements. OPTIONAL INPUT: D: A flag for rotation direction. Set D to +1 for a positive rotation. Set D to -1 for a negative rotation. If D is not provided, a positive rotation results. OUTPUTS: Returns the Hilbert transform of the data vector, X. The output is a complex-valued vector with the same size as the input vector. COMMON BLOCKS: None. SIDE EFFECTS: HILBERT uses FFT() so this procedure exhibits the same side effects with respect to input arguments as that function. PROCEDURE: A Hilbert transform is a series that has had all periodic components phase-shifted by 90 degrees. It has the interesting property that the correlation between a series and its own Hilbert transform is mathematically zero. The method consists of generating the fast Fourier transform using the FFT() function and shifting the first half of the transform products by +90 degrees and the second half by -90 degrees. The constant elements in the transform are not changed. Angle shifting is accomplished by multiplying or dividing by the complex number, I=(0.0000, 1.0000). The shifted vector is then submitted to FFT() for transformation back to the "time" domain and the output is divided by the number elements in the vector to correct for multiplication effect peculiar to the FFT algorithm. REVISION HISTORY: JUNE, 1985, Written, Leonard Kramer, IPST (U. of Maryland) on site contractor to NASA(Goddard Sp. Flgt. Cntr.)
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/hilbert.pro)
NAME: HIST_2D PURPOSE: Return the density function (histogram) of two variables. CATEGORY: Image processing, statistics, probability. CALLING SEQUENCE: Result = hist_2d(V1, V2) INPUTS: V1 and V2 = arrays containing the variables. They must be of byte, integer, or longword type, and contain no negative elements. OUTPUTS: The two dimensional density function of the two variables, a longword array of dimensions (MAX(v1)+1, MAX(v2)+1). Result(i,j) is equal to the number of sumultaneous occurences of V1 = i, and V2 = j, at the same element. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Data must be in byte, integer, or longword form. To use with floating point data, scale into the range of integers. PROCEDURE: Creates a combines array from the two variables, equal to the linear subscript in the resulting 2D histogram, then applies the standard histogram function. The following pseudo-code shows what the result contains, not how it is computed: r = LONARR(MAX(v1)+1, MAX(v2)+1) ;Result FOR i=0, N_ELEMENTS(v1)-1 DO $ r(v1(i), v2(i)) = r(v1(i), v2(i)) +1 EXAMPLE: Return the 2D histogram of two byte images: R = HIST_2D(image1, image2) Return the 2D histogram made from two floating point images with range of -1 to +1, and with 100 bins: R = HIST_2D(long((f1+1) * 50), long((f2+1) * 50)) MODIFICATION HISTORY: Written by: DMS, Sept, 1992 Written
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/hist_2d.pro)
NAME:
HIST_EQUAL
PURPOSE:
Return a histogram-equalized image or vector.
CATEGORY:
Z1 - Image processing, spatially invariant.
CALLING SEQUENCE:
Result = HIST_EQUAL(A [, MINV = minv] [, MAXV = maxv])
INPUTS:
A: The array to be histogram-equalized.
KEYWORD PARAMETERS:
BINSIZE: Size of bin to use. If this keyword is omitted, the value 1
is used. Ignored for byte type data. Default = approx 5000
bins.
HISTOGRAM_ONLY: If set, return the cumulative distribution histogram,
rather than the histogram equalized array. MAXV, MINV, and
BINSIZE will be set, describing the scaling of the histogram,
if not specified.
MAXV: The maximum value to consider. If this keyword is omitted,
the maximum element is used. Input elements greater than or
equal to MAXV are output as 255.
MINV: The minimum value to consider. If this keyword is omitted,
the minimum is computed. Input elements less than or equal
to MINV are output as zero.
TOP: The maximum value to scale the output array. If this keyword
is omitted, 255 is used.
OUTPUTS:
A histogram-equalized byte array is returned.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
The output array is always of byte type and is scaled from 0 to TOP.
Floating-point arrays should not have small ranges, (e.g., less than
around 255) unless a binsize is specified.
PROCEDURE:
The HISTOGRAM function is used to obtain the density distribution of
the input array. The histogram is integrated to obtain the
cumulative density-propability function and finally the lookup
function is used to transform to the output image.
The first element of the histogram is always zeroed, to remove
the background.
EXAMPLE:
Create a sample image using the IDL DIST function and display it by
entering:
IMAGE = DIST(100)
TV, DIST
Create a histogram-equalized version of the byte array, IMAGE, and
display the new version. Use a minumum input value of 10, a maximum
input value of 200, and limit the top value of the output array to
220. Enter:
NEW = HIST_EQUAL(IMAGE, MINV = 10, MAXV = 200, TOP = 220)
TV, NEW
MODIFICATION HISTORY:
August, 1982. Written by DMS, RSI.
Feb, 1988, Revised for Sun, DMS.
Dec, 1994. DMS. Improved handling offloating/double images with
large or small ranges. Default value for MINV is
computed, rather than set to 0.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/hist_equal.pro)
NAME: HLS PURPOSE: Make a color table based on the HLS (Hue, Lightness, Saturation) color system. CATEGORY: Z4 - Image processing, color table manipulation CALLING SEQUENCE: HLS, Litlo, Lithi, Satlo, Sathi, Hue, Loops [, Colr] INPUTS: Litlo: Starting lightness, from 0 to 100%. Lithi: Ending lightness, from 0 to 100%. Satlo: Starting saturation, from 0 to 100%. Sathi: Ending stauration, from 0 to 100%. Hue: Starting Hue, from 0 to 360 degrees. Red = 0 degs, green = 120, blue = 240. Loops: The number of loops through the color spiral. This parameter does not have to be an integer. A negative value causes the loops to traverse the spiral in the opposite direction. OUTPUTS: No required outputs. OPTIONAL OUTPUT PARAMETERS: Colr: A (256,3) integer array containing the R, G, and B values that were loaded into the color tables. Red = colr(*,0), green = colr(*,1), blue = colr(*,2). COMMON BLOCKS: COLORS: Contains the red, green, and blue vectors on exit. SIDE EFFECTS: The color tables are loaded. RESTRICTIONS: None. PROCEDURE: Adapted from program on page 619, Fundamentals of Interactive Computer Graphics, Foley and Van Dam. Using the input parameters, a spiral through the double- ended HLS cone is traced. Points along the cone are converted from HLS to RGB. MODIFICATION HISTORY: Written, DMS, Jan, 1983. Changed common block, dms, 4/1987.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/hls.pro)
NAME: HSV PURPOSE: Make a color table based on the HSV (Hue, Saturation, and Value) color system. CATEGORY: Z4 - Image processing, color table manipulation CALLING SEQUENCE: HLS, Vlo, Vhi, Satlo, Sathi, Hue, Loops [, Colr] INPUTS: Vlo: Starting value, from 0 to 100%. Vhi: Ending value, from 0 to 100%. Satlo: Starting saturation, from 0 to 100%. Sathi: Ending saturation, from 0 to 100%. Hue: Starting Hue, from 0 to 360 degrees. Red = 0 degs, green = 120, blue = 240. Loops: The number of loops through the color spiral. This parameter does not have to be an integer. A negative value causes the loops to traverse the spiral in the opposite direction. OUTPUTS: No required outputs. OPTIONAL OUTPUT PARAMETERS: Colr: A (256,3) integer array containing the R, G, and B values that were loaded into the color tables. Red = colr(*, 0), green = colr(*, 1), blue = colr(*, 2). COMMON BLOCKS: COLORS: Contains the red, green and blue color vectors on exit. SIDE EFFECTS: The color tables are loaded. RESTRICTIONS: None. PROCEDURE: Adapted from a program on page 616, Fundamentals of Interactive Computer Graphics, Foley and Van Dam. Using the input parameters, a spiral through the single-ended HSV cone is traced. Points along the cone are converted from HLS to RGB. MODIFICATION HISTORY: Written, DMS, Jan, 1983. Added common block COLORS, DMS, Dec, 1983 and Apr, 1987.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/hsv.pro)
NAME: H_EQ_CT PURPOSE: Histogram-equalize the color tables for an image or a region of the display. CATEGORY: Image processing. CALLING SEQUENCE: H_EQ_CT, Image ;To histogram equalize from an image. H_EQ_CT ;To histogram equalize from a region INPUTS: Image: Image whose histogram is to be used in determining the new color tables. If this value is omitted, the user is prompted to mark the diagonal corners of a region of the display. Image MUST be a byte image, scaled the same way as the image loaded to the display. OUTPUTS: No explicit outputs. The result is applied to the current color tables. COMMON BLOCKS: COLORS: The IDL color table common block. SIDE EFFECTS: The current color table is modified. RESTRICTIONS: If a parameter is supplied, it is assumed to be an image that was just displayed. PROCEDURE: Either the image parameter or the region of the display marked by the user is used to obtain a pixel-distribution histogram. The cumulative integral is taken and scaled. This function is applied to the current color tables. MODIFICATION HISTORY: DMS, March, 1988, written. DMS, May, 1990, added BOX_CURSOR. AB, 21 September 1992,renamed from HIST_EQUAL_CT to H_EQ_CT to avoid DOS filename limitations. HIST_EQUAL_CT is still available as a wrapper to this routine under operating systems that can handle longer file names.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/h_eq_ct.pro)
NAME: H_EQ_INT PURPOSE: Interactively histogram-equalize the color tables of an image or a region of the display. By moving the cursor across the screen, the amount of histogram equalization is varied. CATEGORY: Image processing. CALLING SEQUENCE: H_EQ_INT, Image ;To histogram equalize from an image. H_EQ_INT ;To histogram equalize from a region. INPUTS: Image: The image whose histogram is to be used in determining the new color tables. If this value is omitted, the user is prompted to mark the diagonal corners of a region of the display. Image MUST be a byte image, scaled the same way as the image loaded to the display. OUTPUTS: No explicit outputs. The result is applied to the current color tables. COMMON BLOCKS: COLORS: The IDL color table common block. SIDE EFFECTS: The current color table is modified. RESTRICTIONS: If a parameter is supplied, it is assumed to be an image that was just displayed. PROCEDURE: Either the image parameter or the region of the display marked by the user is used to obtain a pixel-distribution histogram. The cumulative integral is taken and scaled. This function is applied to the current color tables. A window is created and the histogram equalization function is plotted. A linear ramp is overplotted. Move the cursor from left to right to vary the amount of histogram equalization applied to the color tables from 0 to 100%. Press the right mouse button to exit. MODIFICATION HISTORY: DMS, November, 1989, written. AB, 21 September 1992,renamed from HIST_EQUAL_INT to H_EQ_INT to avoid DOS filename limitations. HIST_EQUAL_INT is still available as a wrapper to this routine under operating systems that can handle longer file names. JWG, 14 December 1992,routine did not restore font.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/h_eq_int.pro)
NAME:
IBETA
PURPOSE:
This function computes the incomplete beta function, Ix(a, b).
CATEGORY:
Special Functions.
CALLING SEQUENCE:
Result = Ibeta(a, b, x)
INPUTS:
A: A positive scalar of type integer, float or double that
specifies the parametric exponent of the integrand.
B: A positive scalar of type integer, float or double that
specifies the parametric exponent of the integrand.
X: A scalar, in the interval [0, 1], of type integer, float
or double that specifies the upper limit of integration.
EXAMPLE:
Compute the incomplete beta function for the corresponding elements
of A, B, and X.
Define the parametric exponents.
A = [0.5, 0.5, 1.0, 5.0, 10.0, 20.0]
B = [0.5, 0.5, 0.5, 5.0, 5.0, 10.0]
Define the the upper limits of integration.
X = [0.01, 0.1, 0.1, 0.5, 1.0, 0.8]
Allocate an array to store the results.
result = fltarr(n_elements(A))
Compute the incomplete beta functions.
for k = 0, n_elements(A)-1 do $
result(k) = Ibeta(A(k), B(k), X(k))
The result should be:
[0.0637686, 0.204833, 0.0513167, 0.500000, 1.00000, 0.950736]
REFERENCE:
Numerical Recipes, The Art of Scientific Computing (Second Edition)
Cambridge University Press
ISBN 0-521-43108-5
MODIFICATION HISTORY:
Written by: GGS, RSI, September 1994
IBETA is based on the routines: betacf.c, betai.c and
gammln.c described in section 6.2 of Numerical Recipes,
The Art of Scientific Computing (Second Edition), and is
used by permission.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/ibeta.pro)
NAME:
IBETA_PDF
PURPOSE:
This function computes the incomplete beta function.
It is called by the probability density functions in
this directory. See the function IBETA() in the "math"
subdirectory for the user-callable version of the
incomplete beta function.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/ibeta_pdf.pro)
NAME:
IGAMMA
PURPOSE:
This function computes the incomplete gamma function, Px(a).
CATEGORY:
Special Functions.
CALLING SEQUENCE:
Result = Igamma(a, x)
INPUTS:
A: A positive scalar of type integer, float or double that
specifies the parametric exponent of the integrand.
X: A positive scalar of type integer, float or double that
specifies the upper limit of integration.
KEYWORD PARAMETERS:
METHOD: Use this keyword to specify a named variable which returns
the method used to compute the incomplete gamma function.
A value of 0 indicates that a power series representation
was used. A value of 1 indicates that a continued fractions
method was used.
EXAMPLE:
Compute the incomplete gamma function for the corresponding elements
of A and X.
Define the parametric exponents.
A = [0.10, 0.50, 1.00, 1.10, 6.00, 26.00]
Define the the upper limits of integration.
X = [0.0316228, 0.0707107, 5.00000, 1.04881, 2.44949, 25.4951]
Allocate an array to store the results.
result = fltarr(n_elements(A))
Compute the incomplete gamma functions.
for k = 0, n_elements(A)-1 do $
result(k) = Igamma(A(k), X(k))
The result should be:
[0.742026, 0.293128, 0.993262, 0.607646, 0.0387318, 0.486387]
PROCEDURE:
IGAMMA computes the incomplete gamma function, Px(a), using either
a power series representation or a continued fractions method. If X
is less than or equal to A+1, a power series representation is used.
If X is greater than A+1, a continued fractions method is used.
REFERENCE:
Numerical Recipes, The Art of Scientific Computing (Second Edition)
Cambridge University Press
ISBN 0-521-43108-5
MODIFICATION HISTORY:
Written by: GGS, RSI, September 1994
IGAMMA is based on the routines: gser.c, gcf.c, and
gammln.c described in section 6.2 of Numerical Recipes,
The Art of Scientific Computing (Second Edition), and is
used by permission.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/igamma.pro)
NAME:
IGAMMA_PDF
PURPOSE:
This function computes the incomplete gamma function using a series
representation. It is called by the probability density functions
in this directory. See the function IGAMMA() in the "math"
subdirectory for the user-callable version of the incomplete gamma
function.
MODIFICATION HISTORY:
Modified by: Jong Yi, Sept 1992
Increased iterations in g_series.pro
Modified by: GGS, RSI, July 1994
Minor changes to code.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/igamma_pdf.pro)
NAME: IMAGE_CONT PURPOSE: Overlay an image and a contour plot. CATEGORY: General graphics. CALLING SEQUENCE: IMAGE_CONT, A INPUTS: A: The two-dimensional array to display. KEYWORD PARAMETERS: WINDOW_SCALE: Set this keyword to scale the window size to the image size. Otherwise, the image size is scaled to the window size. This keyword is ignored when outputting to devices with scalable pixels (e.g., PostScript). ASPECT: Set this keyword to retain the image's aspect ratio. Square pixels are assumed. If WINDOW_SCALE is set, the aspect ratio is automatically retained. INTERP: If this keyword is set, bilinear interpolation is used if the image is resized. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: The currently selected display is affected. RESTRICTIONS: None. PROCEDURE: If the device has scalable pixels, then the image is written over the plot window. MODIFICATION HISTORY: DMS, May, 1988.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/image_cont.pro)
NAME: INTERPOL PURPOSE: Linearly interpolate vectors with a regular or irregular grid. CATEGORY: E1 - Interpolation CALLING SEQUENCE: Result = INTERPOL(V, N) ;For regular grids. Result = INTERPOL(V, X, U) ;For irregular grids. INPUTS: V: The input vector can be any type except string. For regular grids: N: The number of points in the result when both input and output grids are regular. The output grid absicissa values equal FLOAT(i)/N_ELEMENTS(V), for i = 0, n-1. Irregular grids: X: The absicissae values for V. This vecotr must have same # of elements as V. The values MUST be monotonically ascending or descending. U: The absicissae values for the result. The result will have the same number of elements as U. U does not need to be monotonic. OPTIONAL INPUT PARAMETERS: None. OUTPUTS: INTERPOL returns a floating-point vector of N points determined by linearly interpolating the input vector. If the input vector is double or complex, the result is double or complex. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Result(i) = V(x) + (x - FIX(x)) * (V(x+1) - V(x)) where x = i*(m-1)/(N-1) for regular grids. m = # of elements in V, i=0 to N-1. For irregular grids, x = U(i). m = number of points of input vector. MODIFICATION HISTORY: Written, DMS, October, 1982. Modified, Rob at NCAR, February, 1991. Made larger arrays possible and correct by using long indexes into the array instead of integers.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/interpol.pro)
NAME:
INT_2D
PURPOSE:
This function computes the double integral of a bivariate
function F(x,y) with limits of integration from A to B
for x and from P(x) to Q(x) for y.
CATEGORY:
Numerical Analysis.
CALLING SEQUENCE:
Result = INT_2D(Fxy, AB_Limits, PQ_Limits, Pts)
INPUTS:
Fxy: A scalar string specifying the name of a user-supplied
IDL function that defines the bivariate function to be
integrated. The function must accept x & y and return
a scalar result.
AB_Limits: A two-element vector containing the lower, A, and
upper, B, limits of integration for x.
PQ_Limits: A scalar string specifying the name of a user-
supplied IDL function that defines the lower, P(x),
and upper, Q(x), limits of integration for y. The
function must accept x and return a two-element
vector result.
Pts: The number of transformation points used in the
computation. Possible values are: 6, 10, 20, 48 or 96.
KEYWORD PARAMETERS:
DOUBLE: If set to a non-zero value, computations are done in
double precision arithmetic.
EXAMPLE:
Compute the double integral of the bivariate function
F(x, y) = exp(-x^2 -y^2) over the circular region:
A = -4, B = 4, Px = -sqrt(16 - x^2), Qx = sqrt(16 - x^2).
;Define the bivariate function.
function Fxy, x, y
return, exp(-x^2. -y^2.)
end
;Define the limits of integration for y.
function PQ_Limits, x
return, [-sqrt(16. - x^2), sqrt(16. - x^2)]
end
;Define the limits of integration for x.
AB_Limits = [-4.0, 4.0]
;Integrate with 10, 20, 48, and 96 point formulas using double-
;precision arithmetic.
print, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 10, /double)
print, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 20, /double)
print, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 48, /double)
print, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 96, /double)
INT_2D with 10 transformation points yields: 3.1208432
INT_2D with 20 transformation points yields: 3.1415923
INT_2D with 48 transformation points yields: 3.1415923
INT_2D with 96 transformation points yields: 3.1415923
The exact solution (7 decimal accuracy) yields: 3.1415923
PROCEDURE:
INT_2D.PRO computes the double integral of a bivariate function
using iterated Gaussian Quadrature. The algorithm's transformation
data is provided in tabulated form with 15 decimal accuracy.
REFERENCE:
Handbook of Mathematical Functions
U.S. Department of Commerce
Applied Mathematics Series 55
MODIFICATION HISTORY:
Written by: GGS, RSI, January 1994
Modified: GGS, RSI, September 1994
Added 96 point transformation data.
Added DOUBLE keyword. Replaced nested FOR loop with
vector operations resulting in faster execution.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/int_2d.pro)
NAME:
INT_3D
PURPOSE:
This function computes the triple integral of a trivariate
function F(x,y,z) with limits of integration from A to B
for X, from P(x) to Q(x) for Y and from U(x,y) to V(x,y)
for Z.
CATEGORY:
Numerical Analysis.
CALLING SEQUENCE:
Result = INT_3D(Fxyz, AB_Limits, PQ_Limits, UV_Limits, Pts)
INPUTS:
Fxyz: A scalar string specifying the name of a user-supplied
IDL function that defines the trivariate function to be
integrated. The function must accept x, y & z and return
a scalar result.
AB_Limits: A two-element vector containing the lower, A, and
upper, B, limits of integration for x.
PQ_Limits: A scalar string specifying the name of a user-
supplied IDL function that defines the lower, P(x),
and upper, Q(x), limits of integration for y. The
function must accept x and return a two-element
vector result.
UV_Limits: A scalar string specifying the name of a user-
supplied IDL function that defines the lower, U(x,y),
and upper, V(x,y), limits of integration for z. The
function must accept x & y and return a two-element
vector result.
Pts: The number of transformation points used in the
computation. Possible values are: 6, 10, 20, 48 or 96.
KEYWORD PARAMETERS:
DOUBLE: If set to a non-zero value, computations are done in
double precision arithmetic.
EXAMPLE:
Compute the triple integral of the trivariate function
F(x,y,z) = z * (x^2 + y^2 + z^2)^1.5 over the region:
A = -2, B = 2, Px = -sqrt(4 - x^2), Qx = sqrt(4 - x^2),
Uxy = 0, Vxy = sqrt(4 - x^2 - y^2).
;Define the trivariate function.
function Fxyz, x, y, z
return, z * (x^2 + y^2 + z^2)^1.5
end
;Define the limits of integration for y.
function PQ_Limits, x
return, [-sqrt(4. - x^2), sqrt(4. - x^2)]
end
;Define the limits of integration for z.
function UV_Limits, x, y
return, [0.0, sqrt(4. - x^2 - y^2)]
end
;Define the limits of integration for x.
AB_Limits = [-2.0, 2.0]
;Integrate with 10, 20, 48, and 96 point formulas using double-
;precision arithmetic. Notice that it is possible to abbreviate
;keywords.
print, INT_3D('Fxyz', AB_Limits, 'PQ_Limits', 'UV_Limits', 10, /d)
print, INT_3D('Fxyz', AB_Limits, 'PQ_Limits', 'UV_Limits', 20, /d)
print, INT_3D('Fxyz', AB_Limits, 'PQ_Limits', 'UV_Limits', 48, /d)
print, INT_3D('Fxyz', AB_Limits, 'PQ_Limits', 'UV_Limits', 96, /d)
INT_3D with 10 transformation points yields: 57.444248
INT_3D with 20 transformation points yields: 57.446201
INT_3D with 48 transformation points yields: 57.446265
INT_3D with 96 transformation points yields: 57.446266
The exact solution (6 decimal accuracy) yields: 57.446267
PROCEDURE:
INT_3D.PRO computes the triple integral of a trivariate function
using iterated Gaussian Quadrature. The algorithm's transformation
data is provided in tabulated form with 15 decimal accuracy.
REFERENCE:
Handbook of Mathematical Functions
U.S. Department of Commerce
Applied Mathematics Series 55
MODIFICATION HISTORY:
Written by: GGS, RSI, January 1994
Modified: GGS, RSI, September 1994
Added 96 point transformation data.
Added DOUBLE keyword. Replaced nested FOR loop with
vector operations resulting in faster execution.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/int_3d.pro)
NAME:
INT_TABULATED
PURPOSE:
This function integrates a tabulated set of data { x(i) , f(i) },
on the closed interval [min(X) , max(X)].
CATEGORY:
Numerical Analysis.
CALLING SEQUENCE:
Result = INT_TABULATED(X, F)
INPUTS:
X: The tabulated X-value data. This data may be irregularly
gridded and in random order. If the data is randomly ordered
you must set the SORT keyword to a nonzero value.
F: The tabulated F-value data. Upon input to the function
X(i) and F(i) must have corresponding indices for all
values of i. If X is reordered, F is also reordered.
X and F must be of floating point or double precision type.
KEYWORD PARAMETERS:
SORT: A zero or non-zero scalar value.
SORT = 0 (the default) The tabulated x-value data is
already in ascending order.
SORT = 1 The tabulated x-value data is in random order
and requires sorting into ascending order. Both
input parameters X and F are returned sorted.
DOUBLE: If set to a non-zero value, computations are done in
double precision arithmetic.
OUTPUTS:
This fuction returns the integral of F computed from the tabulated
data in the closed interval [min(X) , max(X)].
RESTRICTIONS:
Data that is highly oscillatory requires a sufficient number
of samples for an accurate integral approximation.
PROCEDURE:
INT_TABULATED.PRO constructs a regularly gridded x-axis with a
number of segments as an integer multiple of four. Segments
are processed in groups of four using a 5-point Newton-Cotes
integration formula.
For 'sufficiently sampled' data, this algorithm is highly accurate.
EXAMPLES:
Example 1:
Define 11 x-values on the closed interval [0.0 , 0.8].
x = [0.0, .12, .22, .32, .36, .40, .44, .54, .64, .70, .80]
Define 11 f-values corresponding to x(i).
f = [0.200000, 1.30973, 1.30524, 1.74339, 2.07490, 2.45600, $
2.84299, 3.50730, 3.18194, 2.36302, 0.231964]
Compute the integral.
result = INT_TABULATED(x, f)
In this example, the f-values are generated from a known function,
(f = .2 + 25*x - 200*x^2 + 675*x^3 - 900*x^4 + 400*x^5)
The Multiple Application Trapazoid Method yields; result = 1.5648
The Multiple Application Simpson's Method yields; result = 1.6036
INT_TABULATED.PRO yields; result = 1.6232
The Exact Solution (4 decimal accuracy) yields; result = 1.6405
Example 2:
Create 30 random points in the closed interval [-2 , 1].
x = randomu(seed, 30) * 3.0 - 2.0
Explicitly define the interval's endpoints.
x(0) = -2.0 & x(29) = 1.0
Generate f(i) corresponding to x(i) from a given function.
f = sin(2*x) * exp(cos(2*x))
Call INT_TABULATED with the SORT keyword.
result = INT_TABULATED(x, f, /sort)
In this example, the f-values are generated from the function,
f = sin(2*x) * exp(cos(2*x))
The result of this example will vary because the x(i) are random.
Executing this example three times gave the following results:
INT_TABULATED.PRO yields; result = -0.0702
INT_TABULATED.PRO yields; result = -0.0731
INT_TABULATED.PRO yields; result = -0.0698
The Exact Solution (4 decimal accuracy) yields; result = -0.0697
MODIFICATION HISTORY:
Written by: GGS, RSI, September 1993
Modified: GGS, RSI, November 1993
Use Numerical Recipes cubic spline interpolation
function NR_SPLINE/NR_SPLINT. Execution time is
greatly reduced. Added DOUBLE keyword. The 'sigma'
keyword is no longer supported.
Modified: GGS, RSI, April 1995
Changed cubic spline calls from NR_SPLINE/NR_SPLINT
to SPL_INIT/SPL_INTERP. Improved double-precision
accuracy.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/int_tabulated.pro)
NAME: JULDAY PURPOSE: Calculate the Julian Day Number for a given month, day, and year. This is the inverse of the library function CALDAT. See also caldat, the inverse of this function. CATEGORY: Misc. CALLING SEQUENCE: Result = JULDAY(Month, Day, Year) INPUTS: MONTH: Number of the desired month (1 = January, ..., 12 = December). DAY: Number of day of the month. YEAR: Number of the desired year. OPTIONAL INPUT PARAMETERS: None. OUTPUTS: JULDAY returns the Julian Day Number (which begins at noon) of the specified calendar date. 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). AB, September, 1988
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/julday.pro)
NAME:
KRIG_2D
PURPOSE:
This function interpolates a regularly or irregularly gridded
set of points Z = F(X,Y) using kriging.
CATEGORY:
Interpolation, Surface Fitting
CALLING SEQUENCE:
Result = KRIG2D(Z [, X, Y])
INPUTS:
X, Y, Z: arrays containing the X, Y, and Z coordinates of the
data points on the surface. Points need not be
regularly gridded. For regularly gridded input data,
X and Y are not used: the grid spacing is specified
via the XGRID and YGRID (or XVALUES and YVALUES)
keywords, and Z must be a two dimensional array.
For irregular grids, all three parameters must be
present and have the same number of elements.
KEYWORD PARAMETERS:
Model Parameters:
EXPONENTIAL: if set (with parameters [A, C0, C1]), use an exponential
semivariogram model.
SPHERICAL: if set (with parameters [A, C0, C1]), use a spherical
semivariogram model.
Both models use the following parameters:
A: the range. At distances beyond A, the semivariogram
or covariance remains essentialy constant.
See the definition of the functions below.
C0: the "nugget," which provides a discontinuity at the
origin.
C1: the covariance value for a zero distance, and the variance
of the random sample Z variable. If only a two element
vector is supplied, C1 is set to the sample variance.
(C0 + C1) = the "sill," which is the variogram value for
very large distances.
Input grid description:
REGULAR: if set, the Z parameter is a two dimensional array
of dimensions (N,M), containing measurements over a
regular grid. If any of XGRID, YGRID, XVALUES, YVALUES
are specified, REGULAR is implied. REGULAR is also
implied if there is only one parameter, Z. If REGULAR is
set, and no grid (_VALUE or _GRID) specifications are
present, the respective grid is set to (0, 1, 2, ...).
XGRID: contains a two element array, [xstart, xspacing],
defining the input grid in the X direction. Do not
specify both XGRID and XVALUES.
XVALUES: if present, XVALUES(i) contains the X location
of Z(i,j). XVALUES must be dimensioned with N elements.
YGRID: contains a two element array, [ystart, yspacing],
defining the input grid in the Y direction. Do not
specify both YGRID and YVALUES.
YVALUES: if present, YVALUES(i) contains the Y location
of Z(i,j). YVALUES must be dimensioned with N elements.
Output grid description:
GS: If present, GS must be a two-element vector [XS, YS],
where XS is the horizontal spacing between grid points
and YS is the vertical spacing. The default is based on
the extents of X and Y. If the grid starts at X value
Xmin and ends at Xmax, then the default horizontal
spacing is (Xmax - Xmin)/(NX-1). YS is computed in the
same way. The default grid size, if neither NX or NY
are specified, is 26 by 26.
BOUNDS: If present, BOUNDS must be a four element array containing
the grid limits in X and Y of the output grid:
[Xmin, Ymin, Xmax, Ymax]. If not specified, the grid
limits are set to the extent of X and Y.
NX: The output grid size in the X direction. NX need not
be specified if the size can be inferred from GS and
BOUNDS. The default value is 26.
NY: The output grid size in the Y direction. See NX.
OUTPUTS:
This function returns a two dimensional floating point array
containing the interpolated surface, sampled at the grid points.
RESTRICTIONS:
The accuracy of this function is limited by the single precision
floating point accuracy of the machine.
SAMPLE EXECUTION TIMES (measured on a Sun IPX)
# of input points # of output points Seconds
10 676 1.1
20 676 1.5
40 676 2.6
80 676 7.8
10 1024 1.6
10 4096 5.9
10 16384 23
PROCEDURE:
Ordinary kriging is used to fit the surface described by the
data points X,Y, and Z. See: Isaaks and Srivastava,
"An Introduction to Applied Geostatistics," Oxford University
Press, 1989, Chapter 12.
The parameters of the data model, the range, nugget, and
sill, are highly dependent upon the degree and type of spatial
variation of your data, and should be determined statistically.
Experimentation, or preferrably rigorus analysis, is required.
For N data points, a system of N+1 simultaneous
equations are solved for the coefficients of the
surface. For any interpolation point, the interpolated value
is:
F(x,y) = Sum( w(i) * C(x(i),y(i), x, y)
Formulas used to model the variogram functions:
d(i,j) = distance from point i to point j.
V = variance of samples.
C(i,j) = Covariance of sample i with sample j.
C(x0,y0,x1,y1) = Covariance of point (x0,y0) with (x1,y1).
Exponential covar: C(d) = C1 * EXP(-3*d/A) if d ne 0.
= C1 + C0 if d eq 0.
Spherical covar: C(d) = (1.0 - 1.5 * d/a + 0.5 * (d/a)^3)
= C1 + C0 if d eq 0.
= 0 if d > a.
EXAMPLES:
Example 1: Irregularly gridded cases
Make a random set of points that lie on a gaussian:
n = 15 ;# random points
x = RANDOMU(seed, n)
y = RANDOMU(seed, n)
z = exp(-2 * ((x-.5)^2 + (y-.5)^2)) ;The gaussian
get a 26 by 26 grid over the rectangle bounding x and y:
e = [ 0.25, 0.0] ;Range and nugget are 0.25, and 0.
;(These numbers are dependent upon
;your data model.)
r = krig2d(z, x, y, EXPON = e) ;Get the surface.
Or: get a surface over the unit square, with spacing of 0.05:
r = krig2d(z, x, y, EXPON=e, GS=[0.05, 0.05], BOUNDS=[0,0,1,1])
Or: get a 10 by 10 surface over the rectangle bounding x and y:
r = krig2d(z, x, y, EXPON=e, NX=10, NY=10)
Example 2: Regularly gridded cases
s = [ 10., 0.2] ;Range and sill, data dependent.
z = randomu(seed, 5, 6) ;Make some random data
interpolate to a 26 x 26 grid:
CONTOUR, krig2d(z, /REGULAR, SPHERICAL = s)
MODIFICATION HISTORY:
DMS, RSI, March, 1993. Written.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/krig2d.pro)
NAME:
KW_TEST
PURPOSE:
This function tests the hypothesis that three or more sample
popultions have the same mean of distribution against the
hypothesis that they differ. The popultions may be of equal
or unequal lengths. The result is a two-element vector containing
the test statistic H and the one-tailed probability of obtaining
a value of H or greater from a chi-square distribution. This type
of test is often refered to as the Kruskal-Wallis H-Test.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = KW_test(X)
INPUTS:
X: An array of m-columns (m >= 3) and n-rows of type integer,
float or double. The columns of this two dimensional array
correspond to the sample popultions. If the sample popultions
are of unequal length, all vectors must be appended up to a
common length of n using a user-specified missing value. This
method requires the use of the MISSING keyword.
KEYWORD PARAMETERS:
DF: Use this keyword to specify a named variable which returns
the degrees of freedom used to compute the probability of
obtaining a value of H or greater from the corresponding
chi-square distribution
MISSING: Use this keyword to specify a non-zero numeric value which
is used to appended popultions of unequal length up to a
common length of n.
EXAMPLE:
Test the hypothesis that three sample popultions have the same mean
of distribution against the hypothesis that they differ at the 0.05
significance level.
sp0 = [24.0, 16.7, 22.8, 19.8, 18.9]
sp1 = [23.2, 19.8, 18.1, 17.6, 20.2, 17.8]
sp2 = [18.2, 19.1, 17.3, 17.3, 19.7, 18.9, 18.8, 19.3]
Since the sample popultions are of unequal lengths, a missing value
must be appended to sp0 and sp1. In this example the missing value
is -1.0 and the 3-column, 8-row input array is defined as:
x = [[24.0, 23.2, 18.2], $
[16.7, 19.8, 19.1], $
[22.8, 18.1, 17.3], $
[19.8, 17.6, 17.3], $
[18.9, 20.2, 19.7], $
[-1.0, 17.8, 18.9], $
[-1.0, -1.0, 18.8], $
[-1.0, -1.0, 19.3]]
result = kw_test(x, missing = -1)
The result should be the 2-element vector:
[1.65862, 0.436351]
The computed probability (0.436351) is greater than the 0.05
significance level and therefore we do not reject the hypothesis
that the three sample popultions s0, s1 and s2 have the same mean
of distribution.
PROCEDURE:
KW_TEST computes the nonparametric Kruskal-Wallis H-Test for three or
more populations of equal or unequal size. This test is an extension
of the Rank Sum Test implemented in the RS_TEST function. When each
sample population contains at least five observations, the H test
statistic is approximated very well by a chi-square distribution with
DF degrees of freedom. The hypothesis that three of more sample
populations have the same mean of distribution is rejected if two or
more populations differ with statistical significance.
REFERENCE:
PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition)
Ronald E. Walpole & Raymond H. Myers
ISBN 0-02-424170-9
MODIFICATION HISTORY:
Written by: GGS, RSI, September 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/kw_test.pro)
$Id: label_alloc.pro,v 1.8 1995/01/20 19:41:01 tonyh Exp $
WidLabel
Widget Label class library
Copyright (c) 1993, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
MODIFICATION HISTORY
Written by: Joshua Goldstein, 12/93
LABEL_Icon
Return the label toolbar icon
UNCTION LABEL_Icon
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/label_alloc.pro)
NAME: LABEL_DATE PURPOSE: This function labels axes with dates. CATEGORY: Plotting. CALLING SEQUENCE: To set up: dummy = LABEL_DATE(DATE_FORMAT='string') To use: PLOT, x, y, XTICKFORMAT='LABEL_DATE' INPUTS: No explicit user defined inputs. When called from the plotting routines, the input parameters are (Axis, Index, Value) KEYWORD PARAMETERS: DATE_FORMAT: a format string which may contain the following: %M for month (3 character abbr) %N for month (2 digit abbr) %D for day of month, %Y for 4 digit year. %Z for last two digits of year. %% is %. Other characters are passed directly thru. For example, '%M %D, %Y' prints DEC 11, 1993 '%M %2Y' yields DEC 93 '%D-%M' yields 11-DEC '%D/%N/%Y' yields 11/12/1993 '%M!C%Y' yields DEC on the top line, 1993 on the bottom (!C is the new line graphic command). MONTHS: The names of the months, a twelve element string array. If omitted, use Jan, Feb, ..., Dec. OUTPUTS: The date string to be plotted. COMMON BLOCKS: LABEL_DATE_COM. RESTRICTIONS: Only one date axis may be simultaneously active. PROCEDURE: Straightforward. EXAMPLE: For example, to plot from Jan 1, 1993, to July 12, 1994: Start_date = julday(1, 1, 1993) End_date = julday(7, 12, 1994) Dummy = LABEL_DATE(DATE_FORMAT='%N/%D') ;Simple mm/dd x = findgen(end_date+1 - start_date) + start_date ;Time axis PLOT, x, sqrt(x), XTICKFORMAT = 'LABEL_DATE', XSTYLE=1 (Plot with X axis style set to exact.) MODIFICATION HISTORY: DMS, RSI. April, 1993. Written.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/label_date.pro)
NAME:
LADFIT
PURPOSE:
This function fits the paired data {X(i), Y(i)} to the linear model,
y = A + Bx, using a "robust" least absolute deviation method. The
result is a two-element vector containing the model parameters, A
and B.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = LADFIT(X, Y)
INPUTS:
X: An n-element vector of type integer, float or double.
Y: An n-element vector of type integer, float or double.
KEYWORD PARAMETERS:
ABSDEV: Use this keyword to specify a named variable which returns the
mean absolute deviation for each data-point in the y-direction.
EXAMPLE:
Define two n-element vectors of paired data.
x = [-3.20, 4.49, -1.66, 0.64, -2.43, -0.89, -0.12, 1.41, $
2.95, 2.18, 3.72, 5.26]
y = [-7.14, -1.30, -4.26, -1.90, -6.19, -3.98, -2.87, -1.66, $
-0.78, -2.61, 0.31, 1.74]
Compute the model parameters, A and B.
result = ladfit(x, y, absdev = absdev)
The result should be the two-element vector:
[-3.15191, 0.930440]
The keyword parameter should be returned as:
absdev = 0.636851
REFERENCE:
Numerical Recipes, The Art of Scientific Computing (Second Edition)
Cambridge University Press
ISBN 0-521-43108-5
MODIFICATION HISTORY:
Written by: GGS, RSI, September 1994
Modified: GGS, RSI, July 1995
Corrected an infinite loop condition that occured when
the X input parameter contained mostly negative data.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/ladfit.pro)
NAME: LEEFILT PURPOSE: Performs the Lee filter algorithm on an image array using a box of size 2N+1. This function can also be used on vectors. CATEGORY: E3 Smoothing (image). CALLING SEQUENCE: Result = LEEFILT(A [, N, Sig]) INPUTS: A: The input image array or one-dimensional vector. OPTIONAL INPUT PARAMETERS: N: The size of the filter box is 2N+1. The default value is 5. Sig: Estimate of the standard deviation. The default is 5. If Sig is negative the procedure requests a value to be entered, and displays the resulting image. This cycle continues until a zero value of Sig is entered. OUTPUTS: The filtered image or vector is returned. COMMON BLOCKS: None. SIDE EFFECTS: Displays the filtered image in an IDL window using TVSCL if Sig was negative. RESTRICTIONS: None. PROCEDURE: The LEE (Computer Graphics 197?) technique smooths additive image noise by generating statistics in a local neighborhood and comparing them to the expected values. MODIFICATION HISTORY: Written, 24-Nov-1982, by R. A. Howard, Naval Research Lab, Washington, DC 20375
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/leefilt.pro)
NAME:
LINFIT
PURPOSE:
This function fits the paired data {X(i), Y(i)} to the linear model,
y = A + Bx, by minimizing the chi-square error statistic. The result
is a two-element vector containing the model parameters, A and B.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = LINFIT(X, Y)
INPUTS:
X: An n-element vector of type integer, float or double.
Y: An n-element vector of type integer, float or double.
KEYWORD PARAMETERS:
CHISQR: Use this keyword to specify a named variable which returns the
chi-square error statistic as the sum of squared errors between
Y(i) and A + BX(i). If individual standard deviations are
supplied, then the chi-square error statistic is computed as
the sum of squared errors divided by the standard deviations.
PROB: Use this keyword to specify a named variable which returns the
probability that the computed fit would have a value of CHISQR
or greater. If PROB is greater than 0.1, the model parameters
are "believable". If PROB is less than 0.1, the accuracy of the
model parameters is questionable.
SDEV: An n-element vector of type integer, float or double that
specifies the individual standard deviations for {X(i), Y(i)}.
SIG_AB: Use this keyword to specify a named variable which returns a
two-element vector of probable uncertainties for the model par-
ameters A and B, respectively.
EXAMPLE:
Define two n-element vectors of paired data.
x = [-3.20, 4.49, -1.66, 0.64, -2.43, -0.89, -0.12, 1.41, $
2.95, 2.18, 3.72, 5.26]
y = [-7.14, -1.30, -4.26, -1.90, -6.19, -3.98, -2.87, -1.66, $
-0.78, -2.61, 0.31, 1.74]
Define a vector of standard deviations with a constant value of 0.85
sdev = replicate(0.85, n_elements(x))
Compute the model parameters, A and B.
result = linfit(x, y, chisqr = chisqr, prob = prob, sdev = sdev)
The result should be the two-element vector:
[-3.44596, 0.867329]
The keyword parameters should be returned as:
chisqr = 11.4998, prob = 0.319925
REFERENCE:
Numerical Recipes, The Art of Scientific Computing (Second Edition)
Cambridge University Press
ISBN 0-521-43108-5
MODIFICATION HISTORY:
Written by: GGS, RSI, September 1994
LINFIT is based on the routines: fit.c, gammq.c, gser.c,
and gcf.c described in section 15.2 of Numerical Recipes,
The Art of Scientific Computing (Second Edition), and is
used by permission.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/linfit.pro)
$Id: list_alloc.pro,v 1.7 1995/01/20 19:41:01 tonyh Exp $
WidList
Widget List class library
Copyright (c) 1993, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
MODIFICATION HISTORY
Written by: Joshua Goldstein, 12/93
LIST_Icon
Return the list toolbar icon
UNCTION LIST_Icon
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/list_alloc.pro)
NAME: LJLCT PURPOSE: Load standard color tables for LJ-250/252 printer. CATEGORY: Image display. CALLING SEQUENCE: LJLCT OUTPUTS: No explicit outputs. SIDE EFFECTS: The color tables are modified if the current device is 'LJ'. LIMITATIONS: The default color maps used are for the 90dpi color palette. There are only 8 colors colors availible at 180 dpi. PROCEDURE: If the current device is 'LJ', !D.N_COLORS is used to determine how many bit planes are in use (1 to 4). The standard color map for that number of planes is loaded. These maps are described in Chapter 7 of the "LJ250/LJ252 Companion Color Printer Programmer Reference Manual", Table 7-5. That manual gives the values scaled from 1 to 100, LJLCT scales them from 0 to 255. MODIFICATION HISTORY: AB, 29 July 1990.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/ljlct.pro)
NAME:
LL_ARC_DISTANCE
PURPOSE:
This function returns the longitude and latitude [lon, lat] of
a point a given arc distance (-pi <= Arc_Dist <= pi), and azimuth (Az),
from a specified location Lon_lat0.
CATEGORY:
Mapping, geography.
CALLING SEQUENCE:
Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az)
INPUTS:
Lon_lat0: A 2-element vector containing the longitude and latitude
of the starting point. Values are assumed to be in radians
unless the keyword DEGREES is set.
Arc_Dist: The arc distance from Lon_lat0. The value must be between
-!PI and +!PI. To express distances in arc units, divide
by the radius of the globe expressed in the original units.
For example, if the radius of the earth is 6371 km, divide
the distance in km by 6371 to obtain the arc distance.
Az: The azimuth from Lon_lat0. The value is assumed to be in
radians unless the keyword DEGREES is set.
KEYWORD PARAMETERS:
DEGREES: Set this keyword to express all measurements and
results in degrees.
OUTPUTS:
This function returns a two-element vector containing the
longitude and latitude of the resulting point. Values are
in radians unless the keyword DEGREES is set.
PROCEDURE:
Formula from Map Projections - a working manual. USGS paper
1395. Equations (5-5) and (5-6).
EXAMPLE:
Lon_lat0 = [1.0, 2.0] ; Initial point specified in radians
Arc_Dist = 2.0 ; Arc distance in radians
Az = 1.0 ; Azimuth in radians
Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az)
PRINT, Result
2.91415 -0.622234
MODIFICATION HISTORY:
DMS, Aug, 1992. Written.
DJC, Jun, 1994. Added test for zero arc distance.
Renamed "dist" variable to "arc_dist" for
compatibility with IDL "Dist" function.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/ll_arc_distance.pro)
NAME:
LOADCT
PURPOSE:
Load predefined color tables.
CATEGORY:
Image display.
CALLING SEQUENCE:
LOADCT [, Table]
OPTIONAL INPUTS:
Table: The number of the pre-defined color table to load, from 0
to 15. If this value is omitted, a menu of the available
tables is printed and the user is prompted to enter a table
number.
KEYWORD PARAMETERS:
FILE: If this keyword is set, the file by the given name is used
instead of the file colors1.tbl in the IDL directory. This
allows multiple IDL users to have their own color table file.
The specified file must exist.
GET_NAMES: If this keyword is present AND DEFINED, the names
of the color tables are returned as a string array.
No changes are made to the color table.
NCOLORS = number of colors to use. Use color indices from 0
to the smaller of !D.TABLE_SIZE-1 and NCOLORS-1.
Default = !D.TABLE_SIZE = all available colors.
SILENT: If this keyword is set, the Color Table message is suppressed.
BOTTOM = first color index to use. Use color indices from BOTTOM to
BOTTOM+NCOLORS-1. Default = 0.
OUTPUTS:
No explicit outputs.
COMMON BLOCKS:
COLORS: The IDL color common block.
SIDE EFFECTS:
The color tables of the currently-selected device are modified.
RESTRICTIONS:
Works from the file: $IDL_DIR/resource/colors/colors1.tbl or the file specified
with the FILE keyword.
PROCEDURE:
The file "colors1.tbl" or the user-supplied file is read. If
the currently selected device doesn't have 256 colors, the color
data is interpolated from 256 colors to the number of colors
available.
The colors loaded into the display are saved in the common
block COLORS, as both the current and original color vectors.
Interpolation: If the current device has less than 256 colors,
the color table data is interpolated to cover the number of
colors in the device.
MODIFICATION HISTORY:
Old. For a widgetized version of this routine, see XLOADCT in the IDL
widget library.
DMS, 7/92, Added new color table format providing for more than
16 tables. Now uses file colors1.tbl. Old LOADCT procedure
is now OLD_LOADCT.
ACY, 9/92, Make a pixmap if no windows exist for X windows to
determine properly the number of available colors.
Add FILE keyword.
WSO, 1/95, Updated for new directory structure
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/loadct.pro)
NAME:
LU_COMPLEX
PURPOSE:
This function solves an N by N complex linear system using
LU decomposition. The result is an N-element complex vector.
Alternatively, this function computes the generalized inverse
of an N by N complex array using LU decomposition. The result
is an N by N complex array.
CATEGORY:
Complex Linear Algebra.
CALLING SEQUENCE:
Result = LU_COMPLEX(A, B)
INPUTS:
A: An N by N complex array.
B: An N-element right-side vector (real or complex).
KEYWORD PARAMETERS:
DOUBLE: If set to a non-zero value, computations are done in
double precision arithmetic.
INVERSE: If set to a non-zero value, the generalized inverse of A
is computed. In this case the input parameter B is ignored.
SPARSE: If set to a non-zero value, the input array is converted
to row-indexed sparse storage format. Computations are
done using the iterative biconjugate gradient method.
This keyword is effective only when solving complex linear
systems. This keyword has no effect when calculating the
generalized inverse.
EXAMPLE:
1) Define a complex array (A) and right-side vector (B).
A = [[complex(1, 0), complex(2,-2), complex(-3,1)], $
[complex(1,-2), complex(2, 2), complex(1, 0)], $
[complex(1, 1), complex(0, 1), complex(1, 5)]]
B = [complex(1, 1), complex(3,-2), complex(1,-2)]
Solve the complex linear system (Az = B) for z.
z = LU_COMPLEX(a, b)
2) Compute the generalized inverse of A.
inv = LU_COMPLEX(a, b, /inverse)
PROCEDURE:
LU_COMPLEX solves the complex linear system Az = b using
LU decomposition. If the SPARSE keyword is set, the coefficient
array is converted to row-indexed sparse storage format and the
system is solved using the iterative biconjugate gradient method.
LU_COMPLEX computes the generalized inverse of the complex
array A using LU decomposition if B is supplied as an arbitrary
scalar value or if the INVERSE keyword is set.
REFERENCE:
Numerical Recipes, The Art of Scientific Computing (Second Edition)
Cambridge University Press
ISBN 0-521-43108-5
MODIFICATION HISTORY:
Written by: GGS, RSI, October 1993
Modified: GGS, RSI, February 1994
Transposing the array prior to calling LU_COMPLEX
is no longer necessary. LU_COMPLEX is now able to
compute the generalized inverse of an N by N complex
array using LU decomposition.
Modified: GGS, RSI, June 1994
Included support for sparse complex arrays using the
Numerical Recipes functions NR_SPRSIN and NR_LINBCG.
Modified: GGS, RSI, Decemberber 1994
Added support for double-precision complex inputs.
Reduced internal memory allocation requirements.
Added INVERSE keyword. New documentation header.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/lu_complex.pro)
NAME:
MAN_PROC
PURPOSE:
Provide online documentation for IDL topics. If the current
graphics device supports widgets, a graphical user interface
is used. Otherwise, a more basic version that is a cross
between the Unix man pages and VMS online help is used. The
help is organized in a two-level hierarchy. Level 1 is the
global subject, and Level 2 supplies help on subjects within
each global subject.
CATEGORY:
Help, documentation.
CALLING SEQUENCE:
MAN_PROC [, Request]
INPUTS:
Request: A scalar string containing the item for which help is desired.
This string can contain one or two (whitespace separated)
words. The first word is taken as the global topic and the
second as the topic within the scope of the first. The user
is prompted for missing words.
OUTPUTS:
The widget version uses a text widget to display the help
text. The basic version sends help text to the standard output.
COMMON BLOCKS:
None.
RESTRICTIONS:
The help text is derived from the LaTeX files used to produce
the reference manual. However, it is not possible to produce
exactly the same output as found in the manual due to the limitations
of text-oriented terminals. Therefore, the text used is considerably
abbreviated. Always check the manual if the online help is
insufficient.
MODIFICATION HISTORY:
4 January 1991, AB Renamed the old MAN_PROC to MP_BASIC and added
MP_WIDGETS to handle the widget interface.
3 September 1992, AB Switched from the IDLwidgets version
(MP_WIDGETS) to the builtin help. This allows
help and the IDL> prompt to work simultaneously
17 May 1993, AB Reverted to using MP_WIDGETS for the Sun 3
because it is stuck at OpenWindows 2.0 and
recent changes to online help will not be
ported to that platform.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/man_proc.pro)
Used to read in the index file for each map data file
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/map_continents.pro)
NAME:
map_image
PURPOSE:
This function returns the Image_Orig image warped to fit
the map specified by the system variable !Map. Image_Orig
must be centered at 0.
Category:
Mapping
Calling Sequence:
result = map_image(Image_Orig [, xstart, ystart [, xsize, ysize]])
INPUT:
Image_Orig--- A two-dimensional array representing geographical
image to be overlayed on map. It has Nx columns,
and Ny rows.
KEYWORDS:
LATMIN --- the latitude corresponding to the first row of Image_Orig.
The default value is -90. Latitude and Longitude values
refer to the CENTER of each cell.
LATMAX --- the latitude corresponding to last row of Image_Orig. The
default is 90 - (180. / Ny).
LONMIN --- the longitude corresponding to the first column of
Image_Orig. The default value is -180.
LONMAX --- the longitude corresponding to the last column
of Image_Orig. The default is 180. - (360./Nx).
For images crossing the international dateline, lonmax
will be less than lonmin.
If the longitude of the last column is equal to
(lonmin - (360. /Nx)) MODULO 360.
it is assumed that the image covers all longitudes.
BILINEAR --- A flag, if set, to request bilinear interpolation. The
default is nearest neighbor.
COMPRESS --- Interpolation compression flag. Setting this to
a higher number saves time --- lower numbers produce
more accurate results. Setting this to 1
solves the inverse map transformation for every
pixel of the output image. Default = 4 for output devices
with fixed pixel sizes. Fix is used to make this an int.
WHOLE_MAP = Set to defeat the code that determines the extent
of the image on the map. Some projections are so
tricky (especially the satellite) that it is difficult
to find where the image goes on the map. Setting this
keyword computes the entire map, at the cost of more
time. For images which cover the entire map, setting
this keyword produces no penalty.
SCALE = pixel / graphics scale factor for devices with scalable
pixels (e.g. PostScript). Default = 0.02 pixels/graphic_coord.
This yields an approximate output image size of 350 x 250.
Make this number larger for more resolution (and larger
PostScript files, and images), or smaller for faster
and smaller, less accurate images.
MISSING = value to set areas outside the valid map coordinates.
If omitted, areas outside the map are set to 255 (white) if
the current graphics device is PostScript, or 0 otherwise.
MAX_VALUE = values in Image_Orig greater than or equal to MAX_VALUE
are considered missing. Pixels in the output image
that depend upon missing pixels will be set to MISSING.
MIN_VALUE = values in Image_Orig less than or equal to MIN_VALUE
are considered missing.
Optional Output Parameters:
xstart --- the x coordinate where the left edge of the image
should be placed on the screen.
ystart --- the y coordinate where th bottom edge of the image
should be placed on the screen.
xsize --- returns the width of the resulting image expressed in
graphic coordinate units. If current graphics device has
scalable pixels, the value of XSIZE and YSIZE should
be passed to the TV procedure.
ysize --- returns the pixel height of the resulting image, if the
current graphics device has scalable pixels.
Output:
The warped image is returned.
Procedure: An image space algorithm is used, so the time required
is roughly proportional to the size of the final image.
MODIFICATION HISTORY:
CAB, Feb, 1992. Map_image has been changed to handle images
crossing the international dateline in a more convenient way.
Specifically, it no longer requires that the keyword LONMIN be
greater than or equal to -180 or the keyword LONMAX be
less than or equal to 180.
DMS, Aug, 1992. Completly rewritten. Uses different algorithms.
DMS, Dec, 1992. Coordinates were off by part of a pixel bin.
Also, round when not doing bi-linear interpolation.
DMS, Sep, 1993. Added MAX_VALUE keyword.
DMS, Nov, 1994. Added MIN_VALUE keyword.
SVP, Mar, 1995. Compress is now fix()'d. y is now scaled correctly.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/map_image.pro)
NAME:
map_patch
PURPOSE:
This function returns an interpolated grid in device space,
given a set of rectangularly gridded values, in latitude/longitude
space on the globe.
Category:
Mapping
Calling Sequence:
result = map_patch(Image_Orig [, Lons] [, Lats])
INPUT:
Image_Orig- A two-dimensional array containing the data
to be overlayed on map. It has Nx columns,
and Ny rows. The cell connectivity must be rectangular.
Computations are performed in floating point.
Rows and columns must arranged in increasing longitude
and latitude order.
Lons- An Nx element vector containing the longitude
of each column. lon(image_orig(i,j)) = Lons(i).
This optional parameter may be omitted if the
longitudes are equally spaced and are
specified with the LON0 and LON1 keywords.
Lats- An Ny element vector containing the latitude for each
row. lat(image_orig(i,j)) = lats(j) This optional
parameter may be omitted if the latitudes are equally
spaced and are specified with the LAT0 and LAT1 keywords.
KEYWORDS:
LAT0- The latitude of the first column of data. Default=-90.
LAT1- The latitude of the last column of data. Default=+90.
LON0- The longitude of the first row of data. Default=-180.
LON1- The longitude of the last row of data. Default=180-360/Ny.
MISSING = value to set areas outside the valid map coordinates.
If omitted, areas outside the map are set to 255 (white) if
the current graphics device is PostScript, or 0 otherwise.
MAX_VALUE = values in Image_Orig greater than MAX_VALUE
are considered missing. Pixels in the output image
that depend upon missing pixels will be set to MISSING.
TRIANGULATE = if set, the points are converted to device space
and then triangulated. Specify this keyword if the connectivity
of the points is not rectangular AND monotonic in device space.
Optional Output Keywords:
xstart --- the x coordinate where the left edge of the image
should be placed on the screen.
ystart --- the y coordinate where th bottom edge of the image
should be placed on the screen.
xsize --- returns the width of the resulting image expressed in
graphic coordinate units. If current graphics device has
scalable pixels, the value of XSIZE and YSIZE should
be passed to the TV procedure.
ysize --- returns the pixel height of the resulting image, if the
current graphics device has scalable pixels.
Restrictions:
The four corner points of each cell must be contiguous. This
means that the seam of a map must lie on a cell boundary,
not in its interior, splitting the cell.
Output:
The warped image is returned.
Procedure: An image space algorithm is used, so the time required
is roughly proportional to the size in pixels of the final image.
This routine often produces better results than MAP_IMAGE, because
it works in image (graphic) space, rather than in object (data)
space. Each rectangular cell is divided by a diagonal,
into two triangles. The trianges are then interpolated into
the image array using TRIGRID.
MODIFICATION HISTORY:
DMS of RSI, July, 1994. Written.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/map_patch.pro)
NAME:
map_set
PURPOSE:
The procedure map_set establishes
the axis type and coordinate conversion mechanism
for mapping points on the earth's surface, expressed
in latitude and longitude, to points on a plane, according
to one of ten possible map projections. The user may
may select the map projection, the map center, polar rotation
and geographical limits.
The user may request map_set to plot the
graticule and continental boundaries by setting
the keywords Grid and Continent.
CATEGORY:
Mapping
CALLING SEQUENCE:
map_set, p0lat, p0lon, rot, proj = proj, $
CYLINDRICAL = cyl, MERCATOR = merc, $
MOLLWEIDE = moll, STEREOGRAPHIC = stereo, $
ORTHOGRAPHIC = ortho, Conic = cone, $
LAMBERT = lamb, GNOMIC = gnom, $
AZIMUTHAL = azim, SATELLITE = satel, $
SINUSOIDAL = sinu, AITOFF = aitoff, $
latdel = latdel, londel = londel, limit = limit, $
Sat_p = Sat_p, $
title = title, noborder = noborder, $
noerase = noerase, label = label, $
glinestyle = glinestyle, glinethick=glinethick, $
mlinestyle=mlinestyle, mlinethick=mlinethick, $
color = color, con_color = con_color, $
continents = continents, grid = grid, lonlab = lonlab,$
latlab = latlab, lonalign = lonalign, $
latalign = latalign, charsize = charsize,hires=hires
OPTIONAL INPUT:
P0lat--- For all but Lambert's conformal conic projection
with two standard parallels, P0lat should be set
to the latitude of the point on the earth's surface
to be mapped to the center of the projection plane.
If the projection type is sinusoidal, P0lat must be
0. -90 <= P0lat <= 90. If P0lat is not set, the
default value is 0. If the user has selected
Lambert's conformal conic projection with two
standard parallels, P0lat should be set to the
latitude in degrees of one of the parallels.
If not both P0lat and P0lon are defined, P0lat is
20 by default.
P0lon--- For all but Lambert's conformal conic projection with
two standard parallels, P0lon should be set
by the user to the longitude of the point on the
earth's surface to be mapped to the center of
the map projection. -180 <= P0lon <= 180. If P0lon
is not set, the default value is zero.
Rot----- The user should set the argument Rot to the angle
through which the North direction should be
rotated around the line L between the earth's center
and the point (P0lat, P0lon). Rot is measured in
degrees with the positive direction being clockwise
rotation around L. Default value is 0.
KEYWORDS:
Advance = if set, advance to the next frame, when finished,
when there are multiple plots on the screen.
Azimuthal = azimuthal equidistant projection
Conic = Conic projection
Cylindrical = cylindrcal equidistant projection
Gnomic = gnomonic projection
Lambert = Lambert's equal area projection
Mercator = Mercator's projection
Mollweide = Mollweide type projection
Orthographic = Orthographic projection
Satellite = Satellite (General perspective) projection
Sinusoidal = sinsoidal projection
Stereographic = stereographic projection
Aitoff = Aitoff's projection
charsize = size of characters in labels.
Color = color of the map boundary.
con_color = color of continents.
Continents = flag to signal that continental boundaries
should be drawn.
Glinestyle = linestyle of gridlines. (default = 1 = dotted)
Glinethick = thickness of gridlines. (default = 1 = normal)
Grid = flag to signal that gridlines should be drawn.
Horizon = if set, draw the horizon (limb) around the map.
Isotropic = if set, map will be made isotropic and
X and Y will have a 1:1 aspect ratio.
Label = flag to signal labeling of parallels and
meridians in the grid.
latalign = the aligment of the text baseline for
latitude labels. A value of 0.0 left justifies
the label, 1.0 right justifies it and
0.5 centers. The default value is .5.
Latdel = if set, spacing of parallels drawn on grid.
Default is 10 < (latmin - latmax) / 10).
LatLab = if set, longitude at which to place latitude
labels. Default is longitude of center.
Limit = A four or eight element vector.
If a four element vector, [Latmin, Lonmin, Latmax,
Lonmax] specifying the boundaries of the region
to be mapped. (Latmin, Lonmin) and (Latmax,
Lonmax) are the latitudes and longitudes of
two diagonal points on the boundary with
Latmin < Latmax and Lonmin < Lonmax.
For maps that cross the international dateline,
specify west longitudes as angles between
180 and 360.
If an eight element vector: [ lat0, lon0,
lat1, lon1, lat2, lon2, lat3, lon3] specify
four points on the map which give, respectively,
the location of a point on the left edge,
top edge, right edge, and bottom edge of
the map extent.
lonalign = the aligment of the text baseline for
longitude labels. A value of 0.0 left justifies
the label, 1.0 right justifies it and
0.5 centers it. Default value is .5.
Londel = if set, spacing of meridians drawn on grid.
Y axis, and the screen border
LonLab = if set, latitude at which to place longitude
labels. Default is longitude of center.
Mlinethick = thickness of continental boundaries. Default is 1.
Mlinestyle = linestyle of continental boundaries. Default is
0 = normal.
Noborder = if set, no border is drawn around the map.
Noerase = flag to signal that map_set should not erase the
current plot window. Default is to erase.
Position = Optional POSITION keyword for PLOT to specify the
location of the map in the drawing area. See manual.
Sat_p = an three element array of additional parameters
required by the satellite projection. The parameters
are: [ P, omega, gamma], where: P = distance of
viewpoint from center of globe, in units of the
globe's radius (P may be negative).
Gamma = rotation of
projection plane clockwise from north.
Omega = downward tilt of the
viewing plane in degrees. The
projection plane is first rotated gamma degrees
clockwise from north, and then tilted down
omega degrees. If both gamma and omega are zero,
a Vertical Perspective projection results.
T3D = 1 to use the existing 3D transformation, 0
or omitted for normal.
Title = Title of plot to be centered over plot window.
XMargin = if set, a two element vector that specifies
in character units the vertical margin between
the map and the screen border.
YMargin = if set, a two element vector that specifies
in character units the horizontal margin between
the map and the screen border.
Usa = If set draw the state boundries
zvalue = This keyword goes with T3D and specifies
the height of the mapping plane.
whole_map = in some cases where the limit is small, the gridlines
will not cover the whole map. This keyword can be
specified to eliminate that problem.
hires = Use the High Resolution CIA database for
drawing the continents. Use map_continents to
get the rivers, coasts, & boundaries
Modification history:
Written, Ann Bateson, 1991
SMR, 10-'91 Added a check for additional satelite parameters
when /SATELITE is set.
UCSB, ESRG,5-92 Added USA flag to check and map state boundries
DMS, 6-92 Fixed bug that incorrectly printed grid values with
small lat/lon ranges.
DMS, 8-92 Added 8 element lat/lon keyword, fixed problems
with Satellite, conics with 1 std parallel,
smaller and/or wierd maps
DMS, 3-93 Extended axes by a fudge factor, improved labelling.
JIY, 4-93 Added ZVALUE keyword to work with T3D.
Added NO_GRID keyword to MAP_GRID for displaying
labels only.
Added WHOLE_MAP keyword to make the gridlines cover
the entire map area when the limit is small
COLOR now works with map border and labels.
KDB, 10-93 Fixed bug that would cause divide by zero errors
when P0lat was small and Rot equal to 0.0.
KDB, 5-94 Removed FONT=0 from plot calls. All vector fonts
can now be used. Font selection now depends on
the value of !p.font
DMS, 6-94 Added HORIZON and ISOTROPIC keywords. Cleaned
up a lot of logic. Limits for maps of the entire
globe are done more cleanly and a lot quicker.
MWR, 12-94 Automatically create a window if !D.WINDOW=-1.
Calculations for [XY]MARGIN depend on valid !D values.
SVP, 2-95 Changed to CIA World Maps, added HIRES KEYWORD
Also added Rivers, Coasts, Polygons, and Countries
Thanks Thomas.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/map_set.pro)
NAME:
MD_TEST
PURPOSE:
This function tests the hypothesis that a sample population
is random against the hypothesis that it is not random. The
result is a two-element vector containing the nearly-normal
test statistic Z and the one-tailed probability of obtaining
a value of Z or greater. This test is often refered to as the
Median Delta Test.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = MD_test(X)
INPUTS:
X: An n-element vector of type integer, float or double.
KEYWORD PARAMETERS:
ABOVE: Use this keyword to specify a named variable which returns
the number of sample population values greater than the
median of X.
BELOW: Use this keyword to specify a named variable which returns
the number of sample population values less than the
median of X.
MDC: Use this keyword to specify a named variable which returns
the number of Median Delta Clusters; sequencial values of
X above and below the median.
EXAMPLE:
Define a sample population.
x = [2.00, 0.90, -1.44, -0.88, -0.24, 0.83, -0.84, -0.74, 0.99, $
-0.82, -0.59, -1.88, -1.96, 0.77, -1.89, -0.56, -0.62, -0.36, $
-1.01, -1.36]
Test the hypothesis that X represents a random population against the
hypothesis that it does not represent a random population at the 0.05
significance level.
result = md_test(x, mdc = mdc)
The result should be the 2-element vector:
[0.722745, 0.234918]
The computed probability (0.234918) is greater than the 0.05
significance level and therefore we do not reject the hypothesis
that X represents a random population.
PROCEDURE:
MD_TEST computes the nonparametric Median Delta Test. Each sample
in the population is tagged with either a 1 or a 0 depending on
whether it is above or below the population median. Samples that
are equal to the median are removed and the population size is
corresponding reduced. This test is an extension of the Runs Test
for Randomness.
REFERENCE:
APPLIED NONPARAMETRIC STATISTICAL METHODS
Peter Sprent
ISBN 0-412-30610-7
MODIFICATION HISTORY:
Written by: GGS, RSI, November 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/md_test.pro)
NAME:
MESH_OBJ
PURPOSE:
MESH_OBJ generates a polygon mesh (vertex list and polygon list) that
represent the desired primitive object. The available primitive
objects are: triangulated surface, rectangular surface, polar surface,
cylindrical surface, spherical surface, surface of extrusion, surface
of revolution, and ruled surface.
CATEGORY:
Graphics.
CALLING SEQUENCE:
MESH_OBJ, Type, Vertex_List, Polygon_List, Array1, Array2
INPUTS:
Type: An integer which specifies what type of object to create.
TYPE CODE: SURFACE TYPE:
---------- -------------
0 TRIANGULATED
1 RECTANGULAR
2 POLAR
3 CYLINDRICAL
4 SPHERICAL
5 EXTRUSION
6 REVOLUTION
7 RULED
ELSE none
Vertex_List:
On input, Vertex_List may be undefined. On output, it contains
the mesh vertices. Vertex_List and Polygon_List have the same
format as the lists returned by the SHADE_VOLUME procedure.
Polygon_List:
On input, Polygon_List may be undefined. On output, it contains
the mesh indexes.
Array1:
An array whose use depends on the type of object being created.
SURFACE TYPE: Array1 type
------------- --------------------------------------------
TRIANGULATED A (3, n) array containing random [x, y, z]
points to build a triangulated surface from.
The resulting polygon mesh will have n
vertices. When shading a triangulated mesh,
the shading array should have (n) elements.
RECTANGULAR A two dimensional (n, m) array containing
z values. The resulting polygon mesh will
have n*m vertices.
When shading a rectangular mesh, the shading
array should have (n, m) elements.
POLAR A two dimensional (n, m) array containing
z values. The resulting polygon mesh will
have n*m vertices. The n dimension of the
array is mapped to the polar angle, and the
m dimension is mapped to the polar radius.
When shading a polar mesh, the shading array
should have (n, m) elements.
CYLINDRICAL A two dimensional (n, m) array containing
radius values. The resulting polygon mesh
will have n*m vertices. The n dimension of
the array is mapped to the polar angle,
and the m dimension is mapped to the Z axis.
When shading a cylindrical mesh, the shading
array should have (n, m) elements.
SPHERICAL A two dimensional (n, m) array containing
radius values. The resulting polygon mesh
will have n*m vertices. The n dimension of
the array is mapped to the longitude (0.0 to
360.0 degrees), and the m dimension is
mapped to the latitude (-90.0 to +90.0
degrees).
When shading a spherical mesh, the shading
array should have (n, m) elements.
EXTRUSION A (3, n) array of connected 3-D points which
define the shape to extrude. The resulting
polygon mesh will have n*(steps+1) vertices
(where steps is the number of "segments" in
the extrusion). (See the P1 keyword).
If the order of the elements in Array1 is
reversed, then the polygon facing is
reversed.
When shading an extrusion mesh, the shading
array should have (n, steps+1) elements.
REVOLUTION A (3, n) array of connected 3-D points which
define the shape to revolve. The resulting
polygon mesh will have n*((steps>3)+1)
vertices (where steps is the number of
"steps" in the revolution). (See the P1
keyword). If the order of the elements in
Array1 is reversed, then the polygon facing
is reversed.
When shading a revolution mesh, the shading
array should have (n, (steps>3)+1) elements.
RULED A (3, n) array of connected 3-D points which
define the shape of the first ruled vector.
The optional (3, m) Array2 parameter defines
the shape of the second ruled vector. The
resulting polygon mesh will have
(n>m)*(steps+1) vertices (where steps is the
number of intermediate "steps"). (See the P1
keyword).
When shading a ruled mesh, the shading
array should have (n>m, steps+1) elements.
OPTIONAL INPUTS:
Array2:
If the object type is 7 (Ruled Surface) then Array2 is a (3, m)
array containing the 3-D points which define the second ruled
vector. If Array2 has fewer elements than Array1 then Array2 is
processed with CONGRID to give it the same number of elements
as Array1. If Array1 has fewer elements than Array2 then Array1
is processed with CONGRID to give it the same number of
elements as Array2.
Array2 MUST be supplied if the object type is 7. Otherwise,
Array2 is ignored.
KEYWORD PARAMETERS:
P1 - P5:
The meaning of the keywords P1 through P5 vary depending upon
the object type.
SURFACE TYPE: Keywords
------------- --------------------------------------------
TRIANGULATED P1, P2, P3, P4, and P5 are ignored.
RECTANGULAR If Array1 is an (n, m) array, and if P1 has
n elements, then the values contained in
P1 are the X coordinates for each column of
vertices. Otherwise, FINDGEN(n) is used for
the X coordinates. If P2 has m elements,
then the values contained in P2 are the Y
coordinates for each row of vertices.
Otherwise, FINDGEN(m) is used for the Y
coordinates. The polygon facing is reversed
if the order of either P1 or P2 (but not
both) is reversed.
P3, P4, and P5 are ignored.
POLAR P1 specifies the polar angle of the first
column of Array1 (the default is 0). P2
specifies the polar angle of the last column
of Array1 (the default is 2*PI). If P2 is
less than P1 then the polygon facing is
reversed. P3 specifies the radius of the
first row of Array1 (the default is 0). P4
specifies the radius of the last row of
Array1 (the default is m-1). If P4 is less
than P3 then the polygon facing is reversed.
P5 is ignored.
CYLINDRICAL P1 specifies the polar angle of the first
column of Array1 (the default is 0). P2
specifies the polar angle of the last column
of Array1 (the default is 2*PI). If P2 is
less than P1 then the polygon facing is
reversed. P3 specifies the Z coordinate of
the first row of Array1 (the default is 0).
P4 specifies the Z coordinate of the last
row of Array1 (the default is m-1). If P4 is
less than P3 then the polygon facing is
reversed. P5 is ignored.
SPHERICAL P1 specifies the longitude of the first
column of Array1 (the default is 0). P2
specifies the longitude of the last column
of Array1 (the default is 2*PI). IF P2 is
less than P1 then the polygon facing is
reversed. P3 specifies the latitude of the
first row of Array1 (the default is -PI/2).
P4 specifies the latitude of the last row of
Array1 (the default is +PI/2). If P4 is less
than P3 then the polygon facing is reversed.
P5 is ignored.
EXTRUSION P1 specifies the number of steps in the
extrusion (the default is 1). P2 is a three
element vector specifying the direction
(and length) of the extrusion (the default
is [0, 0, 1]). P3, P4, and P5 are ignored.
REVOLUTION P1 specifies the number of "facets" in the
revolution (the default is 3). If P1 is less
than 3 then 3 is used. P2 is a three element
vector specifying a point that the rotation
vector passes through (the default is
[0, 0, 0]). P3 is a three element vector
specifying the direction of the rotation
vector (the default is [0, 0, 1]). P4
specifies the starting angle for the
revolution (the default is 0). P5 specifies
the ending angle for the revolution (the
default is 2*PI). If P5 is less than P4 then
the polygon facing is reversed.
RULED P1 specifies the number of "steps" in the
ruling (the default is 1).
P2, P3, P4, and P5 are ignored.
DEGREES: If set, then the input parameters are in degrees
(where applicable). Otherwise, the angles are in
radians.
EXAMPLE:
; Create a 48x64 cylinder with a constant radius of 0.25.
MESH_OBJ, 3, Vertex_List, Polygon_List, Replicate(0.25, 48, 64), $
P4=0.5
; Transform the vertices.
T3d, /Reset
T3d, Rotate=[0.0, 30.0, 0.0]
T3d, Rotate=[0.0, 0.0, 40.0]
T3d, Translate=[0.25, 0.25, 0.25]
Vertex_List = Vert_T3d(Vertex_List)
; Create the window and view.
Window, 0, Xsize=512, Ysize=512
Create_View, Winx=512, Winy=512
; Render the mesh.
Set_Shading, Light=[-0.5, 0.5, 2.0], Reject=0
Tvscl, Polyshade(Vertex_List, Polygon_List, /Normal)
; Create a cone (surface of revolution).
MESH_OBJ, 6, Vertex_List, Polygon_List, $
[[0.75, 0.0, 0.25], [0.5, 0.0, 0.75]], P1=16, P2=[0.5, 0.0, 0.0]
; Create the window and view.
Window, 0, Xsize=512, Ysize=512
Create_View, Winx=512, Winy=512, Ax=30.0, Ay=(140.0), Zoom=0.5
; Render the mesh.
Set_Shading, Light=[-0.5, 0.5, 2.0], Reject=0
Tvscl, Polyshade(Vertex_List, Polygon_List, /Data, /T3d)
MODIFICATION HISTORY:
Written by: Daniel Carr, Thu Mar 31 19:16:43 MST 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/mesh_obj.pro)
NAME: MIN_CURVE_SURF PURPOSE: This function Interpolates a regularly- or irregularly-gridded set of points with either a minimum curvature surface or a thin-plate-spline surface. CATEGORY: Mathematical functions, Interpolation, Surface Fitting CALLING SEQUENCE: Result = MIN_CURVE_SURF(Z [, X, Y]) INPUTS: X, Y, Z: arrays containing the X, Y, and Z coordinates of the data points on the surface. Points need not be regularly gridded. For regularly gridded input data, X and Y are not used: the grid spacing is specified via the XGRID and YGRID (or XVALUES and YVALUES) keywords, and Z must be a two dimensional array. For irregular grids, all three parameters must be present and have the same number of elements. KEYWORD PARAMETERS: TPS: If set, use the thin-plate-spline method, otherwise use the minimum curvature surface method. Input grid description: REGULAR: if set, the Z parameter is a two dimensional array of dimensions (N,M), containing measurements over a regular grid. If any of XGRID, YGRID, XVALUES, YVALUES are specified, REGULAR is implied. REGULAR is also implied if there is only one parameter, Z. If REGULAR is set, and no grid (_VALUE or _GRID) specifications are present, the respective grid is set to (0, 1, 2, ...). XGRID: contains a two element array, [xstart, xspacing], defining the input grid in the X direction. Do not specify both XGRID and XVALUES. XVALUES: if present, XVALUES(i) contains the X location of Z(i,j). XVALUES must be dimensioned with N elements. YGRID: contains a two element array, [ystart, yspacing], defining the input grid in the Y direction. Do not specify both YGRID and YVALUES. YVALUES: if present, YVALUES(i) contains the Y location of Z(i,j). YVALUES must be dimensioned with N elements. Output grid description: GS: If present, GS must be a two-element vector [XS, YS], where XS is the horizontal spacing between grid points and YS is the vertical spacing. The default is based on the extents of X and Y. If the grid starts at X value Xmin and ends at Xmax, then the default horizontal spacing is (Xmax - Xmin)/(NX-1). YS is computed in the same way. The default grid size, if neither NX or NY are specified, is 26 by 26. BOUNDS: If present, BOUNDS must be a four element array containing the grid limits in X and Y of the output grid: [Xmin, Ymin, Xmax, Ymax]. If not specified, the grid limits are set to the extent of X and Y. NX: The output grid size in the X direction. NX need not be specified if the size can be inferred from GS and BOUNDS. The default value is 26. NY: The output grid size in the Y direction. See NX. XOUT: If present, XOUT must be a vector containing the output grid X values. If this parameter is supplied, GS, BOUNDS, and NX are ignored for the X output grid. Use this parameter to specify irregular spaced output grids. YOUT: If present, YOUT must be a vector containing the output grid Y values. If this parameter is supplied, GS, BOUNDS, and NY are ignored for the Y output grid. Use this parameter to specify irregular spaced output grids. XPOUT: If present, the arrays XPOUT and YPOUT contain the X and Y YPOUT: values for the output points. With these keywords, the output grid need not be regular, and all other output grid parameters are ignored. XPOUT and YPOUT must have the same number of points, which is also the number of points returned in the result. OUTPUTS: This function returns a two-dimensional floating point array containing the interpolated surface, sampled at the grid points. RESTRICTIONS: The accuracy of this function is limited by the single precision floating point accuracy of the machine. SAMPLE EXECUTION TIMES (measured on a Sun IPX) # of input points # of output points Seconds 16 676 0.19 32 676 0.42 64 676 1.27 128 676 4.84 256 676 24.6 64 256 1.12 64 1024 1.50 64 4096 1.97 64 16384 3.32 PROCEDURE: A minimum curvature spline surface is fitted to the data points described by X, Y, and Z. The basis function: C(x0,x1, y0,y1) = d^2 log(d^k), where d is the distance between (x0,y0), (x1,y1), is used, as described by Franke, R., "Smooth interpolation of scattered data by local thin plate splines," Computers Math With Applic., v.8, no. 4, p. 273-281, 1982. k = 1 for minimum curvature surface, and 2 for Thin Plate Splines. For N data points, a system of N+3 simultaneous equations are solved for the coefficients of the surface. For any interpolation point, the interpolated value is: F(x,y) = b(0) + b(1)*x + b(2)*y + Sum(a(i)*C(X(i),x,Y(i),y)) The results obtained the thin plate spline (TPS) or the minimum curvature surface (MCS) methods are very similar. The only difference is in the basis functions: TPS uses d^2*alog(d^2), and MCS uses d^2*alog(d), where d is the distance from point (x(i),y(i)). EXAMPLES: Example 1: Irregularly gridded cases Make a random set of points that lie on a gaussian: n = 15 ;# random points x = RANDOMU(seed, n) y = RANDOMU(seed, n) z = exp(-2 * ((x-.5)^2 + (y-.5)^2)) ;The gaussian get a 26 by 26 grid over the rectangle bounding x and y: r = min_curve_surf(z, x, y) ;Get the surface. Or: get a surface over the unit square, with spacing of 0.05: r = min_curve_surf(z, x, y, GS=[0.05, 0.05], BOUNDS=[0,0,1,1]) Or: get a 10 by 10 surface over the rectangle bounding x and y: r = min_curve_surf(z, x, y, NX=10, NY=10) Example 2: Regularly gridded cases Make some random data z = randomu(seed, 5, 6) interpolate to a 26 x 26 grid: CONTOUR, min_curve_surf(z, /REGULAR) MODIFICATION HISTORY: DMS, RSI, March, 1993. Written. DMS, RSI, July, 1993. Added XOUT and YOUT, XPOUT and YPOUT.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/min_curve_surf.pro)
NAME:
MK_HTML_HELP
PURPOSE:
Given a list of IDL procedure files (.PRO), VMS text library
files (.TLB), or directories that contain such files, this procedure
generates a file in the HTML format that contains the documentation
for those routines that contain a DOC_LIBRARY style documentation
template. The output file is compatible with World Wide Web browsers.
CATEGORY:
Help, documentation.
CALLING SEQUENCE:
MK_HTML_HELP, Sources, Outfile
INPUTS:
Sources: A string or string array containing the name(s) of the
.pro or .tlb files (or the names of directories containing
such files) for which help is desired. If a source file is
a VMS text library, it must include the .TLB file extension.
If a source file is an IDL procedure, it must include the .PRO
file extension. All other source files are assumed to be
directories.
Outfile: The name of the output file which will be generated.
KEYWORDS:
TITLE: If present, a string which supplies the name that
should appear as the Document Title for the help.
VERBOSE: Normally, MK_HTML_HELP does its work silently.
Setting this keyword to a non-zero value causes the procedure
to issue informational messages that indicate what it
is currently doing. !QUIET must be 0 for these messages
to appear.
STRICT: If this keyword is set to a non-zero value, MK_HTML_HELP will
adhere strictly to the HTML format by scanning the
the document headers for characters that are reserved in
HTML (<,>,&,"). These are then converted to the appropriate
HTML syntax in the output file. By default, this keyword
is set to zero (to allow for faster processing).
COMMON BLOCKS:
None.
SIDE EFFECTS:
A help file with the name given by the Outfile argument is
created.
RESTRICTIONS:
The following rules must be followed in formatting the .pro
files that are to be searched.
(a) The first line of the documentation block contains
only the characters ";+", starting in column 1.
(b) There must be a line which contains the string "NAME:",
which is immediately followed by a line containing the
name of the procedure or function being described in
that documentation block. If this NAME field is not
present, the name of the source file will be used.
(c) The last line of the documentation block contains
only the characters ";-", starting in column 1.
(d) Every other line in the documentation block contains
a ";" in column 1.
Note that a single .pro file can contain multiple procedures and/or
functions, each with their own documentation blocks. If it is desired
to have "invisible" routines in a file, i.e. routines which are only
for internal use and should not appear in the help file, simply leave
out the ";+" and ";-" lines in the documentation block for those
routines.
No reformatting of the documentation is done.
MODIFICATION HISTORY:
July 5, 1995, DD, RSI. Original version.
July 13, 1995, Mark Rivers, University of Chicago. Added support for
multiple source directories and multiple documentation
headers per .pro file.
July 17, 1995, DD, RSI. Added code to alphabetize the subjects;
At the end of each description block in the HTML file,
added a reference to the source .pro file.
July 18, 1995, DD, RSI. Added STRICT keyword to handle angle brackets.
July 19, 1995, DD, RSI. Updated STRICT to handle & and ".
Changed calling sequence to accept .pro filenames, .tlb
text librarie names, and/or directory names.
Added code to set default subject to name of file if NAME
field is not present in the doc header.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/mk_html_help.pro)
NAME:
MK_LIBRARY_HELP
PURPOSE:
Given a directory or a VMS text library containing IDL user library
procedures, this procedure generates a file in the IDL help format
that contains the documentation for those routines that contain
a DOC_LIBRARY style documentation template. The output file is
compatible with the IDL "?" command.
A common problem encountered with the DOC_LIBRARY user library
procedure is that the user needs to know what topic to ask for
help on before anything is possible. The XDL widget library
procedure is one solution to this "chicken and egg" problem.
The MK_LIBRARY_HELP procedure offers another solution.
CATEGORY:
Help, documentation.
CALLING SEQUENCE:
MK_LIBRARY_HELP, Source, Outfile
INPUTS:
SOURCE: The directory or VMS text library containing the
.pro files for which help is desired. If SOURCE is
a VMS text library, it must include the ".TLB" file
extension, as this is what MK_LIBRARY_HELP uses to
tell the difference.
OUTFILE: The name of the output file which will be generated.
If you place this file in the help subdirectory of the
IDL distribution, and if it has a ".help" extension, then
the IDL ? command will find the file and offer it as one
of the availible help categories. Note that it uses the
name of the file as the name of the topic.
KEYWORDS:
TITLE: If present, a string which supplies the name that
should appear on the topic button for this file
in the online help. This title is only used on
systems that allow very short file names (i.e. MS DOS),
so it won't always have a visible effect. However,
it should be used for the broadest compatibility. If
a title is not specified, IDL on short name systems
will use a trucated copy of the file name.
VERBOSE: Normally, MK_LIBRARY_HELP does its work silently.
Setting this keyword to a non-zero value causes the procedure
to issue informational messages that indicate what it
is currently doing.
OUTPUTS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
A help file with the name given by the OUTFILE argument is
created.
RESTRICTIONS:
If you put the resulting file into the "help" subdirectory of
the IDL distribution, it will be overwritten when you install a
new release of IDL. To avoid this problem, keep a backup copy of
your created help files in another directory and move them into
the new distribution.
Since this routine copies the documentation block from the
functions and procedures, subsequent changes will not be
reflected in the help file unless you run MK_LIBRARY_HELP
again.
The following rules must be followed in formating the .pro
files which are searched.
(a) The first line of the documentation block contains
only the characters ";+", starting in column 1.
(b) The last line of the documentation block contains
only the characters ";-", starting in column 1.
(c) Every other line in the documentation block contains
a ";" in column 1.
No reformatting of the documentation is done.
MODIFICATION HISTORY:
17 April, 1991, Written by AB, RSI.
1 December 1992, Reorganized internally. No functionality change.
31 December 1992, Added the TITLE keyword as part of the effort
towards releasing the Microsoft Windows version of IDL.
20 January 1993, Corrected for VMS, W. Landsman HSTX
17 March 1993, Corrected for MSDOS and VMS, AB.
13 January 1994, Added the VERSION attribute and modified format to
accomodate extended identifier names (the old format was
limited to 15 characters.
7 July 1995, Added support for MacOS, DD, RSI.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/mk_library_help.pro)
NAME: MODIFYCT PURPOSE: Update the distribution color table file "colors1.tbl" or the user-supplied file with a new table. CATEGORY: Z4 - Image processing, color table manipulation. CALLING SEQUENCE: MODIFYCT, Itab, Name, R, G, B INPUTS: Itab: The table to be updated, numbered from 0 to 255. If the table entry is greater than the next available location in the table, then the entry will be added to the table in the available location rather than the index specified by Itab. On return, Itab will contain the index for the location that was modified or extended. The table can be loaded with the IDL command: LOADCT, Itab. Name: A string up to 32 characters long that contains the name for the new color table. R: A 256-element vector that contains the values for the red color gun. G: A 256-element vector that contains the values for the green color gun. B: A 256-element vector that contains the values for the blue color gun. KEYWORD PARAMETERS: FILE: If this keyword is set, the file by the given name is used instead of the file colors1.tbl in the IDL directory. This allows multiple IDL users to have their own color table file. The file specified must be a copy of the colors1.tbl file. The file must exist. OUTPUTS: Itab: The index of the entry which was updated, 0 to 255. This may be different from the input value of Itab if the input value was greater than the next available location in the table. If this was the case the entry was added to the table in the next available location instead of leaving a gap in the table. COMMON BLOCKS: None. SIDE EFFECTS: The distribution file "colors.tbl1" or the user-supplied file is modified with the new table. PROCEDURE: Straightforward. MODIFICATION HISTORY: Aug, 1982, DMS, Written. Unix version, 1987, DMS. ACY, 9/92, Update for new color table structure, Add FILE keyword. Allow extending table. WSO, 1/95, Updated for new directory structure
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/modifyct.pro)
NAME:
MOMENT
PURPOSE:
This function computes the mean, variance, skewness and kurtosis
of an n-element vector.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = Moment(X)
INPUTS:
X: An n-element vector of type integer, float or double.
KEYWORD PARAMETERS:
MDEV: Use this keyword to specify a named variable which returns
the mean absolute deviation of X.
SDEV: Use this keyword to specify a named variable which returns
the standard deviation of X.
EXAMPLE:
Define the n-element vector of sample data.
x = [65, 63, 67, 64, 68, 62, 70, 66, 68, 67, 69, 71, 66, 65, 70]
Compute the mean, variance, skewness and kurtosis.
result = moment(x)
The result should be the 4-element vector:
[66.7333, 7.06667, -0.0942851, -1.18258]
PROCEDURE:
MOMENT computes the first four "moments" about the mean of an
n-element vector of sample data. The computational formulas
are given in the Univariate Statistics section of the Mathematics
Guide.
REFERENCE:
APPLIED STATISTICS (third edition)
J. Neter, W. Wasserman, G.A. Whitmore
ISBN 0-205-10328-6
MODIFICATION HISTORY:
Written by: GGS, RSI, August 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/moment.pro)
NAME:
MP_BASIC
PURPOSE:
Provide online documentation for IDL topics. The style
is a cross between Unix man pages and VMS online help. The
help is organized in a two level hierarchy --- Level 1 is the
global subject, and Level 2 supplies help on subjects within
each global subject. If !D.WINDOW is not -1, (window system in use)
the mouse is used to prompt for subjects, otherwise, the normal tty
interface is used.
THIS ROUTINE IS TO BE CALLED ONLY BY MAN_PROC. Users can obtain
online help by using the "?" command.
CATEGORY:
Help, documentation.
CALLING SEQUENCE:
MP_BASIC [, Request]
INPUTS:
REQUEST: A scalar string containing the item on which help is desired.
This string can contain 1 or 2 (whitespace separated) words.
The first word is taken as the global topic and the second
as the topic within the scope of the first. The procedure
prompts for missing words.
OUTPUTS:
Help text is sent to the standard output.
COMMON BLOCKS:
None.
RESTRICTIONS:
The help text is derived from the LaTeX files used to produce
the reference manual. However, it is not possible to produce
exactly the same output as found in the manual due to limitations
of text oriented terminals. The text used is therefore considerably
abbreviated. Always check the manual if the online help is
insufficient.
MODIFICATION HISTORY:
3 November 1988, AB
January, 1989, AB
Added ambiguity resolution, ability to handle multiple levels,
and support for mouse.
SNG, December, 1990 Added support for MS-DOS.
3 January 1991, AB
Renamed from MAN_PROC to make room for the widget version.
Bobby Candey, Atlantic Research 30 January 1991
Added looping in VMS version to extract multiple "]" from filenames
31 December 1992, AB Modified to ignore the optional %TITLE
line at the top of the file. There's no
reason to handle it, since this routine is
obsolete. The builtin online help system
*does* handle it.
11 February 1993, SMR Added support for the Mac Version
21 April 1993, AB, Added ability to use new !HELP_PATH system
variable to locate help files.
13 January 1994, AB Added ability to understand new version
2 help files with extended identifier names.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/mp_basic.pro)
NAME:
MP_WIDGETS
PURPOSE:
Provide a graphical user interface to the online documentation.
The topic is selected by pressing a button at the top.
Subtopics a displayed in a scrolling list on the left side. Pressing
a mouse button while pointing at a subtopic causes the information
on that topic to be displayed in the large text region on the right.
It is expected that this routine will only be called by MAN_PROC.
CATEGORY:
Help, documentation, widgets.
CALLING SEQUENCE:
MP_WIDGETS [, Request]
INPUTS:
Request: A scalar string containing the item on which help is desired.
This string can contain 1 or two (whitespace separated) words.
The first word is taken as the global topic and the second
as the topic within the scope of the first.
OUTPUTS:
None. A widget interface is used to allow reading the help text.
COMMON BLOCKS:
MPW_COM: This common block is private to MP_WIDGETS, and
should not be referenced by other modules.
RESTRICTIONS:
The basic version of the help facility (MP_BASIC) can accept
ambiguous requests, and if a request maches more than a single
subtopic, they are all shown. This version can also accept
ambiguous requests, but only the first subtopic matched is shown.
This feature is not as important as it was in MP_BASIC because the
widget interface allows multiple subjects to be viewed easily.
This routine uses a COMMON block to keep its internal state, so only
one copy of this routine can run at a time.
MODIFICATION HISTORY:
AB, August, 1990
28 December 1990 Rewritten to take advantages in changes to
the widget facility, to use XMANAGER, and to
accept the REQUEST argument.
31 December 1992 Modified to ignore the optional %TITLE
line at the top of the file. There's no
reason to handle it, since this routine is
obsolete. The builtin online help system
*does* handle it.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/mp_widgets.pro)
NAME: MULTI PURPOSE: Expand the current color table to wrap around N times. CATEGORY: Image display. CALLING SEQUENCE: MULTI, N INPUTS: N: The number of times the color table will wrap. This parameter does not need not be an integer. OUTPUTS: No explicit outputs, color tables are loaded. COMMON BLOCKS: COLORS, the IDL color table common block, contains current color tables, loaded by LOADCT, ADJCT, HLS, HSV, etc. SIDE EFFECTS: Color tables are loaded. RESTRICTIONS: One of the above procedures must have been called. PROCEDURE: Tables are expanded by a factor of n. EXAMPLE: Display an image, load color table 1, and make that color table "wrap around" 3 times. Enter: TVSCL, DIST(256) ;A simple image. LOADCT, 1 ;Load color table 1. MULTI, 3 ;See how the new color table affects ;the image. MODIFICATION HISTORY: DMS, May, 1984. Changed common, DMS, 4/87.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/multi.pro)
NAME:
M_CORRELATE
PURPOSE:
This function computes the multiple correlation coefficient of a
dependent variable and two or more independent variables.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = M_correlate(X, Y)
INPUTS:
X: An array of m-columns and n-rows of type integer, float or double
that specifies the independent variable data. The columns of this
two dimensional array correspond to the n-element vectors of
independent variable data.
Y: An n-element vector of type integer, float or double that
specifies the dependent variable data.
EXAMPLE:
Define the independent (X) and dependent (Y) data.
X = [[0.477121, 2.0, 13.0], $
[0.477121, 5.0, 6.0], $
[0.301030, 5.0, 9.0], $
[0.000000, 7.0, 5.5], $
[0.602060, 3.0, 7.0], $
[0.698970, 2.0, 9.5], $
[0.301030, 2.0, 17.0], $
[0.477121, 5.0, 12.5], $
[0.698970, 2.0, 13.5], $
[0.000000, 3.0, 12.5], $
[0.602060, 4.0, 13.0], $
[0.301030, 6.0, 7.5], $
[0.301030, 2.0, 7.5], $
[0.698970, 3.0, 12.0], $
[0.000000, 4.0, 14.0], $
[0.698970, 6.0, 11.5], $
[0.301030, 2.0, 15.0], $
[0.602060, 6.0, 8.5], $
[0.477121, 7.0, 14.5], $
[0.000000, 5.0, 9.5]]
Y = [97.682, 98.424, 101.435, 102.266, 97.067, 97.397, 99.481, $
99.613, 96.901, 100.152, 98.797, 100.796, 98.750, 97.991, $
100.007, 98.615, 100.225, 98.388, 98.937, 100.617]
Compute the multiple correlation of Y on the first column of X.
The result should be 0.798816
result = m_correlate(X(0,*), Y)
Compute the multiple correlation of Y on the first two columns of X.
The result should be 0.875872
result = m_correlate(X(0:1,*), Y)
Compute the multiple correlation of Y on all columns of X.
The result should be 0.877197
result = m_correlate(X, Y)
PROCEDURE:
M_CORRELATE uses relationships based upon partial correlation to
compute the multiple correlation coefficient of linear models with
two or more independent variables: y(x0, x1), y(x0, x1, ... , xn-1).
REFERENCE:
APPLIED STATISTICS (third edition)
J. Neter, W. Wasserman, G.A. Whitmore
ISBN 0-205-10328-6
MODIFICATION HISTORY:
Written by: GGS, RSI, July 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/m_correlate.pro)
NAME: NCDF_EXISTS PURPOSE: Test for the existence of the NetCDF library CATEGORY: File Formats CALLING SEQUENCE: Result = NCDF_EXISTS() INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: Returns TRUE (1) if the NetCDF data format library is supported Returns FALSE(0) if it is not. COMMON BLOCKS: NCDFTEST EXAMPLE: IF ncdf_exists() EQ 0 THEN Fail,"Library not supported on this machine" MODIFICATION HISTORY Written by: Joshua Goldstein, 12/8/92
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/ncdf_exists.pro)
NAME:
NORM
PURPOSE:
1) This function computes the Euclidean norm of a vector.
OR
2) This function computes the Infinity norm of an array.
CATEGORY:
Complex Linear Algebra.
CALLING SEQUENCE:
Result = NORM(A)
INPUTS:
A: An N-element real or complex vector.
An M by N real or complex array.
KEYWORD PARAMETERS:
DOUBLE: If set to a non-zero value, computations are done in
double precision arithmetic.
EXAMPLE:
1) Define an N-element complex vector (a).
a = [complex(1, 0), complex(2,-2), complex(-3,1)]
Compute the Euclidean norm of (a).
result = norm(a)
2) Define an M by N complex array (a).
a = [[complex(1, 0), complex(2,-2), complex(-3,1)], $
[complex(1,-2), complex(2, 2), complex(1, 0)]]
Compute the Infinity norm of the complex array (a).
result = norm(a)
PROCEDURE:
NORM.PRO computes the Euclidean norm of an N-element vector.
NORM.PRO computes the Infinity norm of an M by N array
REFERENCE:
ADVANCED ENGINEERING MATHEMATICS (seventh edition)
Erwin Kreyszig
ISBN 0-471-55380-8
MODIFICATION HISTORY:
Written by: GGS, RSI, April 1992
Modified: GGS, RSI, February 1994
Computes the Euclidean norm of an N-element vector.
Accepts complex inputs. Added DOUBLE keyword.
Modified: GGS, RSI, September 1994
Added support for double-precision complex inputs.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/norm.pro)
NAME: OPLOTERR PURPOSE: Overplot data points with accompanying error bars. CATEGORY: Plotting, 2-dimensional. CALLING SEQUENCE: OPLOTERR, [ X ,] Y , Err [, Psym ] INPUTS: Y: The array of Y values. Err: The array of error bar values. OPTIONAL INPUT PARAMETERS: X: An optional array of X values. The procedure checks whether or not the third parameter passed is a vector to decide if X was passed. If X is not passed, then INDGEN(Y) is assumed for the X values. PSYM: The plotting symbol to use (default = +7). COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Arrays cannot be of type string. There must be enough points to plot. PROCEDURE: A plot of X versus Y with error bars drawn from Y - ERR to Y + ERR is written to the output device over any plot already there. MODIFICATION HISTORY: William Thompson Applied Research Corporation July, 1986 8201 Corporate Drive Landover, MD 20785
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/oploterr.pro)
$Id: pdmenu_alloc.pro,v 1.9 1995/01/20 19:41:01 tonyh Exp $
WidPdmenu
Widget Pull Down Menu class library
Copyright (c) 1993, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
MODIFICATION HISTORY
Written by: Joshua Goldstein, 12/93
PDMENU_Icon
Return the pulldown menu toolbar icon
UNCTION PDMENU_Icon
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/pdmenu_alloc.pro)
NAME:
PICKFILE
PURPOSE:
This function allows the user to interactively pick a file. A file
selection tool with a graphical user interface is created. Files
can be selected from the current directory or other directories.
CATEGORY:
Widgets.
CALLING SEQUENCE:
Result = PICKFILE()
KEYWORD PARAMETERS:
FILE: A string value for setting the initial value of the
selection. Useful if there is a default file
GET_PATH: Set to a named variable. Returns the path at the
time of selection.
GROUP: The widget ID of the widget that calls PICKFILE. When this
ID is specified, a death of the caller results in the death of
the PICKFILE widget application.
READ: Set this keyword to make the title of the PICKFILE window
"Select File to Read".
WRITE: Set this keyword to make the title of the PICKFILE window
"Select File to Write".
PATH: The initial path to select files from. If this keyword is
not set, the current directory is used.
FILTER: A string value for filtering the files in the file list. This
keyword is used to reduce the number of files to choose from.
The user can modify the filter unless the FIX_FILTER keyword
is set. Example filter values might be "*.pro" or "*.dat".
FIX_FILTER: When this keyword is set, only files that satisfy the
filter can be selected. The user has no ability to modify
the filter and the filter is not shown.
TITLE: A scalar string to be used for the window title. If it is
not specified, the default title is "Select File"
NOCONFIRM: Return immediately upon selection of a file. The default
behavior is to display the selection and then return the
file when the user uses the "ok" button.
MUST_EXIST: When set, only files that actually exist can be selected.
OUTPUTS:
PICKFILE returns a string that contains the name of the file selected.
If no file is selected, PICKFILE returns a null string.
COMMON BLOCKS:
PICKER: COMMON block that maintains state for the widget.
SIDE EFFECTS:
This function initiates the XMANAGER if it is not already running.
RESTRICTIONS:
This routine is known to work on Suns (OPEN LOOK), MIPS, RS/6000,
DEC Ultrix, HP/700, VAX/VMS and SGI machines.
Only one instance of the PICKFILE widget can be running at one time.
PICKFILE does not recognize symbolic links to other files in UNIX.
PROCEDURE:
Create and register the widget and then exit, returning the filename
that was picked.
EXAMPLE:
Create a PICKFILE widget that lets users select only files with
the extensions 'pro' and 'dat'. Use the 'Select File to Read' title
and store the name of the selected file in the variable F. Enter:
F = PICKFILE(/READ, FILTER = '*.pro *.dat')
MODIFICATION HISTORY:
Written by: Steve Richards, April, 1991
July, 1991 Added a FILTER keyword to allow users
to select files with a given extension or
extensions.
August, 1991 Fixed bugs caused by differences between
spawned ls commands on different machines.
September, 1991 Made Myfindfile so only one pass was
necessary to find files and directories.
3/92 - ACY Corrected initialization of dirsave, change spawn
command to "ls -lL" and added case for links
add NOCONFIRM keyword for auto exiting on selection
8/92 - SMR Rewrote pickfile as a compound widget.
10/92 - SMR Fixed a bug where extremely large file namess didn't
show up properly in the file list or as return
values.
12/92 - JWG Add better machine dependency code
1/93 - JWG Added FILE, GET_PATH keywords.
1/93 - TAC Added Windows Common dialog pickfile code
2/93 - SMR Fixed the documentation example for multiple extensions
1/94 - KDB If directory had no execute permission on Unix
platforms, CD fails and causes error. Added check
for this. Increased spawn speed by using /sh for unix.
Added -a switch to ls so that all files can be found
on unix machines.
2/94 - KDB Values passed to CD cannot end in a '\' on DOS
platforms. Program would crash if the PATH keyword
was supplied a value that ended with a "\". Added
a check for this.
3/94 - BMH Deleted the reference here to OS_PICKFILE for the
Unix platforms and created an IDL routine to
to call the Mac and Windows specific OS_PICKFILE
routines. This solved the saving and restoring on
different platforms problem.
4/94 - KDB The vms call to lib$findfile in valid_dir was
commented out. This caused errors when path was
changed by user. Uncommented. In Valid_Dir, with
vms the type of directory specification was not
checked (directory can be a path or a filename):
Fixed this. In dirlist section of event handler,
a "[-]" would get trimmed to "" and cause error:
Fixed.
8/94 - ACY Change the spawn command in getdirs to send error
output to /dev/null.
12/94 - DJE Fix the FIX_FILTER option for the MacOS.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/pickfile.pro)
NAME: PLOTERR PURPOSE: Plot data points with accompanying error bars. (See also OPLOTERR.) CATEGORY: Plotting, two-dimensional. CALLING SEQUENCE: PLOTERR, [ X ,] Y , Err [, PSYM = Psym] [, TYPE = Type] INPUTS: X: The array of abcissae. Y: The array of Y values. Err: The array of error-bar values. OPTIONAL KEYWORD PARAMETERS: PSYM: The plotting symbol to use. The default is +7. ITYPE: The type of plot to be produced. The possible types are: ITYPE = 0 : X Linear - Y Linear (default) ITYPE = 1 : X Linear - Y Log ITYPE = 2 : X Log - Y Linear ITYPE = 3 : X Log - Y Log COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Arrays cannot be of type string. There must be enough points to plot. PROCEDURE: A plot of X versus Y with error bars drawn from Y - ERR to Y + ERR is written to the output device. MODIFICATION HISTORY: William Thompson Applied Research Corporation July, 1986 8201 Corporate Drive Landover, MD 20785 DMS, April, 1989 Modified for Unix.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/ploterr.pro)
NAME:
Plot_3dbox
PURPOSE:
This procedure plots data in a 3-dimensional box, with options
to have the data displayed on the walls surrounding the plot area.
CATEGORY:
Plotting, Three-dimensional
CALLING SEQUENCE:
Plot_3dbox, X, Y, Z
INPUTS:
X: A one dimensional array that contains the X coordinats
Y: A one dimensional array that contains the Y coordinates
Z: A one dimensional array that contains the Z coordinates
OPTIONAL INPUTS:
None.
KEYWORD PARAMETERS:
COLOR: The color for the Grid and Lines or the Color
for the box walls when the keyword SOLID_WALLS
is set.
BACKGROUND: The background color of the plot or the color
of the Grid and Plot data when the SOLID_WALLS
keyword is set.
XY_PLANE: Setting this keyword will cause the X and Y values
of the data to be plotted on the Z=0 axis plane.
XZ_PLANE: Setting this keyword will cause the X and Z values
of the data to be plotted on the Y=Ymax axis plane.
YZ_PLANE: Setting this keyword will cause the Y and Z values
of the data to be plotted on the X=Xmax axis plane.
SOLID_WALLS: Setting this keyword causes the axis "walls" of
the plot box to be filled with the value of COLOR.
PSYM: The plotting symbol that the data is draw with.
GRIDSTYLE: Set this keyword to the linestyle that will be
used in drawing the gridlines.
TITLE: Set this keyword to the Main plot title
XTITLE: Set this keyword to the X axis title.
YTITLE: Set this keyword to the Y axis title.
ZTITLE: Set this keyword to the Z axis title.
SUBTITLE: Set this keyword to the Sub-Title
LINESTYLE: The linestyle used to plot the data.
XYSTYLE: The linesytle used to draw the plot in the XY plane.
If this keyword is not set, the value of LINESTYLE
is used.
XZSTYLE: The linesytle used to draw the plot in the XZ plane.
If this keyword is not set, the value of LINESTYLE
is used.
YZSTYLE: The linesytle used to draw the plot in the YZ plane.
If this keyword is not set, the value of LINESTYLE
is used.
Surface All other keywords available to SURFACE are also
Keywords: used by this procedure.
OUTPUTS:
None.
OPTIONAL OUTPUTS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
Plotting on the current device is performed.
RESTRICTIONS:
None.
PROCEDURE:
Straightforward. Unrecognized keywords are passed to the SURFACE
procedure.
EXAMPLE:
Create some data that can be passed to Plot_3dbox
x = Replicate(5., 10)
x1 = cos(findgen(36)*10.*!dtor)*2.+5.
x=[x,x1,x]
y = findgen(56)
z = Replicate(5., 10)
z1 =sin(findgen(36)*10.*!dtor)*2.+5.
z=[z,z1,z]
; Plot this data in a "plot box"
Plot_3dbox, X, Y, Z, /XY_PLANE, /YZ_PLANE, /XZ_PLANE, $
/SOLID_WALLS, GRIDSTYLE=1, XYSTYLE=3, XZSTYLE=4, $
YZSTYLE=5, AZ=40, TITLE="Example Plot Box", $
Xtitle="X Coodinate", Ytitle="Y Coodinate", $
Ztitle="Z Coodinate", SubTitle="Sub Title", $
/YSTYLE, ZRANGE=[0,10], XRANGE=[0,10],Charsize=1.6
; Then to plot symbols on the locations of the above plot
plots, X, Y, Z, /T3D, PSYM=4, COLOR=!p.background
MODIFICATION HISTORY:
6/94 KDB, RSI - Initial Coding and Testing
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/plot_3dbox.pro)
NAME: PLOT_FIELD PURPOSE: This procedure plots a 2-dimensional field. CATEGORY: Plotting, two-dimensional. CALLING SEQUENCE: PLOT_FIELD, U, V INPUTS: U: The 2-dimensional array giving the field vector at each point in the U(X) direction. V: The 2-dimensional array giving the field vector at each point in the V(Y) direction. KEYWORD PARAMETERS: N: The number of arrows to draw. The default is 200. LENGTH: The length of the longest field vector expressed as a fraction of the plotting area. The default is 0.1. ASPECT: The aspect ratio of the plot (i.e., the ratio of the X size to Y size). The default is 1.0. TITLE: The title of plot. The default is "Velocity Field". OUTPUTS: No explicit outputs. SIDE EFFECTS: A new plot is drawn to the current output device. PROCEDURE: N random points are picked, and from each point a path is traced along the field. The length of the path is proportional to "LENGTH" and the field vector magnitude. EXAMPLE: X = FINDGEN(20, 20) ; Create array X Y = FINDGEN(20, 20)*3 ; Create array Y PLOT_FIELD, X, Y ; Create plot MODIFICATION HISTORY: Jan., 1988 Neal Hurlburt, University of Colorado.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/plot_field.pro)
NAME:
PNT_LINE
PURPOSE:
This function returns the perpendicular distance between the
point P0 and the line between points L0 and L1.
CATEGORY:
Geometry.
CALLING SEQUENCE:
Result = PNT_LINE(P0, L0, L1 [, Pl])
INPUTS:
P0: The location of the point. P0 may have 2 to N elements,
for N dimensions.
L0: One end-point of the line. L0 must have same number of
elements as P0.
L1: The other end-point of the line. L1 must have the same
number of elements as LO.
KEYWORD PARAMETERS:
INTERVAL: If set, and if the point on the line between L0
and L1 that is closest to PO is not within the
interval (L0, L1), causes the function to return
the distance from P0 to the closer of the two
endpoints L0 and L1.
OUTPUTS:
This function returns the distance from point P0 to the line
between L0 and L1, unless the closest point on the line is
not in the interval (L0, L1) and the keyword INTERVAL is set.
In this case, the function returns the distance between P0
and the closer of the two end-points.
OPTIONAL OUTPUTS:
Pl: The point on the line between L0 and L1 that is closest to P0.
Pl is not necessarily in the interval (L0, L1).
RESTRICTIONS:
This function is limited by the machine accuracy of single
precision floating point.
PROCEDURE:
Solve equations of perpendicular, etc.
EXAMPLE:
To print the distance between the point (2,3) and the line
from (-3,3) to (5,12), and also the location of the point on
the line closest to (2,3), enter the following command:
PRINT, PNT_LINE([2,3], [-3,3], [5,12], Pl), Pl
MODIFICATION HISTORY:
DMS, RSI, Jan, 1993. Written.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/pnt_line.pro)
NAME: POLAR_CONTOUR PURPOSE: Produce a contour plot from data in polar coordinates. Data may be in a regular or scattered grid. CATEGORY: Graphics. CALLING SEQUENCE: POLAR_CONTOUR, Z, Theta, R INPUTS: Z = data values. If regulary gridded, Z must have dimensions of (NTheta, NR). Theta = values of theta in radians. For the regular grid, Theta must have the same number of elements as the first dimension of Z. For the scattered grid, Theta must have the same number of elements as Z. R = values of radius. For the regular grid, R must have the same number of elements as the second dimension of Z. For the scattered grid, R must have the same number of elements as Z. KEYWORD PARAMETERS: Any of the keywords accepted by CONTOUR may be specified. In addition to: SHOW_TRIANGULATION = color. If set, the triangulation connecting the data points is overplotted in the designated color. OUTPUTS: A contour plot is produced. COMMON BLOCKS: None. SIDE EFFECTS: Plot is produced on the current graphics output device. RESTRICTIONS: None. PROCEDURE: The cartesian coordinates of each point are calculated. TRIANGULATE is called to grid the data into triangles. CONTOUR is called to produce the contours from the triangles. EXAMPLE: Example with regular grid: nr = 12 ;# of radii nt = 18 ;# of thetas r = findgen(nr) / (nr-1) ;Form r and Theta vectors theta = 2 * !pi * findgen(nt) / (nt-1) z = cos(theta*3) # (r-.5)^2 ;Fake function value tek_color Create filled contours: Polar_Contour, z, theta, r, /fill, c_color=[2,3,4,5] Example with random (scattered) grid: n = 200 r = randomu(seed, n) ;N random r's and Theta's theta = 2*!pi * randomu(seed, n) x = cos(theta) * r ;Make a function to plot y = sin(theta) * r z = x^2 - 2*y Polar_Contour, z, theta, r, Nlevels=10, xrange=[0,1], yrange=[0,1] MODIFICATION HISTORY: Written by: Your name here, Date. January, 1995. DMS, RSI.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/polar_contour.pro)
NAME: POLAR_SURFACE PURPOSE: This function interpolates a surface from polar coordinates (R, Theta, Z) to rectangular coordinates (X, Y, Z). CATEGORY: Gridding. CALLING SEQUENCE: Result = POLAR_SURFACE(Z, R, Theta) INPUTS: Z: An array containing the surface value at each point. If the data are regularly gridded (GRID=1) in R and Theta, Z is a two dimensional array, where Z(i,j) has a radius of R(i) and an azimuth of Theta(j). If GRID is not set, R(i) and Theta(i) contain the radius and azimuth of each Z(i). R: The radius. If GRID is set, Z(i,j) has a radius of R(i). If GRID is not set, R must have the same number of elements as Z, and contains the radius of each point. Theta: The azimuth, in radians. If GRID is set, Z(i,j) has an azimuth of Theta(j). If GRID is not set, Theta must have the same number of elements as Z, and contains the azimuth of each point. KEYWORD PARAMETERS: GRID: Set GRID to indicate that Z is regularly gridded in R and Theta. SPACING: A two element vector containing the desired grid spacing of the resulting array in X and Y. If omitted, the grid will be approximately 51 by 51. BOUNDS: A four element vector, [X0, Y0, X1, Y1], containing the limits of the XY grid of the resulting array. If omitted, the extent of input data sets the limits of the grid. QUINTIC: If set, the function uses quintic interpolation, which is slower but smoother than the default linear interpolation. MISSING: A value to use for areas within the grid but not within the convex hull of the data points. The default is 0.0. OUTPUTS: This function returns a two-dimensional array of the same type as Z. PROCEDURE: First, each data point is transformed to (X, Y, Z). Then the TRIANGULATE and TRIGRID procedures are used to interpolate the surface over the rectangular grid. EXAMPLE: r = findgen(50) / 50. ;Radius theta = findgen(50) * (2 * !pi / 50.) ;Theta z = r # sin(theta) ;Make a function (tilted circle) SURFACE, POLAR_SURFACE(z, r, theta, /GRID) ;Show it MODIFICATION HISTORY: DMS Sept, 1992 Written
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/polar_surface.pro)
NAME: POLY PURPOSE: Evaluate a polynomial function of a variable. CATEGORY: C1 - Operations on polynomials. CALLING SEQUENCE: Result = POLY(X,C) INPUTS: X: The variable. This value can be a scalar, vector or array. C: The vector of polynomial coefficients. The degree of of the polynomial is N_ELEMENTS(C) - 1. OUTPUTS: POLY returns a result equal to: C(0) + c(1) * X + c(2)*x^2 + ... COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: Straightforward. MODIFICATION HISTORY: DMS, Written, January, 1983.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/poly.pro)
NAME:
POLYFITW
PURPOSE:
Perform a least-square polynomial fit with optional error estimates.
CATEGORY:
Curve fitting.
CALLING SEQUENCE:
Result = POLYFITW(X, Y, W, NDegree [, Yfit, Yband, Sigma, A])
INPUTS:
X: The independent variable vector.
Y: The dependent variable vector. This vector should be the same
length as X.
W: The vector of weights. This vector should be same length as
X and Y.
NDegree: The degree of polynomial to fit.
OUTPUTS:
POLYFITW returns a vector of coefficients of length NDegree+1.
OPTIONAL OUTPUT PARAMETERS:
Yfit: The vector of calculated Y's. Has an error of + or - Yband.
Yband: Error estimate for each point = 1 sigma.
Sigma: The standard deviation in Y units.
A: Correlation matrix of the coefficients.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
MODIFICATION HISTORY:
Written by: George Lawrence, LASP, University of Colorado,
December, 1981.
Adapted to VAX IDL by: David Stern, Jan, 1982.
Weights added, April, 1987, G. Lawrence
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/polyfitw.pro)
NAME: POLYWARP PURPOSE: Perform polynomial spatial warping. Using least squares estimation, determine the coefficients Kx(i,j) and Ky(i,j) of the polynomial functions: Xi = sum over i and j of: Kx(i,j) * Xo^j * Yo^i Yi = sum over i and j of: Ky(i,j) * Xo^j * Yo^i Kx and Ky can be used as inputs P and Q to the built-in function POLY_2D. CATEGORY: Image processing. CALLING SEQUENCE: POLYWARP, Xi, Yi, Xo, Yo, Degree, Kx, Ky INPUTS: Xi, Yi: The vectors of x,y coordinates to be fit as a function of Xo and Yo. Xo, Yo: The vectors of x,y independent coordinates. These vectors must have the same number of elements as Xi and Yi. Degree: The degree of the fit. The number of coordinate pairs must be greater than or equal to (Degree+1)^2. OUTPUTS: Kx: The array of coefficients for Xi as a function of (xo,yo). This parameter is returned as a (Degree+1) by (Degree+1) element array. Ky: The array of coefficients for yi. This parameter is returned as a (Degree+1) by (Degree+1) element array. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: See: Computer Image Processing and Recognition, Ernest L. Hall, Academic Press, 1979, Pages 186-188. Xi and Yi are expressed as polynomials of Xo, Yo: Xi = Kx(i,j) * Xo^j * Yo^i Summed for i,j = 0 to degree. And Yi = Ky(i,j) * Xo^j * Yo^i. This coordinate transformation may be then used to map from Xo, Yo coordinates into Xi, Yi coordinates. EXAMPLE: The following example shows how to display an image and warp it using the POLYWARP and POLY_2D routines. Create and display the original image by entering: A = BYTSCL(SIN(DIST(250))) TVSCL, A Now set up the Xi's and Yi's. Enter: XI = [24, 35, 102, 92] YI = [81, 24, 25, 92] Enter the Xo's and Yo's: XO = [61, 62, 143, 133] YO = [89, 34, 38, 105] Run POLYWARP to obtain a Kx and Ky: POLYWARP, XI, YI, XO, YO, 1, KX, KY Create a warped image based on Kx and Ky with POLY_2D: B = POLY_2D(A, KX, KY) Display the new image: TV, B MODIFICATION HISTORY: DMS, RSI, Dec, 1983.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/polywarp.pro)
NAME: POLY_AREA PURPOSE: Return the area of a polygon given the coordinates of its vertices. CATEGORY: Analytical Geometry CALLING SEQUENCE: Result = POLY_AREA(X, Y) INPUTS: It is assumed that the polygon has N vertices with N sides and the edges connect the vertices in the order: [(x1,y1), (x2,y2), ..., (xn,yn), (x1,y1)]. i.e. the last vertex is connected to the first vertex. X: An N-element vector of X coordinate locations for the vertices. Y: An N-element vector of Y coordinate locations for the vertices. OUTPUTS: POLY_AREA returns the area of the polygon. This value is always positive. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: None. PROCEDURE: The area is computed as: Area = 1/2 * [ x1y2 + x2y3 + x3y4 +...+x(n-1)yn + xny1 - y1x2 - y2x3 -...-y(n-1)xn - ynx1) MODIFICATION HISTORY: DMS, July, 1984.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/poly_area.pro)
NAME:
POLY_FIT
PURPOSE:
Perform a least-square polynomial fit with optional error estimates.
This routine uses matrix inversion. A newer version of this routine,
SVDFIT, uses Singular Value Decomposition. The SVD technique is more
flexible, but slower.
Another version of this routine, POLYFITW, performs a weighted
least square fit.
CATEGORY:
Curve fitting.
CALLING SEQUENCE:
Result = POLY_FIT(X, Y, NDegree [,Yfit, Yband, Sigma, A] )
INPUTS:
X: The independent variable vector.
Y: The dependent variable vector, should be same length as x.
NDegree: The degree of the polynomial to fit.
OUTPUTS:
POLY_FIT returns a vector of coefficients with a length of NDegree+1.
OPTIONAL OUTPUT PARAMETERS:
Yfit: The vector of calculated Y's. These values have an error
of + or - Yband.
Yband: Error estimate for each point = 1 sigma
Sigma: The standard deviation in Y units.
A: Correlation matrix of the coefficients.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
MODIFICATION HISTORY:
Written by: George Lawrence, LASP, University of Colorado,
December, 1981.
Adapted to VAX IDL by: David Stern, Jan, 1982.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/poly_fit.pro)
NAME: POPD PURPOSE: Change the current working directory to the directory saved on the top of the directory stack maintained by the PUSHD and POPD User Library procedures. This top entry is then removed. CALLING SEQUENCE: POPD SIDE EFFECTS: The top entry of the directory stack is removed. RESTRICTIONS: Popping a directory from an empty stack causes a warning message to be printed. The current directory is not changed in this case. COMMON BLOCKS: DIR_STACK: Contains the stack. MODIFICATION HISTORY: 17, July, 1989, Written by AB, RSI.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/popd.pro)
NAME:
PRIMES
PURPOSE:
This function computes the first K prime numbers. The result is a
K-element vector of type long integer.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = Primes(K)
INPUTS:
K: A scalar of type integer or long integer that specifies the
number of primes to be computed.
EXAMPLE:
Compute the first 25 prime numbers.
result = primes(25)
The result should be:
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, $
53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
REFERENCE:
PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition)
Ronald E. Walpole & Raymond H. Myers
ISBN 0-02-424170-9
MODIFICATION HISTORY:
Written by: GGS, RSI, November 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/primes.pro)
NAME: PRINTD PURPOSE: Display the contents of the directory stack maintained by the PUSHD and POPD User Library procedures. CALLING SEQUENCE: PRINTD OUTPUTS: PRINTD lists the contents of the directory stack on the default output device. COMMON BLOCKS: DIR_STACK: Contains the stack. MODIFICATION HISTORY: 17, July, 1989, Written by AB, RSI.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/printd.pro)
NAME:
PROFILE
PURPOSE:
Extract a profile from an image.
CATEGORY:
Image processing.
CALLING SEQUENCE:
Result = PROFILE(Image, XX, YY)
INPUTS:
Image: The data array representing the image. This array can be
of any type except complex.
KEYWORD PARAMETERS:
XSTART: The starting X location of the lower-left corner of Image.
If this keyword is not specified, 0 is assumed.
YSTART: The starting Y location of the lower-left corner of Image.
If this keyword is not specified, 0 is assumed.
NONMARK: Set this keyword to inhibit marking the image with the
profile line.
OUTPUTS:
PROFILE returns a floating-point vector containing the values of
the image along the profile line marked by the user.
OPTIONAL OUTPUTS:
XX: After picking the end points, XX contains the X coordinates
of the points along the selected profile.
YY: After picking the end points, YY contains the Y coordinates
of the points along the selected profile.
COMMON BLOCKS:
None.
SIDE EFFECTS:
Cursor on image display is enabled.
RESTRICTIONS:
None.
PROCEDURE:
Allow the operator to mark two points on the
image display with the joystick. Extract and
return the points along the line. Optionally
return the X and Y values of each extracted point.
EXAMPLE:
Display an image, select a profile and plot that profile in a new
window. Create and display an image by entering:
A = BYTSCL(DIST(256))
TV, A
Extract a profile from the image. Enter the following command and
mark two points on the image with the mouse:
R = PROFILE(A)
Create a new plotting window and plot the profile by entering:
WINDOW, /FREE
PLOT, R
An interactive version of this routine is available with the User
Library procedure PROFILES.
MODIFICATION HISTORY:
Written, DMS, November, 1982.
Modified for Sun, march, 1988.
December 1991, KRC Made PROFILES return XX and YY.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/profile.pro)
NAME: PROFILES PURPOSE: Interactively draw row or column profiles of an image in a separate window. CATEGORY: Image analysis. CALLING SEQUENCE: PROFILES, Image [, SX = sx, SY = sy] INPUTS: Image: The variable that represents the image displayed in current window. This data need not be scaled into bytes. The profile graphs are made from this array. KEYWORD PARAMETERS: SX: Starting X position of the image in the window. If this keyword is omitted, 0 is assumed. SY: Starting Y position of the image in the window. If this keyword is omitted, 0 is assumed. WSIZE: The size of the PROFILES window as a fraction or multiple of 640 by 512. ORDER: Set this keyword param to 1 for images written top down or 0 for bottom up. Default is the current value of !ORDER. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: A new window is created and used for the profiles. When done, the new window is deleted. RESTRICTIONS: None. PROCEDURE: A new window is created and the mouse location in the original window is used to plot profiles in the new window. Pressing the left mouse button toggles between row and column profiles. The right mouse button exits. EXAMPLE: Create and display an image and use the PROFILES routine on it. Create and display the image by entering: A = BYTSCL(DIST(256)) TV, A Run the PROFILES routine by entering: PROFILES, A The PROFILES window should appear. Move the cursor over the original image to see the profile at the cursor position. Press the left mouse button to toggle between row and column profiles. Press the right mouse button (with the cursor over the original image) to exit the routine. MODIFICATION HISTORY: DMS, Nov, 1988.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/profiles.pro)
NAME:
PROJECT_VOL
PURPOSE:
This function returns a two dimensional image that is the
projection of a 3-D volume of data onto a plane (similar to an
X-ray). The returned image is a translucent rendering of the
volume (the highest data values within the volume show up as the
brightest regions in the returned image). Depth queing and
opacity may be used to affect the image. The volume is
projected using a 4x4 matrix, so any type of projection may
be used including perspective. Typically the system viewing
matrix (!P.T) is used as the 4x4 matrix.
Also, see the intrinsic procedure VOXEL_PROJ which performs many
of the same functions as this routine. VOXEL_PROJ provides the
RGBO rendering method. VOXEL_PROJ is faster, but it does not
allow for perspective projections.
PROJECT_VOL can combine the contents of the Z-buffer with the
projection when the Z_BUFFER keyword is set. PROJECT_VOL will not,
however, modify the contents of the Z-buffer.
CATEGORY:
Volume Rendering.
CALLING SEQUENCE:
Image = PROJECT_VOL(Vol, X_sample, Y_sample, Z_sample)
INPUTS:
Vol: The three dimensional volume of data to project.
Data type : Any 3-D array except string or structure.
X_sample: The number of rays to project along the X dimension
of the image. (The returned image will have the
dimensions X_sample by Y_sample).
Data type : Long.
Y_sample: The number of rays to project along the Y dimension
of the image.
Data type : Long.
Z_sample: The number of samples to take along each ray.
Higher values for X_sample, Y_sample, and Z_sample
increase the image resolution as well as execution time.
Data type : Long.
KEYWORD PARAMETERS:
AVG_INTENSITY:
If set, then the average intensity method of projection
is used. The default is a maximum intensity projection.
This keyword only has effect when NOT using the Z-buffer.
CUBIC: If set, then the cubic method of interpolation is used.
The default is a bilinear interpolation.
DEPTH_Q: Set this keyword to indicate that the image should be
created using depth queing. The depth queing should
be a single floating point value (between 0.0 and 1.0).
This value specifies the brightness of the farthest
regions of the volume relative to the closest regions
of the volume. A value of 0.0 will cause the back
side of the volume to be completely blacked out,
while a value of 1.0 indicates that the back side
will show up just as bright as the front side.
The default is 1.0 (indicating no depth queing).
Data type : Float.
OPAQUE: A 3-D array with the same size and dimensions as Vol.
This array specifies the opacity of each cell in the
volume. Opaque values of 0 allow all light to
pass through. Opaque values are cumulative.
For example, if a ray eminates from a data value of 50,
and then passes through 10 opaque cells (each with a
data value of 0 and an opacity value of 5) then that
ray would be completely blocked out (the cell with the
data value of 50 would be invisible on the returned
image). The default is no opacity.
Data type : Any 3-D array except string or structure
(usually the same type as Vol).
TRANS: A 4x4 floating point array to use as the
transformation matrix when projecting the volume.
The default is to use the system viewing matrix (!P.T).
Data type : Fltarr(4, 4).
XSIZE: The X size of the image to return. Congrid is used to
resize the final image to be XSIZE by YSIZE. The default
is the X size of the current window (or the X size of the
Z-buffer). If there is no current window then the
default is X_sample.
Data type: Int or Long.
YSIZE: The Y size of the image to return. Congrid is used to
resize the final image to be XSIZE by YSIZE. The default
is the Y size of the current window (or the Y size of the
Z-buffer). If there is no current window then the
default is Y_sample.
Data type: Int or Long.
Z_BUFFER: If set, then the projection is combined with the contents
of the Z-buffer. The default is to not use the Z-buffer
contents.
OUTPUTS:
This function returns the projected volume as a two dimensional
array with the same data type as Vol. The dimensions of the
returned array are XSIZE by YSIZE.
EXAMPLE:
Use "T3D" to set up a viewing projection and render a volume of
data using "PROJECT_VOL" :
; Create some data.
vol = RANDOMU(s, 40, 40, 40)
FOR i=0, 10 DO vol = SMOOTH(vol, 3)
vol = BYTSCL(vol(3:37, 3:37, 3:37))
opaque = RANDOMU(s, 40, 40, 40)
FOR i=0, 10 DO opaque = SMOOTH(opaque, 3)
opaque = BYTSCL(opaque(3:37, 3:37, 3:37), TOP=25B)
; Set up the view.
xmin = 0 & ymin = 0 & zmin = 0
xmax = 34 & ymax = 34 & zmax = 34
!X.S = [-xmin, 1.0] / (xmax - xmin)
!Y.S = [-ymin, 1.0] / (ymax - ymin)
!Z.S = [-zmin, 1.0] / (zmax - zmin)
T3D, /RESET
T3D, TRANSLATE=[-0.5, -0.5, -0.5]
T3D, SCALE=[0.7, 0.7, 0.7]
T3D, ROTATE=[30, -30, 60]
T3D, TRANSLATE=[0.5, 0.5, 0.5]
window, 0, xsize=512, ysize=512
; Generate and display the image.
img = PROJECT_VOL(vol, 64, 64, 64, DEPTH_Q=0.7, $
OPAQUE=opaque, TRANS=(!P.T))
TVSCL, img
MODIFICATION HISTORY:
Written by: Daniel Carr. Tue Sep 1 17:52:06 MDT 1992
Modified to increase speed. Also modified
to use current data->normal coordinate conversion. Added
CUBIC, AVG_INTENSITY, XSIZE, YSIZE, and Z_BUFFER keywords.
Daniel Carr. Tue Nov 15 16:03:15 MST 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/project_vol.pro)
NAME: PSAFM PURPOSE: Given an Abobe Font metric file, this procedure generates an AFM file in the format that IDL likes. This new file differs from the original in the following ways: [] Information not used by IDL is removed. [] AFM files with the AdobeStandardEncoding are supplemented with an ISOLatin1Encoding. CATEGORY: Misc., PostScript, Fonts CALLING SEQUENCE: PSAFM, input_filename, output_filename INPUTS: Input_Filename: Name of existing AFM file from Adobe. Output_FIlename: Name of new AFM file to be created. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: Generates an output file. MODIFICATION HISTORY: 8 January 1993, Written by AB, RSI.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/psafm.pro)
NAME:
PSEUDO
PURPOSE:
Generate a pseudo-color table based on the LHB,
(lightness, hue, and brightness) system and load it.
CATEGORY:
Z4 - Image processing, color table manipulation.
CALLING SEQUENCE:
PSEUDO, Litlo, Lithi, Satlo, Sathi, Hue, Loops [, Colr]
INPUTS:
Litlo: Starting lightness, from 0 to 100%.
Lithi: Ending lightness, from 0 to 100%.
Satlo: Starting saturation, from 0 to 100%.
Sathi: Ending saturation, from 0 to 100%.
Hue: Starting hue, in degrees, from 0 to 360.
Loops: The number of loops of hue to make in the color helix.
This value can range from 0 to around 3 to 5 and it need
not be an integer.
OUTPUTS:
No required outputs.
OPTIONAL OUTPUT PARAMETERS:
Colr: A (256,3) integer array containing the red, green, and
blue color values that were loaded into the color lookup
tables. Red = COLR(*,0), Green = COLR(*,1), Blue = COLR(*,1).
COMMON BLOCKS:
None.
SIDE EFFECTS:
Color tables are loaded.
RESTRICTIONS:
None.
PROCEDURE:
This procedure generates a pseudo-color table and loads the red,
green, and blue LUTS with the table. The pseudo-color mapping
used is generated by first translating from the LHB (lightness,
hue, and brightness) coordinate system to the LAB coordinate
system, finding N colors spread out along a helix that spans
this LAB space (supposedly a near maximal entropy mapping for
the eye, given a particular N) and remapping back into the RGB
space (red, green, and blue color space). Thus, given N desired
colors, the output will be N discrete values loaded into the
red LUTs, N discrete values loaded into the blue LUTs, and N
discrete values loaded into the green LUTs.
MODIFICATION HISTORY:
Adapted from the IIS primitive DPSEU. DMS, Nov, 1982.
Changed common, DMS, Apr, 1987.
MWR: 9/13/94 - The cur_* variables in common block need to be non-zero
for use with other routines (e.g. XPALETTE).
MWR: 10/27/94 - Changed common block variable names to comply with
naming convention used by other IDL routines.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/pseudo.pro)
NAME: PS_SHOW_FONTS PURPOSE: This procedure displays all the PostScript fonts that IDL knows about, with both the StandardAdobe and ISOLatin1 encodings. Each display takes a separate page, and each character in each font is shown with its character index. CATEGORY: Misc., PostScript, Fonts. CALLING SEQUENCE: PS_SHOW_FONTS INPUTS: None. KEYWORDS: NOLATIN: If set, do NOT output ISOLatin1 encodings. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: A PostScript file is produced, one page per font/mapping combination. RESTRICTIONS: The output file contains almost 70 pages of output. A PostScript previewer is recommended rather than sending it to a printer. MODIFICATION HISTORY: 12 January 1993, AB, RSI. 12 October 1993, Rob Montgomery, NCAR - added 'nolatin' keyword.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/ps_show_fonts.pro)
NAME:
PURPOSE:
CATEGORY:
Compound widgets.
CALLING SEQUENCE:
widget = CW_TMPL(parent)
INPUTS:
PARENT - The ID of the parent widget.
KEYWORD PARAMETERS:
UVALUE - Supplies the user value for the widget.
OUTPUTS:
The ID of the created widget is returned.
COMMON BLOCKS:
None.
SIDE EFFECTS:
PROCEDURE:
WIDGET_CONTROL, id, SET_VALUE=value can be used to change the
current value displayed by the widget.
WIDGET_CONTROL, id, GET_VALUE=var can be used to obtain the current
value displayed by the widget.
MODIFICATION HISTORY:
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/cw_tmpl.pro)
NAME: PUSHD PURPOSE: Push a directory onto the top of the directory stack maintained by the PUSHD and POPD User Library procedures. CALLING SEQUENCE: PUSHD, Dir INPUTS: Dir: The directory to change to. The current directory will be pushed to the top of the directory stack. SIDE EFFECTS: The current directory is pushed onto the directory stack. It will be the next directory used by POPD. COMMON BLOCKS: DIR_STACK: Contains the stack. MODIFICATION HISTORY: 17, July, 1989, Written by AB, RSI.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/pushd.pro)
NAME:
P_CORRELATE
PURPOSE:
This function computes the partial correlation coefficient of a
dependent variable and one particular independent variable when
the effects of all other variables involved are removed.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = P_correlate(X, Y, C)
INPUTS:
X: An n-element vector of type integer, float or double that
specifies the independent variable data.
Y: An n-element vector of type integer, float or double that
specifies the dependent variable data.
C: An array of type integer, float or double that specifies the
independent variable data whose effects are to be removed.
The columns of this two dimensional array correspond to the
n-element vectors of independent variable data.
EXAMPLES:
Define the data vectors.
x0 = [64, 71, 53, 67, 55, 58, 77, 57, 56, 51, 76, 68]
x1 = [57, 59, 49, 62, 51, 50, 55, 48, 52, 42, 61, 57]
x2 = [ 8, 10, 6, 11, 8, 7, 10, 9, 10, 6, 12, 9]
Compute the partial correlation of x0 and x1 with the effects of
x2 removed. The result should be 0.533469
result = p_correlate(x0, x1, reform(x2, 1, n_elements(x2)))
Compute the partial correlation of x0 and x2 with the effects of
x1 removed. The result should be 0.334572
result = p_correlate(x0, x2, reform(x1, 1, n_elements(x1)))
Compute the partial correlation of x1 and x2 with the effects of
x0 removed. The result should be 0.457907
result = p_correlate(x1, x2, reform(x0, 1, n_elements(x0)))
REFERENCE:
APPLIED STATISTICS (third edition)
J. Neter, W. Wasserman, G.A. Whitmore
ISBN 0-205-10328-6
MODIFICATION HISTORY:
Modified by: GGS, RSI, July 1994
Minor changes to code. New documentation header.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/p_correlate.pro)
NAME:
RANKS
PURPOSE:
This function computes the magnitude-based ranks of a sample
population X. Elements of identical magnitude "ties" are ranked
according to the mean of the ranks that would otherwise be assigned.
The result is a vector of ranks equal in length to X.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = Ranks(X)
INPUTS:
X: An n-element vector of type integer, float or double.
The elements of this vector must be in ascending order
based on their magnitude.
EXAMPLE:
Define an n-element sample population.
x = [-0.8, 0.1, -2.3, -0.6, 0.2, 1.1, -0.3, 0.6, -0.2, 1.1, -0.7, $
-0.2, 0.6, 0.4, -0.1, 1.1, -0.3, 0.3, -1.3, 1.1]
Allocate a two-column, n-row array to store the results.
array = fltarr(2, n_elements(x))
Sort the sample population and store in the 0th column of ARRAY.
array(0, *) = x(sort(x))
Compute the ranks of the sorted sample population and store in the
1st column of ARRAY.
array(1, *) = ranks(x(sort(x)))
Display the sorted sample population and corresponding ranks with a
two-decimal format.
print, array, format = '(2(5x, f5.2))'
The result should be:
-2.30 1.00
-1.30 2.00
-0.80 3.00
-0.70 4.00
-0.60 5.00
-0.30 6.50
-0.30 6.50
-0.20 8.50
-0.20 8.50
-0.10 10.00
0.10 11.00
0.20 12.00
0.30 13.00
0.40 14.00
0.60 15.50
0.60 15.50
1.10 18.50
1.10 18.50
1.10 18.50
1.10 18.50
REFERENCE:
PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition)
Ronald E. Walpole & Raymond H. Myers
ISBN 0-02-424170-9
MODIFICATION HISTORY:
Written by: GGS, RSI, November 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/ranks.pro)
NAME: RDPIX PURPOSE: Interactively display the X position, Y position, and pixel value of the cursor. CATEGORY: Image display. CALLING SEQUENCE: RDPIX, Image [, X0, Y0] INPUTS: Image: The array that represents the image being displayed. This array may be of any type. Rather reading pixel values from the display, they are taken from this parameter, avoiding scaling difficulties. OPTIONAL INPUT PARAMETERS: X0, Y0: The location of the lower-left corner of the image area on screen. If these parameters are not supplied, they are assumed to be zero. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The X, Y, and value of the pixel under the cursor are continuously displayed. RESTRICTIONS: None. PROCEDURE: Instructions are printed and the pixel values are printed as the cursor is moved over the image. Press the left or center mouse button to create a new line of output, saving the previous line. Press the right mouse button to exit the procedure. MODIFICATION HISTORY: DMS, Dec, 1987. Rob Montgomery (rob@hao.ucar.edu), 9/21/92; Correct indices for case of !order = 1
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/rdpix.pro)
NAME:
READ_BMP
PURPOSE:
This function reads a Microsoft Windows Version 3 device
independent bitmap file (.BMP).
CATEGORY:
Input/Output
CALLING SEQUENCE:
Result = READ_BMP(File [, R, G, B [, IHDR]])
INPUTS:
File: The full path name of the bitmap file to read.
OUTPUTS:
This function returns a byte array containing the image
from the bitmap file. In the case of 4-bit or 8-bit images,
the dimensions of the resulting array are (biWidth, biHeight);
for 24-bit images the dimensions are (3, biWidth, biHeight).
Dimensions are taken from the BITMAPINFOHEADER of the file.
NOTE: for 24 bit images, color interleaving is blue, green, red;
i.e. result(0,i,j) = blue, result(1,i,j) = green, etc.
OPTIONAL OUTPUTS:
R, G, B: Color tables from the file. There 16 elements each for
4 bit images, 256 elements each for 8 bit images. Not
defined or used for 24 bit images.
Ihdr: A structure containing BITMAPINFOHEADER from file.
Tag names are as defined in the MS Windows Programmer's
Reference Manual, Chapter 7.
SIDE EFFECTS:
IO is performed.
RESTRICTIONS:
DOES NOT HANDLE: 1 bit deep images, or compressed images.
Is not fast for 4 bit images. Works best on images where the
number of bytes in each scan-line is evenly divisible by 4.
PROCEDURE:
Straightforward. Will work on both big endian and little endian
machines.
EXAMPLE:
TV, READ_BMP('c:\windows\party.bmp', r, g, b) ;Read & display image
TVLCT, r, g, b ;Load it's colors
MODIFICATION HISTORY:
DMS, RSI. March 1993. Original version.
DMS, RSI. May, 1993. Now works on all machines...
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/read_bmp.pro)
NAME:
READ_GIF
PURPOSE:
Read the contents of a GIF format image file and return the image
and color table vectors (if present) in the form of IDL variables.
CATEGORY:
Input/Output.
CALLING SEQUENCE:
READ_GIF, File, Image [, R, G, B]
INPUTS:
File: Scalar string giving the name of the rasterfile to read
OUTPUTS:
Image: The 2D byte array to contain the image.
OPTIONAL OUTPUT PARAMETERS:
R, G, B: The variables to contain the Red, Green, and Blue color vectors
if the rasterfile containes colormaps.
SIDE EFFECTS:
None.
RESTRICTIONS:
This routine only reads in the first image in a file (the format
allows many). Local colormaps are not supported.
Only 8 bit images are supported.
EXAMPLE:
To open and read the GIF image file named "foo.gif" in the current
directory, store the image in the variable IMAGE1, and store the color
vectors in the variables R, G, and B, enter:
READ_GIF, "foo.gif", IMAGE1, R, G, B
To load the new color table and display the image, enter:
TVLCT, R, G, B
TV, IMAGE1
MODIFICATION HISTORY:
Written June 1992, JWG
Added GIF89a and interlaced format, Jan, 1995, DMS.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/read_gif.pro)
NAME: READ_INTERFILE PURPOSE: Simplistic Interfile (v3.3) reader. Can only read a series of images containing byte,int,long,float or double data where all images have the same height and with. Result is returned in a 3-D array. CATEGORY: Input/Output. CALLING SEQUENCE: READ_INTERFILE, File, Data INPUTS: File: Scalar string containing the name of the Interfile to read. Note: if the Interfile has a header file and a data file, this should be the name of the header file (also called the administrative file). OUTPUTS: Data: A 3-D array of data as read from the file. Assumed to be a series of 2-D images. RESTRICTIONS: This is a simplistic reader. It does not get additional keyword information above and beyond what is needed to read in the image data. If any problems occur reading the file, READ_INTERFILE prints a message and stops. If the data is stored in on a bigendian machine and read on a littleendian machine (or vice versa) the order of bytes in each pixel element may be reversed, requiring a call to BYTEORDER PROCEDURE: Generates keyword table and initializes it on the fly. Read in administrative data. Read in binary data. Clean up keyword processing information. EXAMPLE: READ_INTERFILE, '0_11.hdr', X MODIFICATION HISTORY: Written by: J. Goldstein, Oct 1993 12/22/93 JWG,TH Bug fixes. Added byte swapping for short data
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/read_interfile.pro)
NAME: READ_PICT
PURPOSE: Reads limited types of image files written in the PICT
Version 2 Format. This format is used by the Apple
Macintosh Computers.
CATEGORY:
CALLING SEQUENCE:
READ_PICT, FILE, IMAGE ;Reads PICT file into IMAGE
READ_PICT, FILE, IMAGE, R, G, B ;Reads Image and loads color vectors
INPUTS:
FILE = Scalar string giving the name of the PICT file to read.
IMAGE = 2D matrix to be input.
OPTIONAL INPUT PARAMETERS:
R, G, B = The Red, Green, and Blue color vectors to be read
with IMAGE. If not specified, the color table associated
with the picture is ignored.
OUTPUTS:
IMAGE - the image that is read in from the file.
R, G, B - the color vectors from the PICT file.
SIDE EFFECTS:
A file is opened, UnPackData is called, I/O is performed
RESTRICTIONS:
Only creates Version 2 PICT files. Not intended to read all PICT
files. Known to work with IDL PICT files written with write_pict
routine in IDL.
PROCEDURE:
Read in the header, size, and the following quickdraw opcodes.
MODIFICATION HISTORY:
Written 19 November 1990, Steve Richards.
19 November 1992, Steve Richards, Fixed a problem where
the color vectors returned were integer and not
bytes.
Jul 1994, DMS, RSI. Added code for both big and little
endian byte ordering. Previous version would not
work on little endian machines.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/read_pict.pro)
NAME: READ_PPM PURPOSE: Read the contents of a PGM (gray scale) or PPM (portable pixmap for color) format image file and return the image in the form of an IDL variable. PPM/PGM format is supported by the PMBPLUS and Netpbm packages. PBMPLUS is a toolkit for converting various image formats to and from portable formats, and therefore to and from each other. CATEGORY: Input/Output. CALLING SEQUENCE: READ_PPM, File, Image INPUTS: File: Scalar string giving the name of the PGM or PPM file. OUTPUTS: Image: The 2D byte array to contain the image. In the case of a PPM file, a (3, n, m) array is returned. KEYWORD Parameters: MAXVAL = returned maximum pixel value. SIDE EFFECTS: None. RESTRICTIONS: Should adhere to the PGM/PPM "standard". Accepts: P2 = graymap ASCII, P5 graymap RAWBITS, P3 true-color ASCII pixmaps, and P6 true-color RAWBITS pixmaps. Maximum pixel values are limited to 255. Images are always stored with the top row first. (ORDER=1) EXAMPLE: To open and read the PGM image file named "foo.pgm" in the current directory, store the image in the variable IMAGE1 enter: READ_PPM, "foo.gif", IMAGE1 MODIFICATION HISTORY: Written Nov, 1994, DMS.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/read_ppm.pro)
NAME:
READ_SPR
PURPOSE:
This function reads a row-indexed sparse matrix from a specified
file and returns it as the result. Row-indexed sparse matrices
are created by using the Numerical Recipes routine NR_SPRSIN.
CATEGORY:
Sparse Matrix File I/O
CALLING SEQUENCE:
result = READ_SPR('Filename')
INPUTS:
Filename: Name of file containing a row-indexed sparse matrix
KEYWORD PARAMETERS;
NONE
OUTPUTS:
result: Row-indexed sparse matrix
MODIFICATION HISTORY:
Written by: BMH, 1/94.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/read_spr.pro)
NAME:
READ_SRF
PURPOSE:
Read the contents of a Sun rasterfile and return the image and
color table vectors (if present) in the form of IDL variables.
CATEGORY:
Input/Output.
CALLING SEQUENCE:
READ_SRF, File, Image [, R, G, B]
INPUTS:
File: Scalar string giving the name of the rasterfile to read
OUTPUTS:
Image: The 2D byte array to contain the image.
OPTIONAL OUTPUT PARAMETERS:
R, G, B: The variables to contain the Red, Green, and Blue color vectors
if the rasterfile containes colormaps.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
This routine only handles 1, 8, 24, and 32-bit rasterfiles of type
RT_OLD and RT_STANDARD. See the file /usr/include/rasterfile.h
for the structure of Sun rasterfiles.
EXAMPLE:
To open and read the Sun rasterfile named "sun.srf" in the current
directory, store the image in the variable IMAGE1, and store the color
vectors in the variables R, G, and B, enter:
READ_SRF, "sun.srf", IMAGE1, R, G, B
To load the new color table and display the image, enter:
TVLCT, R, G, B
TV, IMAGE1
MODIFICATION HISTORY:
Written fall 1897, AB
3/1/90, Added 24 bit images, DMS.
7/8/90, Added 32 bit images, DMS.
1/22/92, the colors within 24 bit images were not ordered
correctly, DMS.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/read_srf.pro)
NAME:
READ_SYLK
PURPOSE:
Reads the contents of a sylk (Symbolic Link) format spreadsheet data file
and returns a cell data range (if present) in the form of an IDL variable.
CATEGORY:
Input/Output.
CALLING SEQUENCE:
ReturnData = READ_SYLK(InFile [, STARTROW, STARTCOL, NROWS, NCOLS, ARRAY,
COLMAJOR, USEDOUBLES, USELONGS])
INPUT:
InFile: Scalar string with the name of the sylk file to read.
OUTPUT:
ReturnData: The table (vector of structs) or matrix (2D array) that will
contain the spreadsheet cell data. The size and type of this return
variable is set using the optional input parameters (keywords) below.
OPTIONAL INPUT PARAMETERS:
STARTROW: The starting (0-based) row of spreadsheet cells to read. If not
specified, this value defaults to the first row of cells found in the
file.
STARTCOL: The starting (0-based) column of spreadsheet cells to read. If
not specified, this value defaults to the first column of cells found
in the file.
NROWS: The number of spreadsheet rows to read in. If not specified, this
defaults to all of the cell rows found in the file.
NCOLS: The number of spreadsheet columns to read in. If not specified,
this value defaults to all of the cell columns found in the file.
ARRAY: Boolean flag. If TRUE, the data type returned will be an IDL array.
Note that the data in the cell range must be of the same type to
successfully return an array. If this flag is not set, the routine
will return a table (vector of structs) instead. The tags of this
struct will be labelled "Col0", "Col1", ..., "ColN" for a row major
table and "Row0", "Row1", ..., "RowN" for a column major table.
COLMAJOR: Boolean flag. If TRUE, the range of spreadsheet cell data is
transposed and then read into an IDL variable. This flag should be set
when importing spreadsheet data which has column major organization
(ie., listings by column rather than row). The default is row major
format.
USEDOUBLES: Boolean flag. If TRUE, any floating point cell data will be
read in and returned as a double precision rather than the default
float type.
USELONGS: Boolean flag. If TRUE, any integer cell data will be read in and
returned as a long rather than the default int type.
SIDE EFFECTS:
None.
RESTRICTIONS:
This routine *only* reads in numerical and string sylk data. It igonores
all spreadsheet and cell formatting information such as cell width, text
justification, font type, date, time, and monetary notations, etc. In
addition, only attempts to read spreadsheet tables, like-typed cell rows,
columns, or subsets thereof will succeed.
EXAMPLES:
Consider the following row major spreadsheet table with the upper left cell
(value = "Index") at location (0, 0) that has been output to the sylk file
"foo.slk":
Index Name Gender Platform
1 Beth F Unix
2 Kirk M VMS
3 Mark M Windows
4 Dave M Macintosh
Note that the data format of the title row (STRING, STRING, STRING, STRING)
is inconsistant with the following four rows (INT, STRING, STRING, STRING)
in the table. It is impossible to read all of the table into a single IDL
variable, but you could make two calls to READ_SYLK to import all of the
data:
strTitle = READ_SYLK("foo.slk", NROWS = 1)
arrstrTable = READ_SYLK("foo.slk", STARTROW = 1)
The return data are as follows:
IDL> HELP, strTitle
STRTITLE STRUCT = -> Array(1)
IDL> PRINT, strTitle
{ Index Name Gender Platform}
IDL> HELP, arrstrTable
ARRSTRTABLE STRUCT = -> Array(4)
IDL> PRINT, arrstrTable
{ 1 Beth F Unix}{ 2 Kirk M VMS}{ 3 Mark M
Windows}{ 4 Dave M Macintosh}
Further, consider the following call from the same sylk file:
arrszNames = READ_SYLK("foo.slk", /ARRAY, STARTROW = 1, STARTCOL = 1, $
NCOLS = 1)
The return data is now:
IDL> HELP, arrszNames
ARRSZTABLE STRING = Array(4)
IDL> PRINT, arrszNames
Beth Kirk Mark Dave
If the COLMAJOR keyword flag is set the return value differs in type:
arrszNames = READ_SYLK("foo.slk", /ARRAY, /COLMAJOR, STARTROW = 1, $
STARTCOL = 1, NCOLS = 1)
The return data is now:
IDL> HELP, arrszNames
ARRSZTABLE STRING = Array(1, 4)
IDL> PRINT, arrszNames
Beth
Kirk
Mark
Dave
MODIFICATION HISTORY:
Written October 1994, AJH
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/read_sylk.pro)
NAME: READ_WAVE PURPOSE: READ a .wave or .bwave file created by the Advanced Data Visualizer into an series of IDL variables. CALLING SEQUENCE: READ_WAVE, FILE, VARIABLES, NAMES, DIMENSIONS INPUTS: FILE = Scalar string giving the name of the Wavefront file to write. KEYWORD PARAMETERS: MESHNAMES = The name of the mesh used in the Wavefront file for each variable. OUTPUTS: VARIABLES = Upon return, this variable contains a block of the variables contained in the wavefront file. Since each variable in a wavefront file can have more than one field (for instance, a vector variable has 3 fields), the fields of each variable make up the major index into the variable block. For instance, if a Wavefront file had one scalar variable and one vector variable, the scalar would be extracted as follows: vector_scalar = variables(0,*,*,*) and the vector variable would be extracted as follows: vector_variable = variables(1:3,*,*,*) To find the dimensions of the returned variable, see the description below regarding DIMENSIONS NAMES = Upon return, this variable contains the string names of each variable contained in the file. DIMENSIONS = Upon return, this variable is a long array that describes how many fields in the large returned variable block each variable occupies. In the above example of one scalar variable followed by a vector variable, the dimension variable would be: DIMENSIONS = [1,3] So the first field of the returned variable block would be the scalar variable and the following 3 fields would comprise the vector variable. RESTRICTIONS: This routine only preserved the structure of the variables if they are regularly grided variables. MODIFICATION HISTORY: Written July 16, 1991, by Steve Richards.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/read_wave.pro)
NAME: READ_X11_BITMAP PURPOSE: Read bitmaps stored in the X11 format. The X Windows bitmap(1) program produces a C header file containing the definition of a bitmap produced by that program. This procedure reads such a file and creates an IDL byte array containing the bitmap. This procedure is used primarily to read bitmaps to be used as IDL widget button labels. CATEGORY: Bitmaps, X Windows, widgets. CALLING SEQUENCE: READ_X11_BITMAP, File, Bitmap [, X, Y] INPUTS: File: The name of the file containing the bitmap. KEYWORD PARAMETERS: EXPAND_TO_BYTES: return a 2-D array which has one bit per byte (0 for a 0 bit), (255 for a 1 bit) instead. (See example) OUTPUTS: Bitmap: The variable in which to store the bitmap. This variable is returned as a byte array. OPTIONAL OUTPUT PARAMETERS: X: The width of the bitmap is returned in this variable. Y: The height of the bitmap is returned in this variable. COMMON BLOCKS: None. EXAMPLE: To open and read the X11 bitmap file named "my.x11" in the current directory, store the bitmap in the variable BITMAP1, and the width and height in the variables X and Y, enter: READ_X11_BITMAP, "my.x11", BITMAP1, X, Y To display the new bitmap, enter: READ_X11_BITMAP, "my.x11", Image, /EXPAND_TO_BYTES TV, Image, /ORDER MODIFICATION HISTORY: 10 January 1991, AB 1 Apr, 1992, CF fixed bug with bitmaps larger than 32k bytes. 24 March 1993, JWG fixed EXPAND_TO_BYTES option
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/read_x11_bitmap.pro)
NAME:
READ_XWD
PURPOSE:
Read the contents of files created by the XWD (X Windows Dump)
command and return the image and color table vectors in the form of
IDL variables.
CATEGORY:
Input/Output.
CALL:
Result = READ_XWD(File_Name [, R, G, B])
INPUTS:
File_Name: Scalar string giving the name of the xwd file to read
OUTPUTS:
READ_XWD returns a 2D byte array containing the image. If the file
cannot be open or read, the return value is zero.
OPTIONAL OUTPUT PARAMETERS:
R, G, B: The variables to contain the Red, Green, and Blue color
vectors if the XWD file contains color tables.
COMMON BLOCKS:
None.
SIDE EFFECTS:
I/O is performed.
RESTRICTIONS:
This function is intended to be used only on files containing
8-bit pixmaps. It is not intended to be used with all XWD files.
No guarantees are made that all XWD files will work with this routine.
This routine will not work with XWD files with version less than 6.
PROCEDURE:
The header is read into a structure and the bytes are reversed
if necessary. Then the colormap and image portions of the
file are read into their respective variables.
EXAMPLE:
To open and read the X Windows Dump file named "my.xwd" in the current
directory, store the image in the variable IMAGE1, and store the color
vectors in the variables, R, G, and B, enter:
IMAGE1 = READ_XWD("my.xwd", R, G, B)
To load the new color table and display the image, enter:
TVLCT, R, G, B
TV, IMAGE1
MODIFICATION HISTORY:
September, 1990 DMS and SMR, Research Systems, Inc.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/read_xwd.pro)
NAME:
RECON3
PURPOSE:
This function can reconstruct a 3-dimensional data array from
two or more images (or projections) of an object. For example,
if you placed a dark object in front of a white background and
then photographed it three times (each time rotating the object a
known amount) then these three images could be used with RECON3
to approximate a 3-D volumetric representation of the object.
RECON3 also works with translucent projections of an object.
RECON3 returns a 3-D byte array. RECON3 uses the back-projection
method. In medical imaging and other applications, a method
known as "Filtered Backprojection" is often desired. This may
be accomplished here by first filtering the images as desired,
and then using the filtered images for the reconstruction.
CATEGORY:
Volume Reconstruction
CALLING SEQUENCE:
vol = RECON3(Images, Obj_Rot, Obj_Pos, Focal, Dist, $
Vol_Pos, Img_Ref, Img_Mag, Vol_Size)
INPUTS:
Images: The images to use to reconstruct the volume. Execution
time increases linearly with more images.
Data Type: 8-bit (byte) array with dimensions (x, y, n)
where x is the horizontal image dimension, y is the vertical
image dimension, and n is the number of images.
Obj_Rot: The the amount the object is rotated to make it appear as
it does in each image. The object is first rotated
about the X axis, then about the Y axis, and finally
about the Z axis (with the object's reference point at the
origin.
Data Type: (3, n) Float array where Obj_Rot(0, *) is the X
rotation for each image, Obj_Rot(1, *) is the Y rotation,
and Obj_Rot(2, *) is the Z rotation.
Obj_Pos: The position of the the object's reference point RELATIVE to
the camera lens. The camera lens is located at the
coordinate origin and points in the negative Z direction
(the view up vector points in the positive Y direction).
Obj_Pos should be expressed in this coordinate system.
The values for Obj_Pos, Focal, Dist, and Vol_Pos should all
be expressed in the same units (mm, cm, m, in, ft, etc.).
Data Type: (3, n) Float array where Obj_Pos(0, *) is the X
position for each image, Obj_Pos(1, *) is the Y position,
and Obj_Pos(2, *) is the Z position. All the values in
Obj_Pos(2, *) should be less than zero.
Focal: The focal length of the lens for each image. Focal may be
set to zero to indicate a parallel image projection
(infinite focal length).
Data Type: Float array with n elements.
Dist: The distance from the camera lens to the image plane (film)
for each image. Dist should be greater than Focal.
Data Type: Float array with n elements.
Vol_Pos: The two opposite corners of a cube that surrounds the object.
Vol_Pos should be expressed in the object's coordinate system
RELATIVE to the object's reference point.
Data Type: (3, 2) Float array where Vol_Pos(*, 0) specifies
one corner and Vol_Pos(*, 1) specifies the opposite corner.
Img_Ref: The pixel location at which the object's reference point
appears in each of the images.
Data Type: (2, n) Int or Float array where Img_Ref(0, *) is
the X coordinate for each image and Img_Ref(1, *) is the Y
coordinate.
Img_Mag: The magnification factor for each image. This number is
actually the length (in pixels) that a test object would
appear in an image if it were N units long and N units
distant from the camera lens.
Data Type: (2, n) Int or float array where Img_Mag(0, *) is
the X dimension (in pixels) of a test object for each image,
and Img_Mag(1, *) is the Y dimension. All elements in
Img_Mag should be greater than or equal to 1.
Vol_Size: The size of the volume to return. The returned volume will
be a 3-D byte array with dimensions equal to Vol_Size.
Execution time (and resolution) increases exponentially with
larger values for Vol_Size.
Data Type: Int array with 3 elements where Vol_Size(0)
specifies the X dimension of the volume, Vol_Size(1) specifies
the Y dimension, and Vol_Size(2) specifies the Z dimension.
KEYWORD PARAMETERS:
CUBIC: If set, then cubic interpolation is used. The default is
to use tri-linear interpolation, which is slightly faster.
MISSING: The value for cells in the 3-D volume that do not map to
any of the supplied images. The Missing value is passed
to the IDL "INTERPOLATE" function.
Data Type: Byte.
Default : 0B
MODE: If Mode is less than zero then each cell in the 3-D volume
is the MINIMUM of the corresponding pixels in the images.
If Mode is greater than zero then each cell in the 3-D volume
is the MAXIMUM of the corresponding pixels in the images.
If Mode is equal to zero then each cell in the 3-D volume
is the AVERAGE of the corresponding pixels in the images.
Mode should usually be (-1) when the images contain a bright
object in front of a dark background. Mode should usually
be (+1) when the images contain a dark object in front of a
light background. AVERAGE mode requires more memory since
the volume array must temporarily be kept as an INT array
instead of a BYTE array.
Data Type: Int
Default : 0 (average cells)
OUTPUTS:
RECON3 returns a 3-D byte array containing the reconstructed object.
If the images contain low (dark) values where the object is and high
(bright) values where the object isn't, then Mode should be set to (+1).
If the above is true then the returned volume will have low values
where the object is, and high values where the object isn't.
If the images contain high (bright) values where the object is and low
(dark) values where the object isn't, then Mode should be set to (-1).
If the above is true then the returned volume will have high values
where the object is, and low values where the object isn't.
RESTRICTIONS:
In general, the object must be CONVEX for a good reconstruction to be
possible. Concave regions are not easily reconstructed.
An empty coffee cup, for example, would be reconstructed as if it
were full.
The images should show strong light/dark contrast between the object
and the background.
The more images the better. Images from many different angles will
improve the quality of the reconstruction. It is also important to
supply images that are parallel and perpendicular to any axes of
symmetry. Using the coffee cup as an example, at least one image
should be looking through the opening in the handle.
Telephoto images are also better for reconstruction purposes than
wide angle images.
PROCEDURE:
A 4x4 transformation matrix is created for each image based upon the
parameters Obj_Rot, Obj_Pos, Focal, Dist, and Img_Ref. Each cell in
the volume is assigned a 3-D coordinate based upon the parameters
Vol_Pos and Vol_Size. These coordinates are multiplied by the
transformation matricies to produce x,y image coordinates. Each cell
in the volume is assigned a value that is the AVERAGE, MINIMUM, or
MAXIMUM of the image values at the x,y position (depending on Mode).
EXAMPLE:
------------------------------------------------------------------------------
; Assumptions for this example :
; The object's major axis is parallel to the Z axis.
; The object's reference point is at its center.
; The camera lens is pointed directly at this reference point.
; The reference point is 5000 mm in front of the camera lens.
; The focal length of the camera lens is 200 mm.
; If the camera is focused on the reference point, then the
; distance from the lens to the camera's image plane must be
; dist = (d * f) / (d - f) =
; (5000 * 200) / (5000 - 200) = (1000000 / 4800) = 208.333 mm
; The object is roughly 600 mm wide and 600 mm high.
; The reference point appears in the exact center of each image.
; If the object is 600 mm high and 5000 mm distant from the camera
; lens, then the object image height must be
; hi = (h * f) / (d - f) =
; (600 * 200) / (5000 - 200) = (120000 / 4800) = 25.0 mm
; The object image appears 200 pixels high so the final magnification
; factor is
; img_mag = (200 / 25) = 8.0
imgy = 256
frames = 3
images = Bytarr(imgx, imgy, frames, /Nozero)
obj_rot = Fltarr(3, frames)
obj_pos = Fltarr(3, frames)
focal = Fltarr(frames)
dist = Fltarr(frames)
vol_pos = Fltarr(3, 2)
img_ref = Fltarr(2, frames)
img_mag = Fltarr(2, frames)
vol_size = [40, 40, 40]
; The object is 5000 mm directly in front of the camera.
obj_pos(0, *) = 0.0
obj_pos(1, *) = 0.0
obj_pos(2, *) = -5000.0
; The focal length of the lens is constant for all the images.
focal(*) = 200.0
; The distance from the lens to the image plane is also constant.
dist(*) = 208.333
; The cube surrounding the object is 600 mm X 600 mm.
vol_pos(*, 0) = [-300.0, -300.0, -300.0]
vol_pos(*, 1) = [ 300.0, 300.0, 300.0]
; The image reference point appears at the center of all the images.
img_ref(0, *) = imgx / 2
img_ref(1, *) = imgy / 2
; The image magnification factor is constant for all images.
; (The images haven't been cropped or resized).
img_mag(*, *) = 8.0
; Only the object rotation changes from one image to the next.
; Note that the object is rotated about the X axis first, then Y,
; and then Z.
; Create some fake images for this example.
images(30:160, 20:230, 0) = 255
images(110:180, 160:180, 0) = 180
obj_rot(*, 0) = [-90.0, 0.0, 0.0]
images(70:140, 100:130, 1) = 255
obj_rot(*, 1) = [-70.0, 75.0, 0.0]
images(10:140, 70:170, 2) = 255
images(80:90, 170:240, 2) = 150
obj_rot(*, 1) = [-130.0, 215.0, 0.0]
; Reconstruct the volume.
vol = RECON3(images, obj_rot, obj_pos, focal, dist, vol_pos, img_ref, $
img_mag, vol_size, Missing=255B, Mode=(-1))
------------------------------------------------------------------------------
MODIFICATION HISTORY:
Written by: Daniel Carr Thu Feb 4 02:54:29 MST 1993
KDB - 23 Dec., 1993 - Variable dist had a conflict with Userlib
function DIST and could cause compile errors.
Renamed variable dist to distance.
Modified by: Daniel Carr Mon Nov 21 14:21:57 MST 1994
Improved performance and added CUBIC keyword.
Modified by: Daniel Carr Tue Nov 22 12:18:15 MST 1994
Fixed bug which affected small focal length images.
Improved performance again.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/recon3.pro)
NAME: REDUCE_COLORS PURPOSE: This procedure reduces the number of colors used in an image by eliminating pixel values without members. CATEGORY: Image display. CALLING SEQUENCE: REDUCE_COLORS, Image, Values INPUTS: Image: The original image array. Note that the input array is replaced by its color-reduced equivalent. KEYWORD PARAMETERS: None. OUTPUTS: Image: The color-reduced image array. Values: A vector of non-zero pixel values. If Image contains pixel values from 0 to M, Values will be an M+1 element vector containing the mapping from the old values to the new. Values(I) contains the new color index of old pixel index I. SIDE EFFECTS: Input array is overwritten. PROCEDURE: The pixel distribution histogram is obtained and the WHERE function is used to find bins with non-zero values. Next, a lookup table is made where table(old_pixel_value) contains new_pixel_value, and then applied to the image. EXAMPLE: To reduce the number of colors and display an image with the original color tables R, G, B: REDUCE_COLORS, Image, V TVLCT, R(V), G(V), B(V) MODIFICATION HISTORY: DMS, RSI, Oct, 1992.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/reduce_colors.pro)
NAME:
REGRESS
PURPOSE:
Perform a multiple linear regression fit.
REGRESS fits the function:
Y(i) = A0 + A(0)*X(0,i) + A(1)*X(1,i) + ... +
A(Nterms-1)*X(Nterms-1,i)
CATEGORY:
G2 - Correlation and regression analysis.
CALLING SEQUENCE:
Result = REGRESS(X, Y, W, Yfit, A0, Sigma, Ftest, R, Rmul, Chisq)
INPUTS:
X: The array of independent variable data. X must
be dimensioned as an array of Nterms by Npoints, where
there are Nterms coefficients (independent variables) to be
found and Npoints of samples.
Y: The vector of dependent variable points. Y must have Npoints
elements.
W: The vector of weights for each equation. W must be a vector
of Npoints elements. For instrumental weighting,
W(i) = 1/standard_deviation(Y(i))^2. For statistical
weighting, w(i) = 1./Y(i). For no weighting, set w(i)=1,
and also set the RELATIVE_WEIGHT keyword.
OUTPUTS:
REGRESS returns a column vector of coefficients that has Nterms
elements.
OPTIONAL OUTPUT PARAMETERS:
Yfit: Vector of calculated values of Y with Npoints elements.
A0: Constant term.
Sigma: Vector of standard deviations for coefficients.
Ftest: The value of F for test of fit.
Rmul: The multiple linear correlation coefficient.
R: Vector of linear correlation coefficients.
Rmul: The multiple linear correlation coefficient.
Chisq: Reduced, weighted chi squared.
KEYWORDS:
RELATIVE_WEIGHT: If this keyword is set, the input weights
(W vector) are assumed to be relative values, and not based
on known uncertainties in the Y vector. Set this keyword in
the case of no weighting, W(*) = 1.
PROCEDURE:
Adapted from the program REGRES, Page 172,
Bevington, Data Reduction and Error Analysis for the
Physical Sciences, 1969.
MODIFICATION HISTORY:
Written, DMS, RSI, September, 1982.
Added RELATIVE_WEIGHT keyword W. Landsman August 1991
Fixed bug in invert Bobby Candey 1991 April 22
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/regress.pro)
NAME: RESOLVE_ALL PURPOSE: Resolve (by compiling) all procedures and functions. This is useful when preparing .sav files containing all the IDL routines required for an application. CATEGORY: Programming. CALLING SEQUENCE: RESOLVE_ALL INPUTS: None. KEYWORD PARAMETERS: QUIET = if set, produce no messages. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: RESTRICTIONS: Will not resolve procedures or functions that are called via CALL_PROCEDURE, CALL_FUNCTION, or EXECUTE. Only explicit calls are resolved. If an unresolved procedure or function is not in the IDL search path, an error occurs, and no additional routines are resolved. PROCEDURE: This routine iteratively determines the names of unresolved calls to user-written or library procedures and functions, and then compiles them. The process stops when there are no unresolved routines. EXAMPLE: RESOLVE_ALL. MODIFICATION HISTORY: Written by: Your name here, Date. DMS, RSI, January, 1995.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/resolve_all.pro)
NAME:
REVERSE
PURPOSE:
Reverse the order of rows or columns in an array or vector.
CATEGORY:
Array manipulation.
CALLING SEQUENCE:
Result = REVERSE(Array [, Subscript_Index])
INPUTS:
Array: The array or vector containing the original data.
OPTIONAL INPUT PARAMETERS:
Subscript_Index: If this parameter is omitted or 1, the first subscript is
reversed (i.e., rows are reversed). Set this parameter to
2 to reverse columns.
KEYWORD PARAMETERS:
None.
OUTPUTS:
REVERSE returns a copy of the original array that is reversed about
one of its dimensions.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
Only works for 1-, 2-, or 3-dimensional arrays.
PROCEDURE:
Uses the ROTATE function.
MODIFICATION HISTORY:
Old.
Apr, 1991, DMS, Added 3D reversing.
Sept, 1992 Mark L. Rivers, added simple return for scaler argument
Sept, 1994. Added default for 3D case.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/reverse.pro)
NAME:
ROT
PURPOSE:
Rotate, magnify or demagnify, and/or translate an image.
CATEGORY:
Z3 - Image processing, geometric transforms.
CALLING SEQUENCE:
Result = ROT(A, Angle, [Mag, X0, Y0], MISSING = missing,
INTERP = Interp, CUBIC = Cubic)
INPUTS:
A: The image array to be rotated. This array may be of any type,
but it must have two dimensions.
ANGLE: Angle of rotation in degrees CLOCKWISE. (Why?,
because of an error in the old ROT.)
OPTIONAL INPUT PARAMETERS:
MAG: Magnification/demagnification factor. A value of 1.0 = no
change, > 1 is magnification and < 1 is demagnification.
X0: X subscript for the center of rotation. If omitted, X0 equals
the number of columns in the image divided by 2.
Y0: Y subscript for the center of rotation. If omitted, y0 equals
the number of rows in the image divided by 2.
KEYWORDS:
INTERP: Set this keyword for bilinear interpolation. If this keyword
is set to 0 or omitted, nearest neighbor sampling is used.
Note that setting this keyword is the same as using the
ROT_INT User Library function. This change (and others)
essentially makes ROT_INT obsolete.
CUBIC: If 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.
MISSING: The data value to substitute for pixels in the output image
that map outside the input image.
PIVOT: Setting this keyword causes the image to pivot around the point
X0, Y0, so that this point maps into the same point in the
output image. If this keyword is set to 0 or omitted, then the
point X0, Y0 in the input image is mapped into the center of
the output image.
OUTPUTS:
ROT returns a rotated, magnified, and translated version of the
input image. Note that the dimensions of the output image are
always the same as those of the input image.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
The POLY_2D function is used to translate, scale, and
rotate the original image.
EXAMPLE:
Create and display an image. Then display a rotated and magnified
version. Create and display the image by entering:
A = BYTSCL(DIST(256))
TV, A
Rotate the image 33 degrees and magnify it 1.5 times. Use bilinear
interpolation to make the image look nice. Enter:
B = ROT(A, 33, 1.5, /INTERP)
TV, B
MODIFICATION HISTORY:
June, 1982. Written by DMS, RSI.
Feb, 1986. Modified by Mike Snyder, ES&T Labs, 3M Company.
Adjusted things so that rotation is exactly on the
designated center.
October, 1986. Modified by DMS to use the POLY_2D function.
Aug, 1988. Added INTERP keyword.
Dec, 1992. Added PIVOT keyword, William Thompson, NASA/GSFC.
Nov, 1993. Added CUBIC keyword, DMS/RSI.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/rot.pro)
NAME:
RSTRPOS
PURPOSE:
This function finds the last occurrence of a substring within
an object string. If the substring is found in the expression,
RSTRPOS returns the character position of the match, otherwise
it returns -1.
CATEGORY:
String processing.
CALLING SEQUENCE:
Result = RSTRPOS(Expr, SubStr [, Pos])
INPUTS:
Expr: The expression string in which to search for the substring.
SubStr: The substring to search for.
OPTIONAL INPUTS:
Pos: The character position before which the search is bugun.
If Pos is omitted, the search begins at the last character
of Expr.
OUTPUTS:
Returns the position of the substring, or -1 if the
substring was not found within Expr.
SIDE EFFECTS:
Unlike STRPOS, Expr and SubStr must be strings.
EXAMPLE:
Expr = 'Holy smokes, Batman!' ; define the expression.
Where = RSTRPOS(Exp, 'smokes') ; find position.
Print, Where ; print position.
5 ; substring begins at position 5
; (the sixth character).
MODIFICATION HISTORY:
JWG, January, 1993
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/rstrpos.pro)
NAME:
RS_TEST
PURPOSE:
This function tests the hypothesis that two sample popultions,
{X(i), Y(i)}, have the same mean of distribution against the
hypothesis that they differ. The result is a two-element vector
containing the nearly-normal test statistic Z and the one-tailed
probability of obtaining a value of Z or greater. This type of
test is often refered to as the Wilcoxon Rank-Sum Test or Mann-
Whitney U-Test.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = RS_test(X, Y)
INPUTS:
X: An n-element vector of type integer, float or double.
Y: An m-element vector of type integer, float or double.
KEYWORD PARAMETERS:
UX: Use this keyword to specify a named variable which returns
the Mann-Whitney statistic for X.
UY: Use this keyword to specify a named variable which returns
the Mann-Whitney statistic for Y.
EXAMPLE:
Define the vectors of sample data.
x = [-14, 3, 1, -16, -21, 7, -7, -13, -22, -17, -14, -8, $
7, -18, -13, -9, -22, -25, -24, -18, -13, -13, -18, -5]
y = [-18, -9, -16, -14, -3, -9, -16, 10, -11, -3, -13, $
-21, -2, -11, -16, -12, -13, -6, -9, -7, -11, -9]
Test the hypothesis that two sample popultions, {X(i), Y(i)},
have the same mean of distribution against the hypothesis that they
differ at the 0.05 significance level.
result = rs_test(x, y, ux = ux, uy = uy)
The result should be the 2-element vector:
[1.45134, 0.0733429]
The keyword parameters should be returned as:
ux = 330.000, uy = 198.000
The computed probability (0.0733429) is greater than the 0.05
significance level and therefore we do not reject the hypothesis
that X and Y have the same mean of distribution.
PROCEDURE:
RS_TEST computes the nonparametric Rank Sum Test for populations of
equal or unequal size. The populations X(i) and Y(i) are combined
and individual elements are ranked based on magnitude. Elements of
identical magnitude are ranked using a rank equal to the mean of the
ranks that would otherwise be assigned. The Mann-Whitney statistics
(Ux and Uy) are computed and used to determine the nearly-normal test
statistic (Z) and the one-tailed probability of obtaining a value of
Z or greater. The hypothesis that two sample populations have the same
mean of distribution is rejected if Ux and Uy differ with statistical
significance. If either population contains 10 or fewer samples, the
test statistic (Z) and the one-tailed probability of obtaining a value
of Z or greater are returned as zero. In this case, consult published
tables such as the ones available in the REFERENCE given below.
REFERENCE:
PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition)
Ronald E. Walpole & Raymond H. Myers
ISBN 0-02-424170-9
MODIFICATION HISTORY:
Written by: GGS, RSI, August 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/rs_test.pro)
NAME:
R_CORRELATE
PURPOSE:
This function computes Spearman's (rho) or Kendalls's (tau) rank
correlation of two n-element vectors. The result is a two-element
vector containing the rank correlation coefficient and the two-sided
significance level of its deviation from zero.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = R_correlate(X, Y)
INPUTS:
X: An n-element vector of type integer, float or double.
Y: An n-element vector of type integer, float or double.
KEYWORD PARAMETERS:
KENDALL: If set to a nonzero value, Kendalls's (tau) rank correlation
is computed. By default, Spearman's (rho) rank correlation is
computed.
D: Use this keyword to specify a named variable which returns the
sum-squared difference of ranks. If the KENDALL keyword is set
to a nonzero value, this parameter is returned as zero.
ZD: Use this keyword to specify a named variable which returns the
number of standard deviations by which D deviates from its null-
hypothesis expected value. If the KENDALL keyword is set to a
nonzero value, this parameter is returned as zero.
PROBD: Use this keyword to specify a named variable which returns the
two-sided significance level of ZD. If the KENDALL keyword is
set to a nonzero value, this parameter is returned as zero.
EXAMPLE
Define two n-element vectors of tabulated data.
x = [257, 208, 296, 324, 240, 246, 267, 311, 324, 323, 263, 305, $
270, 260, 251, 275, 288, 242, 304, 267]
y = [201, 56, 185, 221, 165, 161, 182, 239, 278, 243, 197, 271, $
214, 216, 175, 192, 208, 150, 281, 196]
Compute Spearman's (rho) rank correlation of x and y.
result = r_correlate(x, y, d = d, zd = zd, probd = probd)
The result should be the two-element vector:
[0.835967, 4.42899e-06]
The keyword parameters should be returned as:
d = 218.000, zd = -3.64390, probd = 0.000268542
Compute Kendalls's (tau) rank correlation of x and y.
result = r_correlate(x, y, /kendall)
The result should be the two-element vector:
[0.624347 0.000118732]
REFERENCE:
Numerical Recipes, The Art of Scientific Computing (Second Edition)
Cambridge University Press
ISBN 0-521-43108-5
MODIFICATION HISTORY:
Written by: GGS, RSI, Aug 1994
R_CORRELATE is based on the routines spear.c and kendl1.c
described in section 14.6 of Numerical Recipes, The Art
of Scientific Computing (Second Edition), and is used by
permission.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/r_correlate.pro)
NAME:
R_TEST
PURPOSE:
This function tests the hypothesis that a binary sequence (a
sequence of 1s and 0s) represents a "random sampling". This
test is based on the "theory of runs" and is often refered to
as the Runs Test for Randomness. The result is a two-element
vector containing the nearly-normal test statistic Z and the
one-tailed probability of obtaining a value of Z or greater.
CATEGORY:
Statistics.
CALLING SEQUENCE:
Result = R_test(X)
INPUTS:
X: An n-element vector of type integer, float or double.
Elements not equal to 0 or 1 are removed and the length
of X is correspondingly reduced.
KEYWORD PARAMETERS:
R: Use this keyword to specify a named variable which returns
the number of runs (clusters of 0s and 1s) in X.
N0: Use this keyword to specify a named variable which returns
the number of 0s in X.
N1: Use this keyword to specify a named variable which returns
the number of 1s in X.
EXAMPLE:
Define a vector of 1s and 0s.
x = [0,1,1,0,1,0,0,0,1,0,0,1,1,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1]
Test the hypothesis that x represents a random sampling against the
hypothesis that it does not represent a random sampling at the 0.05
significance level.
result = r_test(x, r = r, n0 = n0, n1 = n1)
The result should be the 2-element vector:
[2.26487, 0.0117604]
The keyword parameters should be returned as:
r = 22.0000, n0 = 16.0000, n1 = 14.0000
The computed probability (0.0117604) is less than the 0.05
significance level and therefore we reject the hypothesis that x
represents a random sampling. The results show that there are too
many runs, indicating a non-random cyclical pattern.
PROCEDURE:
R_TEST computes the nonparametric Runs Test for Randomness. A
"run" is a cluster of identical symbols within a sequence of two
distinct symbols. The binary sequence (x) defined in EXAMPLE has
22 runs (or clusters). The first run contains one 0, the second
run contains two 1s, the third run contains one 0, and so on.
In general, the randomness hypothesis will be rejected if there
are lengthy runs of 0s or 1s or if there are alternating patters
of many short runs.
REFERENCE:
PROBABILITY and STATISTICS for ENGINEERS and SCIENTISTS (3rd edition)
Ronald E. Walpole & Raymond H. Myers
ISBN 0-02-424170-9
MODIFICATION HISTORY:
Written by: GGS, RSI, August 1994
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/r_test.pro)
NAME: SCALE3 PURPOSE: Set up transformation and scaling for basic 3D viewing. This procedure is similar to SURFR and SCALE3D, except that the data ranges must be specified and the scaling does not vary with rotation. CATEGORY: Graphics, 3D. CALLING SEQUENCE: SCALE3, XRANGE = xr, YRANGE = yr, ZRANGE = zr [, AX = ax] [, AZ = az] INPUTS: No plain parameters. KEYWORD PARAMETERS: XRANGE: Two-element vector containing the minimum and maximum X values. If omitted, the X-axis scaling remains unchanged. YRANGE: Two-element vector containing the minimum and maximum Y values. If omitted, the Y-axis scaling remains unchanged. ZRANGE: Two-element vector containing the minimum and maximum Z values. If omitted, the Z-axis scaling remains unchanged. AX: Angle of rotation about the X axis. The default is 30 degrees. AZ: Angle of rotation about the Z axis. The default is 30 degrees. OUTPUTS: No explicit outputs. Results are stored in the system variables !P.T, !X.S, !Y.S, and !Z.S. COMMON BLOCKS: None. SIDE EFFECTS: The 4 by 4 matrix !P.T (the 3D-transformation system variable), receives the homogeneous transformation matrix generated by this procedure. The axis scaling variables, !X.S, !Y.S, and !Z.S are set from the data ranges. RESTRICTIONS: Axonometric projections only. PROCEDURE: Set the axis scaling variables from the supplied ranges, then: 1) Translate the unit cube so that the center (.5,.5,.5) is moved to the origin. 2) Scale by 1/SQRT(3) so that the corners do not protrude. 3) Rotate -90 degrees about the X axis to make the +Z axis of the data the +Y axis of the display. The +Y data axis extends from the front of the display to the rear. 4) Rotate about the Y axis AZ degrees. This rotates the result counterclockwise as seen from above the page. 5) Then it rotates about the X axis AX degrees, tilting the data towards the viewer. 6) Translate back to the (0,1) cube. This procedure may be easily modified to affect different rotations transformations. EXAMPLE: Set up a 3D transformation where the data range is 0 to 20 for each of the 3 axes and the viewing area is rotated 20 degrees about the X axis and 55 degrees about the Z axis. Enter: SCALE3, XRANGE=[0, 20], YRANGE=[0, 20], ZRANGE=[0, 20], AX=20, AZ=55 MODIFICATION HISTORY: DMS, June, 1991.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/scale3.pro)
NAME: SCALE3D PURPOSE: Scale the 3D unit cube (a cube with the length of each side equal to 1) into the viewing area. CATEGORY: Graphics, 3D. CALLING SEQUENCE: SCALE3D INPUTS: No explicit inputs. !P.T is an implicit input. KEYWORD PARAMETERS: None. OUTPUTS: No explicit outputs. !P.T is an implicit output. COMMON BLOCKS: None. SIDE EFFECTS: !P.T is modified. RESTRICTIONS: Doesn't work for all forms of perspective transformations. PROCEDURE: Eight, 3D data points are created at the vertices of the 3D unit cube. They are transformed by !P.T. The system is translated to bring the minimum (x,y,z) point to the origin, and then scaled to make each coordinates maximum value equal to 1. MODIFICATION HISTORY: DMS, May, 1988.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/scale3d.pro)
NAME:
SEARCH2D
PURPOSE:
This function finds "objects" or regions of similar data
values within a 2-D array of data. Given a starting location
and a range of values to search for, SEARCH2D will find all
the cells within the array that are within the specified range
of values, and have some path of connectivity through these cells
to the starting location. In addition to searching for cells
within a global range of data values, SEARCH2D can also search
for adjacent cells whose values deviate from their neighbors within
specified tolerances. See the procedure "SEARCH3D" for the
three dimensional case.
This function returns a list of the array subscripts that define
the selected object or region.
CATEGORY:
Data subsetting.
Image manipulation.
CALLING SEQUENCE:
Region = SEARCH2D(Array, Xpos, Ypos, Min_val, Max_val)
INPUTS:
Array: The 2-D array of data to search.
Data type : Any 2-D array except string or structure.
Xpos: The X coordinate (first subscript into the 2-D Array)
of the starting cell for the search.
Data type : Long.
Ypos: The Y coordinate (second subscript into the 2-D Array)
of the starting cell for the search.
Data type : Long.
Min_val: The minimum data value to search for. All cells that
are connected to the starting cell, and have a value
greater than or equal to Min_val and less that or equal
to Max_val, will be considered part of the "object".
Max_val: The maximum data value to search for.
KEYWORD PARAMETERS:
DECREASE: If the DECREASE or INCREASE keywords are specified,
then SEARCH2D creates an internal copy of Array.
This internal copy is then processed to enhance the
object edges by using an algorithm similar to the
"SOBEL" edge enhancement process. Any adjacent
cells will be found if their corresponding data value
in the edge enhanced array is greater than DECREASE and
less than INCREASE. In any case, the adjacent cells
will NEVER be selected if their data value is not
between Min_val and Max_val.
The default is 0.0 if INCREASE is specified.
Otherwise, the default is no edge checking.
Data type : Int or Float (usually less than zero).
INCREASE: The maximum value in the edge enhanced array for
a cell to be considered part of the selected object.
Some savings in execution time and memory usage result
when DECREASE and INCREASE are omitted.
See DECREASE above.
The default is 0.0 if DECREASE is specified.
Otherwise, the default is no edge checking.
Data type : Int or Float (usually greater than zero).
LPF_BAND: This keyword indicates what (if any) Low Pass Filtering
is performed on the edge enhanced array before the
search begins. If LPF_BAND is set to 3 or higher
then the edge enhanced array will be smoothed using
LPF_BAND as the width of the smoothing window.
If LPF_BAND is less than 3 then no smoothing is
performed. This keyword only has effect when the
DECREASE or INCREASE keywords are supplied.
See DECREASE above.
The default is zero (no smoothing).
Data type : Int.
DIAGONAL: Normally, cells are considered adjacent only when
squares surrounding the cells share a common edge.
If a non-zero value is passed to DIAGONAL then
SEARCH2D will also locate cells meeting the search
criteria whose surrounding squares share a common
corner. Specifying diagonal search mode requires
more memory and execution time.
The default is no diagonal searching.
Data type : int
OUTPUTS:
This function returns a list of the indices into the 2-D array
that are part of the located object or region. This list is
returned as a LONARR(n) where n is the number of cells found.
If the returned array of indices is called Region, and the
size of the 2-D array of data is size_x by size_y, then the
actual X and Y indices can be obtained by using the following
algorithm :
index_y = Region / size_x
index_x = Region - (index_y * size_x)
The object within the 2-D Array could then be subscripted as :
Array(Region)
OR
Array(index_x, index_y)
EXAMPLE:
Find all the indices corresponding to an object contained in a
2-D array of data.
; Create some data.
img = FLTARR(512, 512)
img(3:503, 9:488) = 0.7
img(37:455, 18:438) = 0.5
img(144:388, 90:400) = 0.7
img(200:301, 1:255) = 1.0
img(155:193, 333:387) = 0.3
; Display the image.
TVSCL, img
; Search for an object starting at (175, 300) whose data values
; are between (0.6) and (0.8).
Region = SEARCH2D(img, 175, 300, 0.6, 0.8, /DIAGONAL)
; Scale the background cells into the range 0 to 127.
img = BYTSCL(img, TOP=127B)
; Highlight the object region by setting it to 255.
img(Region) = 255B
; Display the array with the highlighted object in it.
TVSCL, img
MODIFICATION HISTORY:
Written by: Daniel Carr. Thu Sep 3 15:36:17 MDT 1992
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/search2d.pro)
NAME:
SEARCH3D
PURPOSE:
This function finds "objects" or regions of similar data
values within a 3-D array of data. Given a starting location
and a range of values to search for, SEARCH3D will find all
the cells within the volume that are within the specified range
of values, and have some path of connectivity through these cells
to the starting location. In addition to searching for cells
within a global range of data values, SEARCH3D can also search
for adjacent cells whose values deviate from their neighbors within
specified tolerances. See the procedure "SEARCH2D" for the
two dimensional case.
This function returns a list of the array subscripts that define
the selected object or region.
CATEGORY:
Data subsetting.
Volume manipulation.
CALLING SEQUENCE:
Region = SEARCH3D(Array, Xpos, Ypos, Zpos, Min_val, Max_val)
INPUTS:
Array: The 3-D volume of data to search.
Data type : Any 3-D array except string or structure.
Xpos: The X coordinate (first subscript into the 3-D Array)
of the starting cell for the search.
Data type : Long.
Ypos: The Y coordinate (second subscript into the 3-D Array)
of the starting cell for the search.
Data type : Long.
Zpos: The Z coordinate (third subscript into the 3-D Array)
of the starting cell for the search.
Data type : Long.
Min_val: The minimum data value to search for. All cells that
are connected to the starting cell, and have a value
greater than or equal to Min_val and less that or equal
to Max_val, will be considered part of the "object".
Max_val: The maximum data value to search for.
KEYWORD PARAMETERS:
DECREASE: If the DECREASE or INCREASE keywords are specified,
then SEARCH3D creates an internal copy of Array.
This internal copy is then processed to enhance the
object edges by using an algorithm similar to the
"SOBEL" edge enhancement process (in 3-D). Any
adjacent cells will be found if their corresponding
data value in the edge enhanced array is greater
than DECREASE and less than INCREASE. In any case,
the adjacent cells will NEVER be selected if their
data value is not between Min_val and Max_val.
The default is 0.0 if INCREASE is specified.
Otherwise, the default is no edge checking.
Data type : Int or Float (usually less than zero).
INCREASE: The maximum value in the edge enhanced array for
a cell to be considered part of the selected object.
Some savings in execution time and memory usage result
when DECREASE and INCREASE are omitted.
See DECREASE above.
The default is 0.0 if DECREASE is specified.
Otherwise, the default is no edge checking.
Data type : Int or Float (usually greater than zero).
LPF_BAND: This keyword indicates what (if any) Low Pass Filtering
is performed on the edge enhanced array before the
search begins. If LPF_BAND is set to 3 or higher
then the edge enhanced array will be smoothed using
LPF_BAND as the width of the smoothing window.
If LPF_BAND is less than 3 then no smoothing is
performed. This keyword only has effect when the
DECREASE or INCREASE keywords are supplied.
See DECREASE above.
The default is zero (no smoothing).
Data type : Int.
DIAGONAL: Normally, cells are considered adjacent only when
cubes surrounding the cells share a common face.
If a non-zero value is passed to DIAGONAL then
SEARCH3D will also locate cells meeting the search
criteria whose surrounding cubes share a common
edge or corner. Specifying diagonal search mode
requires more memory and execution time.
The default is no diagonal searching.
Data type : int
OUTPUTS:
This function returns a list of the indices into the 3-D array
that are part of the located object or region. This list is
returned as a LONARR(n) where n is the number of cells found.
If the returned array of indices is called Region, and the
size of the 3-D volume of data is size_x by size_y by size_z,
then the actual X, Y, and Z indices can be obtained by using
the following algorithm :
index_z = Region / (size_x * size_y)
index_y = (Region - (index_z * size_x * size_y)) / size_x
index_x = (Region - (index_z * size_x * size_y)) - (index_y * size_x)
The object within the 3-D Array could then be subscripted as :
Array(Region)
OR
Array(index_x, index_y, index_z)
EXAMPLE:
Find all the indices corresponding to an object contained in a
3-D volume of data.
; Create some data.
vol = RANDOMU(s, 40, 40, 40)
vol(3:13, 1:15, 17:33) = 1.3
vol(15:25, 5:25, 15:25) = 0.2
vol(5:30,17:38,7:28) = 1.3
vol(9:23, 16:27, 7:33) = 1.5
; Search for an object starting at (6, 22, 16) whose data values
; are between (1.2) and (1.4)..
Region = SEARCH3D(vol, 6, 22, 16, 1.2, 1.4, /DIAGONAL)
; Scale the background cells into the range 0 to 127.
vol = BYTSCL(vol, TOP=127B)
; Highlight the object region by setting it to 255.
vol(Region) = 255B
; Set up a 3-D view.
Window, 0, Xsize=640, Ysize=512, Retain=2
Create_View, Xmax=39, Ymax=39, Zmax=39, ax=(-30), az=30, zoom=0.8
; Display the volume with the highlighted object in it.
TVSCL, PROJECT_VOL(vol, 64, 64, 40, Depth_Q=0.4)
MODIFICATION HISTORY:
Written by: Daniel Carr. Thu Sep 3 17:36:04 MDT 1992
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/search3d.pro)
NAME:
SETUP_KEYS
PURPOSE:
Set up function keys for use with IDL.
Under Unix, the number of function keys, their names, and the
escape sequences they send to the host computer vary
enough between various keyboards that IDL cannot be
written to understand all keyboards. Therefore, it provides
a very general routine named DEFINE_KEY that allows the
user to specify the names and escape sequences of function keys.
SETUP_KEYS uses DEFINE_KEY (called via modular procedures) to
enter the keys for known keyboards (Sun3, DEC VT200, HP,
Mips, PSTERM, SGI).
CATEGORY:
Misc.
CALLING SEQUENCE:
SETUP_KEYS
INPUTS:
None.
KEYWORD PARAMETERS:
NOTE: If no keyword is specified, SETUP_KEYS uses !VERSION to
determine the type of machine running IDL. It assumes that the
keyboard involved is of the same type (usually this is correct).
EIGHTBIT: When establishing VT200 function key definitions,
use the 8-bit versions of the escape codes instead
of the default 7-bit.
SUN: Establish function key definitions for a Sun3 keyboard.
VT200: Establish function key definitions for a DEC VT200 keyboard.
HP9000: Establish function key definitions for an HP 9000 series
300 keyboard. Although the HP 9000 series 300 supports both
xterm and hpterm windows, IDL supports only user-definable
key definitions in xterm windows - hpterm windows use
non-standard escape sequences which IDL does not attempt
to handle.
IBM Establish function key definitions for an IBM keyboard.
MIPS: Establish function key definitions for a Mips RS series
keyboard.
PSTERM: Establish function key definitions for PSTERMS such as those
found on the Sun Sparc Station.
SGI: Establish function key definitions for SGI keyboards.
APP_KEYPAD: Will define escape sequences for the group of keys
in the numeric keypad, enabling these keys to be programmed
within IDL.
NUM_KEYPAD: Will disable programmability of the numeric keypad.
OUTPUTS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
The definitions for the function keys are entered. The new keys
can be viewed using the command HELP, /KEYS.
For the HP keyboard, the upper right-hand group of four keys (at the
same height as the function keys) are called "BLANK1" through
"BLANK4", since they have no written labels. Keys defined to have
labels beginning with a capital "K" belong to the numeric keypad
group. For example, "K9" refers to keypad key "9".
Although the HP 9000 series 300 can create both xterm and hpterm
windows, IDL supports only user-definable key definitions in xterm
windows - hpterm windows use non-standard escape sequences which
IDL does not attempt to handle.
MODIFICATION HISTORY:
AB, 26 April 1989
TJA, July 1990. Added key definitions for HP 9000 series 300, as
well as Mips RS series; also rearranged code into
separate files.
SMR, April, 1991. Added key definitions for SGI and PSTERM
AB, 22 November 1994, Added key definitions for IBM.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/setup_keys.pro)
NAME: SFIT PURPOSE: This function determines a polynomial fit to a surface. CATEGORY: Curve and surface fitting. CALLING SEQUENCE: Result = SFIT(Data, Degree) INPUTS: Data: The two-dimensional array of data to fit. The sizes of the dimensions may be unequal. Degree: The maximum degree of fit (in one dimension). OUTPUT: This function returns a fitted array. OUTPUT KEYWORDS: Kx: The array of coefficients for a polynomial function of x and y to fit data. This parameter is returned as a (Degree+1) by (Degree+1) element array. PROCEDURE: Fit a 2D array Z as a polynomial function of x and y. The function fitted is: F(x,y) = Sum over i and j of kx(j,i) * x^i * y^j where kx is returned as a keyword. MODIFICATION HISTORY: July, 1993, DMS Initial creation
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/sfit.pro)
NAME: SHADE_SURF_IRR PURPOSE: Make a shaded surface representation of an irregulary gridded elevation dataset. The data must be representable as an array of quadrilaterals. This routine should be used when the (X, Y, Z) arrays are too irregular to be drawn by SHADE_SURF, but are still semi-regular. CATEGORY: Graphics, surface plotting. CALLING SEQUENCE: SHADE_SURF_IRR, Z, X, Y INPUTS: Z: A 2D array of elevations. This array must be dimensioned as (NX, NY). X: A 2D array containing the X location of each Z value. This array must be dimensioned as (NX, NY). Y: A 2D array containing the Y location of each Z value. This array must be dimensioned as (NX, NY). KEYWORD PARAMETERS: AX: The angle of rotation about the X axis. The default is 30 degrees. This parameter is passed to SURFR. AZ: The angle of rotation about the Z axis. The default is 30 degrees. This parameter is passed to SURFR. IMAGE: Set this keyword to an array that will contain the resulting shaded surface image. The variable is returned as a byte array of the same size as the currently selected graphics device. PLIST: Set this keyword to an array that will contain the polygon list on return. This feature is useful when you want to make a number of images from the same set of vertices and polygons. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: The currently selected display is modified. RESTRICTIONS: The grid described by X and Y must consist of quadrilaterals, must be semi-regular, and must be in "CLOCKWISE" order: i.e., each cell must be defined by the vertices: v(i,j), v(i+1,j),v(i+1,j+1), and v(i,j+1). Clockwise ordering: x(i,j) <= x(i+1, j) ... for all j and y(i,j) <= y(i, j+1) ... for all i. WARNING: This restriction is not checked. PROCEDURE: First, SURFR is called to establish the 3D to 2D transformation. Then the vertex and polygon data structures required by the POLYSHADE function are built and passed that function. POLYSHADE returns the shaded image which is then displayed by TV. This simple procedure can be modified to use and/or accept additional keywords. MODIFICATION HISTORY: Oct, 1989, DMS. DMS, Modified to use SURFR instead of SURFACE. and to return the polygon list.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/shade_surf_irr.pro)
NAME: SHOW3 PURPOSE: Show a 2D array three ways in a display that combines SURFACE, CONTOUR, and an image (color/gray scale pixels). CATEGORY: Display, graphics. CALLING SEQUENCE: SHOW3, Image [, INTERP = Interp, SSCALE = Sscale] INPUTS: Image: The 2-dimensional array to display. KEYWORD PARAMETERS: INTERP: Set this keyword to use bilinear interpolation on the pixel display. This technique is slightly slower, but for small images, it makes a better display. SSCALE: Reduction scale for surface. The default is 1. If this keyword is set to a value other than 1, the array size is reduced by this factor for the surface display. That is, the number of points used to draw the wire-mesh surface is reduced. If the array dimensions are not an integral multiple of SSCALE, the image is reduced to the next smaller multiple. OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: A new plot is generated. RESTRICTIONS: The display gets too "busy" when displaying larger (say 50 by 50), images, especially if they are noisy. It can be helpful to use the SSCALE keyword or the SMOOTH and/or REBIN functions to smooth the surface plot. You might want to modify the calls to CONTOUR and SURFACE slightly to customize the display to your tastes, i.e., with different colors, skirts, linestyles, contour levels, etc. PROCEDURE: First, do a SURFACE with no data to establish the 3D to 2D scaling. Then convert the coordinates of the corner pixels of the array to 2D. Use POLYWARP to get the warping polynomial to warp the 2D image into the area underneath the SURFACE plot. Output the image, output the surface (with data) and then output the contour plot at the top (z=1). MODIFICATION HISTORY: DMS. Jan, 1988. Added fudges for PostScript, April, 1988. Fixed bug where contour plot was occasionally clipped. Dec, 1990.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/show3.pro)
NAME: SHOWFONT PURPOSE: This procedure displays a vector-drawn font on the current graphics device. CATEGORY: Fonts. CALLING SEQUENCE: SHOWFONT, Font, Name INPUTS: Font: The index number of the font (may range from 3 to 29). Name: Title text to appear at top of display. KEYWORD PARAMETERS: ENCAPSULATED: If this keyword is set, and if the current graphics device is "PS", makes encapsulated PostScript output. OUTPUTS: No explicit outputs. SIDE EFFECTS: A display is made. RESTRICTIONS: Not very flexible. PROCEDURE: Straightforward. EXAMPLE: To create a display of Font 3 for PostScript: SET_PLOT, 'PS' SHOWFONT, 3, "Simplex Roman" MODIFICATION HISTORY: Written by: DMS, Nov, 1992 WSO, 1/95, Updated for new directory structure
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/showfont.pro)
Copyright (c) 1991-1993, Research Systems, Inc. All rights reserved. Unauthorized reproduction prohibited. RO ShowInfoEventHndlr, event
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/showinfo.pro)
NAME:
SKEY_DEC
PURPOSE:
Under Unix, the number of function keys, their names, and the
escape sequences they send to the host computer vary
enough between various keyboards that IDL cannot be
written to understand all keyboards. Therefore, it provides
a very general routine named DEFINE_KEY that allows the
user to specify the names and escape sequences. This
routine uses DEFINE_KEY to enter the keys for a DEC
VT200-style keyboard.
Note: SKEY_DEC is primarily designed to be called by
SETUP_KEYS, which attempts to automatically detect the correct
keyboard type in use, and define the keys accordingly.
Nonetheless, SKEY_DEC can be called as a standalone
routine.
This procedure is for Unix systems - NOT VMS.
CATEGORY:
Misc.
CALLING SEQUENCE:
SKEY_DEC
INPUTS:
None.
KEYWORD PARAMETERS:
EIGHTBIT: When establishing VT200 function key definitions,
use the 8-bit versions of the escape codes instead
of the default 7-bit.
APP_KEYPAD: Defines escape sequences for the group of keys
in the numeric keypad, enabling these keys to be programmed
within IDL.
NUM_KEYPAD: Disables programmability of the numeric keypad.
OUTPUTS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
The definitions for the function keys have been entered, and
can be viewed using the command HELP, /KEYS .
MODIFICATION HISTORY:
AB, 26 April 1989
TJA, July 1990, setup_keys_dec created by the "breakup" of setup_keys
into separate files. Also, keywords added to enable and
disable programmability of the numeric keypad.
AB, 21 September 1992,renamed from SETUP_KEYS_DEC to SKEY_DEC to
avoid DOS filename limitations.
AB, 16 June 1993, The IDL scanner used to treat octal string escapes
in a manner similar to the C language, but this ability was
removed to make the MS DOS port possible (conflicts with
file path specifications). Removed all uses of that here.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/skey_dec.pro)
NAME: SKEY_HP PURPOSE: Under Unix, the number of function keys, their names, and the escape sequences they send to the host computer vary enough between various keyboards that IDL cannot be written to understand all keyboards. Therefore, it provides a very general routine named DEFINE_KEY that allows the user to specify the names and escape sequences. This routine uses DEFINE_KEY to enter the keys for the HP 9000 series 300 keyboard. Note: SKEY_HP is primarily designed to be called by SETUP_KEYS, which attempts to automatically detect the correct keyboard type in use, and define the keys accordingly. Nonetheless, SKEY_HP can be called as a standalone routine. CATEGORY: Misc. CALLING SEQUENCE: SKEY_HP INPUTS: None. KEYWORD PARAMETERS: APP_KEYPAD: Defines escape sequences for the group of keys in the numeric keypad, enabling these keys to be programmed within IDL. NUM_KEYPAD: Disables programmability of the numeric keypad. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The definitions for the function keys have been entered, and can be viewed using HELP,/KEYS . The upper right-hand group of four keys (at the same height as the function keys) are called "BLANK1" through "BLANK4", since they have no written labels. Keys defined to have labels beginning with a capital "K" belong to the numeric keypad group. For example, "K9" refers to keypad key "9". Although the HP 9000 series 300 can create both xterm and hpterm windows, IDL supports only user-definable key definitions in xterm windows - hpterm windows use non-standard escape sequences which IDL does not attempt to handle. MODIFICATION HISTORY: TJA & AB, July 1990, setup_keys_hp created, and call to setup_keys_hp placed in procedure setup_keys AB, 21 September 1992,renamed from SETUP_KEYS_HP to SKEY_HP to avoid DOS filename limitations. AB, 16 June 1993, The IDL scanner used to treat octal string escapes in a manner similar to the C language, but this ability was removed to make the MS DOS port possible (conflicts with file path specifications). Removed all uses of that here.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/skey_hp.pro)
NAME: SKEY_MIPS PURPOSE: Under Unix, the number of function keys, their names, and the escape sequences they send to the host computer vary enough between various keyboards that IDL cannot be written to understand all keyboards. Therefore, it provides a very general routine named DEFINE_KEY that allows the user to specify the names and escape sequences. This routine uses DEFINE_KEY to enter the keys for the MIPS RS series keyboard. Note: SKEY_MIPS is primarily designed to be called by SETUP_KEYS, which attempts to automatically detect the correct keyboard type in use, and define the keys accordingly. Nonetheless, SKEY_MIPS can be called as a standalone routine. CATEGORY: Misc. CALLING SEQUENCE: SKEY_MIPS INPUTS: None. KEYWORD PARAMETERS: APP_KEYPAD: Defines escape sequences for the group of keys in the numeric keypad, enabling these keys to be programmed within IDL. NUM_KEYPAD: Disables programmability of the numeric keypad. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The definitions for the function keys have been entered, and can be viewed using HELP,/KEYS . The, , and keys are not defined, as they do not generate standard escape sequences. The same is true for , , and in the grouping of six keys above the arrow keys; however, the other three in the group ARE defined. Keys defined to have labels beginning with a capital "K" belong to the numeric keypad group. For example, "K9" refers to keypad key "9". The key is the only one within the keypad which is not defined. MODIFICATION HISTORY: TJA , July 1990. SETUP_KEYS_MIPS created, and call to SETUP_KEYS_MIPS placed in procedure SETUP_KEYS. AB, 21 September 1992,renamed from SETUP_KEYS_MIPS to SKEY_MIPS to avoid DOS filename limitations. AB, 16 June 1993, The IDL scanner used to treat octal string escapes in a manner similar to the C language, but this ability was removed to make the MS DOS port possible (conflicts with file path specifications). Removed all uses of that here.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/skey_mips.pro)
NAME: SKEY_SGI PURPOSE: Under Unix, the number of function keys, their names, and the escape sequences they send to the host computer vary enough between various keyboards that IDL cannot be written to understand all keyboards. Therefore, it provides a very general routine named DEFINE_KEY that allows the user to specify the names and escape sequences. This routine uses DEFINE_KEY to enter the keys for a Sun keyboard. Note: SKEY_SGI is primarily designed to be called by SETUP_KEYS, which attempts to automatically detect the correct keyboard type in use, and define the keys accordingly. Nonetheless, SKEY_SGI may be called as a standalone routine. CATEGORY: Misc. CALLING SEQUENCE: SKEY_SGI INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The definitions for the function keys have been entered, and can be viewed using HELP,/KEYS . MODIFICATION HISTORY: AB, 26 April 1989 TJA, July 1990, setup_keys_sun created by the "breakup" of setup_keys into separate files. SMR, April 1991, setup_keys_sgi created by modifying setup_keys_sun AB, 21 September 1992,renamed from SETUP_KEYS_SGI to SKEY_SGI to avoid DOS filename limitations. AB, 16 June 1993, The IDL scanner used to treat octal string escapes in a manner similar to the C language, but this ability was removed to make the MS DOS port possible (conflicts with file path specifications). Removed all uses of that here.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/skey_sgi.pro)
NAME: SKEY_SUN PURPOSE: Under Unix, the number of function keys, their names, and the escape sequences they send to the host computer vary enough between various keyboards that IDL cannot be written to understand all keyboards. Therefore, it provides a very general routine named DEFINE_KEY that allows the user to specify the names and escape sequences. This routine uses DEFINE_KEY to enter the keys for a Sun keyboard. Note: SKEY_SUN is primarily designed to be called by SETUP_KEYS, which attempts to automatically detect the correct keyboard type in use, and define the keys accordingly. Nonetheless, SKEY_SUN can be called as a standalone routine. CATEGORY: Misc. CALLING SEQUENCE: SKEY_SUN INPUTS: None. KEYWORD PARAMETERS: None. OUTPUTS: None. COMMON BLOCKS: None. SIDE EFFECTS: The definitions for the function keys have been entered, and can be viewed using the command HELP, /KEYS . MODIFICATION HISTORY: AB, 26 April 1989 TJA, July 1990, SETUP_KEYS_SUN created by the "breakup" of SETUP_KEYS into separate files. AB, 21 September 1992,renamed from SETUP_KEYS_SUN to SKEY_SUN to avoid DOS filename limitations. AB, 16 June 1993, The IDL scanner used to treat octal string escapes in a manner similar to the C language, but this ability was removed to make the MS DOS port possible (conflicts with file path specifications). Removed all uses of that here.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/skey_sun.pro)
NAME:
SLICER
PURPOSE:
Widget based application to show 3D volume slices and isosurfaces.
CATEGORY:
Volume display / rendering.
CALLING SEQUENCE:
COMMON VOLUME_DATA, A
A = your_volume_data
SLICER
INPUTS:
Variable A in VOLUME_DATA common contains volume data. See EXAMPLE
section below.
KEYWORD PARAMETERS:
COMMANDS: An optional string array of commands to execute
before entering the interactive mode. Commands are
in the form of a keyword optionally followed one or more
numeric, blank-separated parameters. For example:
"COMMAND P1 P2 P3 ... Pn"
Keywords and parameters are:
UNDO: Undo previous operation.
ORI X_Axis Y_Axis Z_axis X_Rev Y_Rev Z_Rev X_Rot Z_Rot Asp
This command sets the orientation for the SLICER
display. X_Axis, Y_Axis, and Z_Axis should be 0 for
data x, 1 for data y, and 2 for data z.
X_Rev, Y_Rev, and Z_Rev should be 0 for normal, 1 for
reversed. Asp is the Z axis aspect ratio w/ respect
to X, Y. X_Rot and Z_Rot are the rotations of the
X and Z axes in degrees (30 is the default).
For example, to interchange the X and Z axes and
reverse the Y use the string:
ORI 2 1 0 0 1 0 30 30
TRANS On_Off Threshold: Use this command to turn transparency
on or off and set the transparency threshold value.
1 means on, 0 means off. Threshold is expressed in
percent of data range (0 = min data value, 100 = max
data value).
SLICE Axis Value Interp 0: Draw an orthogonal slice along
the given axis (0=x, 1=y, 2=z) at Value. Set Interp
equal to 1 for interpolation, 0 for nearest neighbor.
Expose = 1 to remove, 0 for normal slice.
SLICE Azimuth, Elev, Interp, Expose, 1, x0, y0, z0: Draw
an oblique slice. The oblique plane crosses the
XY plane at angle Azimuth, with an elevation of Elev.
It passes thru the point (x0, y0, z0).
COLOR Table_Index Low High Shading: Set the color tables.
Table_Index is the pre-defined color table number (see
LOADCT), or -1 to retain the present table. Low, High
and Shading are expressed in percent.
ISO Threshold Hi_Lo: Draw an iso-surface. Threshold is the
isosurface threshold value. Hi_Lo should be set to 1
to view the low side, 0 for the high side.
ERASE: Erase the display.
CUBE Mode Cut_Ovr Interp X0 Y0 Z0 X1 Y1 Z1: Draw cube
(mode = 1) or cut-out (mode = 0).
Cut_Ovr should be set to 1 for cut-over, 0 for
cut-thru. Interp should be 1 for interpolation, 0
for nearest neighbor. (X0,Y0,Z0) is the lower corner
of the cube. (X1,Y1,Z1) is the upper corner.
(X0 < X1, etc.)
WAIT Secs: Wait the designated time (in seconds).
CMD_FILE: A string that contains the name of a file containing SLICER
commands to execute as described above.
DETACHED: if set, put the drawable in a separate window. (Good
for large windows.)
GROUP: The base ID of the widget that calls SLICER. When this
keyword is specified, the death of the caller results in the
death of the SLICER.
RANGE: A two-element array containing minimum and maximum data
values of interest. If this keyword is omitted, the data is
scanned for the minimum and maximum.
MODAL: If set, then the slicer runs in modal mode.
RESOLUTION: a two element vector giving the width and height of
the drawing window. Default = 55% by 44% of screen width.
OUTPUTS:
No explicit outputs.
COMMON BLOCKS:
COMMON VOLUME_DATA, A ;Used to pass in the volume data.
COMMON SLICER_COMMON ;Used internally.
COMMON SLICER_COMMON1 ;Used internally.
SIDE EFFECTS:
On exit, the Z-buffer contains the most recent image generated by
SLICER. The image may be redisplayed on a different device by
reading the Z-buffer contents, plus the current color table.
Widgets are created on the X window display.
RESTRICTIONS:
Widgets are required.
The volume data must fit in memory.
PROCEDURE:
The slicer program has the following modes:
Slices: Displays orthogonal slices thru the data volume.
Block: Displaces the surfaces of a selected block inside
the volume.
Cutout: Cuts blocks from previously drawn objects.
Isosurface: Draws an isosurface contour.
Probe: Displays the position and value of objects
using the mouse.
Colors: Manipulates the color tables and contrast.
Rotations: Sets the orientation of the display.
EXAMPLE:
Data is transferred to the SLICER via the VOLUME_DATA common block
instead of as an argument. This technique is used because volume
datasets can be very large and hence, the duplication that occurs when
passing values as arguments is a waste of memory. Suppose that you
want to read some data from the file "head.dat" into IDL for use
in the SLICER. Before you read the data, establish the VOLUME_DATA
common block with the command:
COMMON VOLUME_DATA, VOL
The VOLUME_DATA common block has just one variable in it. The variable
can have any name. Here, we're using the name "VOL". Now read the
data from the file into VOL. For example:
OPENR, 1, "head.dat"
VOL = FLTARR(20, 30, 42)
READU, 1, VOL
CLOSE, 1
Now you can run the SLICER widget application by entering:
SLICER
The data stored in VOL is the data being worked on by the SLICER.
To obtain the image in the slicer window after slicer is finished:
(Use the image with the current color tables).
SET_PLOT, 'Z' ;Use the Z buffer graphics device
a = TVRD() ;Read the image
MODIFICATION HISTORY:
DMS - RSI, Oct, 1991.
DMS - RSI, Mar, 1992. Added Journaling and expose mode.
Fixed bug with 24 bit color.
DMS - RSI, Jan, 1993. Added oblique slices.
DJC - RSI, Jun, 1994. Fixed oblique slice initialization and
atan(0,0) problem (on HP).
DJC - RSI, Feb, 1995. Added modal keyword.
DJC - RSI, Feb, 1995. Changed "poly" variable to "polyv" to
avoid clash with math "poly" function.
DJC - RSI, Mar, 1995. Fixed shading values for iso-surface.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/slicer.pro)
$Id: slider_alloc.pro,v 1.8 1995/01/20 19:41:01 tonyh Exp $
WidSlider
Widget Slider class library
Copyright (c) 1993, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
MODIFICATION HISTORY
Written by: Joshua Goldstein, 12/93
SLIDER_Icon
Return the slider toolbar icon
UNCTION SLIDER_Icon
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/slider_alloc.pro)
NAME:
SLIDE_IMAGE
PURPOSE:
Create a scrolling graphics window for examining large images.
By default, 2 draw widgets are used. The left draw widget shows
a reduced version of the complete image, while the draw widget on
the right displays the actual image with scrollbars that allow sliding
the visible window.
CALLING SEQUENCE:
SLIDE_IMAGE [, Image]
INPUTS:
Image: The 2-dimensional image array to be displayed. If this
argument is not specified, no image is displayed. The
FULL_WINDOW and SCROLL_WINDOW keywords can be used to obtain
the window numbers of the 2 draw widgets so they can be drawn
into at a later time.
KEYWORDS:
CONGRID: Normally, the image is processed with the CONGRID
procedure before it is written to the fully visible
window on the left. Specifying CONGIRD=0 will force
the image to be drawn as is.
FULL_WINDOW: A named variable in which to store the IDL window number of \
the non-sliding window. This window number can be used with
the WSET procedure to draw to the scrolling window at a later
point.
GROUP: The widget ID of the widget that calls SLIDE_IMAGE. If this
keyword is specified, the death of the caller results in the
death of SLIDE_IMAGE.
ORDER: This keyword is passed directly to the TV procedure
to control the order in which the images are drawn. Usually,
images are drawn from the bottom up. Set this keyword to a
non-zero value to draw images from the top down.
REGISTER: Set this keyword to create a "Done" button for SLIDE_IMAGE
and register the widgets with the XMANAGER procedure.
The basic widgets used in this procedure do not generate
widget events, so it is not necessary to process events
in an event loop. The default is therefore to simply create
the widgets and return. Hence, when register is not set,
SLIDE_IMAGE can be displayed and the user can still type
commands at the "IDL>" prompt that use the widgets.
RETAIN: This keyword is passed directly to the WIDGET_DRAW
function, and controls the type of backing store
used for the draw windows. If not present, a value of
2 is used to make IDL handle backing store.
SLIDE_WINDOW: A named variable in which to store the IDL window number of
the sliding window. This window number can be used with the
WSET procedure to draw to the scrolling window at a later
time.
TITLE: The title to be used for the SLIDE_IMAGE widget. If this
keyword is not specified, "Slide Image" is used.
TOP_ID: A named variable in which to store the top widget ID of the
SLIDE_IMAGE hierarchy. This ID can be used to kill the
hierarchy as shown below:
SLIDE_IMAGE, TOP_ID=base, ...
.
.
.
WIDGET_CONTROL, /DESTROY, base
XSIZE: The maximum width of the image that can be displayed by
the scrolling window. This keyword should not be confused
with the visible size of the image, controlled by the XVISIBLE
keyword. If XSIZE is not specified, the width of Image is
used. If Image is not specified, 256 is used.
XVISIBLE: The width of the viewport on the scrolling window. If this
keyword is not specified, 256 is used.
YSIZE: The maximum height of the image that can be displayed by
the scrolling window. This keyword should not be confused
with the visible size of the image, controlled by the YVISIBLE
keyword. If YSIZE is not present the height of Image is used.
If Image is not specified, 256 is used.
YVISIBLE: The height of the viewport on the scrolling window. If
this keyword is not present, 256 is used.
OUTPUTS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
Widgets for displaying a very large image are created.
The user typically uses the window manager to destroy
the window, although the TOP_ID keyword can also be used to
obtain the widget ID to use in destroying it via WIDGET_CONTROL.
RESTRICTIONS:
Scrolling windows don't work correctly if backing store is not
provided. They work best with window-system-provided backing store
(RETAIN=1), but are also usable with IDL provided backing store
(RETAIN=2).
Various machines place different restrictions on the size of the
actual image that can be handled.
MODIFICATION HISTORY:
7 August, 1991, Written by AB, RSI.
10 March, 1993, ACY, Change default RETAIN=2
23 Sept., 1994 KDB, Fixed Typo in comments. Fixed error in
Congrid call. xvisible was used instead of yvisible.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/slide_image.pro)
NAME:
SPH_4PNT
PURPOSE:
Given four 3-dimensional points, this procedure returns the
center and radius necessary to define the unique sphere passing
through those points.
CATEGORY:
Analytic Geometry.
CALLING SEQUENCE:
SPH_4PNT, X, Y, Z, Xc, Yc, Zc, R
INPUTS:
X: A 4-element vector containing the X coordinates of the points.
Y: A 4-element vector containing the Y coordinates of the points.
Z: A 4-element vector containing the Z coordinates of the points.
Note: X, Y, and Z should be floating-point or double-precision
vectors.
OUTPUTS:
Xc: The sphere's center x-coordinate.
Yc: The sphere's center y-coordinate.
Zc: The sphere's center z-coordinate.
R: The sphere's radius.
RESTRICTIONS:
Points may not coincide.
EXAMPLE:
Find the center and radius of the unique sphere passing through
the points: (1, 1, 0), (2, 1, 2), (1, 0, 3), (1, 0, 1)
Define the floating-point vectors containing the x, y and z
coordinates of the points.
X = [1, 2, 1, 1] + 0.0
Y = [1, 1, 0, 0] + 0.0
Z = [0, 2, 3, 1] + 0.0
Compute the sphere's center and radius.
SPH_4PNT, X, Y, Z, Xc, Yc, Zc, R
Print the results.
PRINT, Xc, Yc, Zc, R
MODIFICATION HISTORY:
Written by: GGS, RSI, Jan 1993
Modified: GGS, RSI, March 1994
Rewrote documentation header.
Uses the new Numerical Recipes NR_LUDCMP/NR_LUBKSB.
Modified: GGS, RSI, November 1994
Changed internal array from column major to row major.
Changed NR_LUDCMP/NR_LUBKSB to LUDC/LUSOL
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/sph_4pnt.pro)
NAME: SPH_SCAT PURPOSE: Interpolate to a regular grid given scattered samples on the surface of a sphere. CATEGORY: Interpolation. CALLING SEQUENCE: Result = SPH_SCAT(lon, lat, f) INPUTS: lon = sample longitudes, a vector, in degrees. lon, lat, and f must have the same number of points. lat = sample latitudes, a vector, in degreees. f = data values measured at lon and lat. f(i) = sample value at lon(i), lat(i). KEYWORD PARAMETERS: GS: If present, GS must be a two-element vector [XS, YS], where XS is the spacing between grid points in longitude, and YS is the spacing in latitude. The default is based on the extents of lon and lat. If the grid starts at longitude Lonmin and ends at Lonmax, then the default horizontal spacing is (Lonmax - Lonmin)/(NX-1). YS is computed in the same way. The default grid size, if neither NX or NY are specified, is 26 by 26. BOUNDS: If present, BOUNDS must be a four element array containing the grid limits in longitude and latitude of the output grid: [Lonmin, Latmin, Lonmax, Latmax]. If not specified, the grid limits are set to the extent of lon and lat. Warning: to cover all longitudes, you must directly specify BOUNDS. NX: The output grid size in the longitude direction. NX need not be specified if the size can be inferred from GS and BOUNDS. The default value is 26. NY: The output grid size in the latitude direction. See NX. BOUT: the actual extent of the regular grid, arranged as in bounds. An optional output parameter. GOUT: The actual grid spacing, a two element optional output array. OUTPUTS: Result = regularly interpolated result. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: Timing. on a Sun SPARCstation LX producing a 36 x 36 output grid (1296 points), t is ~ .578 + .00368 * N + 2.39e-06 * N^2. For example: N 16 64 256 1024 4096 Time .7 .8 1.6 6.6 56 Output points are produced at a rate of approximately 2000 points per second. PROCEDURE: This routine is a convenience interface to the Spherical gridding and interpolation provided by TRIANGULATE and TRIGRID. The methods are based on the work of Robert Renka, Interpolation of Data on the Surface of a Sphere, Oak Ridge Natl Lab Technical Paper CSD-108. The procedure consists of generating a triangulation of the scattered data points, estimating the gradients with a local method, and then constructing a triangle based interpolant of the data and gradient estimates. The interpolant is C(1) continuous. EXAMPLE: Create 50 random longitudes and latitudes, make a function value, and then interpolate, obtaining a 360 x 360 array of 10 degree by 5 degree resolution that covers the sphere: lon = randomu(seed, 50) * 360. -180. ;Make random scattered points lat = randomu(seed, 50) * 180. -90. z = sin(lat*!DTOR) ;Make a function to fit c = cos(lat*!DTOR) x = cos(lon*!DTOR) * c y = sin(lon*!DTOR) * c f = sin(x+y) * sin(x*z) ;The dependent variable ** Now, given lon, lat, and f, interpolate the data: result = sph_scat(lon, lat, f, bounds=[0, -90, 350, 85], gs=[10,5]) MODIFICATION HISTORY: DMS, November, 1994. Written.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/sph_scat.pro)
NAME: SPLINE PURPOSE: This function performs cubic spline interpolation. CATEGORY: Interpolation - E1. CALLING SEQUENCE: Result = SPLINE(X, Y, T [, Sigma]) INPUTS: X: The abcissa vector. Values MUST be monotonically increasing. Y: The vector of ordinate values corresponding to X. T: The vector of abcissae values for which the ordinate is desired. The values of T MUST be monotonically increasing. OPTIONAL INPUT PARAMETERS: Sigma: The amount of "tension" that is applied to the curve. The default value is 1.0. If sigma is close to 0, (e.g., .01), then effectively there is a cubic spline fit. If sigma is large, (e.g., greater than 10), then the fit will be like a polynomial interpolation. OUTPUTS: SPLINE returns a vector of interpolated ordinates. Result(i) = value of the function at T(i). RESTRICTIONS: Abcissa values must be monotonically increasing. EXAMPLE: The commands below show a typical use of SPLINE: X = [2.,3.,4.] ;X values of original function Y = (X-3)^2 ;Make a quadratic T = FINDGEN(20)/10.+2 ;Values for interpolated points. ;twenty values from 2 to 3.9. Z = SPLINE(X,Y,T) ;Do the interpolation. MODIFICATION HISTORY: Author: Walter W. Jones, Naval Research Laboratory, Sept 26, 1976. Reviewer: Sidney Prahl, Texas Instruments. Adapted for IDL: DMS, Research Systems, March, 1983.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/spline.pro)
NAME: SPLINE_P PURPOSE: This procedure performs parameteric cubic spline interpolation. CATEGORY: Interpolation - E1. CALLING SEQUENCE: SPLINE_P, X, Y, Xr, Yr INPUTS: X: The abcissa vector (should be floating or double). Y: The vector of ordinate values corresponding to X. Neither X or Y need be monotonic. KEYWORD PARAMETERS: INTERVAL: The interval in XY space between interpolants. If omitted, approximately 8 interpolants per XY segment will result. TAN0: The tangent to the spline curve at X(0), Y(0). If omitted, the tangent is calculated to make the curvature of the result zero at the beginning. This is a two element vector, containing the X and Y components of the tangent. TAN1: The tangent to the spline curve at X(N-1), Y(N-1). If omitted, the tangent is calculated to make the curvature of the result zero at the end. This is a two element vector, containing the X and Y components of the tangent. OUTPUTS: XR: The abcissa values of the interpolated function. This may NOT be the same variable as either X or Y. YR: The ordinate values of the interpolated function. This may NOT be the same variable as either X or Y. RESTRICTIONS: X and Y should be floating or double. PROCEDURE: Cubic spline interpolation with relaxed or clamped end conditions as used in the Numerical Recipes. This routine is both more general and faster than the user's library function SPLINE. One call to SPLINE_P is equivalent to two calls to SPLINE, as both the X and Y are interpolated with splines. It is suited for interpolating between randomly placed points, and the abcissae values need not be monotonic. In addition, the end conditions may be optionally specified via tangents. EXAMPLE: The commands below show a typical use of SPLINE_P: X = [0.,1,0,-1,0] ;Abcissae for square with a vertical diagonal Y = [0.,1,2,1,0] ;Ordinates SPLINE_P, X, Y, XR, YR ;Interpolate with relaxed end conditions PLOT, XR, YR ;Show it As above, but with setting both the beginning and end tangents: SPLINE_P, X, Y, XR, YR, TAN0=[1,0], TAN1=[1,0] This yields approximately 32 interpolants. As above, but with setting the interval to 0.05, making more interpolants, closer together: SPLINE_P, X, Y, XR, YR, TAN0=[1,0], TAN1=[1,0], INTERVAL=0.05 This yields 116 interpolants and looks close to a circle. MODIFICATION HISTORY: DMS, RSI. August, 1993. Written. DMS, RSI. Jan, 1994. Modified to use NR_ spline routines.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/spline_p.pro)
NAME: STRETCH PURPOSE: Stretch the image display color tables so the full range runs from one color index to another. CATEGORY: Image processing, point operations. CALLING SEQUENCE: STRETCH, Low, High [, /CHOP] INPUTS: Low: The lowest pixel value to use. If this parameter is omitted, 0 is assumed. Appropriate values range from 0 to the number of available colors-1. High: The highest pixel value to use. If this parameter is omitted, the number of colors-1 is assumed. Appropriate values range from 0 to the number of available colors-1. OPTIONAL INPUTS: Gamma: Gamma correction factor. If this value is omitted, 1.0 is assumed. Gamma correction works by raising the color indices to the Gamma power, assuming they are scaled into the range 0 to 1. KEYWORD PARAMETERS: CHOP: If this keyword is set, color values above the upper threshold are set to color index 0. Normally, values above the upper threshold are set to the maximum color index. OUTPUTS: No explicit outputs. COMMON BLOCKS: COLORS: The common block that contains R, G, and B color tables loaded by LOADCT, HSV, HLS and others. SIDE EFFECTS: Image display color tables are loaded. RESTRICTIONS: Common block COLORS must be loaded before calling STRETCH. PROCEDURE: New R, G, and B vectors are created by linearly interpolating the vectors in the common block from Low to High. Vectors in the common block are not changed. If NO parameters are supplied, the original color tables are restored. EXAMPLE: Load the STD GAMMA-II color table by entering: LOADCT, 5 Create and display and image by entering: TVSCL, DIST(300) Now adjust the color table with STRETCH. Make the entire color table fit in the range 0 to 70 by entering: STRETCH, 0, 70 Notice that pixel values above 70 are now colored white. Restore the original color table by entering: STRETCH MODIFICATION HISTORY: DMS, RSI, Dec, 1983. DMS, April, 1987. Changed common. DMS, October, 1987. For unix. DMS, RSI, Nov., 1990. Added GAMMA parameter.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/stretch.pro)
NAME:
STR_SEP
PURPOSE:
This routine cuts a string into pieces which are separated by the
separator string.
CATEGORY:
String processing.
CALLING SEQUENCE:
arr = STR_SEP(string, separator)
INPUTS:
str - The string to be separated.
sep - The separator.
KEYWORDS:
ESC = escape character. Only valid if separator is a single character.
Characters following the escape character are treated
literally and not interpreted as separators.
For example, if the separator is a comma,
and the escape character is a backslash, the character
sequence 'a\,b' is a single field containing the characters
'a,b'.
REMOVE = if set, remove all blanks from fields.
TRIM = if set, remove only leading and trailing blanks from fields.
OUTPUT:
An array of strings as function value.
COMMON BLOCKS:
None
SIDE EFFECTS:
No known side effects.
RESTRICTIONS:
None.
EXAMPLE:
array = STR_SEP ("ulib.usca.test", ".")
MODIFICATION HISTORY:
July 1992, AH, CreaSo Created.
December, 1994, DMS, RSI Added TRIM and REMOVE.
(See /host/bluemoon/usr2/idllib/../rsi/idl_4/lib/str_sep.pro)
NAME: SURFR PURPOSE: Set up 3D transformations. This procedure duplicates the rotation, translation, and scaling features of the SURFACE routine. CATEGORY: Graphics, 3D. CALLING SEQUENCE: SURFR [, AX = ax] [, AZ = az] INPUTS: No plain parameters. KEYWORD PARAMETERS: AX: Angle of rotation about the X axis. The default is 30 degrees. AZ: Angle of rotation about the Z axis. The default is 30 degrees. OUTPUTS: No explicit outputs. Results are stored in !P.T. COMMON BLOCKS: None. SIDE EFFECTS: The 4 by 4 matrix, !P.T, the 3D transformation system variable, receives the homogeneous transformation matrix generate