# Extended IDL Help

This page was created by the IDL library routine `mk_html_help`. For more information on this routine, refer to the IDL Online Help Navigator or type:

         ? mk_html_help

at the IDL command line prompt.

Last modified: Mon Oct 25 16:47:12 2004.

# List of Routines

- BI2XDR_CONVERTER
- BOX_CURSOR[1]
- BOX_CURSOR[2]
- BOX_CURSOR[3]
- CATCHER_V1
- DCVIEWER
- PLOT1D
- PLOT2D
- SCAN2D_ROI
- VIEW1D
- VIEW2D
- XDISPLAYFILE[1]
- XDISPLAYFILE[2]

# Routine Descriptions

## BI2XDR_CONVERTER

[Next Routine] [List of Routines]

     NAME:
           BI2XDR_CONVERTER

     PURPOSE:
           This IDL program converts native binary data into platform-
           independent XDR binary data.

     CATEGORY:
           Widgets.

     CALLING SEQUENCE:
           BI2XDR_CONVERTER [,file=file]  [,GROUP=Group]

     INPUTS:
           None.

     KEYWORD PARAMETERS:
           file:   Specifies the input data file name. The input file should
                   contain pure binary data objects.
           GROUP:  The widget ID of the group leader of the widget. If this
                   keyword is specified, the death of the group leader
                   results in the death of BI2XDR_CONVERTER.

     OUTPUTS:
           The output filename uses the input filename suffixed with '.xdr'.
           Output file contains the converted XDR binary data objects.

     COMMON BLOCKS:
           COMMON BI2XDR_BLOCK

     RESTRICTIONS:
           The input data file should contain pure native binary data objects.
           The 'os.init' and 'dcviewer.pro' must be loaded into IDL first.

     EXAMPLE:

           @os.init
           .RUN dcviewer
           BI2XDR_CONVERTER

     MODIFICATION HISTORY:
           Written by:     Ben-chin K. Cha, 06-01-97.

           xx-xx-xx      iii  comment

(See dcviewer.pro)

## BOX_CURSOR[1]

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
    	BOX_CURSOR

     PURPOSE:
    	Emulate the operation of a variable-sized box cursor (also known as
    	a "marquee" selector).

     CATEGORY:
    	Interactive graphics.

     CALLING SEQUENCE:
    	BOX_CURSOR, x0, y0, nx, ny [, INIT = init] [, FIXED_SIZE = fixed_size]

     INPUTS:
    	No required input parameters.

     OPTIONAL INPUT PARAMETERS:
    	x0, y0, nx, and ny give the initial location (x0, y0) and
    	size (nx, ny) of the box if the keyword INIT is set.  Otherwise, the
    	box is initially drawn in the center of the screen.

     KEYWORD PARAMETERS:
    	INIT:  If this keyword is set, x0, y0, nx, and ny contain the initial
    	parameters for the box.

    	FIXED_SIZE:  If this keyword is set, nx and ny contain the initial
    	size of the box.  This size may not be changed by the user.

    	MESSAGE:  If this keyword is set, print a short message describing
    	operation of the cursor.

     OUTPUTS:
    	x0:  X value of lower left corner of box.
    	y0:  Y value of lower left corner of box.
    	nx:  width of box in pixels.
    	ny:  height of box in pixels.

    	The box is also constrained to lie entirely within the window.

     COMMON BLOCKS:
    	None.

     SIDE EFFECTS:
    	A box is drawn in the currently active window.  It is erased
    	on exit.

     RESTRICTIONS:
    	Works only with window system drivers.

     PROCEDURE:
    	The graphics function is set to 6 for eXclusive OR.  This
    	allows the box to be drawn and erased without disturbing the
    	contents of the window.

    	Operation is as follows:
    	Left mouse button:   Move the box by dragging.
    	Middle mouse button: Resize the box by dragging.  The corner
    		nearest the initial mouse position is moved.
    	Right mouse button:  Exit this procedure, returning the
    			     current box parameters.

     MODIFICATION HISTORY:
    	DMS, April, 1990.
    	DMS, April, 1992.  Made dragging more intutitive.
    	June, 1993 - Bill Thompson
    			prevented the box from having a negative size.
           04-18-96   bkc  Made the box color more visible.
           05-28-98   bkc  Reset bounding box color

(See catcher_v1.pro)

## BOX_CURSOR[2]

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
    	BOX_CURSOR

     PURPOSE:
    	Emulate the operation of a variable-sized box cursor (also known as
    	a "marquee" selector).

     CATEGORY:
    	Interactive graphics.

     CALLING SEQUENCE:
    	BOX_CURSOR, x0, y0, nx, ny [, INIT = init] [, FIXED_SIZE = fixed_size]

     INPUTS:
    	No required input parameters.

     OPTIONAL INPUT PARAMETERS:
    	x0, y0, nx, and ny give the initial location (x0, y0) and
    	size (nx, ny) of the box if the keyword INIT is set.  Otherwise, the
    	box is initially drawn in the center of the screen.

     KEYWORD PARAMETERS:
    	INIT:  If this keyword is set, x0, y0, nx, and ny contain the initial
    	parameters for the box.

    	FIXED_SIZE:  If this keyword is set, nx and ny contain the initial
    	size of the box.  This size may not be changed by the user.

    	MESSAGE:  If this keyword is set, print a short message describing
    	operation of the cursor.

     OUTPUTS:
    	x0:  X value of lower left corner of box.
    	y0:  Y value of lower left corner of box.
    	nx:  width of box in pixels.
    	ny:  height of box in pixels.

    	The box is also constrained to lie entirely within the window.

     COMMON BLOCKS:
    	None.

     SIDE EFFECTS:
    	A box is drawn in the currently active window.  It is erased
    	on exit.

     RESTRICTIONS:
    	Works only with window system drivers.

     PROCEDURE:
    	The graphics function is set to 6 for eXclusive OR.  This
    	allows the box to be drawn and erased without disturbing the
    	contents of the window.

    	Operation is as follows:
    	Left mouse button:   Move the box by dragging.
    	Middle mouse button: Resize the box by dragging.  The corner
    		nearest the initial mouse position is moved.
    	Right mouse button:  Exit this procedure, returning the
    			     current box parameters.

     MODIFICATION HISTORY:
    	DMS, April, 1990.
    	DMS, April, 1992.  Made dragging more intutitive.
    	June, 1993 - Bill Thompson
    			prevented the box from having a negative size.
           04-18-96   bkc  Made the box color more visible.
           05-28-98   bkc  Reset bounding box color

(See view2d.pro)

## BOX_CURSOR[3]

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
    	BOX_CURSOR

     PURPOSE:
    	Emulate the operation of a variable-sized box cursor (also known as
    	a "marquee" selector).

     CATEGORY:
    	Interactive graphics.

     CALLING SEQUENCE:
    	BOX_CURSOR, x0, y0, nx, ny [, INIT = init] [, FIXED_SIZE = fixed_size]

     INPUTS:
    	No required input parameters.

     OPTIONAL INPUT PARAMETERS:
    	x0, y0, nx, and ny give the initial location (x0, y0) and
    	size (nx, ny) of the box if the keyword INIT is set.  Otherwise, the
    	box is initially drawn in the center of the screen.

     KEYWORD PARAMETERS:
    	INIT:  If this keyword is set, x0, y0, nx, and ny contain the initial
    	parameters for the box.

    	FIXED_SIZE:  If this keyword is set, nx and ny contain the initial
    	size of the box.  This size may not be changed by the user.

    	MESSAGE:  If this keyword is set, print a short message describing
    	operation of the cursor.

     OUTPUTS:
    	x0:  X value of lower left corner of box.
    	y0:  Y value of lower left corner of box.
    	nx:  width of box in pixels.
    	ny:  height of box in pixels.

    	The box is also constrained to lie entirely within the window.

     COMMON BLOCKS:
    	None.

     SIDE EFFECTS:
    	A box is drawn in the currently active window.  It is erased
    	on exit.

     RESTRICTIONS:
    	Works only with window system drivers.

     PROCEDURE:
    	The graphics function is set to 6 for eXclusive OR.  This
    	allows the box to be drawn and erased without disturbing the
    	contents of the window.

    	Operation is as follows:
    	Left mouse button:   Move the box by dragging.
    	Middle mouse button: Resize the box by dragging.  The corner
    		nearest the initial mouse position is moved.
    	Right mouse button:  Exit this procedure, returning the
    			     current box parameters.

     MODIFICATION HISTORY:
    	DMS, April, 1990.
    	DMS, April, 1992.  Made dragging more intutitive.
    	June, 1993 - Bill Thompson
    			prevented the box from having a negative size.
           04-18-96   bkc  Made the box color more visible.
           05-28-98   bkc  Reset bounding box color

(See view1d.pro)

## CATCHER_V1

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
    	CATCHER_V1

     PURPOSE:
           EPICS 3.12.2 Scan record data acquistion tool.

           This program provides the EPICS user a convenient IDL data
           acquistion tool.  It calls the IDL external CA functions which
           are defined in the ezcaIDL package.

           Currently, this program can capture both 1D and 2D scan data
           through setting monitor on the EPICS scan record. During data
           acquisition it also provides real-time plotting. Post acquisition
           it also provides primitive 1D and 2D post data plot and analysis.
           Each scan record can support up-to four positioners and fifteen
           detectors."

     CATEGORY:
    	Widgets.

     CALLING SEQUENCE:
    	CATCHER_V1

     INPUTS:
    	None

     KEYWORD PARAMETERS:
         CONFIG:   Specifies the configuration file to be saved when data
                   catcher is normally terminated. If not specified, the
                   default configuration file name 'catch1d.config' is
                   assumed.
         DATA:     Specifies the data file name to be used for appending
                   new captured scan data. If not specified, the default
                   data file name 'catch1d.trashcan.xdr' is assumed.
         ENVFILE:  Specifies the environment (process variables) file to
                   be saved with the captured scan data. If not specified,
                   the default environment file name 'catch1d.env' is
                   assumed.
         NOSAVE:   Turns off the autosave feature. If it is specified, the
                   data catcher will be able to display the life data but
                   data will not be recorded.
         VIEWONLY: Runs the data catcher as a scan data browser. If it is
                   specified, it can only display the recorded scan data
                   from a saved data file.
         GROUP:    The widget ID of the group leader of the widget.  If this
                   keyword is specified, the death of the group leader results in
                   the death of CATCHER_V1.

     OUTPUTS:
           It provides realtime plot and various post acquistion 1D and
           2D surface plot. In addition of DATA file is saved, if 2D scan
           is detected the DATA.image file will also be saved at the end
           of 2D scan. Various levels of report files can also be generated
           by this program.  All the file generated will be prefixed by the
           DATA file name.

     COMMON BLOCKS:
           CATCH1D_COM
           W_PLOTSPEC_BLOCK
           W_VIEWSCAN_BLOCK
           REALTIME_BLOCK
           ENV_FIELD_BLOCK
           FIELD_BLOCK

     SIDE EFFECTS:
           It is capable to detect scan invoked by outside channel access
           client.

     RESTRICTIONS:
           Supports EPICS 3.12.2 and later scan record.

     PROCEDURE:
           For live data acquisition: boot the IOC first, setup and initialize
           the scan records, setup the run ezcaIDL environment, run IDL,
           then start up the data catcher at the IDL prompt.

           A simplified UNIX script file catcher can be used for starting up
           this program. For help on catcher enter "catcher -h" at the UNIX
           prompt.

     EXAMPLE:
           Use default setting for config, envfile, and data file

           CATCHER_V1

           Override the default setting for config, envfile, and data file,
           the 'test' is used for this example.

           CATCHER_V1, CONFIG='test.config', ENVFILE='test.env', DATA='test.dat'

     MODIFICATION HISTORY:
           Written by:     Ben-chin K. Cha, 02-27-96.

           04-16-96  bkc  - Reduce the data catcher window size by moving scan
                            pvname entries to a pop up setup window
                          - Realtime trend plot against the real time axis is
                            implemented
                          - Realtime plot also displays the scan record name
                          - Fix various miscellaneous replot bugs
                          - Add option of accessing HTML documents on help menu

           04-29-96 bkc   - Modified pv status, main window manager, release
                            note 1.4
           09-30-96 bkc   - Implemented more new features, dialog windows,
                            exceptional catches, check for non saved scan
                            data, improve the efficiency, release note 1.5.1
                            etc...
           11-07-96 bkc   - Monitor positioner readback name, debug option,
                            various realtime plot option
           12-13-96 bkc   - Modified index file updating, aborting 2D scan,
                            image file location, report location
           07-23-97 bkc   - Added image strip to show all 15 detectors 2D image
                            (two sizes are available);
                            Added the support for different operating system, eg
                            UNIX or W95 (see SYSTEM_BLOCK, os.init);
                            Modified to run under IDL4.0.1 as well as IDL5.0
           08-08-97 bkc   - Release R2.1 changes
                            Fix the problem of 'No Save', wrong X, Y array due
                            to user aborting 2D scans from the MEDM screen
                            Database desc info for detectors are added to
                            the 2D image data
           09-08-97 bkc   - Release R2.2.X changes
                            Supports both XDR and native type data format
                            If no configuration file exists, it defaults to XDR
                            format
                            Add the curve fitting menu support
    			 Add the color support for the 24 bit visual display
    			 Fix the problem with xmax plot range exceeds the
                            valid int range 64000
           01-28-98 bkc   - Fix the trend analysis problem if time exceeds 32000
                            Fix the error in standard deviation calc if max occurs
                            at y(0)
           02-04-98 bkc   - Add realtime 2D image options for any selected detector
           02-06-98 bkc   - Fix the realtime problem of setting NPTS exceeds 1724
                            Fix the problem with 2D header on 1D drawing area
                            Fix automatic ylog plot scale problem
           02-11-98 bkc   - Allows the user enter any Y scan PV name
    			 Automatic figure out bad file selected
           02-19-98 bkc   - Load default color table once only, use the common
                            color table between view1d, view2d, default line
    			 color defined in catch1d.tbl save by IDL5
           02-27-98 bkc   - Make the File menu sensitive if 'NoSave' is specified
                            in configuration file for 2D scan
           03-02-98 bkc   - Fix Y log plot yrange not defined problem
           03-13-98 bkc   - Fix the realtime plot problem for loading table
                            positioner array
           03-24-98 bkc   - Fix the problem of runtime version the user specified
                            configuration file did not get updated but the
                            'catch1d.config' got updated
           04-14-98 bkc   - Add checking for the wrong type of file picked
           04-15-98 bkc   - Fix the print problem in cw_term function
           05-15-98 bkc   - Eliminate the repeat of 1st scan in 2D scan
                            Use P1DV value as y(0) value for 1D plot
           09-26-98 bkc   - Add Y-vector to hold the y-value for 2D scan (dim 2001)
           11-24-98 bkc   - R2.2.2b
                            New data acquisition will be saved in XDR format.
                            Data catcher will be in viewing mode only if the old
                            data is used.
                            Fix the read problem introduced by the user due to
                            too many characters entered in the comment field.
           12-08-98 bkc   - R2.2.2c Port to W95
           01-12-99 bkc   - Dynamic read in u_read,PS_open,cw_term sources
           01-20-99 bkc   - Fix nosave option at start up it stays nosave option
                            until a new file is entered
                          - Fix viewonly option at start up it stays nosave option
                            until a new file is entered
           02-02-99 bkc   - R2.2.2.c+
                            Fix the File->Copy option it will not work if detectors;                        number exceeds 11
                            Add the pop up message window to warn user if the 1D
                            monitor pvname in config file is not same as in data file
           03-11-99 bkc   - Update Save As ... in XDR format
                            Add the fixIndexFile support in File Menu
                            Fix the problem caused by Start/Prior Pos setting in 2Dscan
           03-19-99 bkc   - Fix the problem starting catcher with blank new file
           03-23-99 bkc   - Fix the plot title for 1D scan
           04-15-99 bkc   - R2.2.2c1
                            Fix the problem associated with 1D scan aborted by the
                            operator sometimes the scan record is still in busy
                            state and the scan record return arrays have not been
                            updated yet such that old scan value is saved
           04-15-99 bkc   - Check for the case empty environment data set is used
           05-24-99 bkc   - R2.2.2c2
                            Add 2D ROI support, TIFF, GIF
           06-17-99 bkc   - R2.2.2c3
                            Check for nosave mode if same file been used by other
                            catcher at startup time
           07-17-99 bkc   - R2.2.2c4
                            Use the lock file system to check for nosave mode
           08-26-99 bkc   - R2.2.2c5
                            Do not reset plot range after zooming
                            Eliminate the extra set of 2D images
           08-26-99 bkc   - R2.2.2c6
                            Fix 2D image X axis for relative and absolute scan mode
                            View report button automatically created report if not ;                        existed yet
                            Add FWHM on Y and DY item in statistic menu
                            Automatic load the first curve into the ez_fit program
                            Upgraded Plot1D plot package
           11-11-99 bkc   - R2.2.2c7
                            Plugin calibration program to panimage menu
                            PanImage menu supports saving TIFF/RTIFF/GIF images
                            Creating ASCII/TIFF/GIF/CALIB/ROI directory for saving
                            respective type of files
                            Increase X,Y vector array to 2001 in view2D
           01-27-00 bkc   - R2.2.2c7+
                            View2d R2.3g+ with set new 2D positions
           05-15-00 bkc   - R2.2.2c8
                            Fix the plot broblem if the request NPTS is set to 2
                            by the user. If NPTS is set to 1, data is duplicate
                            once to get around the oplot problem.
                            Change the dialog info if configuration error is
                            detected, it allows the user re-enter the File menu.
           08-31-00 bkc   - Add the error handling for null file entered
           12-06-00 bkc   - R2.2.2c8+
                            Fix realtime panimage window problem
                            Replace GIF by XDR saving options in view2d, plot2d
           06-30-01 bkc   - R2.2.2c9
                            Fix xtitle with positioner number
    	08-01-01 bkc     Modified the PV goto dialog according to the readin
    			 positioner values
           01-16-02 bkc   - Modified scan setup dialog
           03-12-02 bkc   - Add 2D scan ranges setup
                            Modified regessfit, lorentzian, readascii
                            Add bkg color button to plot1d, ez_fit
                            Modified 1D Goto based on the input file
           03-19-02 bkc   - Save 2D image at the end of each 1D scan
                            Add a variation error function FUNCT_ERF1 to
                            ez_fit
           03-17-03 bkc   - Add option of selecting 'PS ratio' droplist
           10-24-03 bkc   - R2.2.2c10  Ported to IDLVM for window
         			 Fix problem encountered in WIN save file
    			 spawn,/noshell,rm,wc,index file etc...
           12-03-03 bkc   - R3.0  Support old/new scan record
           04-06-04 bkc   - R3.1  Support TrueColor devices
           10-12-04 bkc   - R3.2  Fix 24 bit realtime line color scheme
    			 Add zoom pan left,right,up,down dialog
    			 Plot1d plot options remember previous setting

(See catcher_v1.pro)

## DCVIEWER

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
    	DCVIEWER

     PURPOSE:
           This program integrates the view1D and view2D program into a single
           system. It provides 1D and 2D data viewing features for data
           catcher. It operates on the same set of data files generated by
           the data catcher.

           It is written in pure IDL language and it is platform-independent.
           It can read data either in native binary form or XDR binary form.

           It can be invoked as an XDR data converter to convert native data
           into XDR binary form.

     CATEGORY:
           Widgets.

     CALLING SEQUENCE:

           DCVIEWER [,DATA='1data'] [,FILE='1data.image'] [,/XDR] [,GROUP=Group]

     INPUTS:
           None.

     KEYWORD PARAMETERS:
           DATA:   Specifies the input filename for the 1D scan data on the
                   command line.
           FILE:   Specifies the input filename for the 2D image data on the
                   command line.
           XDR:    Starts the DCVIEWER as the XDR data convert program.
           GROUP:  The widget ID of the group leader of the widget. If this
                   keyword is specified, the death of the group leader results in
                   the death of DCVIEWER.

     OUTPUTS:
           It provides all the viewing and report features available in the
           EPICS data catcher except with the channel access functions been
           removed.

     COMMON BLOCKS:
           COMMON DCVIEWER_BLOCK
           COMMON BI2XDR_BLOCK

     SIDE EFFECTS:
           If the data catcher has appended new scan data on the same file,
           a user has to reload the data file to get the newly added scan
           data into the DCVIEWER.

     RESTRICTIONS:
           A complete package of DCVIEWER includes the following files:
              os.init
              dcviewer.pro
              view1d.init
              view1d.pro
              view1d_overlay.pro
              view2d.init
              view2d.pro
              plot1d.pro
           The path to these files must be included in the IDL_PATH. Before
           invoking DCVIEWER, the file 'os.init' must be loaded into IDL
           first.

     PROCEDURE:
           On the UNIX operating system, the script file 'viewer' can be
           used to directly invoke the data viewer. The environment, path
           settings, and running procedure are automatically taking cared
           by the script file 'viewer'.

     EXAMPLE:
           Start the DCVIEWER as scan data display package -
                   @os.init
                   dcviewer

           Start the DCVIEWER as an XDR data converter -
                   @os.init
                   dcviewer,/XDR

     MODIFICATION HISTORY:
           Written by:     Ben-chin K. Cha, 6-01-97.
           12-19-97 bkc  - Allows the access of the view1d_overlay program
                           Add the IDL> prompt dialog which let the user
                           run any IDL command
           09-06-02 bkc  - The Close button will close viewer program but stay in
                           IDL sesseion with all the routines intact
    			The Exit button will exit the IDL session

(See dcviewer.pro)

## PLOT1D

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           PLOT1D

     PURPOSE:
           This routine provides a general purpose flexible cartesion plot
           package.  It provides simple to use automatic feature of labels,
           legend, comment, line style, symbols, and color options on plot.

           The window generated by this routine will be resizable by the
           window manager.

           Depress the 'Print' button will generate a postscript copy of the
           graph.

           Normally it accepts two parameters X and Y. If the first parameter
           is not used then the data array is plotted on the ordinate versus
           the point number on the abscissa.  Multiple curves (or variables)
           can be stacked into the second parameter as a two dimensional array,
           the first dimension gives the number of data points in each curve,
           the second dimension gives the number of curves to be plotted.

     CATEGORY:
           Widgets.

     CALLING SEQUENCE:

           PLOT1D, [X,] Y [,ID_TLB]  [,ID_DRAW]

     INPUTS:
           X:      The vector array for X abscissa.

           Y:      The Y data array for curve plot. The Y array can contain
                   more than one curve, the first dimension gives the number
                   of data to be plotted for the curve, the second dimension
                   gives the number of curves to be plotted.

     KEYWORD PARAMETERS:
           TITLE:  Set this keyword to specify the plot title string.

           XTITLE: Set this keyword to specify the xtitle string.

           YTITLE: Set this keyword to specify the ytitle string.

           COLOR:  Set this keyword to specify the color number used
                   in the plot routine.

           FACTOR: Set the curve multiplication factor for the Y vector, default 1.

          CURVFIT: Set this keyword if two curves are plotted, first curve
                   is the fitted curve, the second curve is data to be fitted.

           SYMBOL: Set this keyword to specify data plotted as symbol, set to -1
                   data plot as symbol and connected with line.

           XLOG:   Set this keyword to specify a logrithmic X axis.

           YLOG:   Set this keyword to specify a logrithmic Y axis.

           XRANGE: Set this keyword to specify the desired data range for
                   the X axis.

           YRANGE: Set this keyword to specify the desired data range for
                   the Y axis.

           XMARGIN: Set this keyword to specify the left and right margin,
                    default xmargin=[10,3]

           YMARGIN: Set this keyword to specify the bottom and top margin
                    default ymargin=[5,3]

           CHARSIZE:Set this keyword to specify the charsize

           THICK:   Set this keyword to specify the line thickness for the
                    axes and the line plot.

           LINESTYLE:  Set this keyword to turn on different line style used.

           XSTYLE:  Set this keyword to control x axis in IDL plot routine.

           YSTYLE:  Set this keyword to control y axis in IDL plot routine.

           LEGEND:  Set the legend strings corresponding to curves drawn.

           XYLEGEND: Set the x,y location of the legend strings, % from the
                     lower left corner from the graph window, default
                     xylegend=[0.83, 0.60].

           COMMENT:  Set this keyword to write any footnotes on the graph.

           STAMP:  Set this keyword to put the time stamp and user ID on the page.

           WTITLE: Set this keyword to specify the window title string,
                   default to 'Plot1d'.

           WIDTH:  The initial window width at the creation time, which
                   default to 350 pixel.

           HEIGHT: The initial window height at the creation time, which
                   default to 350 pixel.

           GROUP:  The widget ID of the group leader of the widget. If this
                   keyword is specified, the death of the group leader results
                   in the death of PLOT1D.

           DATA:   Set this keyword if an xdisplayfile data button is desired
           REPORT: Set this keyword if an xdisplayfile report button is desired
                   It specifies the report file name to be displayed.

           BUTTON: Set this keyword if no print and close buttons are desired
                   for the PLOT1D widget.

           CLEANUP: Set this keyword if the created window can no be closed by the
                    window manager is desired.

           BGREVS:  Reverse background color

           OVERLAY: Speicify whether overlay option desired

     OPTIONAL_OUTPUTS:
           ID_TLB: The widget ID of the top level base returned by the PLOT1D.

           ID_DRAW: The widget ID of the drawing area used by the PLOT1D.

     COMMON BLOCKS:
           None.

     SIDE EFFECTS:
           If more than one curves are stored in the Y array, it automatically
           uses different color for each curve. If the color keyword is set
           by the user, then the specified color will be used for the whole plot.

     RESTRICTIONS:
           It is assumed that the X position array is the same for multiple
           curve plot.

     EXAMPLES:
           Create a resizable line plot without any title or label
           specification.

               x = !pi * indgen(100)/25
               PLOT1D, x, sin(x)

           Create a resizable line plot with title specifications.

               PLOT1D, x, sin(x), title='title', xtitle='xtitle', ytitle='ytitle'

           Plot two curves with different linestyle and legend at default location.

               x=indgen(100)
               y=make_array(100,2)
               y(0,0)=sin(x * !pi / 50)
               y(0,1)=cos(x * !pi / 50)
               PLOT1D,x,y,legend=['line1','line2'],/linestyle

           Same as the above example plus symbol and a specified legend location.

               x=indgen(100)
               y=make_array(100,2)
               y(0,0)=sin(x * !pi / 50)
               y(0,1)=cos(x * !pi / 50)
               PLOT1D,x,y,/linestyle,symbol=-1, $
                  legend=['line1','line2'], xylegend=[0.5,0.9]

           Plot x,y array plus two lines of comment and a time stamp on the graph.

               PLOT1D,x,y,comment=['Comment line1','Comment line2'],/stamp

     MODIFICATION HISTORY:
           Written by:     Ben-chin K. Cha, Mar. 7, 1996.

           04-26-96 bkc   Add the window cleanup keyword
           10-28-96 bkc   Add the xstyle and ystyle keywords
           07-01-97 bkc   Comment out LOADCT,39 inherit color from parent process
           08-11-97 bkc   Add the curvfit support, only two curves allowed
           12-22-97 bkc   Add the 24 bit color visual device support
           09-04-98 bkc   Fix the plot problem due to ymax eq ymin
           09-19-99 bkc   Support plot1d various plot options
                          Support the multiple scatter plot
                          Add the support of report, factor, charsize keywords
           11-19-99 bkc   Support auto-scaled/user-specified X,Y plot ranges
                          Add multiple list selection of curves
           02-12-01 bkc   Support 'plot1d.txt' data report option
           03-09-01 bkc   Default white backgrund color
                          Print button dum the screen plot by using TVRD
                          PS Plot button generates PS plot output
           02-18-02 bkc   Add option of NPT slider to specify the last of the
                          data points to be plotted for each curve
           05-01-02 bkc   Add FWHM_Y, FWHM_DY, Fitting, Statistic buttons
                          Check for 24 bit display
                          Add bgrevs keyword
                          Check for incomplete color table size case
                          Check for scattering data 1D plot
           04-01-04 bkc   Support both PseudoColor and TrueColor devices
                          Add ITOOL... dialog for falling iplot
           06-03-04 bkc   Add overlay option to plot1d setup dialog

(See plot1d.pro)

## PLOT2D

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           PLOT2D

     PURPOSE:
           This routine provides a general purpose, flexible generic 2D plot
           package.  It provides 2D TV, SURFACE, CONTOUR, and SHADE_SURF plot.
           It is very simple to use and provides various features of
           adjusting 2D plot area, size, style, title, comment, etc.

           The window generated by this routine will be resizable by the
           window manager.

           Depress the 'Print' button will generate a postscript copy of the
           graph.

     CATEGORY:
           Widgets.

     CALLING SEQUENCE:

           PLOT2D, DATA [,TLB] [,WIN]

     INPUTS:
           DATA:   The 2D array to be plotted.

     KEYWORD PARAMETERS:
           XARR:   Set this keyword to specify the corresponding x vector values.

           YARR:   Set this keyword to specify the corresponding y vector values.

           TITLE:  Set this keyword to specify the plot title string.

           XTITLE: Set this keyword to specify the xtitle string.

           YTITLE: Set this keyword to specify the ytitle string.

           ZTITLE: Set this keyword to specify the ztitle string.

           CHARSIZE: Set this keyword to specify the plot charsize, default 1.

           CLASSNAME:  Set classname used in output file construction.

           COMMENT:  Set this keyword to write any notes on the graph.

           RXLOC:  Set notes X ratio to plot device width, default 0.01.

           RYLOC:  Set notes Y ratio to plot device height, default 0.98.

           STAMP:  Print the time stamp on the graph.

           WTITLE: Set this keyword to specify the window title string,
                   default to 'Plot2d'.

           WIDTH:  The initial window width at the creation time, which
                   default to 500 pixel.

           HEIGHT: The initial window height at the creation time, which
                   default to 450 pixel.

           AX:     This keyword specifies the rotated angle about the x-axis.
                   AX>0 toward the viewer, AX<0 away from the viewer, default
                   +30 degree (Surface plot)

           AZ:     This keyword specifies the rotated angle about the z-axis,
                   default 30 degree. (Surface plot)

           LEGO:   This keyword specifies the z value as stacked histogram
                   style plot. (Surface plot)

           SHADE:  This keyword specifies the color shade for the surface plot.

           GROUP:  The widget ID of the group leader of the widget. If this
                   keyword is specified, the death of the group leader results
                   in the death of PLOT2D.

           NCOLORS: If this keyword is specified, it overrides the actual size
                    of the color table used in plot2d.

    	ITOOLS:  If specified the iTools menu is added

    	IJOFFSET: [Ix,Iy] specifies offset indices of data array extracted
    		  from the original data array (used for Query Sub ROI...)

     OPTIONAL_OUTPUTS:
           TLB: The widget ID of the top level base returned by the PLOT2D.

           WIN: The window ID of the drawing area used by the PLOT2D.

     COMMON BLOCKS:
           COLORBAR.

     SIDE EFFECTS:
           The max and min value will be shown as the default comment.

     RESTRICTIONS:
           For contour plot only 12 levels are allowed.

     EXAMPLES:
        Example 1 - Create a resizable 2D plot without any title or label
           specification.

    	     PLOT2D, Data

        Example 2 - Create a resizable 2D plot with real X,Y values, title, stamp,
           Xtitle and Ytitle specification.

    	     PLOT2D,Data,Xarr=X,Yarr=y,Title=ti,Xtitle=xt,Ytitle=yt,/Stamp

     MODIFICATION HISTORY:
           Written by:     Ben-chin Cha, Dec 16, 1998.
           12-22-1998      Add zoom in/out button to control X, Y margins
           01-15-1999      Allow 5 comment lines on plot
                           Replace base widget MAIN13 by Plot2dMAIN13
           03-05-1999      Add Plot Options support to let user set the plot
                           margins, title, labels, color table, various
                           plot style, etc.
           03-17-1999      Add TV image options
           05-14-1999      Add colorbar, save TIFF and GIF options
           11-23-1999      Save images in TIFF/GIF destination directory
                           Add option of N contour levels field
                           Remove the common block definition
           01-24-2000      Add TV step # or axis options
           06-01-2000      Add colorbar_config dialog, and toggle the colorbar to
                           get the colorbar redraw correctly
                           Add classname for automatically generate output file
           12-05-2000      Replace save 2D data as GIF by XDR option
           02-15-2001      Add Data button to support 'plot2d.txt' report option
           03-09-2001      Add xsize,ysize keyword to plot2d
                           Default backgrand color change to white
                           Initial colorbar use relative location
                           PS use the TVRD exactly as shown on screen
           05-29-2001      Add ascii format control on data output
                           Allow the Color bar width, height ajustment
           09-21-2001      Post script plot same as window size
           01-18-2002      Add the PICK1D button to access plot1d, and ezfit
           03-26-2002      Add drawing normalized X,Y profile event
           05-01-2002      Add ncolors keyword, MMB event, check for max colors
           03-01-2004      Add extraction of ROI dialog, RMB events (zoom) in
                           drawing area
    			Add query of value for i,j index event
    			Add set z-value at the i,j index event
    			Add top value color value event
    			Add equal aspect ratio option to Plot Options dialog

(See plot2d.pro)

## SCAN2D_ROI

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           SCAN2D_ROI

     PURPOSE:
           This program let the user interactively define the ROI for a given
           2D image array, calculate the 2D-ROI statistics, and generate ROI
           report.

           It supports 3 types of ROI: rectangle, polygon, and pixel value
           range filter.

     CATEGORY:
           Widgets.

     CALLING SEQUENCE:

           SCAN2D_ROI, Im, X, Y [,HEADER=header] [,ROIFILE=roifile] $
                [,RPTFILE=rptfile] [,MODE=mode] [,COMMENT=comment] [GROUP=group]

     INPUTS:
           IM:     Input 2D image array
           X:      X data vector
           Y:      Y data vector

     KEYWORD PARAMETERS:
           HEADER:     A string list which holds two strings.  If specified it
                       will be plotted at the top left corner of the TV screen.
           COMMENT:    A string used to annotate the special ROI. If specified
                       it will be put in the statistic report.
           ROIFILE:    A string to specifies the default RectROI filename used.
           RPTFILE:    A string to specifies the default ROI report filename used.
           MODE:       Starts the scan2d_roi with desired ROI mode, default is
                       RectROI mode.

     SIDE EFFECTS:
           A directory ROI will be created at the current directory. All the
           ROI related files will be saved under this directory.
           If the keyword rptfile is defined on the command line, then the
           location of ROI directory will be determined from the rptfile.

           The default filenames used for ROI report, rectangle ROI, polygon
           ROI are 'tmproi.rpt', 'tmproi.xdr', 'tmproi.xdr.poly' respectively.

     RESTRICTIONS:
           The ROI filename entered in the file selection dialog is used by the
           rectangle ROI. The ROI filename is automatically suffixed by '.poly'
           for the polygon ROI.

     EXAMPLE:
           For a given 2D image array IM corresponding to  X and Y vectors,
           to run the scan2d_roi program to get various 2D-ROI statistic
           report:

           scan2d_roi,im,x,y

     MODIFICATION HISTORY:
     	Written by:	Ben-chin Cha, June 23, 1999.
           01-24-2001  bkc R1.1
                           Handle large image array, improve the efficiency
           12-05-2003  bkc Fix the problem of inverse order of ROI
    	08-07-2004  bkc Add support for true color devices

(See scan2d_roi.pro)

## VIEW1D

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           VIEW1D

     PURPOSE:

           This program is specially written for the data catcher. It
           provides the IDL user a convenient post data acquisition
           1D data display program. It shares the common 1D data file
           with data catcher without interrupting the process of data
           scanning of data catcher.

     CATEGORY:
    	Widgets.

     CALLING SEQUENCE:
    	VIEW1D [,Data='test.dat'] [,Config='test.config'] [,/XDR] [GROUP=Group]

     INPUTS:
    	None

     KEYWORD PARAMETERS:
         CONFIG:   Specifies whether the configuration file to be used in the
                   startup of the VIEW1D.
         DATA:     Specifies the 1D file name to be used for displaying
                   captured 1D scan data. If not specified, the default
                   data file name 'catch1d.trashcan' is assumed.
         XDR:      Indicates whether the data file entered on the command line is
                   in XDR format.
         GROUP:    The widget ID of the group leader of the widget.  If this
                   keyword is specified, the death of the group leader results in
                   the death of VIEW1D.

     OUTPUTS:
           It provides various post acquistion 1D scan displaying features.
           Various levels of report files can be generated by this program.
           All the file generated will be prefixed by the DATA file name.

     COMMON BLOCKS:
           VIEW1D_COM
           W_PLOTSPEC_BLOCK
           W_VIEWSCAN_BLOCK

     SIDE EFFECTS:
           New scan data may be appended at the end of data file if the
           data catcher is runing at the same time and new data
           is detected by the data catcher. Reload the data file will
           let you access the newly captured scan data from the file.

     RESTRICTIONS:

     PROCEDURE:
           The 'os.init' must be loaded into IDL before invoking the
           VIEW1D application.

     EXAMPLE:
           Use default setting for view1d

           	VIEW1D

           Override the default setting by specifying config and data file
           on the command line

           	VIEW1D, CONFIG='test.config', DATA='test.dat'

     MODIFICATION HISTORY:
           Written by:     Ben-chin K. Cha, 05-27-97.

           08-01-97  bkc   Add the 2D scan # in the header
           10-16-97  bkc   Upgrade to R1.3
                           Automatic figure out the type of binary data read in
                           only works for IDL 5.0.1 and up
                           Add the support for ez_fit curve fitting package
           01-28-98  bkc   Fix the error in standard deviation calc if max occurs
                           at y(0)
           02-17-98  bkc   If the user entered an existing ASCII file it will be
                           backuped for user
           05-14-98  bkc   Upgrade to R1.4
           11-24-98  bkc   Upgrade to R1.5
                           Accommondate the read problem introdued by too many
                           characters entered in comment fields
           01-12-99  bkc   R1.5a dynamic read in u_read PS_open cw_term sources
           05-14-99  bkc   R1.5b replace old statistic_1d by newer version
           08-26-99  bkc   R1.5c scale is not automatically reset after the zooming
                           use Auto Scale button to reset
           08-26-99  bkc   R1.5d
                           Open_binary_type default to XDR
           09-20-99  bkc   View Report automatically generates it if file not found
           10-06-99  bkc   Ez_fit automatically fits the first selected detector
           11-23-99  bkc   R1.5e
                           Remove the automatically plot against step # if a constant
                           X vector was found.
                           ASCII files will be saved under ASCII sub-directory
                           Add submenu FWHM on Y and DY/DX to Statistic menu
           05-17-03  bkc   R1.5e+
    		        Add option of selection 'PS ratio' droplist
    	07-07-04  bkc	Support 24 bit true color devices

(See view1d.pro)

## VIEW2D

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
           VIEW2D

     PURPOSE:
           This program provides the EPICS user a convenient IDL 2D scan data
           display tool.  Its input image file is automatically saved by the
           data catcher program CATCHER_V1.

           Currently, this program provides TV, SURFACE, CONTOUR, SHOW3, and
           PLOT2D plot. It also provides simple xz, yz line plot and data
           value query information.

     CATEGORY:
    	Widgets.

     CALLING SEQUENCE:
    	VIEW2D

     INPUTS:
           None.

     KEYWORD PARAMETERS:
         GROUP:    The widget ID of the group leader of the widget.  If this
                   keyword is specified, the death of the group leader results in
                   the death of VIEW2D.

         FILE:    The input image file name.  If this keyword is specified, the
                  file should contain the image data must be in the data catcher
                  created format.

         XDR:     If specified, indicates that the input is in XDR format.

     OUTPUTS:
           It provides option of postscript plot of drawing area.

     COMMON BLOCKS:
           None.

     RESTRICTIONS:
    	Drawing area is 460 x 400 pixels.

     PROCEDURE:
           This program is available as an epics/extensions tool. It can be
           directly accessed from the view data menu of the CATCHER_V1.

     EXAMPLE:
           VIEW2D

     MODIFICATION HISTORY:
           Written by:     Ben-chin K. Cha, 02-27-96.
           04-29-96 bkc  Add image button, 2d scan #, on-line help
           09-30-96 bkc  Add cross hair to reflect the cursor position
           11-21-96 bkc  Text window image out include x,y array vales
    		      Option of save and load private color map
                         Take care out of sync 2D scan #
                         Modify XZ, YZ profile distributions
           12-13-96 bkc  Add zoom-in, zoom-off, printer support,
                         color PS plot, rewrite TV, equal aspect TV
                         ratio, reverse PS video, cursor features, etc
           04-11-97 bkc  Call the MAX function to give the max location
           08-08-97 bkc  Release R2.1
                         Cursor position readout fixed by catcher R2.1
                         Fix the Y title cut off problem for PostScript
                         More useful plots and printouts info for TV screen
                         and PostScript output
                            min, max values and locations
                            detector database  description
                            positioner database description
           12-15-97 bkc  Release R2.2
                         Add the curve fitting support
                         Rename Refresh button to ReNew
                         Use scroll window for base widget
                         Reverse PS color becomes an option in PS_printer setup
                         Contour plot support 24 bit visual device
                         ASCII ... allows the user override default filename
    				try data directory first, then start directory,
    				then home directory
           01-12-98 bkc  Modify the view2d.init file to increase the allowable
                         image size to 1000x1000
           04-09-98 bkc  Release R2.3
                         If bad image data detected, at least let the user view
                         all the good image so far read into view2d
           05-14-98 bkc  TV legend uses the first color entry from the color table
                         If reverse legend color is set, use the last color entry
                         from the color table
           05-26-98 bkc  Remove scroll bar problem on the main window
           08-31-98 bkc  Release R2.3a
                         Fix the problem of only 1 set of 2D scan in data,
                         Add nodata keyword for axis plot for TV image
           09-31-98 bkc  Release R2.3b
                         Add save image option for AIM program
           01-09-99 bkc  Release R2.3c,  replace the XSURFACE by PLOT2D
                         Dynamic read in u_read PS_open cw_term plot1d plot2d source
                         Fix the TV plot problem of Step # option
           05-14-99 bkc  release R2.3d
                         Add colorbar, scan2d_roi support
                         Add the option of saving as TIFF or GIF useing rename dialog
           06-02-99 bkc  release R2.3e
                         Tiff, gif data will be saved under TIFF directory
                         Add 2D-ROI menu, ROIs..., UpdtRpt..., AppendRpt...
                         Add scan2dROIRpt for all detectors for a given 2D scanno
           09-14-99 bkc  release R2.3f
                         open_binary_type default to XDR  (support alpha too)
                         Add 2D image ASCII report format option
           11-02-99 bkc  release R2.3g
                         Add support of saving TIFF/GIF pan images
                         Upgrade the readascii user interface with table support
                         Add support of image calibration
                         New files saved will be in corresponding sub-directory
           01-20-00 bkc  Increase the X,Y array to 2001
                         Suppress the axis plot of TV if constant value is found
           01-25-00 bkc  Automatically set the Xmin,Xmax,Ymin,Ymax widget
                         release R2.3g+
                         Add the set new postions button if caInit found
           06-01-00 bkc  Release R2.3h
                         Add the Color->ColorBar Config ... dialog for configuring
                         the colorbar on 2D image
           12-05-00 bkc  Release R2.3h+
                         Delete GIF, add XDR option save image as XDR data
                         Modify plot2d save in XDR too
           06-13-01 bkc  Release R2.4
                         Add the option of plot against to P2,P3,P4 X axis
                         Add re-assign dnames to dcviewer driver
                         Read user preferred detector names from '.tmpName'
                         Scan2d_roi support save filter ROI to pass into multiroi
           03-20-02 bkc  Release R2.5
                         Add XL,XR,YL,YR fields reflecting ROI for scan
                         Add set new 2D scan start and end position
           05-07-02 bkc  Add ranges to XDR image save
                         Modify the user interface of Image Color Scheme
           04-07-04 bkc  Add replace TIFF by PNG
           05-19-04 bkc  Release R2.5.1
                         Add the Log Scale color On/Off option to allow more
                         colors displayed in case of weak background signal

(See view2d.pro)

## XDISPLAYFILE[1]

[Previous Routine] [Next Routine] [List of Routines]

     NAME:
    	XDISPLAYFILE

     PURPOSE:
    	Display an ASCII text file using widgets and the widget manager.

     CATEGORY:
    	Widgets.

     CALLING SEQUENCE:
    	XDISPLAYFILE, Filename

     INPUTS:
         Filename:	A scalar string that contains the filename of the file
    		to display.  The filename can include a path to that file.

     KEYWORD PARAMETERS:
    	FONT:   The name of the font to use.  If omitted use the default
    		font.
    	GROUP:	The widget ID of the group leader of the widget.  If this
    		keyword is specified, the death of the group leader results in
    		the death of XDISPLAYFILE.

    	HEIGHT:	The number of text lines that the widget should display at one
    		time.  If this keyword is not specified, 24 lines is the
    		default.

    	TEXT:	A string or string array to be displayed in the widget
    		instead of the contents of a file.  This keyword supercedes
    		the FILENAME input parameter.

    	TITLE:	A string to use as the widget title rather than the file name
    		or "XDisplayFile".

    	WIDTH:	The number of characters wide the widget should be.  If this
    		keyword is not specified, 80 characters is the default.

    	BLOCK:  Set this keyword to have XMANAGER block when this application
    	        is registered. By default the Xmanager keyword NO_BLOCK
    	        is set to 1
    	MODAL:
     OUTPUTS:
    	No explicit outputs.  A file viewing widget is created.

     SIDE EFFECTS:
    	Triggers the XMANAGER if it is not already in use.

     RESTRICTIONS:
    	None.

     PROCEDURE:
    	Open a file and create a widget to display its contents.

     MODIFICATION HISTORY:
    	Written By Steve Richards, December 1990
    	Graceful error recovery, DMS, Feb, 1992.
           12 Jan. 1994  - KDB
                   If file was empty, program would crash. Fixed.
           4 Oct. 1994     MLR Fixed bug if /TEXT was present and /TITLE was not.
          14 Jul. 1995     BKC Increased the max line to variable size.
          16 Jun. 1997     BKC Max dispalyable line is 10000 for non-unix OS system.
          28 Aug. 1997     BKC Add the printer button, file name label, it uses the
                           PS_print,file to print.
          30 Jul. 2002     BKC Add the block, modal keywords take care the
                           animation help problem
          09 Aug  2002     BKC fix the problem with no input filename case

(See catcher_v1.pro)

## XDISPLAYFILE[2]

[Previous Routine] [List of Routines]

     NAME:
    	XDISPLAYFILE

     PURPOSE:
    	Display an ASCII text file using widgets and the widget manager.

     CATEGORY:
    	Widgets.

     CALLING SEQUENCE:
    	XDISPLAYFILE, Filename

     INPUTS:
         Filename:	A scalar string that contains the filename of the file
    		to display.  The filename can include a path to that file.

     KEYWORD PARAMETERS:
    	FONT:   The name of the font to use.  If omitted use the default
    		font.
    	GROUP:	The widget ID of the group leader of the widget.  If this
    		keyword is specified, the death of the group leader results in
    		the death of XDISPLAYFILE.

    	HEIGHT:	The number of text lines that the widget should display at one
    		time.  If this keyword is not specified, 24 lines is the
    		default.

    	TEXT:	A string or string array to be displayed in the widget
    		instead of the contents of a file.  This keyword supercedes
    		the FILENAME input parameter.

    	TITLE:	A string to use as the widget title rather than the file name
    		or "XDisplayFile".

    	WIDTH:	The number of characters wide the widget should be.  If this
    		keyword is not specified, 80 characters is the default.

    	BLOCK:  Set this keyword to have XMANAGER block when this application
    	        is registered. By default the Xmanager keyword NO_BLOCK
    	        is set to 1
    	MODAL:
     OUTPUTS:
    	No explicit outputs.  A file viewing widget is created.

     SIDE EFFECTS:
    	Triggers the XMANAGER if it is not already in use.

     RESTRICTIONS:
    	None.

     PROCEDURE:
    	Open a file and create a widget to display its contents.

     MODIFICATION HISTORY:
    	Written By Steve Richards, December 1990
    	Graceful error recovery, DMS, Feb, 1992.
           12 Jan. 1994  - KDB
                   If file was empty, program would crash. Fixed.
           4 Oct. 1994     MLR Fixed bug if /TEXT was present and /TITLE was not.
          14 Jul. 1995     BKC Increased the max line to variable size.
          16 Jun. 1997     BKC Max dispalyable line is 10000 for non-unix OS system.
          28 Aug. 1997     BKC Add the printer button, file name label, it uses the
                           PS_print,file to print.
          30 Jul. 2002     BKC Add the block, modal keywords take care the
                           animation help problem
          09 Aug  2002     BKC fix the problem with no input filename case

(See view1d.pro)