This page was created by the IDL library routine
mk_html_help. For more information on
this routine, refer to the IDL Online Help Navigator
or type:
? mk_html_help
at the IDL command line prompt.
Last modified: Wed Jun 25 12:45:56 1997.
NAME:
ABGRAD
PURPOSE:
Calculates the absolute value of the gradient of a function represented
as an array of values. Works for 1-7 dimensions.
CATEGORY:
Array Manipulation
CALLING SEQUENCE:
Result = ABGRAD( ARR [, DELTA])
INPUTS:
ARR
Array, numeric, number of dimensions can be 1 through 7
OPTIONAL INPUT PARAMETERS:
DELTA
Size of step used to calculate the numeric derivatives. The approx.
partial derivative in the i-th direction is calculated as
(ARR(...,I + DELTA,...) - ARR(...,I - DELTA,...))/(2*DELTA).
The default value of DELTA is 1. If provided, it is rounded to an
integer on input.
KEYWORD PARAMETERS:
None.
OUTPUTS:
Returns the absolute value of the gradient as an array of the same size
and type as ARR. If ARR is not an array, returns 0.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
Due to current limitations of the MAKE_ARRAY system routine, 8
dimensions are not allowed.
PROCEDURE:
Creates an 7-dimensional array, with dummy leading dimensions,
containing the original array. Generates the differences using the
SHIFT system routine and strips the dummy dimensions at the end.
Uses the function DEFAULT from MIDL.
MODIFICATION HISTORY:
Created 15-NOV-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/abgrad.pro)
NAME: ANNOTATE PURPOSE: Use the mouse to label a plot. CATEGORY: CALLING SEQUENCE: annotate,label[,color=color][,size=size][,x=x][,y=y] INPUTS: label = string to put on plot. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: color = color for label. size = size of label. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: x = x position of label, in data coordinates. y = y position of label, in data coordinates. COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: David L. Windt, AT&T Bell Labs, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/annotate.pro)
NAME:
ARC
PURPOSE:
Draws a circular arc in the currently defined plot area. DATA
coordinates are used. The method of drawing depends on the number of
input parameters provided (see details in CALLING SEQUENCE below).
CATEGORY:
General Graphics.
CALLING SEQUENCE:
There are two possible modes of operation, and accordingly two
different calling sequences:
Mode 1:
ARC, R1, CENTER = CENT, ANGLE = ANG [, optional keywords]
In this mode an arc with angular measure ANG is drawn around the point
CENT, in the mathematical-positive direction, starting from point R1.
Mode 2:
ARC, R1, R2, {RADIUS = RAD, ANGLE = ANG} [, optional keywords]
In this mode the arc is drawn in the mathematical-positive direction,
from point R1 to point R2. The arc is either drawn with radius RAD, or
corresponding to an angle ANG (both RAD and ANG cannot be specified).
INPUTS:
R1, R2
2-dimensional vectors in the [x,y] format, representing points in the
plotting area. R1 is mandatory. The presence of R2 indicates that
Mode 2 is being used.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
CENTER
2 dimensional vector, arc center location, format [x,y].
Mandatory in Mode 1, forbidden in Mode 2.
RADIUS
Scalar, the radius of the arc. |
Forbidden in Mode 1, allowed in Mode 2. | In Mode 2
ANGLE | one and only one
Scalar, the angle measure of the arc. | needs to be provided.
Mandatory in Mode 1, allowed in Mode 2. |
/DEGREES
Indicates that the angle ANG is given in degrees (default is radians).
/BIGARC
When drawing in Mode 2, with the radius provided, there are two
possible arcs that can be drawn, corresponding to angles smaller and
bigger than 180 degrees (the sum of both angles is 360 degrees). By
default the smaller arc is drawn. Setting BIGARC selects the bigger arc.
/SYMMETRIC
In Mode 1 causes the arc to be drawn symmetrically on both sides of R1.
Forbidden in Mode 2.
COLOR
Standard IDL plotting interpretation.
LINESTYLE
Ditto.
THICK
Ditto.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
The arc will appear as a true circular arc only if the aspect ratio of
the X to Y axes is 1:1.
PROCEDURE:
Uses calls to DEFAULT, ONE_OF and SHAPE_COCON from MIDL.
Generates a (2,N) array containing a sufficient number of the arc
points to yield a smooth curve. N is variable, depending both on the
arc size and on the pixel size of the current output device.
MODIFICATION HISTORY:
Created 15-DEC-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/arc.pro)
NAME:
ARREQ
PURPOSE:
Compares arrays for equality. The arrays qualify as equal if:
1) They are of the same general type (num., char., or struct.).
2) Number of dimensions is the same.
3) Size of each dimension is the same.
4) Respective elements are equal.
CATEGORY:
Mathematical Function (general).
CALLING SEQUENCE:
Result = ARREQ( ARR1, ARR2 [, /WARN])
INPUTS:
ARR1, ARR2
Arrays, type and number of dimensions arbitrary.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
/WARN
If set, a warning message is issued for incompatible data types.
/NOVALUE
If set, only number of elements and structure are compared.
OUTPUTS:
Returns 1 if the arrays are equal, 0 otherwise.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses the SIZE function to obtain information about the arrays.
Compares, in order, data types, number of dimensions, size of each
dimension and (unless NOVALUE is set) individual elements.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/arreq.pro)
NAME:
ARROW.
PURPOSE:
Draws an arrow in the current plot area, from the FROM to the TO
location. DATA coordinates are used, unless one of the keywords
/DEVICE or /NORMAL is set.
CATEGORY:
General Graphics.
CALLING SEQUENCE:
ARROW, FROM = tail, TO = head [, keywords]
INPUTS:
None.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
FROM
Two dimensional vector, start location, mandatory.
TO
Two dimensional vector, end location, mandatory.
SIZE
Scalar, specifies size of head [and tail], default is 1.
/TAIL
Puts a tail on the arrow.
/TWOSIDED
Draws a twosided arrow (heads on both ends).
COLOR
Standard IDL plotting interpretation.
/DEVICE
Ditto.
LINESTYLE
Ditto.
/NORMAL
Ditto.
THICK
Ditto.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses DEFAULT, ONE_OF, SHAPE_COCON and SHAPE_TRANS from MIDL. All the
coordinates are converted to DEVICE coordinates for shape generation
and plotting purposes.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
Modified 15-DEC-1991 by Mati Meron. Added keywords COLOR and TWOSIDED.
(See /usr/local/rsi/idl_4/lib/weitere/arrow.pro)
NAME:
ASP_CORR
PURPOSE:
Corrects the aspect ratio of a 2-dimensional shape, in order to make up
for for different scaling in the x and y dimensions.
CATEGORY:
Array Manipulation /General Graphics.
CALLING SEQUENCE:
Result = ASP_CORR( SHAPE, REFERENCE = reflin)
INPUTS:
SHAPE
(2,*) numeric array, mandatory.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
REFERENCE
Defines the scaling procedure, according to the provided character
value. Accepts one of the following six values (only the first two
characters matter):
'XLO' : Scale x, keeping lowest x-value constant.
'XCEN': Scale x, keeping center x-value constant.
'XHI' : Scale x, keeping highest x-value constant.
'YLO' : Scale y, keeping lowest y-value constant.
'YCEN': Scale y, keeping center y-value constant.
'YHI' : Scale y, keeping highest y-value constant.
OUTPUTS:
0 in case of failure (bad or missing shape or keyword value), otherwise
the transformed shape is returned as a floating array (double if the
input is of type double)
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
Three dimensional shapes aren't currently accepted.
PROCEDURE:
Uses calls to CAST, DEFAULT, IS_SHAPE and STRMATCH from MIDL. The
scaling is done using the sizes of the plotting area in device
coordinates, provided by the system variables !d.x_vsize and
!d.y_vsize. Therefore the scaling is always proper for the current
output device.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/asp_corr.pro)
NAME:
BOX
PURPOSE:
Creates an empty plot area, with boundaries defined by XLIMS and YLIMS.
CATEGORY:
General Graphics.
CALLING SEQUENCE:
BOX, XLIMS, YLIMS [, keywords]
INPUTS:
XLIMS, YLIMS
2 dimensional vectors, format: [xmin,xmax] and [ymin,ymax] respectively.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
/BORDER
draws a border around the plot area. Default - no border.
/OVER
creates the plot area over an existing plot. Default - new plot area.
TRUASP
Corrects the XLIMS or YLIMS values to yield a 1:1 aspect ratio.
Accepts six possible character values (only first 2 characters matter):
'XLO' : Scale x, keeping lowest x-value constant.
'XCEN': Scale x, keeping center x-value constant.
'XHI' : Scale x, keeping highest x-value constant.
'YLO' : Scale y, keeping lowest y-value constant.
'YCEN': Scale y, keeping center y-value constant.
'YHI' : Scale y, keeping highest y-value constant.
CHARSIZE
Standard IDL plotting interpretation
COLOR
Ditto
TITLE
Ditto
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
If the keyword TRUASP is set, XLIMS and YLIMS will contain, on return,
the new (scaled) values.
RESTRICTIONS:
None.
PROCEDURE:
Uses calls to CAST, DEFAULT and STRMATCH from MIDL. The scaling is
done using the sizes of the plotting area in device coordinates,
provided by the system variables !d.x_vsize and !d.y_vsize. Therefore
the scaling is always proper for the current output device.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
Modified 15-DEC-1991 by Mati Meron. Added keyword COLOR.
(See /usr/local/rsi/idl_4/lib/weitere/box.pro)
NAME:
CAST
PURPOSE:
Generalized type casting. Converts all variables whose type code is
out of the range [LOW,HIGH] into this range.
CATEGORY:
Type conversion
CALLING SEQUENCE:
Result = CAST( X, LOW [,HIGH])
INPUTS:
X
Numerical, arbitrary, or a character representation of a number(s).
LOW
Number representing a type code, range (1:7). Converted to integer on
input. If greater than 7, it is set to 7. If less then 1, or not
given, it is set to 1.
OPTIONAL INPUT PARAMETERS:
HIGH
Type code, same as LOW. Default value is 7. If provided and less then
LOW, it is set to LOW.
KEYWORD PARAMETERS:
None.
OUTPUTS:
If the type of X is < LOW, CAST returns X converted to type LOW.
If the type of X is > HIGH, CAST returns X converted to type HIGH.
Otherwise CAST returns X.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
An attempt to convert a string which is NOT a character representation
of a number into a numeric type will result in an error.
PROCEDURE:
Identifies the type of X, and if out of the range given by [LOW,HIGH]
calls the proper conversion routine using the system routine
CALL_FUNCTION. Also uses DEFAULT and TYPE from MIDL.
MODIFICATION HISTORY:
Created 25-DEC-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/cast.pro)
NAME:
CCW_PICKF
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.
EXTERN LIBRARIES:
creasolib.tlb
CATEGORY:
Widgets.
CALLING SEQUENCE:
Result = ccw_pickf()
KEYWORD PARAMETERS:
GROUP: The widget ID of the widget that calls ccw_pickf. When this
ID is specified, a death of the caller results in the death of
the ccw_pickf widget application.
READ: Set this keyword to make the title of the ccw_pickf window
"Select File to Read".
WRITE: Set this keyword to make the title of the ccw_pickf window
"Select File to Write".
PATH: The initial path to select files from. If this keyword is
not set, the current directory is used. (will be changed)
FILTER: A string array of file extensions to be allowed. This
keyword is used to ensure that the user can only select files
of a certain type. (will be changed)
Passing a string (not a string array!) that contains wildcard
characters (*), this string serves as a filename filter.
LANGARR: Language array. Follwing order of used words has to specified
langarr (0) = filter
langarr (1) = up one directory level
langarr (2) = subdirectories
langarr (3) = files
langarr (4) = selection
langarr (5) = ok
langarr (6) = cancel
langarr (7) = message
langarr (8) = directory >
langarr (9) = < does not exist !
langarr (10) = please select a file
langarr (11) = for reading
langarr (12) = for writing
langarr (13) = File >
If it is not specified, the standard english vocabulary is
used
GERMAN: If the language array was not specified, then standard german
vocabulary was used.
CREATE: If this keyword is set, the selected filename will be tested on
existing filepath only.
Example: If you want to specify an filename for writing, the
filename must not exist. Then the ccw_pickf routine
checks only the filepath.
XOFFSET: X offset of ccw_pickf widget.
YOFFSET: Y offset of ccw_pickf widget.
TITLE: A scalar string to be used for the window title.
OUTPUTS:
CCW_PICKF returns a string that contains the name of the file selected.
If no file is selected, CCW_PICKF 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:
Only on VAX/VMS tested.
This routine is known to work on Suns (OPEN LOOK), MIPS, RS/6000,
VAX/VMS and SGI machines.
Only one instance of the CCW_PICKF widget can be running at one time.
CCW_PICKF 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 CCW_PICKF 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 = CCW_PICKF (/READ, FILTER = ['pro', 'dat'])
Create a CCW_PICKF widget that lets users select only files beginning
with with 'x' and the extension 'pro'. Use the 'Select File to Write'
title and store the name of the selected file in the variable F. Enter:
F = CCW_PICKF (/WRITE, FILTER = 'x*.pro')
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.
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
6/92 - HJB Fixed various bugs for VMS and added functionality to
change disks on VMS (Filter) including interpreting
filters like "*.d*" for VMS.
8/92 - HJB Added X and Y offset keywords.
10/92 - AH Changed to Compound Widget. (redesign)
(See /usr/local/rsi/idl_4/lib/weitere/ccw_pickf.pro)
NAME:
CHANGEDIR
PURPOSE:
This routine changes the current directory.
CALLING SEQUENCE:
changedir, dir, error=error, /message
INPUTS:
None
KEYWORDS:
error - if an error occured, error is -1
message - if an error occured, a message wil be send
OUTPUT:
None
COMMON BLOCKS:
None
SIDE EFFECTS:
No known side effects.
RESTRICTIONS:
For VAX/VMS only.
EXAMPLE:
MODIFICATION HISTORY:
July 1992, AH, CreaSo Created.
(See /usr/local/rsi/idl_4/lib/weitere/changedir.pro)
NAME: CHECK_TYPE_DIM PURPOSE: This function returns a TRUE or FALSE value (1 or 0) depending on the type of the variable, e.g. is it of type integer. CALLING SEQUENCE: RESULT = CHECK_DATA_TYPE ( VARIABLE ) But the result only makes sense if one keyword or more are set. INPUTS: VARIABLE: an IDL variable to be checked. KEYWORD PARAMETERS: There are two classes of keywords. First, there is ... DIMENSIONS the number of dimensions; check that the input variable is as specified; this parameter can be a scalar (only one dimensionality is expected) or a vector (if several dimensionali- ties are allowed) Next, there are keywords that specify the data types expected for VARIABLE. The choices are: UNDEFINED, BYTE, INTEGER, LONG, FLOAT, DOUBLE, COMPLEX, STRING, and STRUCTURE; and there is also the choice NUMERIC, which is the same as setting the BYTE, INTEGER, LONG, FLOAT, and DOUBLE keywords. OUTPUTS: The function returns 1 if the dimensions are correct and if the data type matches any set keyword, otherwise it returns 0. EXAMPLE: On entering a procedure, you can check that the input parameter P1 is a 1, 2, or 3-dimensional floating or double array, as follows: if not check_data_type ( p1, dim=[1,2,3], /float, /double ) then $ message, "Invalid parameter P1" MODIFICATION HISTORY: Written by: James Hamill Siemens Medical Systems 2501 N. Barrington Rd. Hoffman Estates, IL 60195-7372 (708)304-7760 hamill@sgi.siemens.com October, 1993
(See /usr/local/rsi/idl_4/lib/weitere/check_type_dim.pro)
NAME: chisqr PURPOSE: Compute the Chi Square statistic of a function and a fit to the function. ChiSquare=TOTAL((Y-Yfit)^2/SigmaY^2) CATEGORY: CALLING SEQUENCE: Result=chisqr(y,sigma_y,yfit) INPUTS: y=input array. sigma_y=uncertainty in y. yfit=fit to y. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: David L. Windt, AT&T Bell Labs, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/chisqr.pro)
NAME:
CIRCLE
PURPOSE:
Draws a circle, around CENTER, with radius given by RADIUS, X_RADIUS,
or Y_RADIUS. The drawing is done in the currently defined plot area.
One and ONLY ONE of the three radius values MUST be provided. RADIUS
and X_RADIUS are equivalent. DATA coordinates are used unless one of
the keywords /DEVICE or /NORMAL is set. The circle is drawn so as to
appear visually as a circle, regardless of the coordinates used.
CATEGORY:
General Graphics.
CALLING SEQUENCE:
CIRCLE, CENTER = C, {RADIUS=R, X_RADIUS=XR, Y_RADIUS = YR} [, keywords]
INPUTS:
None.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
CENTER
Two dimensional vector, circle center location, mandatory.
RADIUS |
Scalar, value of radius (measured in the X direction). | One
X_RADIUS | and only one
Scalar, value of radius (measured in the X direction). | must be
Y_RADIUS | provided.
Scalar, value of radius (measured in the Y direction). |
/FILL
causes the circle to be filled with a solid pattern.
COLOR
Standard IDL plotting interpretation.
/DEVICE
Ditto.
LINESTYLE
Ditto.
/NORMAL
Ditto.
THICK
Ditto.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses calls to ONE_OF and COO_CONV from MIDL. Converts all parameters
to device coordinates and calls ELLIPSE (also from MIDL) to do the
actual plotting.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
Modified 15-OCT_1991 by Mati Meron. Added keyword COLOR.
(See /usr/local/rsi/idl_4/lib/weitere/circle.pro)
NAME: clear PURPOSE: clear the screen CATEGORY: CALLING SEQUENCE: clear INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: David L. Windt, AT&T Bell Labs, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/clear.pro)
ROUTINE: coastline
USEAGE: coastline,alat,alon
coastline,alat,alon,map_file,color=color,thick=thick,remap=remap
PURPOSE: superpose coastal outlines over a satellite image
INPUTS:
ALAT 2-D array of image latitude values (one value for
each image pixel)
ALON 2-D array of image longitude values
OPTIONAL INPUTS:
MAP_FILE name of map coordinate data file (default='coastline.dat')
COLOR color of coastal outline
THICK thickness of coast outline
REMAP If set, remap the coordinates in the MAP_FILE data base.
This is useful when the data in a given MAP_FILE has
been updated and you don't want to use the old mapping
which has been saved in the MAPBLK common block.
COMMON BLOCKS: mapblk
PROCEDURE:
Coastline coordinates are read from file MAP_FILE. When COASTLINE is first
called with a given map data file the lat-lon positions for that file are
interpolated onto image coordinates using a newton-raphson search procedure
(LOCATE). The coastline image coordinates are stored in common block MAPBLK
for use in subsequent calls. Use the companion procedure, GEN_COASTLINE.PRO
to generate the map data files.
AUTHOR: Paul Ricchiazzi oct92
Earth Space Research Group, UCSB
(See /usr/local/rsi/idl_4/lib/weitere/coastline.pro)
ROUTINE: color_pal AUTHOR: Terry Figel, ESRG, UCSB 10-21-92 CALLING SEQUENCE: color_pal PURPOSE: Displays Color palette in a seperate window
(See /usr/local/rsi/idl_4/lib/weitere/color_pal.pro)
NAME: CONTOUR_RMS
PURPOSE:
Determine the rms of the contour lines associated with an
image, and create a contour/image plot showing the rms values.
CATEGORY:
CALLING SEQUENCE:
contour_rms,image[,x,y]
INPUTS:
image = (n,m) array for which the contours are to be drawn.
OPTIONAL INPUT PARAMETERS:
x = n-element array giving the scale along the x axis.
y = m-element array giving the scale along the y axis.
KEYWORD PARAMETERS:
level = the contour level(s) to be drawn and analyzed.
file = the name of a contour-path data file associated
with IMAGE and LEVEL.
units = scalar string indicating the spatial units.
Default='pixels'.
manual = set to digitize manually the location of the rms
labels on the plot.
OUTPUTS:
OPTIONAL OUTPUT PARAMETERS:
contours = a structure variable containing
the x and y vectors describing the contours, the
computed sigma (rms) values, and the normalized
coordinates of the positions of the sigma value labels.
COMMON BLOCKS:
none.
SIDE EFFECTS:
The structure variable c_lines is defined as follows:
{c_line,x:fltarr(3000),y:fltarr(3000),rms:' ',xl:0.0,yl:0.0}
where
c_line.x = array of x values of contour.
c_line.y = array of y values of contour.
c_line.rms = string containing the rms value of the
contour
c_line.xl = normalized coordinate of the rms label.
c_line.yl = normalized coordinate of the rms label.
RESTRICTIONS:
Must be run in window environment.
If using a previously defined contour-path data file,
(i.e. one made using WRITE_CONTF) the current window
should be the same size and type (ie, SunView or X)
as the window that was used with WRITE_CONTF, or else
the contours won't be drawn properly.
PROCEDURE:
This program was originally written to look at interfacial
roughness of synthetic multilayers by examining the contours
of digitized TEM images of these structures.
A contour-path data file is created using WRITE_CONTF
if it does not already exist. The contour-path data file
is then read using READ_CONTF. Note that only 'open' contours
are read. CONT_IMAGE is used to display the image and the
contour. Then, the user must 'edit' each contour,
i.e. digitize the endpoints with the mouse,
so as to ensure that reasonable rms values are computed.
After each contour is edited, the rms value is labelled
on the image. The user is prompted for hardcopy.
MODIFICATION HISTORY:
D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/contour_rms.pro)
NAME: CONT_IMAGE PURPOSE: Overlay an image and a contour plot. CATEGORY: General graphics. CALLING SEQUENCE: CONT_IMAGE, IMAGE[,X,Y] INPUTS: IMAGE = 2 dimensional array to display. OPTIONAL INPUTSL X = 1 dimensional array of x-axis values. Y = 1 dimensional array of y-axis values. KEYWORD PARAMETERS: /WINDOW_SCALE = set to scale the window size to the image size, otherwise the image size is scaled to the window size. Ignored when outputting to devices with scalable pixels. /ASPECT = set to retain image's aspect ratio. Assumes square pixels. If /WINDOW_SCALE is set, the aspect ratio is retained. /INTERP = set to bi-linear interpolate if image is resampled. /NOCONTOUR = set to just display framed image. /INVERT = set to invert the image scale, ie image=255-image plus IDL graphics keywords: xtitle,ytitle,subtitle,title,background. OUTPUTS: No explicit outputs. COMMON BLOCKS: none. SIDE EFFECTS: The currently selected display is affected. RESTRICTIONS: None that are obvious. PROCEDURE: If the device has scalable pixels then the image is written over the plot window. MODIFICATION HISTORY: Adapted from IMAGE_CONT. D. L. Windt, AT&T Bell Laboratories, Nov 1989.
(See /usr/local/rsi/idl_4/lib/weitere/cont_image.pro)
NAME:
COO_CONV
PURPOSE:
Transforms values between the coordinate systems supported by IDL.
Allowed coord systems are DATA, DEVICE (only for X, Y axes) and NORMAL.
Functionally similar to the IDL function CONVERT_COORD, COO_CONV is
maintained for historical reasons.
CATEGORY:
Plotting /General Graphics.
CALLING SEQUENCE:
Result = COO_CONV( R, AXIS = AX [, keywords])
INPUTS:
R
numeric, otherwise arbitrary, assumed to be a coordinate(s) in the
direction specified by AXIS.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
AXIS
Sets the transformation axis. Accepts either a numeric value, one of
(0, 1, 2) or a character value (only first character matters), one of
('X', 'Y', 'Z'). Mandatory.
FROM
Character value (only first 3 characters matter), specifies input
coord. system. One of ('DATA','DEVICE','NORMAL'). Defaults to 'DATA'.
TO
Same as FROM. Specifies output coord. system.
OUTPUTS:
'' (0 length string) in case of failure (bad keyword value), otherwise
returns the transformed value as floating (or double if the input is
of type double)
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses calls to CAST, DEFAULT, STREQ, STRMATCH and TYPE from MIDL.
Converts coordinates using values provided by relevant system variables.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/coo_conv.pro)
NAME:
CREATECT
PURPOSE:
Create a new colortable file (IDL version 2.4 and above).
CALLING SEQUENCE:
createct, filename, [entries]
INPUTS:
filename - The name of the new colortable file.
entries - Number of entries in new table. Optional. Default = 1.
KEYWORDS:
None.
OUTPUTS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
A new colortable file is created.
RESTRICTIONS:
- Tested on VAX/VMS only.
EXAMPLES:
Create a new colortable with 20 entries. The 20 entries are all
zero by default. No colortable names are create. The entries may
be modified and extended with the procedure modifyct.
IDL> createct, 'mycolor.tbl', 20
MODIFICATION HISTORY:
November 1992, HJB, CreaSo Created.
(See /usr/local/rsi/idl_4/lib/weitere/createct.pro)
NAME: CURFIT PURPOSE: Non-linear least squares fit to a function of an arbitrary number of parameters. Function may be any non-linear function where the partial derivatives are known or can be approximated. CATEGORY: E2 - Curve and Surface Fitting CALLING SEQUENCE: yfit = curfit(x,y,w,a,sigmaa) INPUTS: X = Row vector of independent variables. Y = Row vector of dependent variable, same length as x. W = Row vector of weights, same length as x and y. For no weighting w(i) = 1., instrumental weighting w(i) = 1./y(i), etc. A = Vector of nterms length containing the initial estimate for each parameter. If A is double precision, calculations are performed in double precision, otherwise in single prec. KEYWORD PARAMTERS: funct = string containing the name of the fitting function. Default = 'funct' quiet = 1 to suppress printing interation information. max_its = Maximum number of iterations the function will do before giving up. Default=1000. accept = Acceptance criterion for acceptable fit. This number is equal to the relative change in the ChiSquare statistic from one iteration to the next. Default=.00001 OUTPUTS: A = Vector of parameters containing fit. Function result = YFIT = Vector of calculated values. OPTIONAL OUTPUT PARAMETERS: Sigmaa = Vector of standard deviations for parameters A. COMMON BLOCKS: NONE. SIDE EFFECTS: The function to be fit must be defined and called FUNCT. For an example see FUNCT in the IDL User's Libaray. Call to FUNCT is: FUNCT,X,A,F,PDER where: X = Vector of NPOINT independent variables, input. A = Vector of NTERMS function parameters, input. F = Vector of NPOINT values of function, y(i) = funct(x(i)), output. PDER = Array, (NPOINT, NTERMS), of partial derivatives of funct. PDER(I,J) = Derivative of function at ith point with respect to jth parameter. Optional output parameter. PDER should not be calculated if parameter is not supplied in call (unless you want to waste some time). RESTRICTIONS: NONE. 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 compines the best features of the gradient search with the method of linearizing the fitting function." Iterations are perform until the chi square changes by only 0.001% or until 1000 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. MODIFICATION HISTORY: Written, DMS, RSI, September, 1982. Modified by D.L. Windt, AT&T Bell Labs, March, 1989.
(See /usr/local/rsi/idl_4/lib/weitere/curfit.pro)
Name:
ddread
Purpose:
This routine reads data in formatted (or unformatted) rows and columns.
The name stands for Data Dump Read. By default, comments are
skipped and the number of columns is sensed. Many options
exist, e.g., selecting rows and columns, reading binary data,
and selecting non-default data type and delimiters.
Examples:
junk = ddread(/help) ; get information only
array = ddread(file) ; read ASCII data
array = ddread(file,/formatted) ; ditto
array = ddread(file,object=object) ; read binary data
array = ddread(file,columns=[0,3]) ; get only 1st & 4th columns
array = ddread(file,rows=lindgen(10)+10); get only 2nd 10 rows
array = ddread(file,offset=10,last=19) ; get rows (10,19)
array = ddread(file,/countall) ; count comment lines
array = ddread(file,/verbose) ; echo comment lines
array = ddread(file,type=1) ; return bytes, not floats or longs
array = ddread(file,range=['start text','stop text']) ; text delimiters
; Place the detailed output from a Lowtran run in a 2-D array---wow!
output = ddread('lowtran.out',range=['(CM-1) (MICRN)','0INTEGRATED ABSORPTION'])
% DDREAD: Read 69 data lines selecting 14 of 14 columns; skipped 395 comment lines.
Usage:
array = ddread([file][,options][,/help])
Optional Inputs:
file = file with data; if omitted, then call pickfile.
Keywords:
/formatted, /unformatted = flags to tell IDL whether data format is
binary or ASCII. ddread tries to determine the type
of data but it's not foolproof.
object = a string containing the IDL declaration for one instance
of the object in an unformatted file, e.g.,
'fltarr(4)'
or
'{struct,dwell:0.,pitch:0.,yaw:0.,roll:0.}'
rows = an array to select a subset of the rows in a formatted file
Does not count comment lines, unless /countallrows is set!
columns = likewise for columns
type = data type of the output D=float (if '.' appears) or long
delimiter = column separater, D=whitespace
/help = flag to print header
range = start and stop row or strings,
e.g. range = ['substring in 1st line','substring in last line']
offset = start row (read to end of file, unless last set)
last = stop row (read from start of file, unless offset set)
/countallrows = flag to count comment rows as well as data rows (D=0)
/verbose = flag to echo comments to screen
Outputs:
array = array of data from the lines (ASCII) or objects (binary)
Common blocks:
none
Procedure:
After deciding on ASCII or binary, read file and return array.
Restrictions:
- Comments can be either an entire line or else an end of a line, e.g.,
/* C comment. */
; IDL comment
Arbitrary text as a comment
Comment in Fortran
The next line establishes # of columns (4) & data type (float):
6. 7 8 9
This line and the next are both considered comments.
6 comment because only one of 4 columns appears
1 2 3 4 but this line has valid data and will be read as data
- Even if a range of lines is selected with offset, range or last, all
lines are read. This could be avoided.
- Other routines needed:
pickfile.pro - to choose file if none is given
nlines.pro - to count lines in a file
nbytes.pro - to count bytes in a variable
replicas.pro - to replicate arrays (not scalars as in replicate.pro)
typeof.pro - to obtain the type of a variable
Modification history:
write, 22-26 Feb 92, F.K.Knight (knight@ll.mit.edu)
allow reading with arbitrary delimiter using reads, 23 Mar 92, FKK
add countallrows keyword and modify loop to read as little
data as possible, 20 May 92, FKK
correct bug if /formatted set, 6 Jul 92, FKK
add verbose keyword to print comments, 6 July 92, FKK
correct bug if /rows=...,/countall set, 6 July 92, FKK & EJA
add a guard against a blank line being converted to a
number, 21 Aug 92, FKK
allow parital line just before the EOF. Possibly this isn't the
right thing to do, but I decided to allow it. If the final line
is incomplete, the values are still read and the remainder of
the line is filled with zeroes. 26 Oct 92, FKK
allow range keyword to be a string array, 2 Dec 92, FKK
make default for countallrows be true if range is present, 2 Dec 92, FKK
add new function (typeof); called in a few places, 2 Dec 92, FKK
(See /usr/local/rsi/idl_4/lib/weitere/ddread.pro)
NAME:
DEFAULT
PURPOSE:
Provides an automatic default value for nondefined parameters.
CATEGORY:
Programming.
CALLING SEQUENCE:
Result = DEFAULT( X, Y [, TYPE = TYP])
INPUTS:
X, Y
Arbitrary, at least one needs to be defined.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
TYPE
Number between 1 to 8. If provided, it is compared to the type-value
of X and X is considered defined only if the two values match. For
example, if TYPE = 7 then X has to be a character value.
OUTPUTS:
X if it is defined, otherwise Y.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses the function TYPE from MIDL.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/default.pro)
NAME:
DIAGOVEC
PURPOSE:
Extracts the diagonal of a square matrix as a vector.
CATEGORY:
Array Manipulation.
CALLING SEQUENCE:
Result = DIAGOVEC(ARR)
INPUTS:
ARR
Array, 2-dimensional, square.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
None.
OUTPUTS:
If ARR is a square matrix, returns the diagonal as a vector, else
generates an error message.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Straightforward.
MODIFICATION HISTORY:
Created 20-DEC-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/diagovec.pro)
NAME: Dlib PURPOSE: Extract the documentation template of one or more procedures. CATEGORY: Help, documentation. CALLING SEQUENCE: Dlib ;For prompting. Dlib, Name ;Extract documentation for procedure Name using the current !PATH. INPUTS: Name = string containing the name of the procedure or "*" for all. OPTIONAL INPUT PARAMETERS: PRINT = keyword parameter which, if set to 1, sends output of doc_library to lpr. If PRINT is a string, it is a shell command used for output with its standard input the documentation. I.e. PRINT="cat > junk" DIRECTORY = directory to search. If omitted, use current directory and !PATH. MULTI = flag to allow printing of more than one file if the module exists in more than one directory in the path + 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: ?? PROCEDURE: Straightforward. MODIFICATION HISTORY: D. L. Windt, AT&T Bell Labs, April 1990. Exact copy of DOC_LIBRARY, except with a name I can type!
(See /usr/local/rsi/idl_4/lib/weitere/dlib.pro)
NAME:
ELLIPSE
PURPOSE:
Draws an ellipse, around CENTER, with radii given by RADII, optionally
rotating it by angle ROT. The drawing is done in the currently
defined plot area. DATA coordinate system is assumed unless specified
otherwise by one of the keywords /DEVICE or /NORMAL.
CATEGORY:
General Graphics.
CALLING SEQUENCE:
ELLIPSE, CENTER = CENT, RADII = RD, [, optional keywords]
INPUTS:
None
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
CENTER
2 dimensional vector, ellipse center location, format [x,y], mandatory.
RADII
2 dimensional vector, contains the x and y radii (in order), mandatory.
ROTATE
Optional. Angle of rotation in the mathematical positive direction.
Assumed in radians, unless DEGREES is set.
/DEGREES
Specifies tha the rotation angle is given in degrees.
/FILL
causes the ellipse to be filled with a solid pattern.
COLOR
Standard IDL plotting interpretation.
/DEVICE
Ditto.
LINESTYLE
Ditto.
/NORMAL
Ditto.
THICK
Ditto.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
If the DATA coordinate system is used and the plot area is defined with
nonlinear (logarithmic) axes, the shape won't look like an ellipse.
PROCEDURE:
Uses calls to DEFAULT, ONE_OF, SHAPE_TRANS and SHAPE_COCON from MIDL.
Generates a (2,N) array containing a sufficient number of ellipse
points to yield a smooth curve. N is variable, depending both on the
ellipse size and on the pixel size of the current output device.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
Modified 15-OCT-1991 by Mati Meron. Added keyword COLOR.
Modified 15-DEC-1991 by Mati Meron. Added size and device dependence
of the number of plot points.
Modified 15-OCT-1992 by Mati Meron. Added rotation.
(See /usr/local/rsi/idl_4/lib/weitere/ellipse.pro)
NAME: eplot PURPOSE: Plot a vector with error bars. CATEGORY: CALLING SEQUENCE: eplot,y,sigy eplot,x,y,sigy eplot,y,sigy_up,sigy_down eplot,x,y,sigy_up,sigy_down INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: Graphics keywords: charsize,color,linestyle,noclip, noerase,psym,subtitle,symsize,t3d,thick,title,xrange, xtitle,xtype,xstyle,ynozero,yrange,ytitle,ytype,ystyle, zvalue OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/eplot.pro)
NAME: EROM PURPOSE: Read one or more variables from a file written by MORE. CATEGORY: CALLING SEQUENCE: erom,v0[,v1,v2,...v9] INPUTS: variable = any variable OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: file = string specifying the name of a file. notitle = set if file was written without a title. noindex = set if file was written with noindex keyword. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: David L. Windt, AT&T Bell Labs, March 1990
(See /usr/local/rsi/idl_4/lib/weitere/erom.pro)
NAME:
ERRBARS
PURPOSE:
Overplots error bars over an existing plot. More general than the
library routines ERRPLOT and PLOTERR, since it allows to independently
vary both X and Y errors, and allows for nonsymmetric error bars.
CATEGORY:
Plotting.
CALLING SEQUENCE:
ERRBARS, [X,] Y [, XERR = XER, YERR = YER]
INPUTS:
X, Y
Vectors containing the data points' coordinates. If only one is given
it is taken to be Y, same as in the PLOT command.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
XERR
Either a vector or a (2,N) array where N is the number of the data
points. Contains the X-errors. If given as a 2 dimensional array, the
entries XERR(0,i) and XERR(1,i) are taken as the errors of X(i) in the
negative and positive directions, respectively. If given as a vector,
the entry XERR(i) serves as both the negative and positive error of
X(i) and therefore symmetric error bars are drawn. If not provided,
the default is no X-errors.
YERR
Same as above, for the Y-errors.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
If either XERR or YERR is given as a vector, it is converted to a (2,N)
array.
RESTRICTIONS:
None.
PROCEDURE:
Straightforward. Uses the system routine PLOTS, and DEFAULT from MIDL.
MODIFICATION HISTORY:
Created 10-DEC-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/errbars.pro)
NAME: ERRORF_FIT PURPOSE: fit y=f(x) where: f(x) = a0*errorf((x-a1)/a2))+a3+x*a4 CATEGORY: ?? - fitting CALLING SEQUENCE: yfit = errorf_fit(x,y,a) INPUTS: x = independent variable, must be a vector. y = dependent variable, must have the same number of points as x. a = initial values of adjustable parameters. quiet = set to inhibit printing curfit iterations. OUTPUTS: yfit = fitted function. OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: Adapted from GAUSSFIT D. L. Windt, AT&T Bell Laboratories, June 1990
(See /usr/local/rsi/idl_4/lib/weitere/errorf_fit.pro)
NAME: EXPO_FIT PURPOSE: Fit y=f(x) where: F(x) = a0*exp(-abs(x-a1)/a2)+a3 a0 = height of exp, a1 = center of peak, a2 = 1/e width, Estimate the parameters a0,a1,a2,a3 and then call curfit. CATEGORY: ?? - fitting CALLING SEQUENCE: yfit = expo_fit(x,y,a) INPUTS: x = independent variable, must be a vector. y = dependent variable, must have the same number of points as x. OUTPUTS: yfit = fitted function. OPTIONAL OUTPUT PARAMETERS: a = coefficients. a three element vector as described above. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: Adapted from GAUSSFIT D. L. Windt, AT&T Bell Laboratories, March, 1990
(See /usr/local/rsi/idl_4/lib/weitere/expo_fit.pro)
NAME: FBAK_2D_MULTI PURPOSE: This procedure will reconstruct a 3D volume from a set of projection images, using the filtered backprojection method and the formalism of nuclear medicine. In nuclear medicine, one refers to a "stack" of 2D images that comprise the 3D one; hence the name. CATEGORY: Image reconstruction from projections. CALLING SEQUENCE: VOLUME = FBAK_2D_MULTI ( SINO ) INPUTS: SINO: a stack of sinograms (N)x(n_slices)x(N_phi), where n_slices is the number of slices to reconstruct and N_phi is the number of view angles, which are assumed to be equally spaced. KEYWORD PARAMETERS: X_COR: A vector of center of rotation offsets, as required in nuclear medicine. Default=ALL 0.0, meaning that each projection image is centered at x=(N/2). N_HALF_ROT: How many half rotations are represented by the input sinograms. 1 implies a 180 degree orbit, 2 implies a 360 degree orbit. Default=1. X0: The image center in X and Y. Default=(N-1)/2.0. PHI0: Starting view angle. Default=0.0. QUIET: If this keyword is not set then by default we display the incomplete reconstructions as each view is processed. OUTPUT: The reconstructed volume. DEPENDENCIES: This procedure calls two user-contributed IDL procedures: STILL_BUSY and TVSTACK Their presence is only cosmetic, so you might want to delete the code that uses these procedures. SIDE EFFECTS: If the /QUIET keyword is not used, the image display will be used to display results, requiring the TVSTACK procedure. The STILL_BUSY procedure is called to announce that this sometimes long-running program is still at work. PROCEDURE: The projection images are assumed to have been filtered in 2D before this routine is called, thereby eliminating the need for filters other than the ramp filter. First, we compute the 1D space-domain ramp filter and we place it in a 2D array. We loop over view angles (BY ANSATZ THESE ARE SPACED EQUALLY FROM PHI0 TO THE MAXIMUM ANGLE) and at each angle we: filter by multiplying each row of the projection image by this array, then we backproject into the image, using linear interpolation. This procedure is by no means optimized for speed, but the code is pretty streamlined. EXAMPLE: If the following commands are combined as a procedure and compiled and executed, we will generate projection images for a volume that contains three discs of radius 10, 20, and 30 pixels, and reconstruct them. On a SUN IPX workstation, the example runs in ~ 2 minutes. n = 128L n_slices = 3L n_views = 90L x0 = [ 50, 60, 70 ] ; centers of the discs, x direction y0 = x0 ; centers of the discs, y direction r0 = [ 10, 20, 30 ] ; disc radii dx = x0 - (n-1)/2.0 ; centers relative to center of proj'n dy = y0 - (n-1)/2.0 ; centers relative to center of proj'n ; Make sinogram by averaging over fine (expanded) samples. expander = 4L np = n*expander xp = findgen(np) - (np-1)/2.0 ; rotated x, expanded coord. dxp = expander*dx ; relative centers, expanded dyp = expander*dy r0p = r0*expander ; radii in expanded coordinates sino = fltarr(n,n_slices,n_views) for view=0,n_views-1 do begin angle = !pi*view/n_views for slice=0,n_slices-1 do begin dx_rotated_expanded = $ dxp(slice)*cos(angle) + dyp(slice)*sin(angle) expanded_projection = $ sqrt(( r0p(slice)^2 - (xp-dx_rotated_expanded)^2 ) > 0 ) sino(0,slice,view) = rebin(expanded_projection,n) endfor endfor ; Reconstruct. recon = fbak_2d_multi ( sino ) end MODIFICATION HISTORY: Written by: James Hamill Siemens Medical Systems 2501 N. Barrington Rd. Hoffman Estates, IL 60195-7372 (708)304-7760 hamill@sgi.siemens.com March, 1991
(See /usr/local/rsi/idl_4/lib/weitere/fbak_2d_multi.pro)
NAME:
FILELIST
PURPOSE:
This routine finds the files or directories at the current directory level.
It must be called with either files or directories as a keyword.
CALLING SEQUENCE:
FILELIST
INPUTS:
None
KEYWORDS:
PATH - path in which programm looks for
FILES - List of found files
DIRECTORIES - List of found directories
FILTER - List of filters
USEDPATH - path in which rocedure looks for. It could be that
keyword path is "[-]" and than it could be useful to
know the used path
ERROR - if set, than error message will not be send variable will
set as follows :
0 - normal successful completion
1 - directory not found
OUTPUT:
List of found files.
COMMON BLOCKS:
None
SIDE EFFECTS:
No known side effects.
RESTRICTIONS:
For VAX/VMS only.
EXAMPLE:
filelist, path = "[here]",$
FILES = files, $
DIRECTORIES = DIRECTORIES, $
FILTER = "*.c"
Looks for C source code in the directories [here]
returns the file list in files and the directory list in directories.
MODIFICATION HISTORY:
July 1992, AH, CreaSo Created.
(See /usr/local/rsi/idl_4/lib/weitere/filelist.pro)
NAME:
FILESCAN
PURPOSE:
This functions returns the required parts of the filename in a string
array.
CALLING SEQUENCE:
FILESCAN
INPUTS:
filename - Filename to be scanned
CURRENT - if set and necessary the path value will be completed with
current path elements.
KEYWORDS:
EXCLUDE - Return the parts of filename without '::', ':', []...
FULL - If not set, the logicals in filename will be translated all
except a concealed device.
OUTPUTS:
NODE - Node of filename (includes '::')
DEV - Device of filename (includes ':')
DIR - Directory of filename (includes '[]')
NAME - Filename to be scanned
TYPE - Extension of the filename (includes '.')
VER - Version number of the filename (includes ';' or '.')
PATH - Node+device+directory
COMMON BLOCKS:
None
SIDE EFFECTS:
No known side effects.
RESTRICTIONS:
For VAX/VMS only.
EXAMPLE:
FileScan ("disk4:[ah]filescan.pro", TYPE = MyExtension, $
DIR = MyDirectory)
MyDirectory eq "[ah]"
MyExtension eq ".pro"
MODIFICATION HISTORY:
October 1992, AH, CreaSo Created.
(See /usr/local/rsi/idl_4/lib/weitere/filescan.pro)
NAME: FMOVIE
PURPOSE: Show a cyclic sequence of images stored in a 3D array
with axes drawn and labelled.
CATEGORY: Image display
CALLING SEQUENCE:
Fmovie, Images [,Xpos, Ypos, Rate]
INPUTS:
Images = (n,m,nframes) byte array of image data, consisting of
nframes images, each of n by m. This array should be
stored with the top row first, (order = 1) for maximum
efficiency.
OPTIONAL INPUT PARAMETERS:
Rate = initial rate, in APPROXIMATE frames per second. If
omitted, the inter-frame delay is set to 0.01 second.
KEYWORD PARAMETERS:
Xpos = X-position on screen.
Ypos = Y-position on screen.
Order = image ordering. Order = 0 for images ordered bottom up,
or = 1 for images ordered top down (the default).
Ax = x-axis values.
Ay = y-axis values.
Graphics keywords: xticks,xtitle,yticks,ytitle,title,subtitle
OUTPUTS:
No explicit outputs.
COMMON BLOCKS:
None.
SIDE EFFECTS:
Images are displayed in the currently selected window.
RESTRICTIONS:
As SunView has no zoom or pan, we have to write each image to
the display. Restricting the maximum rate, etc. Experience has
shown that you can count on a rate of approximately 10 frames / second
with 192 by 192 images. This varies according to the type of
computer, amount of physical memory, and number of frames.
The amount of available memory also restricts the maximum amount
of data that can be displayed in a loop.
PROCEDURE:
Straightforward.
MODIFICATION HISTORY:
Adapted from MOVIE by D. L. Windt, AT&T Bell Labs, August 1990.
(See /usr/local/rsi/idl_4/lib/weitere/fmovie.pro)
NAME:
FRAC
PURPOSE:
Gives the fractional part of X, i.e. X - INT(X). The result is always
positive.
CATEGORY:
Mathematical Function (General) / Type Conversion.
CALLING SEQUENCE:
Result = FRAC(X)
INPUTS:
X
Numerical, otherwise arbitrary.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
None.
OUTPUTS:
Returns the value of FRAC(X), see above, as floating or double prec.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
For complex X the result is FRAC(REAL(X)), the imaginary part is ignored
PROCEDURE:
Uses CAST, INT and TYPE from MIDL.
MODIFICATION HISTORY:
Created 15-JUN-1992 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/frac.pro)
NAME: FRACTAL_FIT PURPOSE: Fit y=f(x) where: F(x) = a0/(x^a1) [+a2] Estimate the parameters a0,a1[,a2] and then call curfit. CATEGORY: ?? - fitting CALLING SEQUENCE: yfit = fractal_fit(x,y,a,background=background) INPUTS: x = independent variable, must be a vector and MUST BE POSITIVE! y = dependent variable, must have the same number of points as x. background = set to add a background term (a2). OUTPUTS: yfit = fitted function. OPTIONAL OUTPUT PARAMETERS: a = coefficients. a two [three] element vector as described above. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: x must be positive. PROCEDURE: MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, March, 1990
(See /usr/local/rsi/idl_4/lib/weitere/fractal_fit.pro)
NAME: FWHM PURPOSE: Measure the full-width-half-max of a region of curve that has been previously plotted. CATEGORY: CALLING SEQUENCE: Result=fwhm(xaxis,yaxis) INPUTS: xaxis = the x axis variable which has been plotted. yaxis = the y axis variable which has been plotted. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: yzero = the zero point level. If not specified, the zero point level is determined from endpoints of the digitized region of interest of the curve. yhm = the value at which the full-width is computed. Allowable range is 0. to 1. If not specified, .5 is used. invert = set to get width of 'absorption line' rather than 'emission line'. nohighlight = set to inhibit highlighting the region of interest. h_color = the color index for highlighting the region of interest. Default is 7 (Yellow). h_thick = the thickness for highlighting the region of interest. nolabel = set to inhibit labelling fwhm. manual = set to disable automatic location selection for labels. l_header = string specifying the label header. Default=''. l_color = color index for the label. l_format = IDL format string for label (eg. '(f4.2)'). units = string specifying units along x axis. charsize = size of label text. psym = psym OUTPUTS: Result = the full-with-half-max of the region of interest of the curve, in x-axis data units. OPTIONAL OUTPUT PARAMETERS: roi=the subscripts of the digitized region of interest. fwhm_roi = the subscripts of the region between the fwhm points and the max (min) of the function. line_pts = a 4-element array containing the coordinates of the line drawn on the plot: [x0,x1,y0,y1] label = the label for the plot. l_pos = a two element array containing the x,y coordinates of the label, in data coords. COMMON BLOCKS: none. SIDE EFFECTS: TEK_COLOR is used to load in the tektronix colors. The region of interest of the curve is highlighted. The fwhm is labelled. RESTRICTIONS: The data must be plotted prior to calling FWHM. PROCEDURE: The user is asked to digitize the endpoints of the region of interest with the mouse. The region is highlighted, and the fwhm is labelled. MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/fwhm.pro)
NAME: FWHM_LABEL PURPOSE: Label the previously measured full-width-half-max of a region of curve that has been previously plotted. CATEGORY: CALLING SEQUENCE: fwhm,xaxis,yaxis,label,l_pos,fwhm_roi,l_header=l_header, l_color=l_color,yhm=yhm,charsize=charsize INPUTS: xaxis = the x axis variable which has been plotted. yaxis = the y axis variable which has been plotted. fwhm_roi = the subscripts of the region between the fwhm points and the max (min) of the function. label = the label for the plot. l_pos = the x,y coordinates of the label, in data coords. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: yhm = the value at which the full-width is computed. Allowable range is 0. to 1. If not specified, .5 is used. l_header = string specifying the label header. Default=''. l_color = color index for the label. charsize = size of label text. psym = psym OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: none. SIDE EFFECTS: TEK_COLOR is used to load in the tektronix colors. The fwhm is labelled. RESTRICTIONS: The data must be plotted prior to calling FWHM. PROCEDURE: This procedure is usually used following a call to FWHM, so that a plot can be similarly labelled when, for example, plotting to PS. MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, March 1990
(See /usr/local/rsi/idl_4/lib/weitere/fwhm_label.pro)
NAME: GAUS2D_AVE PURPOSE: Compute the gaussian-weighted average of a 2-D function, averaged along the column direction. CATEGORY: CALLING SEQUENCE: z_out=gaus2d_ave(z_in,y_in,width[,zero,y_out=y_out]) INPUTS: z_in = 2-D array, dimensions (n,m) y_in = m-element vector. width = width of gaussian, in y-axis units. OPTIONAL INPUT PARAMETERS: zero = center of gaussian. If not specified, y_in(m/2) is used. KEYWORD PARAMETERS: OUTPUTS: z_out = n-element vector of gaussian-weighted averaged z_in's. OPTIONAL OUTPUT PARAMETERS: y_out = y(m/2) COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: z_out = z_in # (gaus/total(gaus)), where gaus=exp(-((y-zero)/width)^2) and y=(findgen(n_elements(y_in))/(n_elements(y_in)-1)-.5)* (max(y_in)-min(y_in)) MODIFICATION HISTORY: David L. Windt, AT&T Bell Labs. July 1990.
(See /usr/local/rsi/idl_4/lib/weitere/gaus2d_ave.pro)
NAME: GAUSSEXPO_FIT PURPOSE: Fit y=f(x) where: F(x) = a0*exp(-z^2/2)+a3*exp(-abs(x-a4)/a5)+a6 and z=(x-a1)/a2 a0 = height of gaussian, a1 = center of gaussian, a2 = 1/e width of gaussia, a3 = height of exponential, a4 = center of exponential, a5 = 1/e width of exponential, a6=background. Estimate the parameters a0,a1,a2,a3,a4,a5,a6 and then call curfit. CATEGORY: ?? - fitting CALLING SEQUENCE: yfit = gaussexpo_fit(x,y,a) INPUTS: x = independent variable, must be a vector. y = dependent variable, must have the same number of points as x. OUTPUTS: yfit = fitted function. OPTIONAL OUTPUT PARAMETERS: a = coefficients. a six element vector as described above. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: Adapted from GAUSSFIT D. L. Windt, AT&T Bell Laboratories, March, 1990
(See /usr/local/rsi/idl_4/lib/weitere/gaussexpo_fit.pro)
NAME: GAUSS_FIT PURPOSE: fit y=f(x) where: f(x) = a0*exp(-z^2/2) + a3 and z=(x-a1)/a2 a0 = height of gaussian, a1 = center of gaussian, a2 = 1/e width, a3 = background. Estimate the parameters a0,a1,a2,a3 and then call curfit. CATEGORY: ?? - fitting CALLING SEQUENCE: yfit = gauss_fit(x,y,a) INPUTS: x = independent variable, must be a vector. y = dependent variable, must have the same number of points as x. quiet = set to inhibit printing curfit iterations. OUTPUTS: yfit = fitted function. OPTIONAL OUTPUT PARAMETERS: a = coefficients. a three element vector as described above. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: Adapted from GAUSSFIT D. L. Windt, AT&T Bell Laboratories, March, 1990
(See /usr/local/rsi/idl_4/lib/weitere/gauss_fit.pro)
NAME: gaus_convol PURPOSE: Convolve a function with a gaussian. CATEGORY: CALLING SEQUENCE: result=gaus_convol(x,y,sig) INPUTS: x = vector of independent variables. y = vector of dependent variables. sig = width of gaussian, in x axis units. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: OUTPUTS: OPTIONAL OUTPUT PARAMETERS: xout = x axis variable minus the points where y=0 due to convolution. COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: CONVOL is used to convolve y with a gaussian whose width is sig, in x axis units. MODIFICATION HISTORY: David L. Windt, AT&T Bell Labs, July 1990.
(See /usr/local/rsi/idl_4/lib/weitere/gaus_convol.pro)
ROUTINE: GEN_COASTLINE
USEAGE: gen_coastline,alat,alon
gen_coastline,alat,alon,map_file,image=image
PURPOSE: generate coastal outline map for satellite images
INPUTS: ALAT 2-D array of image latitude values (one value for
each image pixel)
ALON 2-D array of image longitude values
MAP_FILE Name of map coordinate data file. If MAP_FILE is
not provided, GEN_COASTLINE queries for an
output file name.
OPTIONAL KEYWORD INPUT:
image Image from which to infer coastline outline.
If an image array is not provided, it is assumed
that an image has already been displayed using
the TVIM procedure.
PROCEDURE:
Coastline coordinates are input by using the mouse to click on coastal
features from an image in the default window. The mouse buttons perform
the following actions:
1. left mouse button connects points along coastline
2. middle mouse erases most recent point(s)
3. right mouse button finishes a coastline segment.
When the right mouse button is pressed a pop-up menu appears with four
options:
1. NEW SEGMENT Start a new coastal outline segment
2. CLOSE CURVE, START NEW SEGMENT Complete an island outline and
prepare to start a new segment
3. CLOSE CURVE, QUIT Complete island outline and quit
4. QUIT Flush buffers and quit.
The collection of [latitude, longitude] coordinates are written to the
file MAP_FILE. This map data file can be used as input for the companion
procedure, COASTLINE.PRO which plots the coast line data onto arbitrarily
oriented image files.
AUTHOR: Paul Ricchiazzi oct92
Earth Space Research Group, UCSB
(See /usr/local/rsi/idl_4/lib/weitere/gen_coastline.pro)
NAME: GET_PEAK PURPOSE: Get the local maximum of a previously plotted curve. CATEGORY: CALLING SEQUENCE: Result=get_peak(xaxis,yaxis) INPUTS: xaxis = the x axis variable which has been plotted. yaxis = the y axis variable which has been plotted. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: color = the color index for marking the local maximum. nomark = set to disable marking the location of the peak. nohighlight = set to disable highlighting the region of interest. h_color = the color index for highlighting the region of interest. Default is 7 (Yellow). h_thick = the thickness for highlighting the region of interest. OUTPUTS: Result = the array subscript of the local max. OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: TEK_COLOR is used to load in the tektronix colors. The region of interest of the curve is highlighted. A vertical line is drawn through the local maximum. RESTRICTIONS: PROCEDURE: The user is asked to digitize the endpoints of the region of interest with the mouse using GET_ROI. MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, February 1990.
(See /usr/local/rsi/idl_4/lib/weitere/get_peak.pro)
NAME: GET_PT PURPOSE: Digitize a point on a plot and find the closest point on the curve. CATEGORY: CALLING SEQUENCE: Result = get_pt(xaxis,yaxis,xpoint,ypoint) INPUTS: xaxis = the x axis vector which was used to make the plot. yaxis = the y axis vector which was used to make the plot. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: nohighlight = set to inhibit putting a red mark on the curve at the digitized point. message = a string to print as the message to the user. default = 'Digitize a point: ' noinit = set to inhibit placing the cursor in the center of the plot window. OUTPUTS: Result = the array subscript of the digitized point. OPTIONAL OUTPUT PARAMETERS: xpoint, ypoint = the digitized points. COMMON BLOCKS: SIDE EFFECTS: TEK_COLOR is used to load in tektronix colors. A mark is drawn on the plot at the digitized point. RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/get_pt.pro)
NAME: GET_ROI PURPOSE: Get a region of interest of a previously plotted curve. CATEGORY: CALLING SEQUENCE: Result=get_roi(xaxis,yaxis) INPUTS: xaxis = the x axis variable which has been plotted. yaxis = the y axis variable which has been plotted. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: h_color = the color index for highlighting the region of interest. Default is 7 (Yellow). h_thick = the thickness for highlighting the region of interest. nohighlight = set to disable highlighting the region of interest. psym = psym. OUTPUTS: Result = the array of subscripts of the roi. OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: TEK_COLOR is used to load in the tektronix colors. The region of interest of the curve is highlighted. RESTRICTIONS: PROCEDURE: The user is asked to digitize the endpoints of the region of interest with the mouse using GET_PT. The region is highlighted, unless nohighlight is set. MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/get_roi.pro)
ROUTINE globe_image
AUTHOR: Terry Figel, ESRG, UCSB 10-21-92
USEAGE: globe_image,image
globe_image,image,animation,title=title,limits=limits,$
windowsize=windowsize
PURPOSE: Display an image on a rotating globe
INPUT input image quantity
OUTPUT output 3d array containg output images for animation
Optional keyword input:
title plot title
windowsize Controls the size of the window, Directly responsible
for memory usage
limits 4 item array [min lat,min lon,max lat,max lon] of
input image, if omitted presumed global
coverage [-90,0,90,360]
SIDE EFFECTS: Uses a LOT of MEMORY ~30-50 MEGS, takes a few minutes
to set up animation
If windowsize left at 300 approx 13 megs used on DEC
PROCEDURE GLOBE_IMAGE first map an image to a globe
Then it saves the image, rotates 10 degrees and repeats
Then it animates the saved images
LOCAL PROCEDURES: None
(See /usr/local/rsi/idl_4/lib/weitere/globe_image.pro)
FUNCTION: This procedure
- select values according to a user defined criterion
- display the selected values.
- display the histogram of the selected values in the
array tab.
INPUTS : tab1 --> 2 or 3 dimensional array (NO DEFAULT)
: thresmin --> minimum value for which the value
is selected (NO DEFAULT if use - see OPTIONS)
: thresmax --> maximum value for which the value
is selected (NO DEFAULT if use - see OPTIONS)
OPTIONS : select --> if thresmin and thresmax are ommitted
allows to specify the criterion based on a
different array features.
binsize --> defines the size of the bin for the
histogram (DEFAULT = 1.)
USE : HILIGHT, ARRAY1, 10., 20., BINSIZE=1 :
select and display on the the values in arrray1
between 10. and 20.
HILIGHT, ARRAY1, SELECT=WHERE(ARRAY2 LE 5.43) :
select and display the values in the array1 where
array2 is less or equal than 5.43
CONTACT : Didier JOURDAN didier@esrg.ucsb.edu
(See /usr/local/rsi/idl_4/lib/weitere/hilight.pro)
FUNCTION: This procedure displays the histogram of
the array tab1.
INPUTS : tab1 --> array (NO DEFAULT)
: mini --> minimum value (NO DEFAULT)
: maxi --> maximum value (NO DEFAULT)
: mini --> size on the bin (NO DEFAULT)
OUTPUTS : diplay
OPTIONS : default --> percentage
/abs --> compute the histogram in number of values
/cumul --> compute the cumulative histogram
/overplot --> overplot the histogram
USE : histo, array1, 0,500,1, /cumul
CONTACT : Didier JOURDAN didier@esrg.ucsb.edu
(See /usr/local/rsi/idl_4/lib/weitere/histo.pro)
NAME: IM_POISSON PURPOSE: Add Poisson noise to an array. CATEGORY: Image simulation. CALLING SEQUENCE: RESULT = POISSON_IMAGE ( IMAGE[, SEED] ) INPUT: IMAGE: A numeric array (byte, integer, long, or float) of arbitrary dimensionality. This is the array of values around which values in the result will be Poisson-distributed. OPTIONAL INPUTS: SEED: A longword seed for the random number generator. If this is not supplied, the value -123456789L is used for generating the first random value. KEYWORD PARAMETER: OUTPUT_KIND: The data type of the output array, that is byte, integer, longword, or float. The words "byte", "int", "integer","long", "longword", and "float", in upper or lower case, are accepted, as are the numeric IDL values 1,2,3,4 for byte, integer, longword, and float. OUTPUT: POISSON_IMAGE returns a copy of the input array, Poisson noise added. DEPENDENCIES: This procedure calls a user-contributed IDL procedure: STILL_BUSY RESTRICTIONS: Negative input values are mapped to a result of 0. A call is made to the routine STILL_BUSY to provide messages once a minute during the processing of large arrays. You can eliminate that line of code if you want to. PROCEDURE: Create an image with values Poisson-distributed around the mean values IMAGE, using Knuth's "Algorithm Q". (Donald E. Knuth, The Art of Computer Programming, Volume 2, "Seminumerical Algorithms", Addison- Wesley (1969), page 117. This routine IS NOT VECTORIZED, AND SHOULD RUN SLOWLY. A deft IDL'er could probably vectorize the algorithm, and anyone who does so is entitled to a gold star. Where the gaussian and Poisson distributions are essentially identical (mean value > 50) a normal, that is gaussian, distribution is used. EXAMPLE: Here is how you can create a 100x100 array of values Poisson-distributed around the mean value 5.0, and check the empirical probability against the Poisson distribution: n = 100 a = replicate(5.0,n,n) b = poisson_image ( a, out="byte" ) tvscl, b print, stdev(b,mean), mean, sqrt(5.0) h = histogram ( b ) prob = float(h)/n_elements(b) probi = exp(-5.0) for i=0,10 do begin print, i, prob(i), probi & $ probi=probi*5.0/(i+1) MODIFICATION HISTORY: Written by: James Hamill Siemens Medical Systems 2501 N. Barrington Rd. Hoffman Estates, IL 60195-7372 (708)304-7760 hamill@sgi.siemens.com February, 1992
(See /usr/local/rsi/idl_4/lib/weitere/poisson_image.pro)
NAME:
INT
PURPOSE:
Gives the integer part of X, i.e. the largest integer(s) not
exceeding X. The result is the same as FIX(X) for positive numbers,
but for negative non-integer X it is FIX(X) - 1.
CATEGORY:
Mathematical Function (General) / Type Conversion.
CALLING SEQUENCE:
Result = INT(X)
INPUTS:
X
Numerical, otherwise arbitrary.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
None.
OUTPUTS:
Returns the value of INT(X), see above, as a long integer.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
For complex X the result is INT(REAL(X)), the imaginary part is ignored
PROCEDURE:
Using the system function LONG and the function SIGN from MIDL.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/int.pro)
NAME:
INTEG
PURPOSE:
Integrates a function provided as an array of points.
CATEGORY:
Mathematical Function (array)
CALLING SEQUENCE:
Result = INTEG([X,] Y [, keywords])
INPUTS:
Y
A vector containing the Y coordinates of the data.
OPTIONAL INPUT PARAMETERS:
X
A vector containing the X coordinates of the data. If not provided,
it is assumed that the X coordinates are equally spaced, with a default
default spacing of 1. (unless changed by the DELTA keyword).
KEYWORD PARAMETERS:
DELTA
Sets the spacing of the X coordinates of the data. If the X coord.
are explicitly provided (see X input above) DELTA is ignored.
/VALUE_ONLY
Normally INTEG returns the integral function of Y, as a vector (see
OUTPUTS below). If VALUE_ONLY is set, only the full value of the
integral is returned as scalar. This makes the execution faster.
OUTPUTS:
Normally returns the integral function of Y, i.e. a vector whose i-th
entry is the integral of Y from X(0) to X(i) (and therefore the last
entry is the full integral of Y. If the optional keyword VALUE_ONLY is
set, only the full integral is returned, as a scalar.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
The Y vector (and the X vector, if provided) must be of length >= 3.
PROCEDURE:
Simpson integration, where the mid-interval points are obtained from
cubic interpolation using Neville's algorithm.
Uses CAST, DEFAULT and TYPE from MIDL.
MODIFICATION HISTORY:
Created 20-FEB-1992 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/integ.pro)
NAME: INTER_PROF PURPOSE: Determine the average profile and its derivative along the vertical (horizontal) direction for a rectangular region of an image, and optionally compute the FWHM of features in the derivative. CATEGORY: CALLING SEQUENCE: inter_prof,image[,x][,y] INPUTS: image = (n,m) array. OPTIONAL INPUT PARAMETERS: x = n-element array giving the scale along the x axis. y = m-element array giving the scale along the y axis. KEYWORD PARAMETERS: units = a string specifying the units along x and y. horizontal = set to analyze the average profile along the horizontal rather than the vertical direction. yhm = 'half-max' point for analyzing the derivative. (See FWHM) yzero=zero-point for analyzing the derivative. (See FWHM) manual = set to label FWHM points manually. l_header = string specifiying the FWHM label header. l_color = color index of FWHM label. l_format = IDL format string for FWHM label. nohighlight = set to inhibit highlighting the FWHM roi. h_color = color index of FWHM roi. h_thick = line thickness of FWHM roi. xtitle = IDL xtitle. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: x_plot = x axis variable of the image roi. profile = average profile for the image roi. dprofile = derivative of average profile for the image roi. COMMON BLOCKS: SIDE EFFECTS: TEK_COLOR is used to load in tektronix colors. RESTRICTIONS: Must be run in window environment. PROCEDURE: This procedure was originally written to look at interfacial roughness of synthetic multilayers by analyzing the FWHM of features in the derivative of the average interface profile function obtained from digitized TEM images of these structures. CONT_IMAGE is used to display the image. RECROI is used to get a rectangular region of interest. A window is created and the average profile and derivative are plotted. The user may then evaluate FWHM features using FWHM. MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/inter_prof.pro)
NAME:
IS_SHAPE
PURPOSE:
Checks whether SHAPE is a proper shape, i.e. a (2,*) or (3,*) , numeric
non-complex array.
CATEGORY:
General Graphics.
CALLING SEQUENCE:
Result = IS_SHAPE( SHAPE [, LENGTH = LEN])
INPUTS:
SHAPE
Arbitrary
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
LENGTH
Provides an optional output. See below.
OUTPUTS:
If SHAPE fits the definition of a proper shape (see above), returns the
number of dimensions (2 or 3) as floating, otherwise returns 0.
OPTIONAL OUTPUT PARAMETERS:
LENGTH
The name of a variable to receive the length (number of points) of the
shape. If the shape isn't defined or isn't proper, the value is 0.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses information provided by the system function SIZE.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/is_shape.pro)
NAME:
LABELS
PURPOSE:
Multiple XYOUTS interface.
CATEGORY:
General Graphics.
CALLING SEQUENCE:
LABELS, X, Y, LABS [ ,ALIGN = ALN] [, optional keywords]
INPUTS:
X
The X coordinates of the labels. Can be given either as a scalar (in
which case all the labels will have the same x coordinate) or as a
vector of the same length as the LABS vector.
Y
Same as above for the Y coordinates.
LABS
A character vector containing the labels to be drawn.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
ALIGN
The allignment parameter for LABS (see ALIGN graphics keyword in the
IDL manual. Can be given as a vector, thus providing individual
allignment parameter to each string in LABS.
COLOR
Standard IDL plotting interpretation.
CHARSIZE
Ditto.
CHARTHICK
Ditto.
/DEVICE
Ditto
/NORMAL.
Ditto.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
If any of X, Y or ALIGN is given as a scalar variable, it is converted
to a vector of the same length as LABS.
RESTRICTIONS:
None.
PROCEDURE:
Straigtforward. Calls DEFAULT from MIDL.
MODIFICATION HISTORY:
Created 10-DEC-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/labels.pro)
NAME: LABEL_DATA PURPOSE: Label lines and plotting symbols on a plot. The default is to draw lines of different linestyles and colors, putting a label next to each line. CATEGORY: CALLING SEQUENCE: label_data,xpos,ypos,labels INPUTS: xpos=position of upper left-hand corner of label block along x axis, in normalized coordinates. ypos=position of upper left-hand corner of label block along y axis, in normalized coordinates. labels=n-element string array of labels. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: colors=n-element array of color specifications for labels. lines=n-element array of linestyle specifications for labels. size=scalar specifiying the size of the type. psym=n-element array of psym specifications for labels. symsize=n-element array of symsize spec's for labels. symbols=array of 'symbol' specifiers: each element of psym which is equal to 8 (user-defined symbol) must have a corresponding value for 'symbol' to be used by the procedure SYMBOLS. Examples: psym=[8,8,8,8],symbols=[1,2,20,30] psym=[1,2,8,8],symbols=[1,2] title=scalar string for title of label block. t_color=scalar specifying the color of the title. thick=n-element array specifying the thick spec's for labels y_increment=scalar specifying the space between consecutive labels, in percent of plot window. center = set to center the title. Graphics Keywords: t3d,zvalue OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/label_data.pro)
NAME:
LAPLACIAN
PURPOSE:
Calculates the Laplacian of a function represented as an array of
values. Works for 1-7 dimensions.
CATEGORY:
Array Manipulation
CALLING SEQUENCE:
Result = LAPLACIAN( ARR [, DELTA])
INPUTS:
ARR
Array, numeric, number of dimensions can be 1 through 7
OPTIONAL INPUT PARAMETERS:
DELTA
Size of step used to calculate the numeric derivatives. The approx.
second partial derivative in the i-th direction is calculated as
(ARR(...,I + DELTA,...) + ARR(...,I - DELTA,...) - 2*ARR(...,I,...)) $
/DELTA^2
The default value of DELTA is 1. If provided, it is rounded to an
integer on input.
KEYWORD PARAMETERS:
None.
OUTPUTS:
Returns the absolute value of the gradient as an array of the same size
as ARR. If ARR is not an array, returns 0.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
Due to current limitations of the MAKE_ARRAY system routine, 8
dimensions are not allowed.
PROCEDURE:
Creates an 7-dimensional array, with dummy leading dimensions,
containing the original array. Generates the differences using the
SHIFT system routine and strips the dummy dimensions at the end.
Uses the function DEFAULT from MIDL.
MODIFICATION HISTORY:
Created 15-NOV-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/laplacian.pro)
Name: legend Purpose: This procedure makes a legend for a plot. The legend can contain a mixture of symbols, linestyles, Hershey characters (vectorfont), and filled polygons (usersym). Examples: The call: legend,['Plus sign','Asterisk','Period'],psym=[1,2,3] produces: ----------------- | | | + Plus sign | | * Asterisk | | . Period | | | ----------------- Each symbol is drawn with a plots command, so they look OK. Other examples are given in usage and in optional output keywords. Usage: legend,items,linestyle=linestyle ; vertical legend at upper left legend,items,psym=psym ; ditto except using symbols legend,items,psym=psym,/horizontal ; horizontal format legend,items,psym=psym,box=0 ; sans border legend,items,psym=psym,delimiter='=' ; embed an '=' betw psym & text legend,items,psym=psym,margin=2 ; 2-character margin legend,items,psym=psym,position=pos ; position of legend legend,items,psym=psym,number=2 ; plot two symbols, not one legend,items,/fill,psym=[8,8,8],colors=[10,20,30]; 3 filled squares Inputs: items = text for the items in the legend, a string array. You can omit items if you don't want any text labels. For example, items = ['diamond','asterisk','square']. Optional Inputs: linestyle = array of linestyle numbers If linestyle(i) < 0, then omit ith symbol or line to allow a multi-line entry. psym = array of plot symbol numbers. If psym(i) is negative, then a line connects pts for ith item. If psym(i) = 8, then the procedure usersym is called with vertices define in the keyword usersym. N. B.: Choose either linestyle, psym, neither, or both. If neither is present, only the text is output. If both linestyle and psym parameters are present, they both have to have the same number of elements, and normal plot behaviour occurs. By default, if psym is positive, you get one point so there is no connecting line. vectorfont = vector-drawn characters for the sym/line column, e.g., ['!9B!3','!9C!3','!9D!3'] produces an open square, a checkmark, and a partial derivative, which might have accompanying items ['BOX','CHECK','PARTIAL DERIVATIVE']. If vectorfont(i) = '', then plots is called to make a symbol or a line, but if vectorfont(i) is a non-null string, then xyouts is called. There is no check that !p.font is set properly, e.g., -1 for X and 0 for PostScript. This can produce an error, e.g., use !20 with PostScript and !p.font=0, but allows use of Hershey *AND* PostScript fonts together. Optional Keywords: /help = flag to print header /horizontal = flag to make the legend horizontal /vertical = flag to make the legend vertical (D=vertical) box = flag to include/omit box around the legend (D=include) delimiter = embedded character(s) between symbol and text (D=none) colors = array of colors for plot symbols/lines (D=!color) textcolors = array of colors for text (D=!color) margin = margin around text measured in characters and lines spacing = line spacing (D=bit more than character height) pspacing = psym spacing (D=3 characters) charsize = just like !p.charsize for plot labels position = normalized coordinates of the upper left of the legend number = number of plot symbols to plot or length of line (D=1) usersym = 2-D array of vertices, cf. usersym in IDL manual. (D=square) /fill = flag to fill the usersym Outputs: legend to current plot device Optional Output Keywords: corners = 4-element array, like !p.position, of the normalized coords for the box (even if box=0): [llx,lly,urx,ury]. Useful for multi-column or multi-line legends, for example, to make a 2-column legend, you might do the following: c1_items = ['diamond','asterisk','square'] c1_psym = [4,2,6] c2_items = ['solid','dashed','dotted'] c2_line = [0,2,1] legend,c1_items,psym=c1_psym,corners=c1,box=0 legend,c2_items,line=c2_line,corners=c2,box=0,pos=[c1(2),c1(3)] c = [c1(0)c2(2),c1(3)>c2(3)] plots,[c(0),c(0),c(2),c(2),c(0)],[c(1),c(3),c(3),c(1),c(1)],/norm Useful also to place the legend. Here's an automatic way to place the legend in the lower right corner. The difficulty is that the legend's width is unknown until it is plotted. In this example, the legend is plotted twice: the first time in the upper left, the second time in the lower right. legend,['1','22','333','4444'],linestyle=indgen(4),corners=corners ; BOGUS LEGEND---FIRST TIME TO REPORT CORNERS xydims = [corners(2)-corners(0),corners(3)-corners(1)] ; SAVE WIDTH AND HEIGHT chdim=[!d.x_ch_size/float(!d.x_size),!d.y_ch_size/float(!d.y_size)] ; DIMENSIONS OF ONE CHARACTER IN NORMALIZED COORDS pos = [!x.window(1)-chdim(0)-xydims(0) $ ,!y.window(0)+chdim(1)+xydims(1)] ; CALCULATE POSITION FOR LOWER RIGHT plot,findgen(10) ; SIMPLE PLOT; YOU DO WHATEVER YOU WANT HERE. legend,['1','22','333','4444'],linestyle=indgen(4),pos=pos ; REDO THE LEGEND IN LOWER RIGHT CORNER You can modify the pos calculation to place the legend where you want. For example to place it in the upper right: pos = [!x.window(1)-chdim(0)-xydims(0),!y.window(1)-xydims(1)] Common blocks: none Procedure: If keyword help is set, call doc_library to print header. See notes in the code. Restrictions: Here are some things that aren't implemented. - It would be nice to allow data and device coords as well. - An orientation keyword would allow lines at angles in the legend. - An array of usersyms would be nice---simple change. - An order option to interchange symbols and text might be nice. - Somebody might like double boxes, e.g., with box = 2. - Another feature might be a continuous bar with ticks and text. - There are no guards to avoid writing outside the plot area. - There is no provision for multi-line text, e.g., '1st line!c2nd line' Sensing !c would be easy, but !c isn't implemented for PostScript. A better way might be to simply output the 2nd line as another item but without any accompanying symbol or linestyle. A flag to omit the symbol and linestyle is linestyle(i) = -1. - There is no ability to make a title line containing any of titles for the legend, for the symbols, or for the text. - It might be nice to force the legend to be placed at hardwired locations in the plot, e.g., with keywords like /left/bottom for lower left. Allowing this requires knowing the width of the text before it is printed, which is difficult. Side Effects: Modification history: write, 24-25 Aug 92, F K Knight (knight@ll.mit.edu) allow omission of items or omission of both psym and linestyle, add corners keyword to facilitate multi-column legends, improve place- ment of symbols and text, add guards for unequal size, 26 Aug 92, FKK add linestyle(i)=-1 to suppress a single symbol/line, 27 Aug 92, FKK add keyword vectorfont to allow characters in the sym/line column, 28 Aug 92, FKK
(See /usr/local/rsi/idl_4/lib/weitere/legend.pro)
Name: legendtest Purpose: Test the legend procedure. Usage: .run legendtest Inputs: none Optional Inputs: none Keywords: none Outputs: legends of note Common blocks: none Procedure: Side Effects: Sets !20 font to symbol if PostScript and !p.font=0. Restrictions: With the vectorfont test, you'll get different results for PostScript depending on the value of !p.font. Modification history: write, 27 Aug 92, F.K.Knight (knight@ll.mit.edu)
(See /usr/local/rsi/idl_4/lib/weitere/legendtest.pro)
ROUTINE: locate
USEAGLE locate,lat,lon,alat,alon,x,y
PURPOSE: Given the coordinate arrays alat(i,j) and alon(i,j), LOCATE
finds the indices x,y such the point (alat(x,y),alon(x,y))
is closest to a given point (lat,lon). This routine
is used by COASTLINE.
INPUT:
lat geographic latitude
lon geographic longitude
alat array of image latitudes
alon array of image longitudes
OUTPUT:
x,y array indicies such that alat(x,y), alon(x,y) is closest
point to (alat,alon)
AUTHOR: Paul Ricchiazzi oct92
Earth Space Research Group, UCSB
(See /usr/local/rsi/idl_4/lib/weitere/locate.pro)
NAME: LPQ PURPOSE: Spawn a process which executes the Unix 'lpq' command. CATEGORY: CALLING SEQUENCE: lpq INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY:
(See /usr/local/rsi/idl_4/lib/weitere/lpq.pro)
NAME: LPRINT
PURPOSE: Close a PostScript file and print it.
CATEGORY:
CALLING SEQUENCE:
lprint
INPUTS:
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS:
file=the name of the file to print. Default is idl.ps.
return = 1 will execute set_plot,getenv('IDL_DEVICE')
OUTPUTS:
OPTIONAL OUTPUT PARAMETERS:
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/lprint.pro)
NAME: LS PURPOSE: Spawn a process which executes the Unix 'ls' command. CATEGORY: CALLING SEQUENCE: ls INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: Dir=scalar string specifying the directory. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY:
(See /usr/local/rsi/idl_4/lib/weitere/ls.pro)
NAME: MAKE_ARROW PURPOSE: Put a label and a line on a plot. CATEGORY: CALLING SEQUENCE: Make_arrow,label INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: x=2-element array specifying the location of the line. y=2-element array specifying the location of the line. If x and y are not specified, the user is asked to digitize the endpoints of the line using the mouse. color=color of line and label. size=size of text. linestyle=linestyle of the line. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/make_arrow.pro)
NAME:
MAKE_GRID
PURPOSE:
Generates a 1-6 dimensional grid of points within a specified range.
CATEGORY:
Array manipulation.
CALLING SEQUENCE:
Result = MAKE_GRID( SPAN, [ NPOINTS, [ FUNARR = FNARR]])
INPUTS:
SPAN
A (2,N) numeric array, where N <= 6 is the number of grid dimensions.
The pair of entries in SPAN(*,i) represents the coordinate minimum and
maximum in the i-th dimension of the grid.
OPTIONAL INPUT PARAMETERS:
NPOINTS
A numeric vector containing the number of points along each dimension.
If not provided, the same number of points will be assigned to each
dimension. This default number depends on the number of dimensions, as
follows:
dimensions | points per dimension
1 2^20
2 2^10
3 2^6
4 2^4
5 2^3
6 2^3
If NPOINTS has less entries then the number of dimensions, the missing
entries will be assigned the value of the last existing one. If some
of the entries (but not the first) are 0 or 1, they'll be replaced by
the value of the preceding non-zero entry.
KEYWORD PARAMETERS:
FUNARR
optional output, see below.
OUTPUTS:
Returns an array with the dimensions (NDIM,NPOINTS(0),...) where NDIM
is the number of dimensions of the grid, such that Result(*,i0,i1,...)
is a vector containing the cartesian coordinates of the point at
location (i0,i1,...) within the grid.
OPTIONAL OUTPUT PARAMETERS:
FUNARR
The name of the variable to receive a blank array of dimensions
(NPOINTS(0),NPOINTS(1),...). This array can be used to receive the
values of a function evaluated over the grid.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
The number of dimensions must not exceed 6.
PROCEDURE:
Straightforward. Uses DEFAULT from MIDL.
MODIFICATION HISTORY:
Created 15-JAN-1992 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/make_grid.pro)
NAME: make_latex_tbl PURPOSE: Create a LaTeX format table. CATEGORY: CALLING SEQUENCE: make_latex_tbl,array,tfile INPUTS: array = (n,m) array of data. tfile = string specifying the name of the '.tex' file to create. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: columns = an n-element string specifying the LaTeX column format. For example, if array = (3,m), then an acceptable value for columns would be ['|l|','|c|','|c|'], which would left-justify the first column of data, and center the remaining two. format = an n-element string specifying the FORMAT used to PRINTF the data. This must conform to IDL FORMAT standards. If not set, the default the data are printed using the IDL free format. title = a string specifying the title of the table. headings = an n-element string array containing the table headings. nohlines = set to inhibit printing \hline between rows of data. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: The '.tex' file is created. RESTRICTIONS: The TITLE is printed with vertical lines on either side, regardless of how the COLUMNS parameter may be set. It is thus necessary to edit the file to remove the vertical line commands if desired. PROCEDURE: The data contained in ARRAY are printed to a file with the appropriate '&' and '\\' symbols necessary for use as in the LaTeX tabular environment. If COLUMNS is not set, the default is '|c|' which centers the data in columns, with vertical line separators. MODIFICATION HISTORY: David L. Windt, AT&T Bell Laboratories, December 1989.
(See /usr/local/rsi/idl_4/lib/weitere/make_latex_tbl.pro)
NAME: MK4QUADS PURPOSE: Convert an array z(x,y) defined for x,y > 0 to znew(x,y) defined for all x,y. CATEGORY: CALLING SEQUENCE: znew=mk4quads(z) INPUTS: z = 2D array OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: It is assumed that z(x,y) is symmetrix about x=0 and y=0. PROCEDURE: Straightforward. MODIFICATION HISTORY: D. L. Windt, AT&T Bell Labs, February 1990.
(See /usr/local/rsi/idl_4/lib/weitere/mk4quads.pro)
NAME: MORE PURPOSE: Print one or more variables on the screen using the MORE keyword. CATEGORY: CALLING SEQUENCE: More,v0[,v1,v2,...v9] INPUTS: variable = any variable OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: file = string specifying the name of an output file. title = string array for variable names. noindex = set to inhibit printing the index number. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: David L. Windt, AT&T Bell Labs, March 1990
(See /usr/local/rsi/idl_4/lib/weitere/more.pro)
NAME: MOVIE PURPOSE: Show a cyclic sequence of images stored in a 3D array. CATEGORY: Image display CALLING SEQUENCE: Movie, Images [,Rate] INPUTS: Images = (n,m,nframes) byte array of image data, consisting of nframes images, each of n by m. This array should be stored with the top row first, (order = 1) for maximum efficiency. OPTIONAL INPUT PARAMETERS: Xpos = X position of images. Ypos = Y position of images. Rate = initial rate, in APPROXIMATE frames per second. If omitted, the inter-frame delay is set to 0.01 second. KEYWORD PARAMETERS: Order = image ordering. Order = 0 for images ordered bottom up, or = 1 for images ordered top down (the default). OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: Images are displayed in the lower left corner of the currently selected window. RESTRICTIONS: As SunView has no zoom or pan, we have to write each image to the display. Restricting the maximum rate, etc. Experience has shown that you can count on a rate of approximately 10 frames / second with 192 by 192 images. This varies according to the type of computer, amount of physical memory, and number of frames. The amount of available memory also restricts the maximum amount of data that can be displayed in a loop. PROCEDURE: Straightforward. MODIFICATION HISTORY: DMS, Nov, 1988. Added Xpos, Ypos keywords. D. L. Windt AT&T Bell Labs, Nov. 1989
(See /usr/local/rsi/idl_4/lib/weitere/movie.pro)
NAME: MOVIE2 PURPOSE: Show a cyclic sequence of 2 sets of images stored in 2 3D arrays. CATEGORY: Image display CALLING SEQUENCE: Movie2, Image1,Image2[,xpos1,ypos1,xpos2,ypos2,rate] INPUTS: Image1 = (n,m,nframes) byte array of image data, consisting of nframes images, each of n by m. This array should be stored with the top row first, (order = 1) for maximum efficiency. Image3 = same as image1 OPTIONAL INPUT PARAMETERS: Xpos1,Ypos1 = Position of Image1. Xpos2,Ypos2 = Position of Image2. Rate = initial rate, in APPROXIMATE frames per second. If omitted, the inter-frame delay is set to 0.01 second. KEYWORD PARAMETERS: Order = image ordering. Order = 0 for images ordered bottom up, or = 1 for images ordered top down (the default). OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: Images are displayed in the lower left corner of the currently selected window. RESTRICTIONS: As SunView has no zoom or pan, we have to write each image to the display. Restricting the maximum rate, etc. Experience has shown that you can count on a rate of approximately 10 frames / second with 192 by 192 images. This varies according to the type of computer, amount of physical memory, and number of frames. The amount of available memory also restricts the maximum amount of data that can be displayed in a loop. PROCEDURE: Straightforward. MODIFICATION HISTORY: Adapted from MOVIE. David L. Windt, AT&T Bell Labs, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/movie2.pro)
NAME: MOVIE3 PURPOSE: Show a cyclic sequence of 3 sets of images stored in 3 3D arrays. CATEGORY: Image display CALLING SEQUENCE: Movie, Image1,Image2,Image3[,xpos1,ypos1,xpos2,ypos2,xpos3,ypos3,rate] INPUTS: Image1 = (n,m,nframes) byte array of image data, consisting of nframes images, each of n by m. This array should be stored with the top row first, (order = 1) for maximum efficiency. Image2 = same as image1. Image3 = same as image1. OPTIONAL INPUT PARAMETERS: Xpos1,Ypos1 = position of image1. Xpos2,Ypos2 = " " 2. Xpos3,Ypos3 = " " 3. Rate = initial rate, in APPROXIMATE frames per second. If omitted, the inter-frame delay is set to 0.01 second. KEYWORD PARAMETERS: Order = image ordering. Order = 0 for images ordered bottom up, or = 1 for images ordered top down (the default). OUTPUTS: No explicit outputs. COMMON BLOCKS: None. SIDE EFFECTS: Images are displayed in the lower left corner of the currently selected window. RESTRICTIONS: As SunView has no zoom or pan, we have to write each image to the display. Restricting the maximum rate, etc. Experience has shown that you can count on a rate of approximately 10 frames / second with 192 by 192 images. This varies according to the type of computer, amount of physical memory, and number of frames. The amount of available memory also restricts the maximum amount of data that can be displayed in a loop. PROCEDURE: Straightforward. MODIFICATION HISTORY: Adapted from MOVIE David L. Windt, AT&T Bell Labs, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/movie3.pro)
NAME:
MRFT
PURPOSE:
Read FITS-files from rather different sources (Exabyte,Tape, Disk file)
and convert them to different data structures under IDL.
Includes FITS version from Wright Instruments Ltd., ESO and ESO Extensions
CATEGORY:
FITS
CALLING SEQUENCE:
mrft,fbname,nfiles,istart,read_only=read_only,swap=swap,short=short
( e.g. rftest,'rdata',10,1,/swap,/short )
( /swap etc will set swap=1 !)
INPUTS:
'fbname' is the basename of the files to save as (e.g. 'jun24')
nfiles is the number of files to read
istart is the number with which the filename will start
(e.g. istart=12 : filename='jun24.12' for the first file)
OPTIONAL INPUT PARAMETERS:
/swap will cause byte-swapping
/short will only print the most important data
/read_only will read the specified number of files from
the tape and will print only the FITS-header, but will not save
anything !
OUTPUTS:
No explicit output, resulting data files will be generated on disk.
RESTRICTIONS:
In case of reading FITS from disk only one file is read.
(See /usr/local/rsi/idl_4/lib/weitere/mrft.pro)
ROUTINE: mve
AUTHOR: Terry Figel, ESRG, UCSB 10-21-92
CALLING SEQUENCE: mve,var
INPUT:
var an array
PURPOSE: print out the max min mean and std deviation of var
(See /usr/local/rsi/idl_4/lib/weitere/mve.pro)
Name: nbytes Purpose: Return the number of bytes in the variable Usage: nb = nbytes(variable) Inputs: variable = any IDL variable Optional Inputs or Keywords: help = flag to print header Outputs: nb = number of bytes in variable Common blocks: none Procedure: Idea from David Stern. Modification history: write, 22 Feb 92, F.K.Knight increase speed by writing to disk only for structures, 10 Sep 92, FKK eliminate Unix-specific file (from ali@rsinc.com), 11 Sep 92, FKK
(See /usr/local/rsi/idl_4/lib/weitere/nbytes.pro)
NAME:
NINT
PURPOSE:
Yields the value of X rounded to the nearest integer.
CATEGORY:
Mathematical Function (General) / Type Conversion.
CALLING SEQUENCE:
Result = NINT(X)
INPUTS:
X
Numerical, otherwise arbitrary.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
None.
OUTPUTS:
Returns the value of NINT(X), see above, as a long integer.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
For complex X the result is NINT(REAL(X)), the imaginary part is ignored
PROCEDURE:
Using the system function LONG and the function SIGN from MIDL.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/nint.pro)
Name: nlines Purpose: Return the number of lines in a file Usage: nl = nlines(file) Inputs: file = file to scan Optional Inputs or Keywords: help = flag to print header Outputs: nl = number of lines in the file. Common blocks: none Procedure: Assume ASCII data and read through file. Modification history: write, 24 Feb 92, F.K.Knight
(See /usr/local/rsi/idl_4/lib/weitere/nlines.pro)
NAME: nn_clust.pro PURPOSE: tag events with cluster # CATEGORY: data processing - cluster analysis CALLING SEQUENCE: result = NN_CLUST(data,weights,[N_PARAM=n_param], [N_EVENT=n_event],[N_CLUST=n_clust]) INPUTS: data = data set to be clustered, weights = array of weights which describe cluster centers (produced by the function NN_LEARN) OPTIONAL INPUT PARAMETERS: n_param = # of parameters in data set - 1st dimension of data set n_event = # of events in data set - 2nd dimension of the data set n_clust = # of clusters to find - arbitrary KEYWORD PARAMETERS: none OUTPUTS: result = integer array of cluster assignment of each event OPTIONAL OUTPUT PARAMETERS: none COMMON BLOCKS: none SIDE EFFECTS: none (?) RESTRICTIONS: Read the header of 'nn_learn.pro'. PROCEDURE: The data set is processed against the weights array and a cluster # assignment is made for each event in the input data set based on the weights array which describe the center of each cluster. MODIFICATION HISTORY: initial algorithm: Mark Naiver (Univ of Texas - Austin) Date last modified ==> 1 March 93 : RCH [LANL] Contact: Robb Habbersett (505/667-0296 or robb@big-geek.lanl.gov)
(See /usr/local/rsi/idl_4/lib/weitere/nn_clust.pro)
NAME: nn_learn.pro PURPOSE: Learning step to cluster data using neural network techniques. CATEGORY: Data processing - cluster analysis CALLING SEQUENCE: weights = nn_learn(data,max_val,[BLR=blr],[ELR=elr], [N_EVENT=n_event],[N_PASS=n_pass],[N_PARAM=n_param],[N_CLUST=n_clust] INPUTS: data = data set to be clustered, max_val = maximum range of each parameter in the data set (to normalize the weights). OPTIONAL INPUT PARAMETERS: blr = begining learning rate, elr = ending learning rate n_pass = # of iterations of the learning pass n_param = # of parameters in data set - 1st dimension of data set n_event = # of events in learning set - 2nd dimension of data set n_clust = # of clusters to find - arbitrary (?) KEYWORD PARAMETERS: none OUTPUTS: result = an array of weights describing the cluster centers. OPTIONAL OUTPUT PARAMETERS: none COMMON BLOCKS: none SIDE EFFECTS: This approach has an inherent weakness in that it must be set to find a specific number of clusters; It will find that number of clusters in the data set - regardless. RESTRICTIONS: This routine has not been rigorously tested on different types of data. It "appears" to work on flow cytometry data. PROCEDURE: A limited subset of a larger data set is presented to this routine as a training set to condition the neural network. The result is a set of weights which describe the centers of the resolved clusters. MODIFICATION HISTORY: Initial algorithm: Mark Naiver (Univ of Texas - Austin) Date last modified ==> 1 March 93 : RCH [LANL] Contact: Robb Habbersett (505/667-0296 or robb@big-geek.lanl.gov)
(See /usr/local/rsi/idl_4/lib/weitere/nn_learn.pro)
NAME: Oeplot PURPOSE: Overplot a vector with error bars. CATEGORY: CALLING SEQUENCE: oeplot,y,sigy oeplot,x,y,sigy oeplot,y,sigy_up,sigy_down oeplot,x,y,sigy_up,sigy_down INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: Graphics keywords: linestyle,noclip, psym,symsize,t3d,zvalue OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: See EPLOT MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/oeplot.pro)
NAME: ONED2TWOD PURPOSE: Create a two-dimensional array whose elements are equal to the radial distance from the origin, given a one-dimensional vector. CATEGORY: CALLING SEQUENCE: outarray = oned2twod(invector) INPUTS: invector = a one-dimensional vector. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: OUTPUTS: outarray = a two-dimensional array: outarray(i,j)=sqrt(invector(i)^2+invector(j)^2) OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, April, 1990.
(See /usr/local/rsi/idl_4/lib/weitere/oned2twod.pro)
NAME:
ONE_OF
PURPOSE:
Called with up to 8 variables A_ through H_ , ONE_OF checks which
variable is defined (only one is supposed to be).
CATEGORY:
Programming.
CALLING SEQUENCE:
Result = ONE_OF( A_ [,B_, ... H_] [, VALUE = VAL])
INPUTS:
A_ through H_
Arbitrary, all are optional.
OPTIONAL INPUT PARAMETERS:
See above.
KEYWORD PARAMETERS:
VALUE
Optional output, see below.
OUTPUTS:
Returns the serial number (range 0 through 7) of the defined variable,
or -1 if none is defined. If more than one variable is defined, ONE_OF
issues an error message and returns to the main level.
OPTIONAL OUTPUT PARAMETERS:
VALUE
The name of the variable to receive the value of the single defined
variable, or a null string if none is defined.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
Currently ONE_OF is restricted to a maximum of 8 variables. If needed,
the number can be increased.
PROCEDURE:
Straightforward.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
Modified 30-JUL-1991 by Mati Meron. The dependence of the original
code on the EXECUTE system routine has been eliminated in order to
assure compatibility with the OUTPUT routine.
(See /usr/local/rsi/idl_4/lib/weitere/one_of.pro)
NAME:
OUTPUT
PURPOSE:
Generic output interface. Allows sending the results of virtually any
IDL command or file to any predefined hard copy device. In detail,
OUTPUT executes the provided command, writes the output to a file and
sends the file to a printout que.
CATEGORY:
Input/Output
CALLING SEQUENCE:
OUTPUT, COMM [, keywords] [,optional input parameters]
INPUTS:
COMM
Character value representing a valid IDL command. Can be (and usually
is) a procedure or function call.
OPTIONAL INPUT PARAMETERS:
A__ through H__
Serve to pass variables which are used in the command COMM. Since COMM
is passed to output as a single string, OUTPUT is not receiving the
values of any variables used by COMM. If such values are needed they
have to be passed separately. This is done using the variables A__
through H__ in combination with the keyword SUBST (see below), which
accepts a string made of the names of the variables separated by spaces
or commas.
Example:
Assume a routine named NEWPLOT which is called using the syntax
NEWPLOT, I, X, SCOPE = Y
If at the time of call I, X, and Y have known values, say 3, 12.4
and [12,95] then it is possible to issue the command
OUTPUT, 'NEWPLOT, 3, 12.4, SCOPE = [12,95]'
If, on the other hand one would want to pass NEWPLOT to output
using the variables K, E and RANG for I, X, Y, the command can be
OUTPUT, 'NEWPLOT, I, X, SCOPE = Y', $
SUBST = 'I,X Y', K, E, RANG
The order in which the variable names appear in SUBST is arbitrary
but it has to be in a one-to-one correspondence with the order in
which the actual arguments are given. Therefore, the following is
equally valid
OUTPUT, 'NEWPLOT, I, X, SCOPE = Y', $
SUBST = 'Y, I, X', RANG, K, E
KEYWORD PARAMETERS:
QUE
Accepts a string (only the first two chars matter) and sets the
printout que. Currently accepted values and the ques they represent
are as follows:
'LN03' - The LN03 printer at the X26.
'MAC' - The Macintosh LaserWriter in 815. This is the
default if no que is specified.
'PS' - Same as MAC.
'PHASER' - The Phaser color printer in 815.
'TRANSP' - The Phaser Printer with LEGAL sized paper. Use this
one for transparencies.
'901' - The SIXEL printer in 901.
'SIXEL' - Same as 901.
This is by no means the final list, as new ques keep being added from
time to time.
FIL
Accepts a string representing a valid VMS file name. Extension isn't
necessery. Default is 'IDL'.
/KEEP
Specifies file disposition. If set, the file is kept after printout.
the default is 'DELETE'.
/BEEP
If set, a beep will sound when OUTPUT finishes processing the file, and
another beep sounds when the printout is complete. Useful for long
files.
Note: Currently, when a file is sent from the VAX to one of the
PostScript printers (MAC or PHASER), no verification is done to check
that the printer is on and ready to receive. However, such a
verification is performed if /BEEP is set.
OPTION
Accepts a string representing a valid IDL command. If given, this
command will be executed BEFORE COMM. If the command in OPTION
includes variables, their values can be passed using the same mechanism
as the one used for COMM (see above).
SUBST
Accepts a string containing the names of the variables which are to
receive the values A__ through H__ (or part of them) for substitution
purposes. Commas and/or spaces are valid delimiters.
OUTPUTS:
None, other then the file that's created and whatever outputs are
generated by COMM.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
OUTPUT tries to avoid any side effects, as far as possible.
Specifically, the values of all the system variables are reset at exit
from OUTPUT to the values they had before output was called. Still,
since COMM can be any possible command, side effects cannot be totally
avoided.
A currently known side effect has to do with PostScript printers. If
either COMM or OPTION change the postscipt settings, the new settings
will remain in effect after OUTPUT exits.
RESTRICTIONS:
1) The commands in COMM and OPTION (if used) are not allowed to use calls
to the EXECUTE system routine, either directly or indirectly. This is
so since OUTPUT itself relies on EXECUTE and since EXECUTE (unlike
other IDL commands) cannot be called recursively.
2) Currently the number of substitution variables is limited to 8. If
it'll turn out that this number isn't sufficient it can be easily
increased. Let me know.
3) The commands in COMM (and OPTION) shouldn't change the output device
(i.e. NO using SET_PLOT, DEVICE/CLOSE, etc., all this is taken care of
by OUTPUT). If they do, no error will result but the outcome will be
unpredictable.
4) In order to make the best use of OUTPUT it is recommended that the
commands in COMM will be totally device independent (i.e. no using
explicit device coordinates etc.). This allows to send the output of
the same procedure to the various printers and get consistent results.
If one finds it necessery to use some device specific commands (like
setting a color table for the Phaser printer), they should be put in
OPTION (that's really the whole purpose of having OPTION)
PROCEDURE:
OUTPUT contains a list of the appropriate device opening and closing
commands for the ques it recognizes. When called, it does the
following.
1) Checks QUE and if recognizable generates the appropriate OPEN,
CLOSE and PRINTOUT commands.
2) Performs variable substitution if so specified (by a non-blank
value of SUBST)
3) Opens device.
4) Executes OPTION, if given.
5) Executes COMM
6) Closes device.
7) Spawns PRINT command to the appropriate que.
OUTPUT uses various routines from MIDL, namely:
TYPE, DEFAULT, STRMATCH, STRPARSE and PLVAR_KEEP.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
Modified 15-SEP-1991 by Mati Meron. Added Phaser and Sixel support.
Modified 15-NOV-1991 by Mati Meron. Added the 'TRANSP' que and the
/BEEP keyword.
Modified 28-DEC-1991 by Mati Meron. Now any changes made to the color
table of PostScript devices by either COMM or OPTION are undone before
OUTPUT exits.
(See /usr/local/rsi/idl_4/lib/weitere/output.pro)
NAME:
PACK
PURPOSE:
Pack ascii files into one container file in order to make it
easier to transfer a bunch of procedures to another computer
system (especially for E-Mail and Kermit). The container file
may be used like an IDL command procedure to unpack itself.
No additional unpack procedure is neccessary.
CALLING SEQUENCE:
pack, [filename, [packname]]
INPUTS:
filename - A comma separated list of filenames to be packed
into the container file (default = *.pro)
packname - The name of the container file (default = idl.pck).
KEYWORDS:
None.
OUTPUTS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
A container file is created.
RESTRICTIONS:
- Tested on VAX/VMS only.
- No check for packing binary files or directories is done.
- No check for packing the current or other packfiles is done.
- The unpack operation will terminate IDL when done.
- No filename checking for other operating systems is performed.
- No I/O error handling is performed. All errors will stop the program.
- The pack procedure is not automatically copied into the packfile
for a later re-pack on the target system. This could be solved by
making PACK a userlib procedure (incl. loadarray.pro and filescan.pro).
- The directory information is not transfered (directory tree transfer).
EXAMPLES:
Packing a default container:
IDL> pack
Unpack the default container IDL.PCK on the target machine:
IDL> @idl.pck
Alternative unpack without having IDL started before:
idl idl.pck
MODIFICATION HISTORY:
October 1992, HJB, CreaSo Created.
(See /usr/local/rsi/idl_4/lib/weitere/pack.pro)
Name: PANELPLOT Purpose: Plot many sets of variables on one common set of axes Usage: panelplot,xdata,ydata,/init,nplots=n,... ; make 1st plot panelplot,xdata,ydata,... ; make 2nd plot ... panelplot,xdata,ydata,... ; make nth plot Inputs: (the following inputs apply during initialization) init = flag to initialize for plots nplots = number of plots on the page (the following inputs apply to each individual plot) xdata = abscissa values ydata = ordinate values Optional Inputs: (the following inputs apply during initialization) charsize = value to override the default value: !p.charsize minx = minimum x value to plot maxx = maximum x value to plot xtitle = title of the x axis title = main plot title (the following inputs apply to each individual plot) ytitle = the y axis title rtitle = the plot title on right side of plot ltitle = the plot title on left side of plot yrange = array of y ranges for data Outputs: plot to current device of data Restrictions: To suppress tick labels, labels are set to blanks. However, there may be more ticks than blanks, producing unwanted labels. The plot area hardwired and will be incorrect for large charsizes. Modification history: modify multiplot, 12 Nov 91, FKK eliminate legend, fills with polyh, etc. 5 Jun 92, FKK change keyword mtitle to title, 25 Aug 92, FKK add ystyle and xstyle keywords, 2 Oct 92, FKK
(See /usr/local/rsi/idl_4/lib/weitere/panelplot.pro)
NAME:
PIE_PLOT
PURPOSE:
Creates a pie-graph.
CATEGORY:
Graphics.
CALLING SEQUENCE:
PIE_PLOT, VALUES
INPUTS:
Values: A vector containing the values to be represented by the pieces
of the pie. Each element in VALUES corresponds to a single piece
in the output.
KEYWORD PARAMETERS:
CENTER: Gives the center position of the pie.
RADIUS: Is the lenght of a piece.
ANGLE: Startup angle in conclusion to vertical above the center.
It is given in "dec".
EXPLODE: A vector (float),the same size as VALUES, containg the index, how wide the pieces
have to move out of the center (in percent of radius).
COLORS: A vector, the same size as VALUES, containing the color index
to be used for each piece. If not specified, the colors are
selected based on spacing the color indices as widley as possible
within the available colors.
OUTLINES: A vector, the same size as VALUES, containing the color index
to be used for the outlines of each piece. If not specified,
the colors are taken from the colors for the filled pieces.
TITLE: A string containing the main title for the pie plot.
LABELS: A string array, containing one string label per piece.
PERCENT: If set, the different percentages of the pieces are also plotted.
FORMAT: Contains the format for the percentage.
NUMBERS: If set, the numbers of the pieces are plotted around.
FILLED: If set, the pieces are filled.
INVISIBLE: Contains the numbers of pieces not to be shown.
T3D: Creates pie in 3-D.
CHARSIZE: Size of the characters used for numbers, labels, percentage.
CHARTHICK: Thickness of characters.
FONT: Font for characters.
FILL_PATTERN: Fill pattern for pieces.
STEPS: width of increment.
WINSIZE: Size of the output window.
POSITION: Position of output window.
THICK: Thickness of the outline.
SHADOW: If shadow is set, a shadow pie is drawn under the pie (only with t3d).
SOLID: If solid is set, the 3-d pie gets a solid box around the pieces
(only with t3d).
HIGH: A value, that describes how high the boxes around the pieces hade to be
(only with t3d).
MODIFICATION HISTORY:
Created by Michael Dalbert / CreaSo in august, 1992.
(See /usr/local/rsi/idl_4/lib/weitere/pie_plot.pro)
NAME:
PLOTOT
PURPOSE:
Plots multiple data sets on a single plot
CATEGORY:
Plotting
CALLING SEQUENCE:
PLOTOT, [X,] Y [, optional keywords]
INPUTS:
Y
A numeric vector or 2 dimensional array containing the Y coordinates of
the data. If Y is a vector PLOTOT operates same as PLOT. If it is
a 2-dim.array, each row is ploted separately. It is assumed that the
number of points per plot is larger than the number of plots so that if
Y is an (M*N) array with N > M, it will be transposed prior to plotting.
OPTIONAL INPUT PARAMETERS:
X
A numeric vector containing the X coordinates of the data. If absent
it is replaced by the vector [0, 1, 2 ...].
KEYWORD PARAMETERS:
XTYPE
Standard IDL plotting interpretation.
YTYPE
Ditto.
XEXACT
Ditto.
YNOZERO
Ditto.
XTITLE
Ditto.
YTITLE
Ditto.
TITLE
Ditto.
CHARSIZE
Ditto.
THICK
Ditto.
SYMSIZE
Ditto
PSYM
Ditto. If given as a vector consecutive elements are applied to
consecutive plots.
LINESTYLE
Ditto. If given as a vector consecutive elements are applied to
consecutive plots.
COLOR
Ditto. If given as a vector consecutive elements are applied to
consecutive plots.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Straightforward. Uses calls to DEFAULT and SIGN in MIDL.
MODIFICATION HISTORY:
Created 30-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/plotot.pro)
NAME:
PLOT_VER2
PURPOSE:
Draws 2 plots, vertically spaced, with a possibility of multiple curves
on each plot.
CATEGORY:
Plotting
CALLING SEQUENCE:
PLOT_VER2, [X,] Y0, Y1 [, optional keywords]
INPUTS:
Y0
A numeric vector or 2 dimensional array containing the Y coordinates of
the data for the top plot. If Y is a 2-dim.array, each row is ploted
separately. It is assumed that the number of points per plot is larger
than the number of plots so that if Y is an (M*N) array with N > M, it
will be transposed prior to plotting.
Y1
Same as Y0 for the bottom plot.
OPTIONAL INPUT PARAMETERS:
X
A numeric vector containing the X coordinates of the data. If absent
it is replaced by the vector [0, 1, 2 ...].
KEYWORD PARAMETERS:
RATIO
Size ratio between top and bottom plot. Default is 1.
GAP
Width of the gap between the plots in character units. Default is 0.1
XMARGIN
Standard IDL plotting interpretation
YMARGIN
Ditto.
XTYPE
Ditto.
YTYPE
Ditto. If given as 2-element vector, elements 0 and 1 apply to top and
bottom plots, respectively.
XEXACT
Ditto.
YNOZERO
Ditto. If given as 2-element vector, elements 0 and 1 apply to top and
bottom plots, respectively.
XTITLE
Ditto.
YTITLE
Ditto. If given as 2-element vector, elements 0 and 1 apply to top and
bottom plots, respectively.
TITLE
Ditto.
CHARSIZE
Ditto.
THICK
Ditto.
SYMSIZE
Ditto
PSYM
Ditto. If given as a vector consecutive elements are applied to
consecutive curves on each plot.
LINESTYLE
Ditto. If given as a vector consecutive elements are applied to
consecutive curves on each plot.
COLOR
Ditto. If given as a vector consecutive elements are applied to
consecutive curves on each plot.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Straightforward. Uses calls to DEFAULT, PLVAR_KEEP and PLOTOT in MIDL.
MODIFICATION HISTORY:
Created 30-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/plot_ver2.pro)
NAME:
PLVAR_KEEP
PURPOSE:
Saves or restores the values of system variables.
CATEGORY:
Input/output
CALLING SEQUENCE:
PLVAR_KEEP, ACTION = ACT [, /RESET]
INPUTS:
None.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
ACTION
Specifies the action to take. Two possible values, 'SAVE' and
'RESTORE' (only first three characters count).
/RESET
Protection bypass. Normally multiple calls to PLVAR_KEEP are counted
but no action is taken after the first. For example, if 3 consecutive
calls with ACTION = 'SAVE' were issued then the system variables are
saved on the first call and nothing happens on the next two. Then,
when calls with ACTION = 'RESTORE' are issued, only the third call will
have an effect. This mechanism allows using 'SAVE' and 'RESTORE' calls
as pairs of braces around program sections. For the (rare) cases when
one wants to save or restore regardless of previously issued calls,
setting RESET disables the protection mechanism.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
M_PLVARS
SIDE EFFECTS:
None when used properly. If the numbers of SAVEs and RESTOREs are not
equal, either due to an omission or to an error in a called routine,
the settings won't be restored to their initial state. In this case
the cure is to execute
PLVAR_KEEP, ACTION = 'RESTORE', /RESET
RESTRICTIONS:
None.
PROCEDURE:
Uses a common block (M_PLVARS) to save and restore the values of:
!P, !X, !Y, !Z, !D.NAME. Also uses the routines TYPE, DEFAULT and
STRMATCH from MIDL.
MODIFICATION HISTORY:
Created by 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/plvar_keep.pro)
NAME:
POLEVAL
PURPOSE:
Evaluates a polynomial function according to the formula:
F = c(0) + c(1)*X + ... + c(n)*X^N
Similar to the library routine POLY. The difference is that when the
keyword QUOTIENT is used, the routine returns, in QCOEF, the values of
the coefficients of the quotient polynomial. In other words, given the
coefficients of a polynomial P, and a value Xc, the function returns
the value P(Xc), and in QCOEF are returned the coefficients of the
polynomial Q(X) = P(X)/(X - Xc). Note that unless P(Xc) is 0, the
division has a remainder.
CATEGORY:
Mathemetical function (general).
CALLING SEQUENCE:
Result = POLEVAL( X, COEF [, QUOTIENT = QCOEF])
INPUTS:
X
Numeric, otherwise arbitrary
COEF
Numeric vector.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
QUOTIENT
An optional output parameter. See below.
OUTPUTS:
Returns the value of the polynomial at X. The result has the same
structure and number of elements as X and the same type as the higher
of X and COEF.
OPTIONAL OUTPUT PARAMETERS:
QUOTIENT
The name of the variable to receive the quotient polynomial. The
quotient is an array with one more dimension than X. For example, if
X is given as an array with dimensions (10,8,64) and the order of the
polynomial is 4 then the dimensions of the quotient will be (10,8,64,4).
QCOEF(4,5,6,*) will then contain the coefs. of P(X)/(X - X(4,5,6)), etc.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Standard Horner evaluation. Uses the function DEFAULT from MIDL.
MODIFICATION HISTORY:
Created 15-NOV-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/poleval.pro)
Name: ppi Purpose: Make a ppi (plan position indicator) plot, named for the early CRT displays that presented radar data in polar coordinates. Plot is intensity versus range and azimuth. THere are two input forms: for regularly and irregularly gridded data. Examples: rcs = intarr(360,10) ; DUMMY DATA---SPIRAL RAMP for i=0,9 do $ rcs(*,i) = (indgen(360)+i*10) mod 360 azi = indgen(360) ; AZIMUTH BINS range = indgen(10)+1 ; RANGE BINS ppi,rcs,azi,range ; PPI PLOT: ; 1-deg BINS x 1-UNIT RANGE BINS ppi,rcs,azi,range,color=32 ; USE 32 COLORS, NOT 8 ppi,rcs,azi,range,grid=[12,5] ; ADD GRID AT 12 AZIMUTHS & 5 RANGES tc = bytarr(6) ; ARRAY FOR COLORS col = ['black','cyan','green','yellow','red','white'] for i = 0,5 do tc(i) = thecolor(col(i)) ppi,rcs,azi,range,color=tc ; USE AN ARRAY OF COLOR INDICES Usage: ppi,rcs,azimuth,range[,rangebin=rangebin,azimuthbin=azimuthbin][,option=opt] OR ppi,data[,rangebin=rangebin,azimuthbin=azimuthbin][,option=opt] Inputs: rcs = 2-D array of rcs data with dimensions nazim x nrange azimuth = 1-D vector of azimuth bins, length nazimuth, ,in degrees CW from North (up) range = 1-D vector of range bins, length nrange OR data = 2-D array of intensities at (r,theta) with dimensions 3 x npts where 1st dim contents ------- ----------------------------- 0 range to data point 1 azimuth of data point in degrees 2 intensity of data point and npts = number of points or sectors to plot Optional Keywords: rangebin = size of range bin in same units as range (D=range spacing) azimuthbin = size of azimuth bin in degrees (D=azimuth spacing) help = flag to print header rcsrange = data range spanned by colors (D=[min(data),max(data)]) colors = # of colors in plot (D=8) or array of color indices step = step in color table between colors. The default steps through the entire color table. (D=!d.n_colors/colors) title,xtitle,ytitle = titles like plot position = 4-element array for plot position in window---!d.position (D=largest square with margins) rangerange = plot limits (D=auto) grid = 1 or 2-element array to specify the number of azimuth and range grids, (D=none) Example: grid=[12,5] for azimuth every 30 degrees and range every 25% of range extent Outputs: polar plot to current device Common blocks: none Procedure: If keyword help is set, call doc_library to print header. Only points are plotted if bin parameters are omitted; otherwise, trapezoids are used to approximate sectors. For PostScript, the actual PostScript commands are written to the file; for other devices, polyfill is used. The reason is that polyfill doesn't use the PostScript fill operator. Instead polyfill uses vectors, which makes a gigantic file. I tried a few sets of PostScript commands, but I found that a single arcn did the trick. Previously, I tried the set <...setrgbcolor newpath...arcn...lineto...arc closepath fill> where the ellipsis means the parameters are omitted. Using only arcn with a linewidth equal to the rangebin yields a file about half the length. PostScript code is optimized to produce small PS file. A halftone screen could be used for color device and few colors. Restrictions: Only tested for Openwindows and PostScript, but should work for any device that allows polyfill. Modification history: write, 11-19 Jun 92, F.K.Knight (knight@ll.mit.edu) add optional azimuthal and range grids, 23 Jun 92, FKK add optional array of color indices, 15 Oct 92, FKK TBD, add an optional color bar
(See /usr/local/rsi/idl_4/lib/weitere/ppi.pro)
NAME:
PRIMES
PURPOSE:
Calculates a table of prime numbers in the range NLO - NHI.
CATEGORY:
Mathematical function (general).
CALLING SEQUENCE:
List = PRIMES( [NLO,] NHI)
INPUTS:
NHI
Upper limit of the range of the primes table.
OPTIONAL INPUT PARAMETERS:
NLO
Lower limit of the prime table range. If not provided, i.e. if only
one input parameter is provided, NLO defaults to 1.
KEYWORD PARAMETERS:
None.
OUTPUTS:
Returns the list of primes between NLO and NHI (inclusive), as long
integer. If no primes are found, returns 0.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses the Sieve of Erasthotenes algorithm. The starting primes table is
provided by the function PR_SIEVE, from MIDL.
MODIFICATION HISTORY:
Created 15-NOV-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/primes.pro)
NAME:
PR_SIEVE
PURPOSE:
Called from PRIMES, generates a list of all the prime numbers <= N.
CATEGORY:
Mathematical function (general)
CALLING SEQUENCE:
List = PR_SIEVE(N)
INPUTS:
N
Positive integer.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
None.
OUTPUTS:
Returns the list of all prime numbers <= N.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
Since PR_SIEVE isn't supposed to be called directly, no checking is
done to verify that N is indeed a positive integer. All the necessery
checking is done by the function PRIMES.
PROCEDURE:
Uses the Sieve of Erasthotenes algorithm. Calls itself recursively to
generate the primes table.
MODIFICATION HISTORY:
Created 15-NOV-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/pr_sieve.pro)
ROUTINE: put_color_scale
USEAGE: PUT_COLOR_SCALE,x1,y1,range[,inc,ysize=ysize,charsize=charsize]
PURPOSE: Draws a numbered color scale
INPUT:
x1,y1 device coordinates of lower left hand corner of color bar
range array which contains full range of physical values,
The number scale limits are computed fron min(range) and
max(range)
inc increment step of the number scale in physical units
OPTIONAL KEYWORD INPUT:
charsize character size on number scale
ysize vertical size of color bar in device units.
AUTHOR: Paul Ricchiazzi oct92
Earth Space Research Group, UCSB
(See /usr/local/rsi/idl_4/lib/weitere/put_color_scale.pro)
NAME: RD_MATRIX PURPOSE: Read a data file created using MATRIX. CATEGORY: CALLING SEQUENCE: rd_matrix,x,y[,file=file] INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: file = name of the data file. OUTPUTS: x = independent variable. y = dependent variable. OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, February, 1990.
(See /usr/local/rsi/idl_4/lib/weitere/rd_matrix.pro)
NAME: rd_mca_data PURPOSE: Read mca data files written with ~icl/norland5700/mca CATEGORY: icl CALLING SEQUENCE: rd_mca_data,x,y[,file=file] INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: file = name of mca data file. OUTPUTS: x,y = the x and y data variables. OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: David L. Windt, AT&T Bell Laboratories.
(See /usr/local/rsi/idl_4/lib/weitere/rd_mca_data.pro)
Name:
readb
Purpose:
Procedure to copy the bits of an array to another IDL variable.
Good for internal conversion, but limited in scope.
A more general approach would allow other than array input.
Examples:
#1
a = replicate(byte('ff'x),4) ; MAKE A SOURCE ARRAY
t = intarr(2) ; MAKE A DESTINATION ARRAY
readb,a,t ; NEW ROUTINE
print,t ; EQUIVALENT TO: t = fix(a,0,2)
-1 -1
#2
print, 'test of nested structures'
print, '========================='
st1 = {st1, aa:0L, bb:55.}
a=bindgen(216) ; JUST ENOUGH BYTES!
b={t1:0L, t2:0.0, t3:lonarr(5,5), t4:fltarr(5,5), t5:st1}
readb, a, b
Usage:
readb,source,destination[,offset][,/help]
Inputs:
source = IDL source array, not a structure
Optional Inputs:
offset = offset of starting point measured in elements of source
Offset is set if this is a recursive call. It might also be
set if you want to start reading from the middle of the source array.
Note that offset is just like offset in a = fix(source,offset).
Keywords:
help = flag to print header
Outputs:
destination = IDL destination variable, any type
Common blocks:
none
Procedure:
If keyword help is set, call doc_library to print header.
The recursive portion is from Alan Youngblood (support@rsinc.com).
For a structure, there is a loop through the tags and readb calls
itself. For each tag, you reach a conversion line using one of
byte(), fix(), long(), etc., after which offset is incremented by
the length of the tag.
Modification history:
start with Alan's ideas, 8-10 Sep 92, FKKnight (knight@ll.mit.edu)
(See /usr/local/rsi/idl_4/lib/weitere/readb.pro)
NAME:
READCT
PURPOSE:
Read a colortable from file.
CALLING SEQUENCE:
readct, num, filename, red, green, blue
INPUTS:
num - Number of colortable to be read.
filename - Name of the new colortable file.
KEYWORDS:
nointer - Do not interpolate if ne equal zero.
OUTPUTS:
red - Red values of the colortable.
green - Green values of the colortable.
blue - Blue values of the colortable.
COMMON BLOCKS:
None.
SIDE EFFECTS:
A file is read.
RESTRICTIONS:
Tested on VAX/VMS only.
MODIFICATION HISTORY:
September 1992, HJB, CreaSo Created.
(See /usr/local/rsi/idl_4/lib/weitere/readct.pro)
NAME:
READ_ASCII
PURPOSE:
Reads data from an ASCII file into an array. It is assumed that the
file contains columns of numbers, with the same number of entries in
each row. The numbers may be separated by commas, spaces and/or tabs.
The file may contain a header. The first line in which the first
non-blank character is one of ".+-0123456789" will be considered the
beginning of the data. Text lines imbedded in the data are skipped.
CATEGORY:
Input/Output.
CALLING SEQUENCE:
Result = READ_ASCII( FILNAM [, optional keywords])
INPUTS:
FILNAM
Char. value, the name of the data file. Default extension is '.DAT'.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
/SHOW
If set, the header (if one exists) will be printed to the screen.
NPOINTS
Optional output, see below.
HEADER
Optional output, see below.
OUTPUTS:
Returns the data in a (NC,NR) floating array, where NC, NR, are the
numbers of rows and columns respectively. In case of error returns 0.
OPTIONAL OUTPUT PARAMETERS:
NPOINTS
The name of a 2-dim vector to to receive the values of NC, NR (see
above). Doesn't need to be defined prior to the call. In case of an
error returns [0,0]
HEADER
The name of a character array to receive the header lines. Doesn't
need to be defined prior to the call. In case of on error, or if no
header exists, returns a zero length string.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Straightforward. Uses STRPARSE from MIDL.
MODIFICATION HISTORY:
Created 25-JAN-1992 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/read_ascii.pro)
NAME: READ_CONTF PURPOSE: Read the contours defined by a path file created by CONTOUR. CATEGORY: CALLING SEQUENCE: XYARR=READ_CONTF(FILENAME[,/OPEN][,/CLOSED]) INPUTS: Filename = name of file containing contour paths. This file must have been made using CONTOUR, PATH=Filename, ... KEYWORD PARAMETERS: /Open to read in only open contours. /Closed to read in only closed contours. Open and Closed are mutually exclusive. OUTPUTS: COMMON BLOCKS: None. SIDE EFFECTS: RESTRICTIONS: PROCEDURE: Adapted from polycontour.pro. EXAMPLE: MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/read_contf.pro)
NAME: RECROI PURPOSE: Define a rectangular region of interest of an image using the image display system and the cursor/mouse. CATEGORY: Image processing. CALLING SEQUENCE: r=recroi(sx,sy[,xverts,yverts]) INPUTS: sx, sy = size of image, in pixels. KEYWORD PARAMETERS: 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. xaxis, yaxis = optional 1-d arrays corresponding to the x and y scales of image. Needed only if xroi and/or yroi are specified. xroi, yroi = optional output vectors associated with the digitized rectangular region of interest. xaxis and yaxis keyword parameters must be supplied. OUTPUTS: Function result = vector of subscripts of pixels inside the region. OPTIONAL OUTPUTS: xverts, yverts = optional output parameters which will contain the vertices enclosing the region. Setting NOREGION inhibits the return of the pixel subscripts. COMMON BLOCKS: Colors is used to obtain the current color table which is modified and then restored. SIDE EFFECTS: For this implementation, bit 0 of each pixel is used to draw the outline of the region. You WILL have to change this to fit the capabilities and procedures of your display. The lowest bit in which the write mask is enabled is changed. RESTRICTIONS: PROCEDURE: The write mask for the display is set so that only bit 0 may be written. Bit 0 is erased for all pixels. The color tables are loaded with odd values complemented, even values unchanged. A message is printed, assuming a mouse, indicating the effect of the three buttons. The operator marks opposite corners of the rectangle. MODIFICATION HISTORY: Adapted from DEFROI D. L. Windt, AT&T Bell Laboratories, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/recroi.pro)
NAME:
RECTAN
PURPOSE:
Draws a rectangle between the limits specified by XLIMS and YLIMS. The
drawing is done in the currently defined plot area. DATA coordinate
system is assumed unless specified otherwise by one of the keywords
/DEVICE or /NORMAL.
CATEGORY:
General Graphics.
CALLING SEQUENCE:
RECTAN, XLIMS = XLS, YLIMS = YLS [, optional keywords]
INPUTS:
None
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
XLIMS
2 dimensional vector, format [xmin,xmax], mandatory.
YLIMS
2 dimensional vector, format [xmin,xmax], mandatory.
ROTATE
Optional. Angle of ratation in the mathematical positive direction.
Assumed in radians, unless DEGREES is set.
/DEGREES
Specifies that the rotation angle is given in degrees.
RADIUS
Value of radius for rounded corners.
/RELATIVE
Specifies that the radius value is relative to the shorter side of the
rectangle.
/FILL
causes the rectangle to be filled with a solid pattern.
COLOR
Standard IDL plotting interpretation.
/DEVICE
Ditto.
LINESTYLE
Ditto.
/NORMAL
Ditto.
THICK
Ditto.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses calls to DEFAULT, ONE_OF, SHAPE_COCON, SHAPE_CLOSE and SHAPE_TRANS
from MIDL.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
Modified 15-OCT-1991 by Mati Meron. Added keyword COLOR.
Modified 15-OCT-1992 by Mati Meron. Added rotation capability.
Modified 30-OCT-1992 by Mati Meron. Added corner rounding capability.
(See /usr/local/rsi/idl_4/lib/weitere/rectan.pro)
Name: replicas Purpose: Replicate an array, as replicate.pro does for scalars or structures. Replicas calls replicate if input is a scalar or structure. Usage: array = replicas(/help) copies = replicas(array,ncopies) Inputs: array = array to replicate ncopies = number of replicas Optional Inputs or Keywords: help = flag to print header Outputs: copies = an array of one dimension more than array and filled with copies of array Common blocks: none Procedure: If keyword help is set, call doc_library to print header. This routine could be incorporated into a more general replicate. However, the use of the parameter ncopies is not as general as in replicate. Modification history: write, 22 Feb 92, F.K.Knight guard against calling replicate with an array of structures, 18 Nov 92, FKK
(See /usr/local/rsi/idl_4/lib/weitere/replicas.pro)
NAME:
RESTOREARRAY
PURPOSE:
This routine loads the content of an array into a string seperate by the
separator string.
CALLING SEQUENCE:
LOADARRAY, STRING_ARRAY, SEPARATOR
INPUTS:
STRING, SEPERATOR
KEYWORDS:
FULL - If not set, empty elements will not appear in string
SELEM - Starting element
EELEM - Ending element
OUTPUT:
string
COMMON BLOCKS:
None
SIDE EFFECTS:
No known side effects.
RESTRICTIONS:
NONE
EXAMPLE:
str = loadarray (["ulib","usca","test"], ".")
result : str eq ulib.usca.test
MODIFICATION HISTORY:
July 1992, AH, CreaSo Created.
(See /usr/local/rsi/idl_4/lib/weitere/restorearray.pro)
NAME:
RFT
PURPOSE:
Read FITS-files from rather different sources (Exabyte,Tape, Disk file)
and convert them to different data structures under IDL.
Includes FITS version from Wright Instruments Ltd., ESO and ESO Extensions
CATEGORY:
FITS
CALLING SEQUENCE:
rft,fbname,nfiles,istart,read_only=read_only,swap=swap,short=short
( e.g. rftest,'rdata',10,1,/swap,/short )
( /swap etc will set swap=1 !)
INPUTS:
'fbname' is the basename of the files to save as (e.g. 'jun24')
nfiles is the number of files to read
istart is the number with which the filename will start
(e.g. istart=12 : filename='jun24.12' for the first file)
OPTIONAL INPUT PARAMETERS:
/swap will cause byte-swapping
/short will only print the most important data
/read_only will read the specified number of files from
the tape and will print only the FITS-header, but will not save
anything !
OUTPUTS:
No explicit output, resulting data files will be generated on disk.
RESTRICTIONS:
In case of reading FITS from disk only one file is read.
(See /usr/local/rsi/idl_4/lib/weitere/rft.pro)
NAME:
ROMBERG
PURPOSE:
Performs high precision numerical integration.
CATEGORY:
Mathematical function (general).
CALLING SEQUENCE:
Result = ROMBERG( FUN, RANGE [, EPS [, keywords]])
INPUTS:
FUN
Character value representing an existing IDL function. The function
must comply with the IDL standard of being able to accept an array
input and return an array output. The calling sequence for the
function must be either
Result = FUN(x)
or
Result = FUN(x, extra)
where X is the variable and EXTRA may be any single entity (scalar,
array, structure etc.) used to pass additional parameters to the
function.
RANGE
Two element vector, integration range.
OPTIONAL INPUT PARAMETERS:
EPS
Allowed integration error. Default is 1e-6 for single-precision
integration and 1e-14 for double-precision. EPS is understood to
represent absolute error unless the keyword RELATIVE is set.
KEYWORD PARAMETERS:
/RELATIVE
If set, EPS represent the allowed relative integration error.
PARAMS
An arbitrary value or variable which is passed to the function FUN.
ERROR
Optional output, see below.
STATUS
Optional output, see below.
OUTPUTS:
Returns the value of the integral. The result is always a scalar. The
numerical type of the result (floating, double-precision or complex) is
determined by the type of values returned by FUN.
OPTIONAL OUTPUT PARAMETERS:
ERROR
The name of the variable to receive the estimated integration error.
If RELATIVE is set the error returned is relative.
STATUS
The name of the variable to receive integration status information.
Possible values are:
0 - Integration didn't converge.
1 - OK.
2 - Integration converged, but with precision worse then specified.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Enhanced Romberg integration, using the extended midpoint rule and
Neville's interpolation algorithm. The process is iterated untill
either the desired accuracy is achieved, the maximal allowed number of
steps is exceeded or further iterations cause the error to grow instead
of diminishing. The procedure can handle functions with an integrable
singularity at one (or both) end of the integration interval.
Uses CAST, DEFAULT and TYPE from MIDL.
MODIFICATION HISTORY:
Created 15-FEB-92 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/romberg.pro)
NAME:
ROOT
PURPOSE:
Finds roots of functions.
CATEGORY:
Mathematical function (general).
CALLING SEQUENCE:
Result = ROOT( FUN, RANGE [, EPS [, keywords]])
INPUTS:
FUN
Character value representing an existing IDL function. The function
must return scalar values. It is not necessery for FUN to be able to
accept an array input and return an array output. The calling sequence
for the function must be either
Result = FUN(x)
or
Result = FUN(x, extra)
where X is the variable and EXTRA may be any single entity (scalar,
array, or structure) used to pass additional parameters to the function.
RANGE
Two element vector, search range.
OPTIONAL INPUT PARAMETERS:
EPS
Allowed error. Default is 1e-6 for single-precision search and 1e-14
for double-precision. EPS is understood to represent absolute error
unless the keyword RELATIVE is set.
KEYWORD PARAMETERS:
/RELATIVE
If set, EPS represent the allowed relative (to the size of RANGE) error.
PARAMS
An arbitrary value or variable which is passed to the function FUN.
ERROR
Optional output, see below.
STATUS
Optional output, see below.
OUTPUTS:
Returns the location of the root. The result is always a scalar. The
numerical type of the result (floating, double-precision or complex) is
determined by the type of values returned by FUN.
If no root is found, returns 1e38.
OPTIONAL OUTPUT PARAMETERS:
ERROR
The name of the variable to receive the estimated error of the root
location. If RELATIVE is set the error returned is relative.
STATUS
The name of the variable to receive search status information.
Possible values are:
0 - Root not found.
1 - OK.
2 - Search converged, but the result appears to be a singularity.
This may happen with nonsingular functions if the precision
demands are set to high.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Combination of interval halving and quadratic interpolation. Assumes
that the function changes sign in the search interval and searches for
zero crossing. If the values of FUN on both ends of the interval have
the same sign the procedure returns "No Root". It is possible, at the
cost of added complexity, to relax this condition and be able to search
for multiple roots. In case there is a need this option can be
implemented.
Uses CAST, DEFAULT and TYPE from MIDL.
MODIFICATION HISTORY:
Created 15-FEB-92 by Mati Meron.
Modified 15-APR-92 by Mati Meron. Added Quadratic Interpolation to
speed up convergence for smooth functions.
(See /usr/local/rsi/idl_4/lib/weitere/root.pro)
NAME: Rotation PURPOSE: Rotate two vectors by a specified amount. CATEGORY: CALLING SEQUENCE: Rotation,X,Y,Deg,Nx,Ny INPUTS: X,Y :orignal data point pairs DEG :degrees to rotate. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: OUTPUTS: Nx, Ny = rotated point pairs. OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: Jeff Bennett, U of Colorado
(See /usr/local/rsi/idl_4/lib/weitere/rotation.pro)
NAME:
SEC_PLOT
PURPOSE:
Plots a circle-sector defined by center,startup angle and rangeangle.
CATEGORY:
Graphics.
CALLING SEQUENCE:
SEC_PLOT, Center, Radius, Rangeangle
INPUTS:
CENTER: Gives the center position of the sector.
RADIUS: Is the lenght of the sector.
RANGEANGLE: It gives the width of the sector in form of an angle.
It is given in "dec".
KEYWORD PRAMETERS:
STARTANGLE: Startup angle in conclusion to vertical above the center.
It is given in "rad".
COLOR: Given color is used for sector, default is 255.
OUTLINE: Given color for the secotor outlines.
FILLED: If it is set, the pieces are filled with the colors, given
by keyword colors or by colortable.
T3D: Creates sector 3-dim.
FILL_PATTERN: The fill pattern for filling the polygons.
STEPS: Width of increment.
THICK: Thickness of the outline.
Z: The high of sector if it is drawn as an solid one (only with t3d).
SOLID: If solid is set, the sector gets a box around (only with t3d).
SHADOW: If it is set, the sector gets a shadow below (only with t3d).
MODIFICATION HISTORY:
Created by Michael Dalbert / CreaSo in august, 1992.
(See /usr/local/rsi/idl_4/lib/weitere/sec_plot.pro)
NAME:
SEL_CHAN
PURPOSE:
Select a channel from registrated data
in 'img' an return a 2D-image
CATEGORY:
tools
CALLING SEQUENCE:
sel_chan(img,ch)
INPUTS:
img : imagefile in the form (channel[0..31],x,y) .
ch: number of channel to extract ( 0..31 )
OPTIONAL INPUT PARAMETERS:
none
KEYWORD PARAMETERS:
none
OUTPUTS:
2D image with data from selected channel
SIDE EFFECTS:
not yet detected
RESTRICTIONS:
none
PROCEDURE:
straight foreward
MODIFICATION HISTORY:
Thomas horn 1992-Dec-9
(See /usr/local/rsi/idl_4/lib/weitere/sel_chan.pro)
NAME:
SEQLIM
PURPOSE:
Estimates limits of infinite sequences.
CATEGORY:
Mathematical Function (General).
CALLING SEQUENCE:
Result = SEQLIM( SVL [, RVL ] [, keywords])
INPUTS:
SVL
Numeric vector containing consecutive terms of the sequence. At least
two terms are needed.
OPTIONAL INPUT PARAMETERS:
RVL
Numeric vector, same length as SVL. Contains estimates of the
deviations of the terms of SVL from the limit. Usually RVL is
generated internally, since if good estimates of the deviations from
the limit do exist, SEQLIM is not needed.
KEYWORD PARAMETERS:
/OSCILLATING
Switch. Should be set if the sequence is expected to oscillate around
its limit.
ERROR
Optional output, see below.
STATUS
Ditto.
OUTPUTS:
Returns the limit estimate if one is found, otherwise returns 1E38.
OPTIONAL OUTPUT PARAMETERS:
ERROR
The name of the variable to receive the estimated error of the returned
limit value. If the sequence doesn't seem to converge, returns 1E38.
STATUS
The name of the variable to receive convergence status information.
Returns 1 if the sequence converges, 0 otherwise.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses Neville's interpolation algorithm.
MODIFICATION HISTORY:
Created 15-JUN-1992 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/seqlim.pro)
NAME:
SERIES_SUM
PURPOSE:
Estimates sums of infinite series.
CATEGORY:
Mathematical Function (General).
CALLING SEQUENCE:
Result = SERIES_SUM( SVL [, RVL ] [, keywords])
INPUTS:
SVL
Numeric vector containing consecutive terms of the series. At least
two terms are needed.
OPTIONAL INPUT PARAMETERS:
RVL
Numeric vector, same length as SVL. Contains estimates of the
deviations of the partial sums of SVL from the limit. Usually RVL is
generated internally, since if good estimates of the deviations from
the limit do exist, SERIES_SUM is not needed.
KEYWORD PARAMETERS:
/OSCILLATING
Switch. Should be set if the series is oscillating, i.e. contains
positive and negative terms.
ERROR
Optional output, see below.
STATUS
Ditto.
OUTPUTS:
Returns the sum estimate if one is found, otherwise returns 1E38.
OPTIONAL OUTPUT PARAMETERS:
ERROR
The name of the variable to receive the estimated error of the returned
sum value. If the series doesn't seem to converge, returns 1E38.
STATUS
The name of the variable to receive convergence status information.
Returns 1 if the series converges, 0 otherwise.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses the routine SEQLIM from MIDL. Also uses DEFAULT.
MODIFICATION HISTORY:
Created 15-JUN-1992 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/series_sum.pro)
NAME:
SHAPE_AREA
PURPOSE:
Calculates the area enclosed by a 2-dimensional shape.
CATEGORY:
Mathematical Array function.
CALLING SEQUENCE:
Result = SHAPE_AREA( SHAPE)
INPUTS:
SHAPE
A (2,*) numeric array. 3D shapes are not supported.
OPTIONAL INPUT PARAMETERS:
None.
OUTPUTS:
0 for failure (improper or 3D shape) else returns the area of the shape.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
Limited to 2 dimensional shapes.
PROCEDURE:
Sraightforward. Calls IS_SHAPE from MIDL.
MODIFICATION HISTORY:
Created 10-NOV-1992 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/shape_area.pro)
NAME:
SHAPE_CLOSE
PURPOSE:
Closes the shape, i.e. appends the first point to the end of the shape,
unless the shape is already closed in which case nothing happens.
CATEGORY:
Array Manipulation / General Graphics
CALLING SEQUENCE:
Result = SHAPE_CLOSE( SHAPE)
INPUTS:
SHAPE
A (2,*) or (3,*) numeric array.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
None.
OUTPUTS:
0 for failure, i.e. a missing or invalid shape, otherwise returns the
closed shape.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Straightforward. Uses calls to IS_SHAPE and ARREQ in MIDL.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/shape_close.pro)
NAME:
SHAPE_COCON
PURPOSE:
Converts 2 or 3 dimensional shapes from the FROM to the TO coordinate
system. Allowed systems are DATA, DEVICE (only for 2-dim shapes) and
NORMAL. In principle identical to the system routine CONVERT_COORD,
SHAPE_COCON is maintained for historical reasons.
CATEGORY:
Plotting / General Graphics
CALLING SEQUENCE:
Result = SHAPE_COCON( SHAPE [,keywords])
INPUTS:
SHAPE
A (2,*) or (3,*) array.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
FROM
Specifies input coordinate system. Possible values are 'DATA',
'DEVICE' and 'NORMAL' (Only the first 3 characters matter). Default
is 'DATA'.
TO
Same as FROM for the output coordinate system.
OUTPUTS:
0 for failure (improper shape or bad keyword value) else returns the
transformed shape.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses calls to DEFAULT, IS_SHAPE and COO_CONV from MIDL.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/shape_cocon.pro)
NAME:
SHAPE_TRANS
PURPOSE:
Performs a geometrical transformation of an arbitrary 2_dim shape.
The transformation may include (in order):
1) Magnification by MAG. If MAG is a 2-dim vector, X and Y
coordinates are magnified by MAG(0) and MAG(1) respectively.
If FLIP is set, the magnification will include inversion in
the X or Y axis, according to the value of FLIP.
2) Rotation by the angle ANG.
3) Translation by ROFF.
CATEGORY:
General Graphics
CALLING SEQUENCE:
Result = SHAPE_TRANS( SHAPE [,parameters] [,keywords])
INPUTS:
SHAPE
A (2,*) numeric array. Future support for 3D shapes is planned.
OPTIONAL INPUT PARAMETERS:
ANG
Rotation angle, assumed to be measured in radians, unless /DEGREES is
set. Default value is 0, i.e. no rotation.
MAG
Magnification factor, can be given as a scalar (in which case both
dimensions are multiplied by this scalar) or a 2 dimensional vector (in
which case the X and Y dimensions are multiplied by MAG(0) and MAG(1)
respectively. Default value is 1, i.e. no magnification.
ROFF
Translation vector. Can be given as a scalar (in which case same
translation is applied to both dimensions) or as a 2 dimensional
vector. Default is [0,0], i.e. no translation.
KEYWORD PARAMETERS:
/DEGREES
If set, the angle value is given in degrees.
/FLIP
accepts a char value ('X' or 'Y'). Causes inversion in the
appropriate axis.
/CENTER
If set, the transformations are performed relative to the center of the
shape, given by the average of the minimal and maximal value in each
dimension. By default the transformation center is [0,0].
OUTPUTS:
0 for failure (improper or 3D shape) else returns the transformed shape.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
Currently limited to 2 dimensional shapes.
PROCEDURE:
Uses calls to DEFAULT, IS_SHAPE and STRMATCH from MIDL.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/shape_trans.pro)
NAME: SHIFT_PLOT PURPOSE: Interactively slide a previously plotted array using the mouse. CATEGORY: Graphics CALLING SEQUENCE: shift_plot,x[,y,shift=shift] INPUTS: x,y = array variables OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: Same as for oplot OUTPUTS: OPTIONAL OUTPUT PARAMETERS: shift = the shift along the x-axis COMMON BLOCKS: SIDE EFFECTS: The current graphics window is affected. RESTRICTIONS: PROCEDURE: MENUS is used to get input. The previously plotted array is first erased, then oplot'ed, with the incremental shift. MODIFICATION HISTORY: David L. Windt, AT&T Bell Labs, February, 1990
(See /usr/local/rsi/idl_4/lib/weitere/shift_plot.pro)
NAME:
SHOWCT
PURPOSE:
Show (set) a colortable.
CALLING SEQUENCE:
showct, red, green, blue
INPUTS:
red - Red values of the colortable.
green - Green values of the colortable.
blue - Blue values of the colortable.
KEYWORDS:
bottom - Stretch bottom value.
top - Stretch top value.
gamma - Gamma value.
rev - Reverse the colortable.
chop - Chop top if 1, clip if 0.
OUTPUTS:
colors - The rgb colors set by this procedure as a [3,n] array.
COMMON BLOCKS:
None.
SIDE EFFECTS:
A file is read.
RESTRICTIONS:
Tested on VAX/VMS only.
MODIFICATION HISTORY:
September 1992, HJB, CreaSo Created.
(See /usr/local/rsi/idl_4/lib/weitere/showct.pro)
NAME: SHOW_CT PURPOSE: Make a window and show the first 32 colors in the current color table. CATEGORY: CALLING SEQUENCE: Show_ct INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: David L. Windt, AT&T Bell Labs, November 1989
(See /usr/local/rsi/idl_4/lib/weitere/show_ct.pro)
NAME:
SHOW_REG
PURPOSE:
Zeigt dreidimens. Array (n,x,y) als n Bilder
mit den Dimensionen x,y in einem Fenster
CATEGORY:
tools
CALLING SEQUENCE:
showreg,img
INPUTS:
img : imagefile in the form (channel[0..31],x,y) .
OPTIONAL INPUT PARAMETERS:
none
KEYWORD PARAMETERS:
none
OUTPUTS:
none, display
SIDE EFFECTS:
not yet detected
RESTRICTIONS:
none
PROCEDURE:
straight foreward
MODIFICATION HISTORY:
Thomas horn 1992-Dec-9
(See /usr/local/rsi/idl_4/lib/weitere/showreg.pro)
NAME:
SIGN
PURPOSE:
Gives the sign of X, i.e. 1 for positive, -1 for negative, 0 for 0.
CATEGORY:
Mathematical Function (General)
CALLING SEQUENCE:
Result = SIGN(X)
INPUTS:
X
Numerical, otherwise arbitrary.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
None.
OUTPUTS:
Returns the value of SIGN(X), see above, as an integer.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
For complex X the result is SIGN(REAL(X)), the imaginary part is ignored
PROCEDURE:
Straightforward. Using CAST from MIDL.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
Modified 25-DEC-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/sign.pro)
NAME: SINCHSQUARE_FIT PURPOSE: Fit y=f(x) where: F(x) = a0*( sin(a1*(x-a2))/(a1*(x-a2)) )^2 + a3 Estimate the parameters a0,a1,a2,a3 and then call curfit. CATEGORY: ?? - fitting CALLING SEQUENCE: yfit = sinch_fit(x,y,a) INPUTS: x = independent variable, must be a vector. y = dependent variable, must have the same number of points as x. OUTPUTS: yfit = fitted function. OPTIONAL OUTPUT PARAMETERS: a = coefficients. a two element vector as described above. COMMON BLOCKS: None. SIDE EFFECTS: None. RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: Adapted from GAUSSFIT D. L. Windt, AT&T Bell Laboratories, March, 1990
(See /usr/local/rsi/idl_4/lib/weitere/sinchsquare_fit.pro)
NAME: SMALL_WINDOW PURPOSE: Make a 500x400 window. CATEGORY: Graphics CALLING SEQUENCE: small_window[,Window_num] INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: Window_num = window number. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: David L. Windt, AT&T Bell Laboratories, March 1990.
(See /usr/local/rsi/idl_4/lib/weitere/small_window.pro)
NAME:
SOLVE_LINSYS
PURPOSE:
Solves the system of linear equations ARR*X = RHS
CATEGORY:
Mathematical Function /matrix manipulation.
CALLING SEQUENCE:
Result = SOLVE_LINSYS( ARR, RHS [, keywords])
INPUTS:
ARR
Square matrix, numeric.
RHS
Vector representing the right hand side of the equation. Length should
be compatible to the dimensions of the matrix.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
THRESHOLD
Sets the threshold that's used to determine whether the matrix is
regular. Default value is 1e-20. See OPTIONAL OUTPUT PARAMETERS for
details.
STATUS
Optional output, see below.
OUTPUTS:
Returns the solution of the linear system in a vector form, type floating
or higher.
OPTIONAL OUTPUT PARAMETERS:
STATUS
The name of the variable to receive the status flag for the operation.
Possible values are 0 for a singular ARR, 1 for regular. ARR is
considered singular if the ratio of the smallest and largest diagonal
element in the LU decomposition of ARR is less then THRESHOLD.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses LU decomposition and backsubstitution, followed by LU correction.
These operations are perfomed by the system functions LUDCMP, LUBKSB and
MPROVE, based on routines from the book NUMERICAL RECIPES IN C. Also
uses the functions DEFAULT and CAST from MIDL.
MODIFICATION HISTORY:
Created 15-DEC-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/solve_linsys.pro)
NAME:
SORPURGE
PURPOSE:
Similar to the SORT function, but ignores repeated values of elements.
CATEGORY:
Array Manipulation
CALLING SEQUENCE:
Result = SORPURGE ( ARR [, keywords])
INPUTS:
ARR
The array to be sorted (scalar is also accepted).
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
NETLEN
Optional output, see below.
OUTPUTS:
Returns a vector of indices that allow access to all DIFFERENT elements
of ARR in ascending order.
OPTIONAL OUTPUT PARAMETERS:
NETLEN
The name of a variable to receive the number of elements
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses SORT to order the array, then finds all the elements that differ
from their predecessors.
MODIFICATION HISTORY:
Created 15-AUG-1992 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/sorpurge.pro)
NAME: SP PURPOSE: Execute Set_plot, and some handy default settings. CATEGORY: CALLING SEQUENCE: sp,device,n_plots INPUTS: device = 0 for set_plot,'SUN' 1 for set_plot,'PS' 2 for set_plot,'TEK' 3 for set_plot,'X' n_plots = 1 for !p.multi=0 2 for !p.multi=[0,1,2] 3 for !p.multi=[0,1,3] 4 for !p.multi=[0,2,2] OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: landscape = 1 for landscape mode when device=1. full_page = 1 for full page plotting when device=1. hardware = 1 for hardware fonts. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: David L. Windt, AT&T Bell Labs November 1989
(See /usr/local/rsi/idl_4/lib/weitere/sp.pro)
NAME:
SPLIN_COEFFS
PURPOSE:
Calculates cubic splines coefficients which are intended to be used by
the supplementary function SPLIN_EVAL. The combination of SPLIN_COEFFS
and SPLIN_EVAL is more efficient than the library function SPLINE when
repeated interpolations based on the same data set are performed.
CATEGORY:
Mathemetical Function (General).
CALLING SEQUENCE:
Result = SPLIN_COEFFS( X, Y)
INPUTS:
X
Vector, numeric, at least 3 elements. Contains the X coordinates of
the data, in arbitrary order.
Y
Vector, numeric, same length as X. Contains the Y values corresponding
to the values in X.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
None.
OUTPUTS:
Returns an (n,3) array where n is the number of data points. The
columns of the result are:
0 - X values, sorted in increasing order.
1 - Corresponding Y values.
2 - Calculated corresponding spline coefficients.
This array is intended to be used as an input to the function SPLIN_EVAL
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
As mentioned above, the X and Y arrays must have at least 3 elements.
PROCEDURE:
Standard Cubic spline evaluation (see Numerical Recipies, chapt. 3.3)
with the boundary condition of 0 THIRD derivative (constant end
curvature). Uses calls to CAST and SORPURGE in MIDL.
MODIFICATION HISTORY:
Created 15-APR-1992 by Mati Meron.
Modified 15-AUG-1992 by Mati Meron. Replaced SORT with SORPURGE in
order to protect against a possible repetition of x values.
(See /usr/local/rsi/idl_4/lib/weitere/splin_coeffs.pro)
NAME:
SPLIN_EVAL
PURPOSE:
Cubic spline evaluation using spline coefficients supplied by the
supplementary function SPLIN_COEFFS. The combination of SPLIN_COEFFS
and SPLIN_EVAL is more efficient than the library function SPLINE when
repeated interpolations based on the same data set are performed.
CATEGORY:
Mathemetical Function (General).
CALLING SEQUENCE:
Result = SPLIN_EVAL( X, SPC [, DERIV = Nder)
INPUTS:
X
Numeric, otherwise arbitrary. The X value (or values) for which the
spline interpolation is to be performed.
SPC
An (n,3) array of spline coefficients, created by the function
SPLIN_COEEFS.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
DERIV
Integer. If provided and nonzero, an interpolated derivative of the
order DERIV is returned. Default value is 0.
OUTPUTS:
Returns the result of the interpolation, in the same form as X. The
type of the result is floating or higher, depending on X.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Standard Cubic spline evaluation (see Numerical Recipies, chapt. 3.3)
with the boundary condition of 0 THIRD derivative (constant end
curvature). Uses DEFAULT from MIDL.
MODIFICATION HISTORY:
Created 15-APR-1992 by Mati Meron.
Modified 15-MAY-1992 by Mati Meron. Added derivative option.
(See /usr/local/rsi/idl_4/lib/weitere/splin_eval.pro)
NAME:
SQUARE
PURPOSE:
Draws a SQUARE, based on a length of a side and a given location of a
corner. The square is drawn so as to appear visually as a square, even
if the lengths of the sides in DATA coordinates differ. The drawing is
done in the currently defined plot area. DATA coordinates are used
unless one of the keywords /DEVICE or /NORMAL is set.
CATEGORY:
General Graphics.
CALLING SEQUENCE:
Square, {BASE = BAS, HEIGHT = HEI, SIDE = SID}, $
{LL_CORNER = LLC, LR_CORNER = LRC, UR_CORNER = URC, UL_CORNER = ULC}, $
[optional keywords]
INPUTS:
None.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
BASE |
Length of side, measured in the X-direction. | One
SIDE | and only one
Same as BASE. | must be
HEIGHT | provided
Length of side, measured in the Y-direction. |
LL_CORNER |
2dim vector, coordinates of the lower left corner. |
LR_CORNER | One
2dim vector, coordinates of the lower right corner.| and only one
UR_CORNER | must be
2dim vector, coordinates of the upper right corner.| provided
UL_CORNER |
2dim vector, coordinates of the upper left corner. |
/FILL
causes the square to be filled with a solid pattern.
COLOR
Standard IDL plotting interpretation.
/DEVICE
Ditto.
LINESTYLE
Ditto.
/NORMAL
Ditto.
THICK
Ditto.
OUTPUTS:
None.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses calls to ONE_OF and COO_CONV from MIDL. Converts all parameters
to device coordinates and calls RECTAN (also from the MIDL) to do the
actual plotting.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
Modified 15-OCT_1991 by Mati Meron. Added keyword COLOR.
(See /usr/local/rsi/idl_4/lib/weitere/square.pro)
ROUTINE: step_ct
USEAGE: step_ct, range, inc[, cs]
step_ct, /off
PURPOSE: Discreetizes color scale at given numerical intervals.
INPUT:
range array or vector which specifies range of physical values,
e.g., [amin,amax]
inc number scale increment
cs a factor between -10 to +10 that translates the
color table upto a half a color step higher (cs=10) or
half a color step lower (cs=-10). It has its most
noticeable effect when the number of steps is small,
because in this case a single step is usually a
significant change in color value. (default = 0)
off restore original unquantized color table,
no other input is required when this keyword is set
AUTHOR: Paul Ricchiazzi oct92
Earth Space Research Group
UCSB
(See /usr/local/rsi/idl_4/lib/weitere/step_ct.pro)
NAME: STILL_BUSY PURPOSE: This function can be embedded inside an IDL code that is expected to run for a long time, announcing with printed messages that the code is still running. Unlike a PRINT statement in a loop, STILL_BUSY makes its announcements just once a minute. CATEGORY: Calming down impatient users like the author. CALLING SEQUENCE: STILL_BUSY[, ANNOUNCEMENT] OPTIONAL INPUT: ANNOUNCEMENT: An array of messages or values to be printed. If no parameter is used, the message reads "STILL BUSY" plus the time and date. KEYWORD PARAMETERS: NONE. OUTPUT: NONE. COMMON BLOCKS: BIZZY SIDE EFFECTS: The overhead of calling this function many times might be onerous; so don't bury it deep inside nested loops. PROCEDURE: Each time the procedure is invoked, it decodes the !STIME system vari- able to see if the minute has changed since the last time. If so, then the program prints the announcement. If not, it returns and does nothing. EXAMPLE: The following code might be used in a coded procedure that runs for twenty minutes. About twenty times out of the 1000 passages through the loop, a message appears on the screen. for iter = 1, 1000 do begin number_cruncher, data, i STILL_BUSY, "Processing iteration number " + strtrim(i,2) endfor MODIFICATION HISTORY: Written by: James Hamill Siemens Medical Systems 2501 N. Barrington Rd. Hoffman Estates, IL 60195-7372 (708)304-7760 hamill@sgi.siemens.com October, 1989
(See /usr/local/rsi/idl_4/lib/weitere/still_busy.pro)
NAME:
STREQ
PURPOSE:
Compares for equality the first LEN characters of STR1, STR2.
If LEN is 0 the whole strings are compared.
CATEGORY:
String Processing
CALLING SEQUENCE:
Result = STREQ( STR1, STR2 [,LEN] [, keywords])
INPUTS:
STR1, STR2
character strings, mandatory.
OPTIONAL INPUT PARAMETERS:
LEN
Number of characters to compare. Default is 0, translating to a full
comparison.
KEYWORD PARAMETERS:
/CASEON
If set the comparison is case sensitive. Default is ignore case.
/WARN
if set, a warning is issued whenever STR1 or STR2 is not a character
variable. Default is no warning.
OUTPUTS:
1 for equal, 0 for nonequal.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Straightforward. Using DEFAULT and TYPE from MIDL.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/streq.pro)
NAME:
STRMATCH
PURPOSE:
Compares the string STR with the strings in the array LIST. Comparison
is done for the first LEN characters, or all of them if LEN is 0. If a
match is found, STR is replaced by the full string from the list.
CATEGORY:
String Processing
CALLING SEQUENCE:
Result = STRMATCH( STR, LIST [, LEN] [, /CASEON])
INPUTS:
STR
Character string.
LIST
Character array.
OPTIONAL INPUT PARAMETERS:
LEN
The number of characters to compare. Default is full comparison.
KEYWORD PARAMETERS:
/CASEON
If set, the comparison is case sensitive. Default is ignore case.
OUTPUTS:
Returns the index of the first match, or -1 if no match is found.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Uses the function STREQ from MIDL.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/strmatch.pro)
NAME:
STRPARSE
PURPOSE:
Parses the string LINE using the characters in DELIM as delimiters.
Puts individual pieces into consecutive locations in LIST.
CATEGORY:
String Processing
CALLING SEQUENCE:
Result = STRPARSE( LINE, DELIM [, LIST])
INPUTS:
LINE
Character string.
DELIM
Character string. Each Character of DELIM is used as a delimiter.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
None.
OUTPUTS:
Returns the number of pieces found minus one i.e. the index of the last
element of LIST if LIST is provided. If LINE is a null string or not a
string, the function returns -1.
OPTIONAL OUTPUT PARAMETERS:
LIST
Character array. If name is provided, the pieces of LINE resulting
from the parsing process are returned in consecutive locations in LIST.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Straightforward. Using the function TYPE from MIDL.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/strparse.pro)
ROUTINE: superpix
USEAGE: superpix, a, binsz, abin, sbin
superpix, a, binsz, abin, sbib, /align, /compare
PURPOSE: compute super pixel average and standard deviation
of a scene
INPUT:
a image array
binsz A scalar specifying the number of horizontal and
vertical sub-pixels in one super pixel.
BINSZ must be an odd integer.
align If set, output arrays are REBINed back up to the
original size and output array cell centers are aligned
with input array cell centers.
compare if set, compare A and ABIN with the FLICK procedure
OUTPUT:
abin mean value of superpixel at superpixel cell centers
sbin standard deviation of superpixel at superpixel
cell centers.
AUTHOR: Paul Ricchiazzi oct92
Earth Space Research Group, UCSB
(See /usr/local/rsi/idl_4/lib/weitere/superpix.pro)
NAME: SYMBOLS
PURPOSE:
Create custom plotting symbols
CATEGORY:
CALLING SEQUENCE:
symbols,symbol_number,scale
INPUTS:
symbol_number=
1 = open circle
2 = filled circle
3 = arrow pointing right
4 = arrow pointing left
5 = arrow pointing up
6 = arrow pointing down
7 = arrow pointing up and left (45 degrees)
8 = arrow pointing down and left
9 = arrow pointing down and right.
10 = arrow pointing up and right.
11 through 18 are bold versions of 3 through 10
19 = horizontal line
20 = box
21 = diamond
22 = triangle
30 = filled box
31 = filled diamond
32 = filled triangle
Scale = size of symbols.
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS:
Color = color of symbols
OUTPUTS:
OPTIONAL OUTPUT PARAMETERS:
COMMON BLOCKS:
SIDE EFFECTS:
The desired symbol is stored in the user buffer and
will be plotted if !P.PSYM = 8.
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
Jeff Bennett, U of Colorado, 198?
(See /usr/local/rsi/idl_4/lib/weitere/symbols.pro)
NAME:
TABULATE
PURPOSE:
Accepts data in form of a set (up to 8) one dimensional arrays and
prints it out as a table.
CATEGORY:
Input/Output
CALLING SEQUENCE:
TABULATE, A [,B ....H] [,keywords]
INPUTS:
A [B ... H]
One or more (up to 8) one dimensional arrays. Type arbitrary
(including string arrays). If the array lengths are not all equal, the
shortest length will be used.
OPTIONAL INPUT PARAMETERS:
All but the first array are arbitrary.
KEYWORD PARAMETERS:
INDEX
If set, the elements indices (0, 1 ... etc.) are printed in the first
column of the table. Set by default if only one column is provided.
FROM
Specifies the index of the first element to be displayed. Default is 0.
TO
Specifies the index of the last element to be displayed. Default is
end of array.
TITLE
Character string, used as the title of the table. Default is no title.
HEADER
Character array containing the titles of the columns. Default titles
are the letters A thru H. The title of the index column, if it appears
is N and cannot be changed. If some of the entries in HEADER are null
strings, the default headers will be used for the corresponding columns.
FORMAT
Character array, containing format specifications for the columns. The
default formats are as follows:
BYTE - I4
INTEGER - I6
LONG - I11
FLOATING - G14.7
DOUBLE - G22.14
COMPLEX - G14.7 (twice)
STRING - A16
If some of the entries in FORMAT are null strings, defaults will be
used for the corresponding columns. If only partial formats are given
(for example 'E', or '16.6') missing fields are filled from the
default. Valid formats are A, D, E, F, G, I, O, Z. Nonvalid formats
are ignored.
Important: TABULATE may change the formats (either defaults or
provided explicitly through FORMAT) in order to make enough room in the
display.
REALFORM
Character string (only first letter matters). If given and is one of
D, E, F or G, provides the default format for all the real, double and
complex data. If not given, the default is G format.
FILE
String representing a valid file name (if extension is not provided the
default is .TAB). If provided, the output is sent to this file,
otherwise it is sent to the terminal.
/MORE
Sends output to the screen one page at a time (like UNIX MORE).
OUTPUTS:
None, other then the printed table.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
TABULATE may reduce the widths of the print fields in order to
accomodate all the data. If after reduction to minimum widths the data
still cannot be fitted, no table will be generated.
While in theory tabulate can display up to 8 columns, the actual number
depends on the data types. Approximate maximal numbers of columns are:
BYTE, INTEGER or STRING - 8 columns (strings may be truncated)
LONG or FLOAT - 6 columns
DOUBLE - 5 columns
COMPLEX - 3 columns
Warning: TABULATE uses EXECUTE, which cannot be called recursively.
PROCEDURE:
Straightforward. Uses DEFAULT, STRPARSE and TYPE from MIDL.
MODIFICATION HISTORY:
Created 3-MAY-1992 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/tabulate.pro)
Name:
thecolor
Purpose:
Function to rob a color index from the current color table and set
it to the specified color. Then return the index.
Options exist for where in the color table the index is chosen.
Color names come from the Openwindows colors file, q.v. wrgb.pro.
Usage:
plot,x,color=thecolor('red') ; plot is red.
plot,x,color=thecolor('LightGoldenrod3') ; case insensitive
plot,x,color=thecolor('red',index=!d.n_color-1)
; the last index set to red
plot,x,color=thecolor('red',/first)
; 1st available at the start of the color table (Default)
plot,x,color=thecolor('red',/last)
; ditto except at the end of the color table
tmp = thecolor(/reset) ; forget all previous thecolor calls
Inputs:
name = name of color, a string
Optional Inputs:
none
Keywords:
/help = flag to print header
index = force the color index to be this value
/last = choose index from first available at end of color table
/first = choose the first available at the bottom. (D)
rgb = output RGB values for the color
/noindex = flag to simply return the rgb values, leaving the color
table unchanged
/reset = flag to kill all current reserved colors but doesn't restore
the previous color table. Use loadct,n, tvlct,r,g,b or xloadct.
/list = list the current colors and their indices
/show = list all available colors
/view = show swatches of all available colors; call wrgb widget
Outputs:
index = function return
Optional outputs:
none (cf. keyword rgb)
Common blocks:
thecolor, used to remember available names and info from
previous calls, containing:
thecolors = names of colors stored in previous calls to thecolor
thecolorindices = corresponding color table indices (those replaced)
thecolornames = list of available color names, read from file
thecolorrgb = corresponding rgb triples
previousfirstindex = previous index stored at start of color table
previouslastindex = previous index stored at end of color table
Procedure:
If keyword help is set, call doc_library to print header.
Restrictions:
Needs a file where color names and RGB values are found.
Two files are hardwired; at least one needs to be present.
The widget xdisplayfile is called if /show is set.
The widget wrgb is called if /view is set.
Modification history:
write, 29 Nov 91, F.K.Knight (knight@ll.mit.edu)
add keyword noindex to simply return the rgb values and not alter the
color table, 27 Apr 92, FKK
add keyword reset, 30 Jun 92, FKK
fix bug when /last occurs after /first, 30 Jun 92, FKK
make a generic file the default, 6 Oct 92, FKK
(See /usr/local/rsi/idl_4/lib/weitere/thecolor.pro)
NAME: TRACE
PURPOSE: Define a path through an image using the image display
system and the cursor/mouse. This routine is designed to
be used on images which have been displayed with the TVIM
procedure.
CATEGORY: Image processing.
CALLING SEQUENCE:
R = trace(aa)
R = trace(aa,xverts, yverts, /nodes, /restore, /silent)
INPUTS:
aa 2-d image array used to establish index dimensions
KEYWORD INPUT PARAMETERS:
RESTORE if set, originaly displayed image is restored to its
original state on completion.
NODES If set index array is not returned.
Use this option when positions x and y vertices are
all that are required.
ZOOM Two element vector specifying zoom factor in x and y,
if omitted, [1.,1.] is assumed. A single scalar value
will set both the x and y zoom factors.
SILENT If set no intructional printout is issued at the
beginning of execution
OUTPUTS:
Function result = subscript vector of pixels along defined path.
OPTIONAL OUTPUTS:
XVERTS Vector of x vertices of traced path
YVERTS Vector of y vertices of traced path
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 path 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 path, either by
dragging the mouse with the left button depressed or by
marking individual points along the path 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. On exit gaps in the
traced path are filled by interpolation
Adapted from DEFROI by : Paul Ricchiazzi oct92
Earth Space Research Group, UCSB
(See /usr/local/rsi/idl_4/lib/weitere/trace.pro)
ROUTINE tvim
USEAGE: tvim,a
tvim,a,title=title,xtitle=xtitle,ytitle=ytitle,$
xrange=xrange,yrange=yrange,$
scale=scale,range=range,noframe=noframe,aspect
PURPOSE: Display an image with provisions for
1. numbered color scale
2. plot title
3. annotated x and y axis
4. simplified OPLOT capability
INPUT a image quantity
Optional keyword input:
title plot title
xtitle x axis title
ytitle y axis title
xrange array spanning entire x axis range.
NOTE: TVIM only uses min(XRANGE) and max(XRANGE).
yrange array spanning entire y axis range.
NOTE: TVIM only uses min(YRANGE) and max(YRANGE).
scale if set draw color scale. SCALE=2 causes steped
color scale
range two or three element vector indicating physical
range over which to map the color scale. The
third element of RANGE, if specified, sets the
step interval of the displayed color scale. It
has no effect when SCALE is not set. E.g.,
RANGE=[0., 1., 0.1] will cause the entire color
scale to be mapped between the physical values
of zero and one; the step size of the displayed
color scale will be set to 0.1.
aspect the x over y aspect ratio of the output image
if not set aspect is set to (size_x/size_y) of the
input image.
noframe if set do not draw axis box around image
SIDE EFFECTS: Setting SCALE=2 changes the color scale using the
STEP_CT procedure. The color scale may be returned
to its original state by the command, STEP_CT,/OFF
PROCEDURE TVIM first determins the size of the plot data window
with a dummy call to PLOT. When the output device is
"X", CONGRID is used to scale the image to the size of
the available data window. Otherwise, if the output
device is Postscript, scaleable pixels are used in the
call to TV. PUT_COLOR_SCALE draws the color scale and
PLOT draws the x and y axis and titles.
DEPENDENCIES: PUT_COLOR_SCALE, STEP_CT
AUTHOR: Paul Ricchiazzi oct92
Earth Space Research Group, UCSB
(See /usr/local/rsi/idl_4/lib/weitere/tvim.pro)
NAME: TVSTACK PURPOSE: This procedure displays a multidimensional array (e.g. 3D) as a stack of images lain side by side, and by default scaled between the minimum and maximum values in the array. This is a method of visualizing 3D data sets, for example reconstructions of tracer uptake in nuclear medicine. For an image measuring NX by NY by NZ, the effect is somewhat the same as typing for z=0,nz-1 do tvscl, image(*,*,z), z except that they aren't necessarily scaled to the frame maxima, and some options are available through the keywords. CATEGORY: IMAGE DISPLAY CALLING SEQUENCE: TVSTACK, IMAGES INPUTS: IMAGES: The multidimensional array to be displayed. It may have any number of dimensions but is displayed as if it is 3D. KEYWORD PARAMETERS: W_BORDER: Width of the border to be drawn around each frame displayed. If framing is performed, each NX by NY image takes up (NX+2*W_BORDER) pixels in the X direction and (NY+2*W_BORDER) pixels in the Y direction. Default = NO BORDER. C_BORDER: Color of the border, if the W_BORDER keyword is set. Default= !d.n_colors/3. TVSCL: If this keyword is set, each 2D image is scaled to its own max and min. By default, the max and min of the multidimensional array are used. POSITION: The screen position used by the first image frame in the sequence. Thus, images are positioned as if the command for z=0,nz-1 do tvscl, image(*,*,z), position+z were used. Default = 0 (start in upper left corner of th display window.) REVERSE_DIM: which dimension of the image is to be reversed (using the REVERSE function from the USERLIB); 1 means X, 2 means Y. Default = NO REVERSAL. ROTATE_PAR: what parameter to use to rotate the image frames, with the IDL ROTATE function (q.v.) in which 0=no rotation, 1=90 degrees CCW without transposing, and so on. Defaul=NO ROTATION. SKIP: Use this keyword if you desire to display only some of the images for example every other one, which would be represented by SKIP=2. Images are positioned as if the command for z=0,nz-1,SKIP do tvscl, image(*,*,z), z/SKIP were used. Default = 1, that is, do not skip. If you specify /SKIP you end up not skipping (!!!) because in this case you specify steps of 1. OUTPUTS: None; the procedure writes into the current display window. EXAMPLE: A 3D gaussian can be displayed as follows: n = 50 xysq = shift(dist(n)^2,n/2,n/2) ; x^2 + y^2 rsq = fltarr(n,n,n) ; array to hold r^2 for z=0,n-1 do rsq(0,0,z) = (z-n/2.0)^2 + xysq ; r^2 = x^2 + y^2 + z^2 fwhm=10.0 & sig=fwhm/(2*sqrt(2*alog(2))) & gauss_3D=exp(-rsq/(2*sig^2)) ; 3D gaussian of 10 channels FWHM tvstack, gauss_3D, /w_b ; display it MODIFICATION HISTORY: Written by: James Hamill Siemens Medical Systems 2501 N. Barrington Rd. Hoffman Estates, IL 60195-7372 (708)304-7760 hamill@sgi.siemens.com April, 1992
(See /usr/local/rsi/idl_4/lib/weitere/tvstack.pro)
ROUTINE: tv_polar
USEAGE: tv_polar,r,phi,theta
tv_polar,r,phi,theta,title=title,xdim=xdim,ydim=ydim,scale=scale,$
image=image,xvec=xvec,yvec=yvec
PURPOSE: Display of images defined in polar coordinates (without
resorting to IDL's mapping routines).
INPUT:
r image quantity (2-d array) one value at each (phi,theta) point
note that the phi coordinate is the first index
phi monitonically increasing vector specifying azimuthal coordinate
PHI must span either 0 to 360 degrees or 0 to 180 degrees.
If phi spans 0-180 degrees, reflection symmetry is assumed,
i.e., r(phi,theta)=r(360-phi,theta).
theta monitonically increasing vector specifying polar coordinate
(degrees)
KEYWORD INPUT:
title plot title
xdim size of rebined cartesian array in x direction (default=50)
ydim size of rebined cartesian array in y direction (default=50)
scale if set (or scale=1) display color scale,
if scale eq 2 display color scale with discreet colors
rot location of zero azimuth
0 left (default)
1 top
2 right
3 bottom
OUTPUT: none
KEYWORD OUTPUT:
image rebined image of size (xdim,ydim)
xvec vector of x coordinate values
yvec vector of y coordinate values
These optional output quantities can be used to overplot
contour lines over the TV_POLAR output. For example,
TV_POLAR,a,phi,theta,image=im,xvec=xv,yvec=yv
CONTOUR,im,xv,yv,/overplot,levels=.3+findgen(10)*.1
AUTHOR: Paul Ricchiazzi oct92
Earth Space Research Group, UCSB
(See /usr/local/rsi/idl_4/lib/weitere/tv_polar.pro)
NAME:
TYPE
PURPOSE:
Finds the type class of a variable.
CATEGORY:
Programming.
CALLING SEQUENCE:
Result = TYPE(X)
INPUTS:
X
Arbitrary, doesn't even need to be defined.
OPTIONAL INPUT PARAMETERS:
None.
KEYWORD PARAMETERS:
None.
OUTPUTS:
Returns the type of X as an integer, in the (0,7) range.
OPTIONAL OUTPUT PARAMETERS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
None.
PROCEDURE:
Extracts information from the SIZE function.
MODIFICATION HISTORY:
Created 15-JUL-1991 by Mati Meron.
(See /usr/local/rsi/idl_4/lib/weitere/type.pro)
Name: typeof Purpose: Function to return the type of the variable---a shorthand for extracting the type from the array returned by size. Usage: if typeof(variable) eq 7 then message,'Variable is a string.' Inputs: variable = any IDL variable Optional Inputs or Keywords: help = flag to print header Outputs: typeof = type code from the size array Common blocks: none Procedure: Just get the type code from the size array. Modification history: write, 2 Dec 92, F.K.Knight (knight@ll.mit.edu)
(See /usr/local/rsi/idl_4/lib/weitere/typeof.pro)
NAME:
VMS translate logical
PURPOSE:
This routine translates a VMS logical without translating concilt
devices .
CALLING SEQUENCE:
result = vms_trnl (logi)
INPUTS:
logical - VMS logical
KEYWORDS:
None.
OUTPUTS:
TRnaslated logical
COMMON BLOCKS:
None
SIDE EFFECTS:
No known side effects.
RESTRICTIONS:
For VAX/VMS only.
EXAMPLE:
MODIFICATION HISTORY:
November 1992, AH, CreaSo Created.
(See /usr/local/rsi/idl_4/lib/weitere/vms_trnl.pro)
NAME: WDUMP PURPOSE: Dump the contents of the current plotting window to a PostScript printer. CATEGORY: CALLING SEQUENCE: wdump INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: MODIFICATION HISTORY: David L. Windt, AT&T Bell Laboratories, February, 1990
(See /usr/local/rsi/idl_4/lib/weitere/wdump.pro)
Name: weibull Purpose: Function to return the value of the Weibull pdf. Example: beta = 1. ; SHAPE PARAMETER ; =1==> exponential distribution ; >1==> wear-out type shapes whereby f(T) is zero at ; T=gamma, increases as T-->T~, and then decays to 0. ; =2==> Rayleigh distribution gamma = 0. ; LOCATION PARAMETER ; locates the distribution along the abscissa eta = 1. ; SCALE PARAMETER ; reciprocal of useful life T = findgen(100)/10. print,weibull(T,beta,gamma,eta) Usage: pdf = weibull(T[,beta][,gamma][,eta][,/help][,/reliability][,/failurerate]) Inputs: T = abscissa coordinate, scalar or array Optional Inputs: beta = shape parameter, > 0 (D=1==> exponential distribution) eta = scale parameter, > 0 (D=1) gamma = location parameter (D=0) Keywords: help = flag to print header /reliability = return only the exponential portion: R = exp(-((T-gamma)/eta)^beta) R has a value of 1 from 0<=T<=gamma and decreases for T>gamma to zero. /failurerate = return only the failure rate portion: lambda = (beta/eta)*((T-gamma)/eta)^(beta-1) lambda is infinity for 0(See /usr/local/rsi/idl_4/lib/weitere/weibull.pro)
WHARDCOPY
[Previous Routine] [Next Routine] [List of Routines]NAME: WHARDCOPY PURPOSE: Use WMENU to get Yes/No response to hardcopy query. CATEGORY: CALLING SEQUENCE: Result=whardcopy(/initialize) INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: Initialize = 1 initializes the menu to 'Yes', 0 to 'No' OUTPUTS: Result = 1 if the answer is yes, 0 otherwise. OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: Must be run in window environment. PROCEDURE: MODIFICATION HISTORY: David L. Windt AT&T Bell Labs, November 1989(See /usr/local/rsi/idl_4/lib/weitere/whardcopy.pro)
WRGB
[Previous Routine] [Next Routine] [List of Routines]Name: wrgb Purpose: Read and display colors from the rgb table---good for choosing X-windows colors and browsing for pleasing hues. Usage: wrgb[,offset=offset][,dim=dim] Optional Inputs: offset = starting point in the file; there are about 740 entries. dim = length of side (in pixels) of a color square Outputs: Colors are reported to the terminal if the left or middle mouse button is pushed. Common blocks: wrgb = variables that need to be passed between routines Procedure: Use IDL widgets. After setup, xmanager runs the show. The background routine (wrgb_bck) runs like rdpix.pro and reports the color at the cursor position to the window. Pushing the left or middle mouse button records the current color at the terminal, again like rdpix.pro. Moving the offset slider forces an update of the color table. Pushing the done button kills all the widgets. Example: IDL> wrgb ; starts widget Modification history: convert xrgb to widget-based wrgb, 30Sep91, FKK fix bugs, e.g. cursor,x,y,2 didn't return on cursor motion, 7Oct91, FKK save existing color table at start and reset it at end, 29Jan92, FKK add help button, 29 Jul 92, FKK use a generic file rather then $OPENWINHOME/lib/rgb.txt, 6 Oct 92, FKK(See /usr/local/rsi/idl_4/lib/weitere/wrgb.pro)
WRITE_CONTF
[Previous Routine] [Next Routine] [List of Routines]NAME: WRITE_CONTF PURPOSE: Create a contour-path data file from an image. CATEGORY: CALLING SEQUENCE: write_contf,image[,x][,y][,level=level][,file=file] INPUTS: image = (n,m) array from which to generate the contours. OPTIONAL INPUT PARAMETERS: x = n-element x-axis vector. y = m-element y-axis vector. KEYWORD PARAMETERS: level=contour level. You are prompted for a level if level is not specified. file=contour-path data file. You are prompted for a file if file file is not specified. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: A contour-path data file is created. RESTRICTIONS: PROCEDURE: CONT_IMAGE is used to show the image and the contour; CONTOUR,PATH=file is then used to create the contour path-data file. MODIFICATION HISTORY: D. L. Windt, AT&T Bell Laboratories, November 1989(See /usr/local/rsi/idl_4/lib/weitere/write_contf.pro)
XFONT
[Previous Routine] [Next Routine] [List of Routines]NAME: XFONT PURPOSE: This procedure allows to view arbritrary text in different font on your operating system. CATEGORY: Widgets, Fonts CALLING SEQUENCE: XFONT INPUTS: OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: GROUP = The widget ID of the widget that calls xfont. When this ID is specified, a death of the caller results in a death of xfont. OUTPUTS: OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: Initiates the XManager if it is not already running. RESTRICTIONS: Written and tested on VAX/VMS. For other operating systems we need a file containing all valid names of X fonts. A default X font file that works for all operating systems has not yet been created (suggestion: X11 fonts list). New font list files should be named "XFONTS."+!VERSION.OS . Selection on the spacing field (P=Proportional, M=Monospaced and C=CharCell is not yet implemented (Arrays: fa and xa). Selection of slants "Reverse Italic", "Reverse Oblique" and "Other" is not yet implemented. PROCEDURE: Create and register the widget and then exit. MODIFICATION HISTORY: Created from a template written by: Hans-Joachim Bothe, November 1991(See /usr/local/rsi/idl_4/lib/weitere/xfont.pro)
ZOOM_PLOT
[Previous Routine] [Next Routine] [List of Routines]NAME: ZOOM_PLOT PURPOSE: Plot y versus x for a region of interest interactively defined by the user. CATEGORY: CALLING SEQUENCE: zoom_plot,x,y INPUTS: x = the x axis variable y = the y axis variable OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: OUTPUTS: A new window is created showing the X-Y plot of the region of interest. OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: Function get_roi is called to obtain the region of interest. MODIFICATION HISTORY: David L. Windt, AT&T Bell Laboratories(See /usr/local/rsi/idl_4/lib/weitere/zoom_plot.pro)
ZRTTOZXY
[Previous Routine] [List of Routines]NAME: ZRTTOZXY PURPOSE: Convert a 2d array from polar (r,theta) coordinates to cartesian (x,y) coordinates. CATEGORY: CALLING SEQUENCE: zxy=zrttozxy(zrt,r,theta,x,y) INPUTS: r = N0-element vector of EQUALLY SPACED radial points. theta = M0-element vector of EQUALLY SPACED angular points. zrt = 2D array of z-values of size (N0,M0) in polar coordinates. x = N-element vector of x points. y = M-element vector of y points. OPTIONAL INPUT PARAMETERS: KEYWORD PARAMETERS: OUTPUTS: zxy = 2D array of z-values of size (N,M) in cartesian coordinates. OPTIONAL OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: r and theta MUST be equally spaced vector. EACH (x,y) point MUST lie within the pie-shaped section of the x-y plane defined by MIN(r),MAX(r),MIN(theta),MAX(theta) PROCEDURE: BILINEAR is used to interpolate z(x,y) given z(r,theta): zxy(x(i),y(j))=BILINEAR(zrt(r,theta),rxy(x(i),y(j)),thetaxy(x(i),y(j)) MODIFICATION HISTORY: D. L. Windt, AT&T Bell Labs, February 1990(See /usr/local/rsi/idl_4/lib/weitere/zrttozxy.pro)