*** io ***
cvtByteOrder - equiv to swap_endian
OPENR_ - openr, /SWAP_IF_LITTLE_ENDIAN
OPENU_ - openu, /SWAP_IF_LITTLE_ENDIAN
OPENW_ - openw, /SWAP_IF_LITTLE_ENDIAN
SGK_PICKFILE - return a picked file
*** color ***
NOBPTT - do NOT bypass translation table
PC8 - Set device, pseudo_color = 8
PICKCOLOR - help pick a color, using HSV model (best w/ 24 bit disp)
PLCT - Load a `plotting' color map (16 predefined colors)
SGKLCT - Load a color table, using SGK's format
SGKLCT - Load a color table, using SGK's format
TC24 - Set device, true_color = 24
UDC - use decomposed color model for 24 bit dispays
XSGKLCT - GUI interface to SGKLCT
XSGKLCT - GUI to SGKLCT
*** math ***
CMP_AVG - computes average of argument
CMP_CC - compute cross-correlation
CMP_COVAR - compute covariance from Hessian matrix (use num. der.)
CMP_COVAR_A - compute covariance from Hessian matrix (analytical)
CMP_RMS - computes root-mean-squares of argument
CMP_WAVG - computes weighted average of arguments
DLSQ_FIT - perform non linear least-square fit
FCC - compute cross-correlation using FFT
LZ - Lorentzian((x-x0)/w)
FCN - c(0)*lz(x, c(1), c(2)) + c(3)
DLZ - 1st derivative wrt kth param of lz()
DFCN - 1st derivative wrt kth param of fcn()
D2FCN - 2nd derivative wrt kth & kkth param of fcn()
FRSTDER - computes the 1st derivative
FSMOOTH - frequency smoothing, over `n' pixels
GEN_POLY - Generalized Polynomial Computation
GETMAX - compute the maximum, using parabolic fit
INTERP_1D - 1D linear interpolation
INTERP_2D - 2D bi-cubic interpolation
LGFIT - Fit a Legendre polynomial expansion
LGPOLY - evaluate Legendre polynomial expansion
LINFIT - perform a linear fit
LSQ - perform a Least-Squares fit
POLY_SOLVE - solve for x the polynomial expansion Sum_i Pi(x) = y
POLYFIT - perform a polynomial fit, include x-sigma rejection
POLYFIT2D - perform a 2D polynomial fit, include x-sigma rejection
POLYX - evaluates extended polynomial
QEQROOTS - solve quadratic equation a x^2 + b x + c
SANMBA - simulated annealing amoeba minimization
SCNDER - computes second derivative
SVDINVERT - invert matrix using single value decomposition
TZ_INTEGRATE - trapeze rule integration
TZ_INTEGRATE2D - 2D trapeze rule integration
XBIN - bin a data set xybin = xbin(x,y,n)
XSMOOTH - smoothing up to the edges
*** misc ***
@ADD-ALL-ASTRON-LIBS - add ALL pro/* for astron lib
addal - add ASTRON lib to the path
ADDSLASH - add a slash (/) to end of a string, unless ...
CTRL - return control char
cvt_d2HMS - return 'HH:MM:SS.SS' string of a value
cvt_HMS2D - return double value of a 'HH:MM:SS' string
cvt_jd2t - return 'YYYY.MM.DD_HH:MM:SS_UT' string for JD
cvt_T2JD - convert 'YYYY.MM.DD_HH:MM:SS' string to JD
DEG2RAD - convert degree to radians
FILEEXIST - check if a file exists
FLIP - flip an array
FTOA - return string(f), using fixed formating rule
ISAPEAK - return list of peaks
ISDOUBLE - return 1 if argument is of type DOUBLE
ISLONG - return 1 if argument is of type LONG
ISSTRING - return 1 if argument is of type STRING
ISSTRUC - return 1 if argument is of type STRUCTURE
ITOA - return strcat(string(round(i), format='(i0)'), sep)
NEEDSWAP - check OS byte order
NLAST - n_elements()-1
NLINES - return the no of lines in a file
@NO-WARNINGS - turn off all warnings
OLH - wrapper to widget_olh
PAUSE - pause until a CR is pressed
PCURSOR - print the current value of the cursor
PLOT_CLOCK - plot the time as a clock
PTELL - print a number to tell progress of a computation
RAD2DEG - convert radians to degrees
RAMP - return a ramp of N values for a given range
RCALL - return & close,/all
READ_RDB - read a RDB table, ie tab separated
READ_STRUCT - read a struct array from a flat ASCII table
READ_TABLE - read a flat ASCII table
REWIND, lu - point_lun, lu, 0
RHIST - [cumul] histogram w/ range
STRCAP - capitalize arg
STRCAT - catenate string array in one string w/ given separator
STRSEP - calls strsplit(string, separator, /extract)
WRITE_MGIFS - hacked version of write_gif, w/ LOOP keyword
WRITE_RDB - write a RDB table, ie tab separated
WRITE_STRUCT - write a struct array as a flat ASCII table
*** plot ***
AUTO_RANGE - return a padded plotting range
bMenu - button selection menu
BWIN - wrapper around window to open a big window
DEMO_MODE - Returns true if IDL is in Demo Mode.
EB_PLOT - overplot error-bars
EPSCLOSE - call ps_close for EPS files (noprint, noid)
EPSOPEN - call ps_open for EPS files
FSDSP - Scaled display of a 2D array in a FITS file
GET_CPOS - get the cursor postion
GV - run cmd=ghostview on plot file
HHASH - plot hashes in the given yRange
hist_oplot - oplot histogram using polyfill
HLINE - overplot an horizontal line
IDENTIFY - identify points on a plot
LABEL - LaTeX alike string parser for labeling
MAKE_LEGEND - put a legend on a plot
MAKE_USERSYM - create the user symbol of given name
PLOT3D - 3d point plot
@PS-PRINT-C - print the postscript plot
@PS-PRINT-GV - print the postscript plot
@PS-PRINT-P - print the postscript plot, portrait mode
@PS-PRINT-Q - queue the postscript plot to be printed
@PS-PRINT - print the postscript plot
PS_CLOSE - Close the PostScript plotting device opened with PS_Open
PS_OPEN - Set the plotting device to be PostScript
PS_OPTS - Set options for plotting device if set to be PostScript
PUT_ID - Put an ID (time stamp, user, & hostname) on a plot
RELSCALE - Relative scaling, convert relative unit to data unit
RXYOUTS - "Relative" version of xyouts
SDSP - Scaled display of a 2D array (ie image)
SDSPOS - position equiv to sdsp, when using !p.multi
SHOW3D - displays volumetric data using cuts
SHOW_FONT - Show all the characters in a given font
SPOSITION - Return dev. pos. for proper scaling of plots on images
SQUARE_PLOT - Restrict the plotting area to a relative square position
STV - Performs a "scaled" TV, see SWINDOW
STVSCL - Performs a "scaled" TVSCL, see SWINDOW
SWINDOW - Open a "scaled" window, w/ proper scaling whether X or PS
SXYOUTS - "scaled" version of XYOUTS, see SWINDOW
VEC2D - Plot 2D vector
VEC3D - Make a 3d vector plot
VECOL2D - Plot 2D vector, using color coding
VHASH - plot hashes in the given xRange
VLINE - overplot a vertical line
XBOPLOT - over-plot binned values
XFONTSEL - Select an X font
XGetScreenSize - return the screen(s) size (using xdpyinfo)
XPLOT_IO - Log plot x vs y, works when y is not always positive
XYLABEL - wrapper to xyouts, x, y, label(string), but add /rel
ZOOM - Zoom an array by factor(s) n1, [n2]
ZOOMTO - Zoom an array to be N1 x N2
*** widgets ***
getIDsFromCheckList - get widget IDs from checkList (see topMBW)
PlayPPMMovie - Play movie from list of PPM images.
setIDsFromCheckList - (re)set check marks from checkList (see topMBW)
SHOWPERCENT - Creates a widget to indicate fraction completed
TOPMBW - Creates a top level base widget w/ menu bar
XBLINK - blink two images
XWDEL - wdel for xwin
XWIN - widget wrapper around window to open a big window
XWSET - wset for xwin
; covar = cmp_covar_a(x, y, c, nfree)
;
; compute the covariance using the Hessian matrix, and analytical expressions
; of the derivatives, for the DLSQ problem y = fcn(x, c)
;
; keywords:
; weigths: weigths associated to (x,y) == 1/sigma
; (as for obsolete cmp_covar_aw)
; var: return variance
; hmat: return the Hessian matrix
; no2d: don't include 2nd deriv terms
; debug: if set, will print stuff, and stop inside routine
;
; calls dfcn(x, c, k) and d2fcn(x, c, k, kk), for 1st and 2nd derivatives
;
; if NFREE == 0 indicates maximum likelyhood, use
; NFREE = n_elements(c) otherwise
;
; <- Last updated: Fri Dec 4 16:51:48 1998 -> SGK
;
; Name:
; dlsq_fit
; Purpose:
; perform non linear least-square fit to
; Y = FCN(X, C)
;
; Calling Sequence:
; niter = dlsq_fit(x, y, c, eps, niterx)
; Keywords:
; silent: if set, perform fit silently
; debug: if set, print the 'A' and 'B' matrices
; Inputs:
; c(): first guess of fitting coefs
; eps(): relative accuracy required for each coef
; niterx: max no of iterations
; weights: weights associated to (x,y) == 1/sigma
; useNumDer: flag, if set, uses numerical derivative
; (instead of DFCN)
; delta(): array of relative changes to compute numerical
; derivatives (default: eps/2.)
;
; Output:
; niter: no if iteration required to achieve required accuracy
; (negative if error
; or did not converge in niterx iterations)
; c: fitting coefs
;
; dc: keyword w/ values of delta-c at last iteration
; hasConverged: keyword w/ index of coefs that have converged
;
; Notes:
; uses the function FCN(x,c) to fit,
; and DFCN(x,c,k) as derivative of FCN vs c(k)
;
; adjust only c( where eps gt 0 ) until abs(d-c/c) < eps,
; and # iter <= niterx
; Name:
;
; EB_PLOT
;
; Purpose:
;
; overplot error-bars (in y-direction by default)
;
; Calling sequence:
;
; EB_PLOT, X, Y, S
;
; Inputs:
;
; X: vector of absices
; Y: vector of ordinates
; S: error-bar size (y-s to y+s, or x-s to x+s if XAXIS is set)
;
; Input Keyword:
;
; XAXIS: if set, specify abcisses style error bars (x-axis)
; SERIF: add serifs
; LENGTH: relative length of the serifs, default : 0.005
; POSITIVE: draw only postive (y+s, or x+s) error bars
; NEGATIVE: draw only negative (y-s, or x-s) error bars
;
; Support all oplot keywords, as well
;
; Example:
;
; plot, x, y, psym=4
; eb_plot, x, y, s, color = 2
;
; <- Last updated: Mon Mar 29 15:17:28 1999 -> SGK
; functions:
;
; lz(x,x0,w) = Lorentzian((x-x0)/w)
; fcn(x,c) = c(0)*lz(x, c(1), c(2)) + c(3)
; and
; dlz(x, x0, w, k): 1st derivative wrt kth param of lz()
; dfcn(x, c, k): 1st derivative wrt kth param of fcn()
; d2fcn(x, c, k, kk): 2nd derivative wrt kth & kkth param of fcn()
;
; fcn() and dfcn() are used by dlsq_fit
; lz() and dlz() are used by fcn() and dfcn()
;
; Name:
; Gen_Poly
; Purpose:
; Generalized Polynomial Computation
; y(*) = Sum c(i).p(*, i)
; i = 0,#(c)-1
;
; Calling Sequence:
; y = Gen_Poly(c, p)
;
; Example:
; Computes Legendre polynomials to 5th order, for x = -1.,(0.1),1., then
; value for y = Sum_i c_i P_i(x)
;
; x = findgen(21)/10.-1.
; p =fltarr(21, 6)
; p(*,0) = 1.0
; p(*,1) = x
; for i = 2, 5 do $ ; Legendre polynomials recursion relation
; p(*,i) = ((2*i-1)*x*p(*, i-1) - (i-1)*p(*, i-2))/i
;
; c = [0.1, 420., 0.1, 20.0, 0.1, -5.0]
; y = gen_poly(c, p)
; plot, x, y
;
; See Also: LGPOLY LSQ
; index = identify(x, y, [/markit], [psym=], /loop)
;
; identify points on a plot, ie the closest value in x[], y[] selecte with the
; cursor; return the index/indices of the identified point(s)
;
; input keywords:
;
; markit = flag, of set will mark the identified point
; loop = flag, if set loop until click outside plot boundary
; psym = value of psym for marking identified points
;
; support all oplot keywords, like color, etc...
;
; example:
;
; plot, x, y, /psym
; idx = identify(x, y, /loop, /mark, color=2, symsize=2)
;
; c = lgfit(x, y, m)
;
; fit a m-coefficients Legendre polynomial expansion to {X,Y}, with
; optional x-Sigma rejection
;
; Input Keyword
;
; sy 1-sigma uncertainties on y
; nRej no of rejection passes, def. 0 (none)
; xRej x-sigma rejection factor, def. 3.0
; regular flag, if set uses regular polynomial instead of legendre
; plot flag, if set plot the data and the fit
; xtitle xtitle for the plot
; ytitle ytitle for the plot
; title subtitle for the plot
;
; Output Keyword
;
; rms RMS of residuals to the fit
; cnt no of points included in the fit
; idi index list of value included in the fit
; idx index list of value excluded in the fit
; sc 1-sigma uncertainty on the fitted coefs
; px evaluated polynomials P_i(x_j)
; extra values for [r, rr, s, ss], see LSQ
;
; see also LGPOLY, LSQ, GEN_POLY
;
; <- Last updated: Fri Dec 18 15:24:30 1998 -> SGK
;
; lsq, y, sy, x, m, a, sa, r, rr, s, ss
;
; least square solution to:
;
; y(k) +/- sy(k) = Sum a(i).x(k,i), for k=1,n
; i=1,m
;
; m< don't use that point
; r is the average residual, rr its stdev,
; s is the stdev of the prob, ss=std(s).
;
; keyword:
;
; nonerror: if set disable the 'on_error, 2'
;
; Ref : Linnik, Y. V., Method of Least Squares and Principle of the Theory
; of Observation, Pergamon Press, Mc Millan Co., 1961, ch. 6, pp 135-187.
;
; <- Last updated: Mon Aug 11 12:50:32 2003 -> SGK
;
; make_legend, symbols, text
;
; put a legend on a plot, parse text with LABEL()
;
; input keywords:
;
; lines = list of line style
; location= 1, 2, 3 or 4 for lower left/right, upper right/left resp.
; def: 1 (lower left)
; colors = list of colors
; spaceFctr = extra y-space factor
; noLabel = flag, if set do not parse the text with LABEL()
; charsize= character size, def. 1
;
; Support all keywords common to XYOUTS and OPLOT
;
; Example:
; make_legend, [4, 2], ['\alpha-\Omega\ model', 'observations'], color = 1
;
; <- Last updated: Tue Nov 13 13:55:51 2001 -> SGK
; Name:
;
; PLCT
; Purpose:
;
; Load a `plotting' color map:
; red, green, blue, yellow, magenta, indigo, etc...
; up to 14 colors.
;
; Calling Sequence:
;
; PLCT
;
; Keywords:
; n = - no of colors [3-14],
; default 14, min 3, max 14.
; offset = - offset at which to load the colmap,
; default 1, min 1.
; invertBW = flag, of set invert black and white levels
;
; Side Effects:
; Modify the color map, using TVLCT.
;
; Example:
;
; IDL> plct
; IDL> plot, findgen(3), thick=4, yr=[0, 6]
; IDL> for i = 1, 14 do oplot,findgen(3) + i/4., color = i, thick = 4
;
; Modification History:
; Jul 7 1995 Written by SGK, CfA.
; Jun 29 1998 modified to create a full color map, and deal w/ b/w
; levels, SGK
; May 13 2000 no action if TEK window system
; May 26 2002 call UDC if !D.N_COLORS NE !D.TABLE_SIZE
; PLOT3D, Z, X, Y
;
; makes a 3d point plot using a dummy
; SURFACE, /SAVE
; followed by a
; PLOTS, /T3D
;
; if [xyz]ranges are not set, uses SGK's AUTO_RANGE()
;
; The following keywords are supported:
; AX, AZ, XSTYLE, YSTYLE, ZSTYLE, XRANGE, YRANGE, ZRANGE,
; XTITLE, YTITLE, ZTITLE, TITLE, SUBTITLE,
; PSYM, SYMSIZE, CHARSIZE
; Name:
; c = polyfit(x, y, m)
; Purpose:
; perform a polynomial fit to
;
; y = Sum a P (x ) for i=0,m and j=0,N-1 w/ n >> m
; j i i i j
;
; by default P_i(x) = x^ii where ii = i-xZero
;
; Input Keywords:
;
; sy specify uncertainties for y,
; if sy(i) <= 0.0 this point is NOT used in the fit
; Legendre use legendre polynomials
; xZero offset to exponent def. 0 (none)
; noDC flag, if set does not include dc term (fit must go thru [0,0])
; usePX flag, if set uses the values passed in px= for P_i(x_j)
; nRej no of rejection passes, def. 0 (none)
; xRej x-sigma rejection factor, def. 3.0
; print flag, if set print the fitting coefs
; plot flag, if set plot
; psym psym for oplot def. 1
; noLabel flag, if set don't label values of coefs on plot
; cz character size for labels, def: 1.
; xtitle xtitle for the plot
; ytitle ytitle for the plot
; title subtitle for the plot
; noerase /noerase set to plot
; nonerror flag, if set disable the 'on_error, 2'
;
; Output:
; polynonial coefficients
;
; Output Keywords:
;
; rms RMS of residuals to the fit
; cnt no of points included in the fit
; idi list of included indices
; idx list of excluded indices
; px values of P_i(x_j) (for gen_poly)
; sc uncertainties on coefs
; extra [r, rr, s, ss] as defined by LSQ, ie:
; r is the average residual, rr its stdev,
; s is the stdev of the prob, ss = std(s).
;
; <- Last updated: Tue Mar 28 12:23:36 2006 -> SGK
;
; Name:
;
; PS_Close
;
; Purpose:
;
; Closes the PostScript plotting device (opened with PS_Open),
; adds an optional time-stamp in the lower left corner,
; sends the PostScript file to the default printer
; and restore the plotting device saved by PS_Open.
;
; the default b/w printer is $PRINTER, or `ssplw',
; the default color printer is $COLORPRINTER, or `psc1',
;
; the default b/w print command is $LPCMD, or `lp',
; the default color print command is $COLORLPCMD, or `lp',
;
; Calling sequence:
;
; PS_Close
;
; Keywords:
;
; NOID - If set, the time-stamp ID is not added to the plot.
;
; NOPRINT - If set, the PostScript plotting device is closed, and
; the plotting device saved by PS_Open is restore,
; but the PostScript file is NOT sent to the printer.
;
; GV - set NOPRINT and run GV (ghostview previewer routine)
;
; SAVEAS = . Save the PostScript file by copying it to the
; specified file. The plot is still printed, unless NOPRINT is set.
;
; PRINTER = . Send the plot the specified printer.
; By default the enviroment variable PRINTER (or COLORPRINTER) is used to
; determine the printer to use. If it is not set the defaul values are
; ssplw (or psc1).
;
; TRANSPARENCY - If set, requests a transparency.
; Not all printers support this option (-SInputSlot=Transparency).
; (Only the color printers do)
;
; OPTIONS = . Optional extra options for the pslpr command.
; Example: OPTIONS = '-SDuplex' to use duplex printing.
;
; LPR = . Specify the command to use to print the file; by defaut
; pslpr is used. Note that if this keyword is specified, the keywords
; PRINTER, TRANSPARENCY and OPTIONS are ignored.
; Example: LPR = '/usr/bin/lp'
;
; SILENT - If set, disable warning messages
;
; QUEUE - If set, save the plot to print them all later
;
; NOEXEC - flag, if set won execute the spawn, cmd (for debug/testing mode)
;
; See also: PS_Open
; Name:
;
; PS_Open
;
; Purpose:
;
; Set the plotting device to be PostScript, and save the current plotting
; device (to restore it when the plot is done).
;
; Calling sequence:
;
; PS_Open
;
; Keywords:
;
; PORTRAIT - Normally, PS_Open defines the plotting area as landscape. If
; this keyword is set, the plotting area will be portrait.
;
; FILENAME = - Normally, PS_Open uses '/tmp/idl-$USER.ps' for the
; PostScript file, the keyword FILENAME can be used to override that value.
; ($USER is retrieved with a getenv('USER')).
;
; SIZES = <2-elements array> - Specify the plot size.
; The default plotting area is 10" x 7.5".
;
; OFFSETS = <2-elements array> - Specify the plot margins.
; The default plotting area has 0.5", 0.5" margins.
;
; SQUARE - if set, sets the plotting area to be square.
; Since the plotting area includes room for labels to axis, this option
; alone does not gives you a square plot (cf: !P.REGION).
;
; FLUSH - flush (ie ignore) all previously queued plots (see PS_Close)
;
; FONT - if numeric, set !P.FONT to value of FONT and turn on IsoLatin1
; - if string, set !P.FONT=0 and use the given PostScript font name as
; default (!3), checks the font name against a list, and if doesn't
; match use 'Helevetica-Narrow-Bold' as font
; (ie font=' ' equivalent to font='Helevetica-Narrow-Bold')
;
; PCZ - set !P.charsize to value PCZ (otherwise set it to zero)
; saves old value and ps_close restores it
;
; ENCAPSULATED - produces an encapsulated PostScript plot.
;
; BPP = - Set the number of bits per pixel; default value is 8,
; valid values are 8, 4, OR 2. A higher no produces a better
; resolution but also a bigger PostScript file.
;
; COLOR - If set, produces a color PostScript plot.
;
; TABLOID - If set, selects tabloid/ledger format (17" x 11" paper).
; The default plotting area is 16" x 10", with 0.5" margins.
; Not all printers can print tabloid format.
;
; LEDGER = TABLOID, /landscape
;
; PAGE_LENGTH = - Specify the actual page lenght.
; The default lenght is 17" for tabloid format, 11" otherwise.
; This is needed because IDL's implementation of the YOFFSET keyword to
; DEVICE in landscape mode is brain dead. The y-offset must be specified
; relative to the page lenght. This way PS_Open() offsets are more
; intuitive. (cf: IDL ref. guide, section: PostScript Positioning).
;
; QMS - If set, reduces the margins for the old QMS printer
; The horiz margin is increased by 0.8",
; and the horiz size decreased by 1.0".
;
; OKFontList - string array of valid font names to check font=
; against
;
; SILENT - If set, disable warning messages
;
; See also: PS_Close
; data = read_table(fn)
;
; read an ASCII file organized with a constant no. of col. per row, and return
; a float array. Uses the first line to deduce the number of columns (based
; on the column separator), unless nCols, format or struct are set.
;
; Input Keywords:
;
; nSkip: no of (header) lines to skip, def.: 0
; nCols: no of columns in the file, (don't try to guess using first line)
; colSep: column separator, def.: ' '
; format: format specification, def.: none
; [must supply nCols when using format, unless struct is given]
; [if format is supplied, colSep is ignored]
; autoSkip: flag, if set skip as many line as needed,
; skip lines that start w/ the comDel
; comDel: the comments delimitor def.: #
; double: flag, if set return double precision array
; verbose: flag, if set print out some information about the file
; struct: structure to use to read the data
; noOnerror: flag, if set won't do `on_error, 2'
;
; Output Keywords:
;
; header: header, ie the lines skipped
;
; <- Last updated: Tue Oct 28 20:42:37 2008 -> SGK
;
; sdsp, img, wno = wno, xrange = xr, yrange = yr, $
; xstyle = xstyle, ystyle = ystyle, $
; xsize = xsize, ysize = ysize, noScale = noScale, swFill = swFill, $
; xOffset = xOff, yOffset = yOff, noPmulti = noPmulti, $
; nlevels = nlevels, levels = levels, c_lines = c_lines, $
; zoom = zoomIn, sample = sample, $
; wtitle = wtitle, xtitle = xtitle, ytitle = ytitle, title = title, $
; margin1 = w1, margin2 = w2, tickf = tickf, $
; absOffset = absOffset, noXC = noXC, _extra = _extra
;
; scaled display of a 2D array (ie image)
;
; zoomIn can be either a scalar or a 2-elements array
; if nlevels > 0, coutours are superposed
; if wno < 0, use current window
;
; uses
; show3D, data, x, y, z, cuts = cuts, $
; sMin = sMin, sMax = sMax, $
; size = size, ax = ax, az = az, $
; xMin = xMin, xMax = xMax, $
; yMin = yMin, yMax = yMax, $
; zMin = zMin, zMax = zMax, $
; topCut = topCut, topTrns = topTrns, $
; topMin = topCutMin, topMax = topCutMax, $
; botCut = botCut, botTrns = botTrns, $
; botMin = botCutMin, botMax = botCutMax, noSwindow = noSwindow, $
; mark = mark, msymbol = msymbol, msize = msize, $
; img = img, noSwindow = noSwindow, noDisplay = noDisplay, $
; charsize = csz, silent = silent, $
; xtitle = xtitle, ytitle = ytitle, ztitle = ztitle, $
; tcsz = tcsz, title = title, noAxis = noAxis
;
; displays volumetric data[*,*,*] using cuts, given x[*], y[*], z[*] regular
; grid coords
;
; cuts = replicate(cut, ncuts)
;
; where:
;
; cut = {cutInfo, index:0L, dir:0L, tMin:0., tMax:0.}
; index: index of the cut (like data[*,index,*])
; dir: direction of the cut;
; 0: data[index, *, *]; 1: data[*, index, *]; 2: data[*, *, index]
; tMin/tMax: range of values to be transparent
;
; sMax: scaling max def.: 5*cmp_rms(data)
; sMin: scaling min def.: -sMax
; size: image size def.: [1100, 850]
; ax, az: perspective rotation angles def.: 40, 40
; xMin, xMax: min/max scaling for x def.: x[0], x[n_elements(x)-1]
; yMin, yMax: y
; zMin, zMax: z
;
; showPercent, pc
;
; Creates a widget to indicate fraction completed
;
; Keywords:
;
; upon creation:
; title: specify the title, def.: 'Fraction Completed'
; text: text to put after the xx%, def.: ''
; height: window height, def.: 200
; width: window width, def.: 15
; bg: background color index, def.: !d.n_colors-1
; fg: foreground color index, def.: 0
; to destroy:
; destroy: if set, destroy the widget
;
; Example:
;
; showPercent, text = 'done...'
;
; FOR i = 1, 30 DO BEGIN
; pc = 100.*i/30
; showPercent, pc
; wait, 0.2
; ENDFOR
; wait, 1.
; showPercent, /destroy
; end
;
; Name:
;
; SPosition
;
; Purpose:
;
; Returns the appropriate position vector to be used in "position=[],/dev"
; specification, but properly scaled to work whether the plotting device
; is an X window or the PostScript device.
;
; Calling sequence:
;
; scaled_position = SPosition(position)
;
; Input:
;
; position: 4 element position vector in X-window device coords
;
; Output:
;
; 4 elements vector suitable for position=...,/dev specification
;
; Restriction:
;
; The SWindow routine must be called first to establish the scaling factor
; before using SPosition.
;
; Example:
;
; IDL> image = randomu(seed,200,300)
; IDL> swindow, 0, xsize=300, ysize=400
; IDL> stv, image, 50, 50
; IDL> plot, findgen(10), /noerase $
; position = sposition([50, 50, 250, 350]), /dev
; IDL> sxyouts, 100, 200, 'this is at (100,200)'
;
; See also: SWindow, STV, STVScl, SXYOuts
; Name:
;
; STV
;
; Purpose:
;
; Performs a "scaled" TV, namely a TV that will be properly scaled to work
; whether the plotting device is an X window or the PostScript device.
;
; Calling sequence:
;
; STV, image, xposition, yposition
;
; Restriction:
;
; The SWindow routine must be called first to establish the scaling factor
; before using SPosition.
;
; Example:
;
; IDL> image = randomu(seed,200,300)*255
; IDL> swindow, 0, xsize=300, ysize=400
; IDL> stv, image, 50, 50
; IDL> plot, findgen(10), /noerase $
; position = sposition([50, 50, 250, 350]), /dev
; IDL> sxyouts, 100, 200, 'this is at (100,200)'
;
; or
;
; IDL> image = randomu(seed,200,300)*255
; IDL> swindow, 0, xsize=300, ysize=400
; IDL> stv, image, 50, 50, /axis, $
; IDL> xrange = [0., 2.], yrange = [-15., 15.], $
; IDL> xtitle = 'here', xtickl = -.01, $
; IDL> ytitle = 'there', ytickl = -.01, $
; IDL> title = 'demo!c'
;
; See also: SWindow, STVScl, SPosition, SXYOuts
;
; Name:
;
; STVScl
;
; Purpose:
;
; Performs a "scaled" TVSCL, namely a TVSCL that will be properly scaled to
; work whether the plotting device is an X window or the PostScript device.
;
; Calling sequence:
;
; STV, image, xposition, yposition
;
; Keywords:
;
; axis - flag, if set will draw axis around image
; xRange, yRange - x/y ranges for axis around image
;
; Additional keywords are passed to the PLOT routine that draw these axis
;
; Restriction:
;
; The SWindow routine must be called first to establish the scaling factor
; before using STVSCL
;
; Example:
;
; IDL> image = randomu(seed,200,300)
; IDL> swindow, 0, xsize=300, ysize=400
; IDL> stvscl, image, 50, 50
; IDL> plot, findgen(10), /noerase $
; position = sposition([50, 50, 250, 350]), /dev
; IDL> sxyouts, 100, 200, 'this is at (100,200)'
;
; or
;
; IDL> image = randomu(seed,200,300)
; IDL> swindow, 0, xsize=300, ysize=400
; IDL> stvscl, image, 50, 50, /axis, $
; IDL> xrange = [0., 2.], yrange = [-15., 15.], $
; IDL> xtitle = 'here', xtickl = -.01, $
; IDL> ytitle = 'there', ytickl = -.01, $
; IDL> title = 'demo!c'
;
; See also: SWindow, STV, SPosition, SXYOuts
;
; Name:
;
; SWindow
;
; Purpose:
;
; Performs a "scaled" WINDOW, namely a WINDOW that allows plots to be
; properly scaled to work whether the plotting device is an X-window or the
; PostScript device.
;
; Calling sequence:
;
; SWindow, window_index, $
; xsize = xsize, ysize = ysize, xpos = xpos, ypos = ypos
;
; Keywords (Optional):
;
; XSIZE, YSIZE: specify the window size
; XPOS, YPOS: specify the window position (for X-windows only)
; TITLE: specify the window title
; PIXMAP: flag, if set will open a pixmap ('X' only)
; FILL: flag, if set will fill the printer area ('PS' only)
; otherwise the aspect ration is preserved
; Restriction:
;
; Only one scaling factor is kept for scaling (ie the one corresponding to
; the last call to swindow)
;
; Example:
;
; IDL> image = randomu(seed,200,300)
; IDL> swindow, 0, xsize=300, ysize=400
; IDL> stv, image, 50, 50
; IDL> plot, findgen(10), /noerase $
; position = sposition([50, 50, 250, 350]), /dev
; IDL> sxyouts, 100, 200, 'this is at (100,200)'
;
; See also: STV, STVScl, SPosition, SXYOuts
;
; History:
; Apr 28 1994 SGK: added xpos and ypos keywords
; Dec 11 1998 SGK: preserve aspect ration when destination is PS printer
; May 26 2005 SGK: added title keyword
; display a 2D vector plot
;
; vec2d, vx, vy, x, y
;
; display V = (vx, vy), for locations (x,y)
;
; vx - x-component, 2D vector
; vy - y-component, 2D vector
; x - x-location, 1D or 2D vector (optional)
; y - y-location, 1D or 2D vector (optional)
;
; keywords:
;
; scale - vector scaling (def = max(vx^2+vy^2))
; factor - additional scaling factor (def = 1)
; xrange, yrange - axis ranges (def = auto_range(*))
; xInc, yInc - draw vectors every x/yInc pts only (def = 1)
; dotSize - specify the size of dots (def=.5)
; log - flag to scale the vector length prop to LOG10(mag)
; noDots - flag to supress dots
; centered - flag to plot vector centered on (x,y) location
; (implies noDots=1)
; overWrite - draw (more) vectors on an existing plot
; arrow - flag, if set draw arrows
; aWFract - arrow width fraction (def = .15)
; aLFract - arrow length fraction (def = .30)
; noOnError - flag, if set don't turn on `on_error, 2' statement
;
; extra keywords are passed to the first PLOT (like title, etc...)
;
; see also VECOL2D
; VEC3D, AMP, ALPHA, BETA, X, Y, Z, $
; SCALE = SCALE, overWrite = overWrite
; or
;
; VEC3D, VX, VY, VZ, ALPHA, BETA, X, Y, Z, /useXYZ, $
; SCALE = SCALE, overWrite = overWrite
;
; makes a 3d vector plot using a dummy
; SURFACE, /SAVE
; followed by a
; PLOTS, /T3D
;
; if [xyz]ranges are not set, uses SGK's AUTO_RANGE()
;
; The following keywords are supported:
; AX, AZ, XSTYLE, YSTYLE, ZSTYLE, XRANGE, YRANGE, ZRANGE,
; XTITLE, YTITLE, ZTITLE, TITLE, SUBTITLE,
; CHARSIZE
; display a 2D vector plot, using color coding
; (i.e.: dir. -> Hue, mag. -> Sat.)
;
; vecol2d, vx, vy
;
; display V = (vx, vy), on implicit equispaced gridded locations
;
; vx - x-component, 2D vector
; vy - y-component, 2D vector
;
; keywords:
;
; scale - vector scaling (def = max(vx^2+vy^2))
; xrange, yrange - axis ranges (def = auto_range(*))
; xSize, ySize - x,y sizes of the window to open
; xOffset, yOffset - x,y offsets w/in the window
; swFill - swindow fill flag (when printing)
; wno - window number (keep current if < 0)
; zoom - zoom factor (accept 1 or 2 args)
; noAxis - set [xy]style to 5 (no axis)
; sample - flag to sample instead of interpol. when zooming
; bgdImg - background image to use as Value
; bMIn, bMax - bgdImg scaling (def min/max of bgdImg)
; bWrap - flag, if set will wrap instead of clipping bgdImg
; hueOff - hue offset (def = 0)
; gamma - gamma correction for Sat and Val (def = 0.)
; swapSV - swap Sat and Val codification
; log - flag to scale Hue prop to LOG10(mag)
; noOnError - flag, if set don't turn on `on_error, 2' statement
;
; extra keywords are passed to the first PLOT (like title, etc...)
;
; see also VEC2D
; NAME:
; WRITE_MGIFS
;
; PURPOSE:
; Write an IDL image and color table vectors to a
; GIF (graphics interchange format) file.
;
; CATEGORY:
;
; CALLING SEQUENCE:
;
; WRITE_GIF, File, Image ;Write a given array.
;
; WRITE_GIF, File, Image, R, G, B ;Write array with given color tables.
;
;
; INPUTS:
; Image: The 2D array to be output.
;
; OPTIONAL INPUT PARAMETERS:
; R, G, B: The Red, Green, and Blue color vectors to be written
; with Image.
; Keyword Inputs:
; CLOSE = if set, closes any open file if the MULTIPLE images
; per file mode was used. If this keyword is present,
; nothing is written, and all other parameters are ignored.
; MULTIPLE = if set, write files containing multiple images per
; file. Each call to WRITE_GIF writes the next image,
; with the file remaining open between calls. The File
; parameter is ignored, but must be supplied,
; after the first call. When writing
; the 2nd and subsequent images, R, G, and B are ignored.
; All images written to a file must be the same size.
;
; LOOP = if set, add the NETSCAPE enhencement for loops (SGK hack)
;
;
; OUTPUTS:
; If R, G, B values are not provided, the last color table
; established using LOADCT is saved. The table is padded to
; 256 entries. If LOADCT has never been called, we call it with
; the gray scale entry.
;
;
; COMMON BLOCKS:
; COLORS
;
; SIDE EFFECTS:
; If R, G, and B aren't supplied and LOADCT hasn't been called yet,
; this routine uses LOADCT to load the B/W tables.
;
; COMMON BLOCKS:
; WRITE_GIF_COMMON.
;
; RESTRICTIONS:
; This routine only writes 8-bit deep GIF files of the standard
; type: (non-interlaced, global colormap, 1 image, no local colormap)
;
; The Graphics Interchange Format(c) is the Copyright property
; of CompuServ Incorporated. GIF(sm) is a Service Mark property of
; CompuServ Incorporated.
;
; MODIFICATION HISTORY:
; Written 9 June 1992, JWG.
; Added MULTIPLE and CLOSE, Aug, 1996.
; xbOPlot, x, y, nBins, nRej = nRej, $
; xbin = xb, xmin = xmin, xmax = xmax, $
; xLog = xLog, yLog = yLog, psym = psym, linestyle = linestyle, $
; noEB = noEB, _extra = extra
;
; over-plot binned values (w/ EB)
; --------------- -
;= XBOPLOT - over-plot binned values
; ---------------------------------------------------------------------------
; NAME:
; XMANAGER
;
; PURPOSE:
; Provide management for widgets client applications created using IDL.
;
; CATEGORY:
; Widgets.
;
; CALLING SEQUENCE:
; XMANAGER [, Name, ID]
;
; OPTIONAL INPUTS:
; NAME: A string giving the name of the application that is being
; registered.
;
; ID: The widget ID of the top level base of the new client.
;
; KEYWORD PARAMETERS:
; BACKGROUND:
; -------------------------------------------------------------
; | PLEASE NOTE: This keyword is OBSOLETE. It's functionality |
; | is provided by the TIMER keyword to the WIDGET_CONTROL |
; | procedure. |
; -------------------------------------------------------------
;
; CATCH: If TRUE, tells XMANAGER to use CATCH when dispatching
; widget events. If FALSE, CATCH is not used and execution
; halts on error. The default is TRUE. If CATCH is specified,
; the internal state of XMANAGER is updated and it returns
; immediately without taking any further action. CATCH
; is only effective if XMANAGER is blocking to dispatch
; errors. If active command line event dispatching is in
; use, it has no effect.
;
; CLEANUP: This keyword contains a string that is the name of the
; routine called when the widget dies. If not specified,
; no routine is called. The cleanup routine must accept one
; parameter which is the widget id of the dying widget. This
; routine is set as the KILL_NOTIFY routine for the widget.
;
; EVENT_HANDLER: The name of the event handling routine that is to be
; called when a widget event occurs in the registered
; application. If this keyword is not supplied, the Xmanager
; will construct a default name by adding the "_EVENT" suffix
; to the NAME argument. See below for a more detailed
; explanation.
;
; GROUP_LEADER: The widget id of the group leader for the application
; being registered. When the leader dies, all widgets that have
; that leader will also die.
;
; For example, a widget that views a help file for a demo
; widget would have that demo widget as it's leader. When
; the help widget is registered, it sets the keyword
; GROUP_LEADER to the widget id of the demo widget. If
; the demo widget is destroyed, the help widget led by
; the it would be killed by the XMANAGER.
;
; JUST_REG:
; This keyword tells the manager to just register the widget
; but not to start doing the event processing. This is useful
; when you want to register a group of related top level widgets
; but need to regain control immediately afterwards.
;
; NOTE: JUST_REG does not do the same thing as NO_BLOCK. This is
; explained in detail below under "SIDE EFFECTS".
;
; MODAL:
; --------------------------------------------------------------
; | PLEASE NOTE: This keyword is OBSOLETE. It's functionality |
; | is provided by the MODAL keyword to the WIDGET_BASE |
; | procedure. |
; --------------------------------------------------------------
;
; When this keyword is set, the widget that is being registered
; traps all events and desensitizes all the other widgets. It
; is useful when input from the user is necessary before
; continuing. Once the modal widget dies, the others are
; resensitized and the normal event processing is restored.
; XMANAGER is therefore using sensitivity to provide the
; illusion of modality. The WIDGET_BASE keyword is a newer
; IDL feature that provides the real thing.
;
; NO_BLOCK: If set, tells XMANAGER that the registering client
; does not require XMANAGER to block if active command line
; event processing is available. If active command line
; event processing is available *AND* every current XMANAGER
; client specifies NO_BLOCK, then XMANAGER will not block
; and the user will have access to the command line while
; widget applications are running.
;
; NOTE: NO_BLOCK does not do the same thing as JUST_REG. This is
; explained in detail below under "SIDE EFFECTS".
;
; OUTPUTS:
; No outputs.
;
; COMMON BLOCKS:
; MANAGED
; XMANAGER_LOCAL:
; Common blocks used for module state maintenance. These common
; blocks are considered private to this module and should not
; be referenced outside RSI supplied routines. They are
; subject to change without notice.
;
;
; SIDE EFFECTS:
;
; JUST_REG vs NO_BLOCK
; --------------------
; Although their names imply a similar function, the JUST_REG and
; NO_BLOCK keywords perform very different services. It is important
; to understand what they do and how they differ.
;
; JUST_REG tells XMANAGER that it should simply register a client
; and then return immediately. The result is that the client becomes
; known to XMANAGER, and that future calls to XMANAGER will take this
; client into account. Therefore, JUST_REG only controls how the
; registering call to XMANAGER should behave. The registered client
; can still be registered as requiring XMANAGER to block by not setting
; NO_BLOCK. In this case, future calls to XMANAGER will block.
;
; NO_BLOCK tells XMANAGER that the registered client does not
; require XMANAGER to block if the command processing front end
; is able to support active command line event processing (described
; below). XMANAGER remembers this attribute of the client until
; the client exits, even after the call to XMANAGER that registered the
; client returns. NO_BLOCK is just a "vote" on how XMANAGER should
; behave. The final decision is made by XMANAGER by considering the
; NO_BLOCK attributes of all of its current clients as well as the
; ability of the command front end in use to support the active command
; line.
;
; Blocking vs Non-blocking
; ------------------------
; The issue of blocking in XMANAGER requires some explanation.
; IDL places incoming widget events into a queue of pending events.
; The only way to get these events processed and dispatched is to
; call the WIDGET_EVENT function. Arranging for WIDGET_EVENT to be
; called properly is the primary job of XMANAGER. XMANAGER offers
; two different modes of operation:
;
; - The first (outermost) XMANAGER processes events by calling
; WIDGET_EVENT as necessary until no managed clients remain on
; the screen. This is referred to as "blocking", because XMANAGER
; does not return to the caller until it is done, and the IDL
; command line is not available.
;
; - XMANAGER does not block, and instead, the part of IDL
; that reads command input also watches for widget events
; and calls WIDGET_EVENT as necessary while also reading
; command input. This is referred to as "non-blocking" or
; "active command line" mode.
;
; The default is to block. However, if every currently active
; application specified the NO_BLOCK keyword to XMANAGER, non-blocking
; mode is used, if possible.
;
; There are currently 5 separate IDL command input front end
; implementations:
;
; - Apple Macintosh IDE
; - Microsoft Windows IDE
; - Motif IDE (Unix and VMS)
; - Unix plain tty
; - VMS plain tty
;
; Except for the VMS plain tty, all of these front ends are able to
; support the non-blocking active command line. VMS users can have
; an active command line by using the IDLde interface. The decision
; on whether XMANAGER blocks to process widget events is determined
; by the following rules, in order of precedence:
;
; - Use of the MODAL keyword will cause XMANAGER to block.
; - Setting JUST_REG to 1 ensures that XMANAGER will not block.
; - If using the VMS plain tty interface, XMANAGER will block.
; - If none of the previous rules apply, XMANAGER will block
; if any of its currently active clients were registered without
; specifying NO_BLOCK. If NO_BLOCK is specified for every client,
; XMANAGER will not block and will instead return and allow
; active command line processing to take place.
;
; When possible, applications should set the NO_BLOCK keyword.
; This allows the IDL command line to be active while events are
; being processed, which is highly desirable.
;
;
; RESTRICTIONS:
; The implementation of XMANAGER may change in the future. Details
; of its internal implementation must not be relied upon --- only
; its external definition can be considered stable.
;
; XMANAGER uses several undocumented features provided by the
; internal WIDGET routines. These features are private to RSI, and
; are not guaranteed to remain in IDL or to remain unchanged. They
; exist only to support XMANAGER and should not be used elsewhere:
;
; WIDGET_CONTROL, /XMANAGER_ACTIVE_COMMAND
; WIDGET_CONTROL, /MODAL
; WIDGET_EVENT, /BREAK_ON_EXPOSE
; WIDGET_EVENT, /EVENT_BREAK
; WIDGET_EVENT, /XMANAGER_BLOCK
; WIDGET_INFO, /XMANAGER_BLOCK
;
; These features are undocumented because they are not considered
; permanent. Research Systems reserves the right to remove or alter
; these features at any time.
;
; EXAMPLE USE:
; To create a widget named Example that is just a base widget with a done
; button using the XMANAGER you would do the following:
;
;
; ;------ first - the event handler routine ------;
;
; PRO example_event, ev ;this is the routine that
; ;deals with the events in the
; ;example widget.
;
; WIDGET_CONTROL, ev.id, GET_UVALUE = uv ;the uservalue is retrieved
; ;from the widget where the
; ;event occurred
;
; if(uv eq 'DONE') then $ ;if the event occurred in the
; WIDGET_CONTROL, ev.top, /DESTROY ;done button then kill the
; END ;widget example
;
;
; ;------ second - the main routine ------;
;
; PRO example ;this is the main routine
; ;that builds the widget and
; ;registers it with the Xmanager
;
; base = WIDGET_BASE(TITLE = 'Example') ;first the base is created
;
; done = WIDGET_BUTTON(base, $ ;next the done button is
; TITLE = 'DONE', $ ;created and it's user value
; UVALUE = 'DONE') ;set to "DONE"
;
; WIDGET_CONTROL, base, /REALIZE ;the widget is realized
;
; XManager, 'example', base ;finally the example widget
; ;is registered with the
; ;Xmanager
; END
;
; notes: First the event handler routine is listed. The handler
; routine has the same name as the main routine with the
; characters "_event" added. If you would like to use another
; event handler name, you would need to pass it's name in as
; a string to the EVENT_HANDLER keyword. Also notice that the
; event routine is listed before the main routine. This is
; because the compiler will not compile the event routine if
; it was below the main routine. This is only needed if both
; routines reside in the same file and the file name is the same
; as the main routine name with the ".pro" extension added.
;
;
; PROCEDURE:
; When the first widget is registered, initialize the lists and then
; start processing events. Continue registering widgets and dispatching
; events until all the widgets have been destroyed. When a widget is
; killed, destroy all widgets that list the destroyed widget as their
; leader, if any.
;
; RELATED FUNCTIONS AND PROCEDURES:
; XREGISTERED, XMTOOL
;
; MODIFICATION HISTORY: Written by Steve Richards, November, 1990
; SMR, Mar, 1991 Added a cleanup routine keyword to allow dying
; widgets to clean themselves up when dying.
; SMR, May, 1991 Fixed a bug found by Diane Parchomchuk where an error
; occurred when registering a widget ight after destroying another.
; SMR & ACY, July, 1991
; Fixed a bug found by Debra Wolkovitch where lone widgets being
; destroyed and new ones created caused problems.
; SMR, Sept, 1991 Changed cleanup to use the new WIDGET_INFO routine.
; SMR & ACY, Oct, 1991
; Fixed a bug where a background event that unregistered itself
; after a time would result in an XMANAGER error.
; SMR, Mar. 1992 Changed XMANAGER to use enhanced widget functions for
; event processing.
; SMR, Nov. 1992 Changed modal widget handling allowing nesting of
; modal widgets. The first modal desensitizes all current widgets
; and subsequent modals only desensitize the modal that called them.
; JIY, Apr. 1993 Changed modal widget handling process to not run the
; event loop for nested modal widgets. Allowed for multiple modal
; widgets.
; AB & SMR, 17 November 1993
; Added ID validity checking to desensitizing of modal widgets to
; fix a bug where already dead widgets were being accessed.
; DJE, Feb, 1995
; Made it so that non-modal widgets created from a modal widget have
; events processed in the modal widget's event loop. This fixes a
; bug where xmanager wouldn't return immediately if there was a
; modal widget somewhere in the nesting, even though a non-modal
; widget was being added. The nesting level could get _very_ deep.
; DJE, Apr 1995
; Pass a local variable to WIDGET_EVENT in the MODAL case, instead
; of passing the common block variable modalList. This avoids a bug
; where modalList gets changed behind WIDGET_EVENT's back.
; DJE, Apr 1996
; Changes for handling asynchronous widget event dispatching.
; Complete rewrite. Background tasks are no longer supported. The
; MODAL keyword is now obsolete. Added CATCH and BLOCK keywords.
; AB, May 1996
; Made changes so that XMANAGER always blocks under VMS with the
; non-GUI interface. This is due to the fact that the SMG$ system
; routines used by IDL in the plain tty case cannot support
; interleaving of X events with tty input.
; AB, 9 January 1997
; Changed the meaning of the CATCH keyword so that catching is the
; default. Removed BLOCK and replaced with NO_BLOCK. Switched
; default action back to blocking from unblocking based on feedback
; from the IDL 5 beta. Added the ability to block only as long as a
; client without NO_BLOCK is running, and then revert to the active
; command line.
; AB, 10 February 1997
; Cleaned up code to make it easier to understand and maintain.
; Also cleaned up the distinction between real modality (MODAL
; keyword to WIDGET_BASE) and XMANAGER's older fake modality
; (MODAL keyword to XMANAGER), and fixed bugs in the current
; implementation of fake modality.
; NAME:
; XSGKLCT
; PURPOSE:
; A graphical interface to the SGKLCT procedure.
; XSGKLCT displays the current color map and provides
; an array of buttons, one per availible predefined color
; table. Using the mouse to press these buttons causes
; the corresponding color map to be loaded.
; CATEGORY:
; Widgets
; CALLING SEQUENCE:
; XSGKLCT
; INPUTS:
; None.
; KEYWORDS:
; GROUP = The widget ID of the widget that calls Xsgklct. When
; this ID is specified, a death of the caller results in a
; death of Xsgklct
; SILENT - Normally, no informational message is printed when
; a color map is loaded. If this keyword is present and
; zero, this message is printed.
; DIR = - the directory specification where the color maps
; reside (def: $COLMAP_DIR,
; otherwise '/home/sylvain/colmap/')
; EXT = - the extension name of the colr maps (def: '.clr')
; NCOL = no of columns to use for the names list (def: 2)
; LMAX = max no of colmap names to make visible in the list (def: 16)
; OUTPUTS:
; None.
; COMMON BLOCKS:
; None.
; SIDE EFFECTS:
; One of the predefined color maps may be loaded.
; RESTRICTIONS:
; This routine uses SGK's SGKLCT procedure to do the actual work.
; MODIFICATION HISTORY:
; 24, August, 1990, Written by AB, RSI.
; March 1, 1992 Mark Rivers added Reverse Table to options menu.
; 7/92, DMS, Added new color tables (allows more than 16).
; 9/92, ACY, Add FILE keyword.
; 9/93, SGK, Took IDL's distribution XLOADCT and modified it
; Sep 9 1998 look for env. var. COLMAP_DIR
; zoom an array by factor(s) n1, [n2]
;
; za = zoom(a, n1 [, n2] [,/sample] )
;
; ie, tvscl,zoom(a,2) equivalent to tvscl, zoom(a,2,2)
; or, tvscl,zoom(a,2,3)
;
; use /sample to prevent interpolation
; preserve symmetry in an odd sized array