BHill AstroContrib Library

This page is a listing of the entire contents of this library for IDL. This listing is the long version. Viewing the much more compact listing may be handier.

[Go Back to Main IDL Libraries Search Page]


Last modified: Thu Dec 21 21:17:06 2000.

List of Routines


Routine Descriptions

ADJPLOT

[Next Routine] [List of Routines]
  NAME:            ADJPLOT

  PURPOSE:
    Generates a widget containing a plot with X and Y ranges
    adjustable using sliders.

  CALLING SEQUENCES (see individual routines for arguments
    and keywords):

    ADJPLOT, X, Y, GROUP_LEADER=group_leader, $
      XSIZE=xsize, YSIZE=ysize, TOP_ID=top_id, WTITLE=wtitle, $
      CURSOR_COLOR=cursor_color, CLICK_PRO=click_pro, $
      BASE_ID=base_id, TITLE=title, XTITLE=xtitle, $
      YTITLE=ytitle, CLICK_PTR=click_ptr, FREE_BLOCK=free_block, $
      _EXTRA=extra

    ADJPLOT_REPLOT, Top_id, X, Y, XSTATIC=xstatic, $
      YSTATIC=ystatic, YRELATIVE=yrelative, _Extra=extra

    ADJPLOT_CLICK, Top_id, Click_pro, Click_ptr

    ADJPLOT_CLEANUP, Top_id

    ADJPLOT_EVENT, Event

  MODIFICATION HISTORY:
     Written by R. S. Hill, RITSS, 6 Aug. 1999
     Various improvements.  RSH, Aug.-Sep. 1999
     Documented.  RSH, 5 Oct. 1999
     Square brackets around subscripts.  RETALL changed to RETURN
        in short doc section.  RSH, 3 July 2000

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/adjplot.pro)


BIG_PS

[Previous Routine] [Next Routine] [List of Routines]
NAME:
       BIG_PS

PURPOSE:
       Converts an IDL (image) array to a postscript file.

CATEGORY:
	input/output

CALLING SEQUENCE:
       big_ps, image, immin=immin, immax=immax, title=title,$
       	filename=filename, log=log, colortable=colortable, rev=rev,$
		scaletitle=scaletitle, nobar=nobar

INPUTS:
       Image: IDL image array to be printed (need not be square)

OPTIONAL KEYWORDS:
       LOG: if set, scales image logarithmically.
               WARNING: image will be returned as a log. Make a copy
                        if you want to save original image!
       IMMIN: minimum data value to use in scaling [default = image min]
       IMMAX: maximum data value to use in scaling [default = image max]
       FILENAME: name of postscript file written to disk [def= 'idl.ps']
       TITLE: title of image (written above image when printed)
       COLORTABLE: color look-up table to use when printing [def = greyscale]
	REV: if set, white-on-black is reversed to black-on-white (saves toner)
	SCALETITLE: title for colorbar scaling (i.e., 'LOG SCALING')
	NOBAR: if set, scalebar is suppressed (NOTE: scaletitle still 
                appears unless you set scaletitle = '')

OUTPUTS:
       none, postscript file written to disk

COMMENTS:
	It is highly recommended to use the IMMIN keyword when using
		the log scale. The default is 10^(-5), which
		may stretch color scale too far.
	You can use a personal colortable by first loading that table
		at the IDL prompt (use tvlct) and then running BIG_PS
		with colortable set equal to -1. You can do this for a 
		preset table as well; for example, type "LOADCT,1" and
		then run BIG_PS with colortable = -1.
	To get JUST the image with no annotation, set:
               title = ''
               scaletitle = ''
               nobar = 1

HISTORY:
       Written by:	PP/ACC  5/11/95 (from DL/ACC)
       8/31/95         PP/ACC  Version 1.2   Changed keyword set, now allows
                                  keywords to be set to 0.
       9/25/95         PP/ACC  Version 1.3   Fixed a bug in logarithmic scaling,
                                  image now scaled correctly.
	9/26/95		PP/ACC  Version 1.4   Added scaling type under colorbar.
				   Added reverse option. Also, input image
				   is no longer changed; a temp image is 
				   created for log scaling and reversal.
	9/29/95		PP & DJL /ACC Fixed bug in color table
	10/16/95	PP/ACC	Added scaletitle keyword
	6/6/96		PP/ACC fixed bug in log scaling and immin setting
	8/30/96		PP/ACC Loadct now runs silently
	4/16/97		PP/ACC added NOBAR keyword, changed default title to '',
                                   now returns user to original device type
       5/22/97         PP/ACC changed immin and immax to imin and imax to 
                               prevent them being overwritten on multiple calls
	10/27/97        PP/ACC fixed bug which changed colortable every time
			       routine called with colortable=-1. Now resets
			       colortable to orig. value before exiting

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/big_ps.pro)


CW_DEFROI2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CW_DEFROI2

 PURPOSE:
   Widget to define a region of interest within a widget drawable. 
 CATEGORY:
   Regions of interest, graphics.
 CALLING SEQUENCE:
   Result = CW_DEFROI2(draw)
 INPUTS:
   Draw = id of drawable to draw the region.  The drawable should
 	have both MOTION and BUTTON events enabled.
 KEYWORD PARAMETERS:
   IMAGE_SIZE = the size of the underlying array, expressed
       as a two element vector: [columns, rows].  Default =
       drawable size / zoom.
   OFFSET = offset of lower left corner of image within the
       drawable.  Default = [0,0].
   ORDER = if set, return inverted subscripts, as if the array
       were output from top to bottom.
   RESTORE = Set to restore the drawable to its previous appearance
       on exit.  Otherwise, the regions remain on the drawable.
   ZOOM = if the image array was expanded (via REBIN for example)
       specify this two element vector containing the expansion
       factor in X and Y.  Default = [1,1].  Must be integer.
   GROUP_LEADER, FLOATING = use these to make it a floating widget
       that can't be obscured
 OUTPUTS:
      Result = subscripts of points within the region[s] defined.
       If no region was defined, a scalar -1 is returned.
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       The regions are drawn within the drawable.  Set the RESTORE
       keyword to undo the damage.  
 RESTRICTIONS:
   This is a MODAL widget.  No other widget applications will be
   responsive while this widget is in use.

 PROCEDURE:
   Complicated.
 EXAMPLE:
   To obtain the average of the counts of a region within a drawable:
   Assume A = the array of interest, n columns, m rows, and that
   it is displayed in drawable D, at offset X=20, Y=100, and zoomed
   with a factor of 2:
       TV, REBIN(A, M*2, N*2), 20, 100     ;Display the image
       q = CW_DEFROI2(D, ZOOM=[2,2], OFFSET=[20,100], IMAGE_SIZE=[m,n])
       if q(0) ne -1 then print,'Average = ', total(a(q))/n_elements(q)
       
 MODIFICATION HISTORY:
   DMS, RSI, December, 1993.  Written.
   Added FLOATING and GROUP_LEADER keywords and renamed CW_DEFROI2.
      RSH, RITSS, 5 Oct. 1999
   Omit TVCRS for non-MacOs.  RSH, RITSS, 30 Aug 2000
   Skip events not named WIDGET_DRAW.  RSH, RITSS, 31 Aug 2000

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/cw_defroi2.pro)


EXAMDISPLAY

[Previous Routine] [Next Routine] [List of Routines]
   NAME:
                 EXAMDISPLAY

   PURPOSE:
      Object-oriented image display widget for image display and for
      numerical examination via plots and listings.

   EXPLANATION:
      These routines set up an object-oriented widget for image display
      and examination.  The object orientation is in the programming
      method, not the graphics, which are traditional IDL direct graphics.
      For arguments, see the individual routines below, especially the
      init method, and also imgdisplay__define.pro, which sets up the 
      object from which this one inherits.

   INHERITS:
      imgdisplay

   CATEGORY:
      Widgets.

   CALLING SEQUENCE FOR INITIALIZATION:
      new = obj_new('examdisplay', parent, keywords=.....)

   ARGUMENT:
      parent:          widget ID of parent base widget

   KEYWORD INPUTS:
      See imgdisplay__define.pro
      Also there are the following:
      header:    Image header
      log_tag:   Initial tag for display's log file.   Default="examdisp"

   RESTRICTIONS:
      8-bit displays only. 

   MODIFICATION HISTORY:
      Written by R. S. Hill, Raytheon ITSS, 4 Aug 99
      Various upgrades and bugfixes.  RSH, 15 Sep 99
      Add logging of output data.  RSH, 21 Mar 2000
      Square brackets for subscripts.  Initial log filename tag 
          is an input.  RSH, 27 June 2000
      Destroy help button when exam subwidget morphs.  Fixed font
          for dataset listings.  RSH, 20 Aug 2000
      Aperture photometry.  Style altered so the you don't have
          to keep pressing the EXAMINE button.  More subwidgets
          stay in existence until dismissed.  RSH, 31 Aug 2000
      Aperture growth curve photometry.  Whole-image statistics.
          RSH, 6 Sep 2000
      Fixed small image display in growth curve phot for big
          radii.  RSH, 20 Sep 2000

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/examdisplay__define.pro)


GANGDISPLAY

[Previous Routine] [Next Routine] [List of Routines]
   NAME:
                 GANGDISPLAY

   PURPOSE:
      Object-oriented image display widget for synchronized displays.

   EXPLANATION:
      These routines set up an object-oriented widget for synchronized
      (ganged) image displays.  The object orientation is in the programming
      method, not the graphics, which are traditional IDL direct graphics.

      For arguments, see the individual routines below, especially the
      init method.  See also imgdisplay__define.pro, and
      repeater__define.pro, which set up the objects from which this 
      one inherits directly.

      Using the displays created by this object, the programmer can
      replicate zooming and panning for two different images.
      One display is the "sender" and the others are "receivers".
      Double-clicking in a display window of a receiver turns it into
      sender.

   INHERITS:
      imgdisplay   - image display and readout widget
      repeater     - object to replicate and propagate events 
                     from one widget to another

   CATEGORY:
      Widgets.

   CALLING SEQUENCE FOR INITIALIZATION:
      new = obj_new('gangdisplay', parent, prev, first, keywords=.....)

   ARGUMENTS:
      See also the objects from which this one inherits.
      PARENT:    Widget ID of parent base widget
      PREV:      Object reference for previous display in chain    
      FIRST:     Object reference for first display in chain

   KEYWORDS:
      BLINKABLE:   NOT IMPLEMENTED.  If set, endow displays with blink
                   capability.
      _EXTRA:      The other keywords needed by IMGDISPLAY, which see.

   MODIFICATION HISTORY:
      Written by R. S. Hill, Raytheon ITSS, 23 April 1999
      11 May 1999 - added scale synchronizing button.  RSH
      24 May 1999 - changed call to ::v to call to ::draw.  RSH
      27 May 1999 - Correct processing of double click
                    if already sender.  RSH

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/gangdisplay__define.pro)


GANGEXAMINE

[Previous Routine] [Next Routine] [List of Routines]
   NAME:
                 GANGEXAMINE

   PURPOSE:
      Object-oriented image display widget for synchronized displays
      permitting interactive examination of the image arrays.

   EXPLANATION:
      These routines set up an object-oriented widget for synchronized
      (ganged) image displays.  The object orientation is in the programming
      method, not the graphics, which are traditional IDL direct graphics.

      For arguments, see the individual routines below, especially the
      init method.  See also examdisplay__define.pro, and
      repeater__define.pro, which set up the objects from which this 
      one inherits directly.

      Using the displays created by this object, the programmer can
      replicate zooming and panning for two different images.
      One display is the "sender" and the others are "receivers".
      Double-clicking in a display window of a receiver turns it into
      sender.

   INHERITS:
      examdisplay  - image display and readout widget
                     (inherits in turn from imgdisplay)
      repeater     - object to replicate and propagate events 
                     from one widget to another
   CATEGORY:
      Widgets.

   CALLING SEQUENCE FOR INITIALIZATION:
      new = obj_new('gangexamine', parent, prev, first, keywords=.....)

   ARGUMENTS:
      Parent:    Widget ID of parent base widget
      Prev:      Object reference for previous display in chain    
      First:     Object reference for first display in chain

   KEYWORDS:
      SYNC:        If set, create a button to propagate display scaling
                   from sender to other displays.
      BLINKABLE:   NOT IMPLEMENTED.  If set, endow displays with blink
                   capability.
      _EXTRA:      The other keywords needed by EXAMDISPLAY, which see.


   MODIFICATION HISTORY:
      Written by R. S. Hill, Raytheon ITSS, 23 April 1999
      11 May 1999 - Added scale synchronizing button.  RSH
      24 May 1999 - Changed call to ::v to call to ::draw.  RSH
      27 May 1999 - Correct processing of double click
                    if already sender.  RSH
      14 Sep 1999 - Call examdisplay cleanup routine.  RSH
      29 Aug 1999 - Propagate viewport updates.  Blinking.  RSH

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/gangexamine__define.pro)


HISTSCL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       HISTSCL

 PURPOSE:
       Wrapper for IDL histogram equalization.

 CATEGORY:
       Image processing

 CALLING SEQUENCE:
       Result = HISTSCL( Image )

 INPUT POSITIONAL PARAMETERS:
       Image:    Image to be scaled; can actually be any array.

 INPUT KEYWORD PARAMETERS:
       MINVAL:   Minimum value for stretch.  Default=min(Image)
       MAXVAL:   Maximum value for stretch.  Default=max(Image)
       TOP:      Top value for output.  Default=!D.table_size-1

 FUNCTION RESULT:
       Byte array with sqrt stretch.  Negative and zero values are
       included nicely in the stretch range instead of being clipped.

 MODIFICATION HISTORY:
       Written by:     RSH, RITSS, 29 August 2000

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/histscl.pro)


IMGDISPLAY

[Previous Routine] [Next Routine] [List of Routines]
              Object Oriented Widget for Image Display and Hardcopy

 NAME:
       IMGDISPLAY

 PURPOSE:
       This file contains code for an object-oriented image display 
       widget.

 EXPLANATION:
       The programming is object-oriented, but the graphics are
       in direct graphics mode, not object graphic.  This widget
       lets the user adjust the image scaling and contrast and print
       out hard copies.  

 CATEGORY:
       Widgets.

 CALLING SEQUENCE FOR INITIALIZATION:
       new = obj_new('imgdisplay', parent, keywords=.....)

 ARGUMENT:
       parent:          widget ID of parent base widget

 KEYWORD INPUTS:
       xsize, ysize:    dimensions of total image area, pixels
       x_scroll_size, y_scroll_size:  dimensions of scrolling
                        viewport, if desired
       uvalue:          arbitrary user value
       kill_button:     include a button to destroy the widget cleanly
       kill_dialog:     ask user "really?" before killing widget
       fixedfont:       font for data entry fields
       refresh:         make image refreshable; the widget
                        will carry around its own pixmap backup(s)
       subwindow:       X0,Y0, NX, NY specifying a section of the
                        total window that will be used for image
                        display (and be separately refreshable if
       title:           title of generated hardcopy
       nocontrols:      do not generate image display controls
       scale_template:  another IMGDISPLAY from which to get
                        image scaling parameters
       bottom, ncolors: specify a section of the color table
                        to be used, leaving entres 0...bottom-1
                        for graphics colors
       ps_dialog:       on generating hardcopy, prompt user for file
                        name
       nobuttons:       do not generate any control buttons at all
       zoomwin:         generate a zoom window
       panwin:          generate a pan window
       readout:         generate a pixel readout
       vertical:        put readout all the way at bottom

 OUTPUTS:
       result = ID of immediate child of parent

 RESTRICTIONS:
       This widget is self-contained and doesn't return
       any events to the outside world.  It is a subordinate widget
       and must be generated as a child of some other base.

 MODIFICATION HISTORY:
       Converted to object-oriented code from cw_sig_display.pro,
           3 Mar 99, RSH, RITSS
       Several new capabilities.  23 April 1999 RSH
       Spiffed up documentation, make ::V routine cleaner, fixed
           bugs, added kill_dialog.  29 April 1999 RSH
       Several small changes.  11 May 1999 RSH
       Changed name of ::v to ::draw, as more conventional naming.
           21 May 1999
       Some cursor debugging.  24 May 1999 RSH
       Cursor outputs not given if no image.  A pixmap memory leak
           fixed.  14 July 1999  RSH
       Fixed problem if zoom box is bigger in at least on dimension
           than the main display.  23 July 1999 RSH
       Size function now returns more info.  28 July 1999 RSH
       Fixed bug in setting boxcolor.  2 Aug 1999 RSH
       Made popup group leader of xloadct.  5 Aug 1999 RSH
       Changed readouts to label widgets.  14 Sep 1999 RSH
       Add NOOLDZOOM to ::DRAW so that a random zoom shadow
           can be suppressed.  5 Oct 1999 RSH
       Fixed bug trying to read from zoom window with no contents.
           13 Oct 1999 RSH
       INIT routine forces device to x.  21 Mar 2000 RSH
       Redisplay button.  Scale pan window same as main window.
           21 Mar 2000 RSH
       Use tracking events to make sure mouse presses/releases don't
           get mixed up.  Force pan window to have same scaling
           as main window.  8 May 2000 RSH
       Change label of xloadct button.  Wset main window before leaving
           event handler.  17 May 2000 RSH
       Subscripts surrounded by square brackets instead of
           parentheses.  Thick=1 added to plots calls.  27 June 2000 RSH
       Changed FIELDFONT to FIXEDFONT and use it in data listings.
           Save viewport in info structure.  Emulated events assumed
           anonymous.  Byte image instead of pixmap used to generate
           zoom and pan displays to work better with 24 bit.  REDRAW
           distinct from REFRESH added to support TrueColor visual.
           TICKLE to force cursor move into main graphics window.
           ZOOMDRAW modularized.  Sqrt and hist_equal
           scaling added.  Togglable crosshair in zoom window.
           XCOLORS (Fanning routine) instead of XLOADCT, to support
           24 bits.  29 Aug 2000 RSH
       Fixed bug in SIZE method if no zoom window.  RSH, 31 Aug 2000
       Clamped cursor X and Y coords at image size.  RSH, 21 Sep 2000
 

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/imgdisplay__define.pro)


IMGDISPLAY::DISPLAY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGDISPLAY::DISPLAY

 PURPOSE:
       This procedure does the image scaling for the imgdisplay 
       object/widget.

 CATEGORY:
       Widgets, image processing

 CALLING SEQUENCE:
       obj->DISPLAY, graph, Image, Min_sig, Max_sig

 INPUT POSITIONAL PARAMETERS:
       Graph:        Graphics window ID for display (NOT the 
                     draw widget ID)
       Image:        Image to be displayed
       IF /pixelunits is set:
       Min_sig:      Minimum of stretch in image units.
       Max_sig:      Maximum of stretch in image units.
       IF pixelunit not set:
       Min_sig:      Minimum of stretch in std devs above or below
                     mean.  
       Max_sig:      Maximum of stretch in std devs above or below
                     mean.

 INPUT KEYWORD PARAMETERS:
       SCTYPE:       One of 'LINEAR', 'LOG', 'SQRT', 'HIST'.
                     Default='LINEAR'
       PS:           Use big_ps to display image to Postscript.  
                     Default = display to X window 
       TITLE:        Title of Postscript display.  Default=
                     'Display Dump'
       FILENAME:     Filename of Postscript output.  Default=
                     'sig_display.ps'
       SUBWINDOW:    [xmin,ymin,xmax,ymax] defining region of display
                     that is actually to be used.  Default=all.
       PIXELUNITS:   Set this flag to work in data units rather than
                     units of std dev.  Default=not set, units
                     are std dev relative to mean
       NCOLORS:      Number of byte values to scale to.
       BOTTOM:       Lowest byte value to scale to.

 OUTPUT KEYWORD PARAMETERS:
       GRAYIMG:      Scaled byte image actually displayed.
       INFO:      Actual min and max of stretch in data units.
       MIN_OTHER: Min of stretch in "other" units (sigmas if
                  /pixelunits set, data units of pixelunits not set)
       MAX_OTHER: Max of stretch in "other" units.


 MODIFICATION HISTORY:
  Bare bones.  RSH, HSTX, 27 Oct. 1997
  Postscript.  RSH, HSTX, 29 Oct. 1997
  Zeroes display window before putting up image.  RSH, 3 Apr. 1998
  3-sigma clip before taking final sigma.  RSH, RSTX, 4 May 1998
  Redisplay with good notations.  RSH, 4 May 1998
  Use 1024 random points rather than subimage for sigma.  RSH, 29 Dec 98
  NCOLORS, BOTTOM.  RSH, 25 Feb 99

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/imgdisplay__define.pro)


IMGDISPLAY::GETSCALE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGDISPLAY::GETSCALE

 PURPOSE:
       This procedure returns an array the same length as the color
       table, telling what data value corresponds to each element.

 CATEGORY:
       Widgets.

 CALLING SEQUENCE:
       obj->GETSCALE, Scale, LENGTH=length

 INPUT POSITIONAL PARAMETERS:
       Id:       Widget ID of CW_SIG_DISPLAY compound widget.

 INPUT KEYWORD PARAMETERS:
       LENGTH:   If you want the returned vector to have a different
                 length from !D.table_size.

 OUTPUT POSITIONAL PARAMETERS:
       Scale:    Floating point vector giving the data value for
                 every color.

 MODIFICATION HISTORY:
       Written by:     RSH, RITSS, 6 Jan 98

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/imgdisplay__define.pro)


IMGDISPLAY::RESIZE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       IMGDISPLAY::RESIZE

 PURPOSE:
       This procedure resizes the main draw window.

 CATEGORY:
       Widgets.

 CALLING SEQUENCE:
       obj->RESIZE

 INPUT KEYWORD PARAMETERS:
       XYTOTAL:      2-element vector giving the X and Y size of the
                     total image area.
       XYVIEWPORT:   2-element vector giving the X and Y of the
                     portion actually seen and scrolled.
       SUBWINDOW:    4-element vector giving portion of total display
                     actually used to receive data.  Format is
                     [X0, Y0, NX, NY].

 MODIFICATION HISTORY:
       Written by:     RSH, RITSS, 6 Jan 98

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/imgdisplay__define.pro)


LOGSCL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LOGSCL

 PURPOSE:
       This scales an image using a log function table.

 CATEGORY:
       Image processing

 CALLING SEQUENCE:
       Result = LOGSCL( Image )

 INPUT POSITIONAL PARAMETERS:
       Image:    Image to be scaled; can actually be any array.

 INPUT KEYWORD PARAMETERS:
       MINVAL:   Minimum value for log stretch.  Default=min(Image)
       MAXVAL:   Maximum value for log stretch.  Default=max(Image)
       TOP:      Top value for output.  Default=!D.table_size-1

 FUNCTION RESULT:
       Byte array with log stretch.  Negative and zero values are
       included nicely in the stretch range instead of being clipped.

 MODIFICATION HISTORY:
       Written by:     RSH, RITSS, 5 Jan 99
       16 Feb 99 - TOP keyword added.  RSH
        3 Jul 00 - RETALL changed to RETURN in doc section;
                   square brackets.  RSH
       25 Jul 00 - RETURN in doc section returns -1.  RSH

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/logscl.pro)


QSTAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   qstat

 PURPOSE:
   Quick statistics on an array.

 MAJOR TOPICS:
   Statistics.

 CALLING SEQUENCE:
   qstat, data, mean, sig, npix, pc50

 INPUT PARAMETERS:
   data        Array of numbers to be characterized.

 INPUT KEYWORDS:
   noprint     Flag.  Omit printing if set.
   nf          Numerical format.
   textout     The usual GSFC TEXTOUT parameter.
   descrip     Descriptive line for hardcopy.
                       
 OUTPUT PARAMETERS:
   mean        Mean of data array.
   pc50        Median of data array.
   sig       Standard deviation (scatter) of data array.
   npix        Number of elements in data array.

 HISTORY:  11 Dec. 1996 - Written.  RSH, HSTX
            7 Feb. 1997 - Help added.  RSH 
           19 Aug. 1998 - Min and max printed.  RSH
           28 Aug. 1998 - Robust stats added.  RSH
           21 Sep. 1998 - Robust keyword.  RSH
           22 Sep. 1998 - Forward_function decl.  RSH
           28 Oct. 1998 - Finite numbers only.  RSH
            2 Nov. 1998 - Robust stuff deleted, improved display.  RSH
            5 Aug. 1999 - TEXTOUT copied from imlist.pro.  RSH
           28 June 2000 - IDL V5 and idlastro standards.  RSH
           20 Sep. 2000 - More readable format.  RSH

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/qstat.pro)


READSTRING

[Previous Routine] [Next Routine] [List of Routines]
 NAME:                 readstring
       
 PURPOSE:  Read text file into a string array.

 CATEGORY: Text processing

 CALLING SEQUENCE: readstring,filename,array

 INPUT ARGUMENTS:  
       filename - input file name

 OUTPUT ARGUMENTS:
       array - string array with contents of file

 INPUT KEYWORD PARAMETER:
       maxline - maximum number of lines allowed; default=1000

 MODIFICATION HISTORY:
   30 Jun. 1997 - Written.  RSH/HSTX
   28 Jun. 2000 - Square bracket subscripts.  RSH

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/readstring.pro)


REPEATER

[Previous Routine] [Next Routine] [List of Routines]
  NAME:
             REPEATER

  PURPOSE:
     In object-oriented programming using widgets, REPEATER is a 
     base class to replicate events generated in one widget and 
     send them to other widgets that have a similar structure. 

  MOTTO:
     Object-oriented programming is much easier to do
     than to describe.

  EXPLANATION:
     This object is a base class intended to be inherited by
     other more useful classes that need its functionality.

     This object assumes a programming convention whereby the
     INFO structure of a widget (see D. Fanning's book) is
     actually the data portion of an IDL object.  Further, it
     is assumed that the IDs of widgets whose events you might
     want to rebroadcast are kept in data elements (structure 
     tags) of the object.

     The sending and receiving objects must be REPEATERs, by
     inheritance.  Thus to use REPEATER, you have to define a
     child class inheriting both from REPEATER and from the other
     widget/object class you are really interested in.  An
     example is GANGDISPLAY, which inherits from REPEATER and
     IMGDISPLAY, and is used in the program CLEANTEST.

  USAGE:
     Assume you have defined a class called BUNCH_OF_WIDGETS,
     inheriting from REPEATER, e.g.:

        struct = {bunch_of_widgets, inherits my_fancy_display, $
                  inherits repeater}
     (This would be in bunch_of_widgets__define.pro.  You also 
     have to set up an ::init method for bunch_of_widgets
     that calles repeater::init properly.  Assume the first 
     three arguments are the linkage arguments passed to 
     repeater::init, which see below.)

     Then where you're really using them, you do, e.g.:

        base = widget_base(top_level_base, row=1)
        bunch1 = obj_new('bunch_of_widgets', base)
        bunch2 = obj_new('bunch_of_widgets', $
                          base, bunch1, bunch1)
        bunch3 = obj_new('bunch_of_widgets', $
                          base, bunch2, bunch1)
   
     In this example, the args (apart from the class name) are
     parent, prev, and first from repeater::init below.
     
     There isn't room here to teach object-oriented programming, but
     it is hoped that this gives the flavor of using this particular
     object.

  MODIFICATION HISTORY:
     Written by R. S. Hill, Raytheon ITSS, 23 April 1999

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/repeater__define.pro)


RSTAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
   rstat

 PURPOSE:
   Robust statistics on an array.  Results are output in terms of
   "hinges" and "fences" as defined in Tukey's Exploratory Data
   Analysis; these are the quantities that are typically used in
   box-and-whisker plots.  These descriptive statistics are particularly
   useful for telling whether a distribution has long tails or outliers.

 MAJOR TOPICS:
   Statistics.

 CALLING SEQUENCE:
   RSTAT, Data_in, Med, Hinge1, Hinge2, Ifence1, Ifence2, $
       Ofence1, Ofence2, Mind, Maxd

 INPUT PARAMETERS:
   data_in     Array of numbers to be characterized.

 INPUT KEYWORDS:
   noprint     Flag.  Omit printing if set.
   textout     The usual GSFC TEXTOUT parameter.
   descrip     Descriptive line for hardcopy.
                       
 OUTPUT PARAMETERS:
   med         Median.
   hinge1      Lower quartile.
   hinge2      Upper quartile.
   ifence1     Lower one of the inner fences =
                   hinge1 - 1.5*(interquartile interval)
   ifence2     Upper one of the inner fences =
                   hinge2 + 1.5*(interquartile interval)
   ofence1     Lower one of the outer fences =
                   hinge1 - 3*(interquartile interval)
   ofence2     Upper one of the outer fences =
                   hinge2 + 3*(interquartile interval)
   mind, maxd  Min and max.

 HISTORY:   2 Dec. 1996 - Written.  RSH, HSTX
           15 Sep. 1999 - Spiffed up for usage similar to imlist.  RSH
            1 June 2000 - Improved descriptive header for output.  RSH
            3 July 2000 - IDL V5 and idlastro standards.  Check for
                          existence of finite data.  RSH

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/rstat.pro)


SQRTSCL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SQRTSCL

 PURPOSE:
       This scales an image using a square root function table.

 CATEGORY:
       Image processing

 CALLING SEQUENCE:
       Result = SQRTSCL( Image )

 INPUT POSITIONAL PARAMETERS:
       Image:    Image to be scaled; can actually be any array.

 INPUT KEYWORD PARAMETERS:
       MINVAL:   Minimum value for square root stretch.  Default=min(Image)
       MAXVAL:   Maximum value for square root stretch.  Default=max(Image)
       TOP:      Top value for output.  Default=!D.table_size-1

 FUNCTION RESULT:
       Byte array with sqrt stretch.  Negative and zero values are
       included nicely in the stretch range instead of being clipped.

 MODIFICATION HISTORY:
       Written by:     RSH, RITSS, 29 August 2000

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/sqrtscl.pro)


TEXT_NUMBER

[Previous Routine] [Next Routine] [List of Routines]
  NAME:   TEXT_NUMBER

  PURPOSE:
    This procedure gets a string from a text widget, then converts
    it to a number, then back to a string, and stores the final result
    back into the text widget.  The reason for this is so the user
    can see how the program parsed a number he entered.

  INPUT ARGUMENTS:
    Textwidget .......... Widget ID of text widget containing number.

  INOUT/OUTPUT ARGUMENTS:
    Num_value ........... Value of number in text widget.  Zero if
                          numerical format not valid.  Used as input
                          if /SET keyword used.

  INPUT KEYWORDS:
    /LONGTYPE ........... Setting flag causes num_value to be a long
                          integer; otherwise, it's whatever
                          strnumber returns.
    MINV=, MAXV= ........ Num_value is forced into this range.  No
                          defaults.
    FORMAT= ............. IDL numerical format.
    /SET ................ Setting this flag causes Num_value to be
                          put into the widget.

  MODIFICATION HISTORY:
    Split off from CLEAN1.PRO.  RSH, RITSS, 5 Oct. 1999
    Square bracket subscripts.  RSH, RITSS, 28 June 2000
    FORMAT added.  RSH, RITSS, 29 Aug 2000
    SET added.  RSH, RITSS, 20 Sep 2000

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/text_number.pro)


XCOLORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       XCOLORS

 PURPOSE:

       The purpose of this routine is to interactively change color tables
       in a manner similar to XLOADCT. No common blocks are used so
       multiple copies of XCOLORS can be on the display at the same
       time (if each has a different TITLE). XCOLORS has the ability
       to notify a widget event handler, an object method, or an IDL
       procedure if and when a new color table has been loaded. The
       event handler, object method, or IDL procedure is then responsibe
       for updating the program's display on 16- or 24-bit display systems.

 AUTHOR:

       FANNING SOFTWARE CONSULTING
       David Fanning, Ph.D.
       2642 Bradbury Court
       Fort Collins, CO 80521 USA
       Phone: 970-221-0438
       E-mail: davidf@dfanning.com
       Coyote's Guide to IDL Programming: http://www.dfanning.com

 CATEGORY:

       Widgets, Object, Command line.

 CALLING SEQUENCE:

       XCOLORS

 INPUTS:

       None.

 KEYWORD PARAMETERS:

       BLOCK: If this keyword is set, the program will try to block the
          IDL command line. Note that this is only possible if no other
          widget program is currently blocking the IDL command line. It
          is much more reliable to make XCOLORS a modal widget (see the MODAL
          keyword), although this can generally only be done when XCOLORS
          is called from another widget program.

       BOTTOM: The lowest color index of the colors to be changed.

       COLORINFO: This output keyword will return either a pointer to
          a color information structure (if the program is called in
          a non-modal fashion) or a color information structure (if the program
          is called in modal or blocking fashion). The color information
          structure is an anonymous structure defined like this:

             struct = { R: BytArr(!D.Table_Size), $ ; The current R color vector.
                        G: BytArr(!D.Table_Size), $ ; The current G color vector.
                        B: BytArr(!D.Table_Size), $ ; The current B color vector.
                        NAME: "", $                 ; The name of the current color table.
                        INDEX: 0 }                  ; The index number of the current color table.

          If a pointer to the structure is obtained, you will be responsible
          for freeing it to prevent memory leakage:

             XColors, ColorInfo=colorInfoPtr
             Print, "Color Table Name: ", (*colorInfoPtr).Name
             Ptr_Free, colorInfoPtr

          Note that that Name field will be "Unknown" and the Index field will
          be -1 until a color table is actually selected by the user. You are
          responsible for checking this value before you use it.

          When called in modal or blocking fashion, you don't have to worry about freeing
          the pointer, since no pointer is involved:

             XColors, /Block, ColorInfo=colorInfoData
             Help, colorInfoData, /Structure
             Print, "Color Table Name: ", colorInfoData.Name

       DATA: This keyword can be set to any valid IDL variable. If
          the variable is defined, the specified object method or notify
          procedure will be passed this variable via a DATA keyword. This
          keyword is defined primarily so that Notify Procedures are compatible
          with the XLOADCT way of passing data. If is not strictly required,
          since the _EXTRA keyword inheritance mechanism will allow passing
          of *any* keyword parameter defined for the object or procedure that is
          to be notified.

       DRAG: Set this keyword if you want colors loaded as you drag
          the sliders. Default is to update colors only when you release
          the sliders.

       _EXTRA: This keyword inheritance mechanism will pick up and
          pass along to any method or procedure to be notified and keywords
          that are defined for that procedure. Note that you should be sure
          that keywords are spelled correctly. Any mis-spelled keyword will
          be ignored.

       FILE: A string variable pointing to a file that holds the
          color tables to load. The normal colors1.tbl file is used by default.

       GROUP_LEADER: The group leader for this program. When the group
          leader is destroyed, this program will be destroyed.

       MODAL: Set this keyword (along with the GROUP_LEADER keyword) to
          make the XCOLORS dialog a modal widget dialog. Note that NO
          other events can occur until the XCOLORS program is destroyed
          when in modal mode.

       NCOLORS: This is the number of colors to load when a color table
          is selected.

       NOTIFYID: A 2-column by n-row array that contains the IDs of widgets
          that should be notified when XCOLORS loads a color table. The first
          column of the array is the widgets that should be notified. The
          second column contains IDs of widgets that are at the top of the
          hierarchy in which the corresponding widgets in the first column
          are located. (The purpose of the top widget IDs is to make it
          possible for the widget in the first column to get the "info"
          structure of the widget program.) An XCOLORS_LOAD event will be
          sent to the widget identified in the first column. The event
          structure is defined like this:

          event = {XCOLORS_LOAD, ID:0L, TOP:0L, HANDLER:0L, $
             R:BytArr(!D.N_COLORS < 256), G:BytArr(!D.N_COLORS < 256), $
             B:BytArr(!D.N_COLORS < 256), INDEX:0, NAME:""}

          The ID field will be filled out with NOTIFYID[0, n] and the TOP
          field will be filled out with NOTIFYID[1, n]. The R, G, and B
          fields will have the current color table vectors, obtained by
          exectuing the command TVLCT, r, g, b, /Get. The INDEX field will
          have the index number of the just-loaded color table. The name
          field will have the name of the currently loaded color table.

          Note that XCOLORS can't initially tell *which* color table is
          loaded, since it just uses whatever colors are available when it
          is called. Thus, it stores a -1 in the INDEX field to indicate
          this "default" value. Programs that rely on the INDEX field of
          the event structure should normally do nothing if the value is
          set to -1. This value is also set to -1 if the user hits the
          CANCEL button. (Note the NAME field will initially be "Unknown").

          Typically the XCOLORS button will be defined like this:

             xcolorsID = Widget_Button(parentID, Value='Load New Color Table...', $
                Event_Pro='Program_Change_Colors_Event')

          The event handler will be written something like this:

             PRO Program_Change_Colors_Event, event

                ; Handles color table loading events. Allows colors be to changed.

             Widget_Control, event.top, Get_UValue=info, /No_Copy
             thisEvent = Tag_Names(event, /Structure_Name)
             CASE thisEvent OF

                'WIDGET_BUTTON': BEGIN

                     ; Color table tool.

                   XColors, NColors=info.ncolors, Bottom=info.bottom, $
                      Group_Leader=event.top, NotifyID=[event.id, event.top]
                   ENDCASE

                'XCOLORS_LOAD': BEGIN

                     ; Update the display for 24-bit displays.

                   Device, Get_Visual_Depth=thisDepth
                   IF thisDepth GT 8 THEN BEGIN
                   WSet, info.wid

                    ...Whatever display commands are required go here. For example...

                    TV, info.image

                 ENDIF
                 ENDCASE

              ENDCASE

              Widget_Control, event.top, Set_UValue=info, /No_Copy
              END

       NOTIFYOBJ: A vector of structures (or a single structure), with
          each element of the vector defined as follows:

             struct = {XCOLORS_NOTIFYOBJ, object:Obj_New(), method:''}

          where the Object field is an object reference, and the Method field
          is the name of the object method that should be called when XCOLORS
          loads its color tables.

             ainfo = {XCOLORS_NOTIFYOBJ, a, 'Draw'}
             binfo = {XCOLORS_NOTIFYOBJ, b, 'Display'}
             XColors, NotifyObj=[ainfo, binfo]

          Note that the XColors program must be compiled before these structures
          are used. Alternatively, you can put this program, named
          "xcolors_notifyobj__define.pro" (*three* underscore characters in this
          name!) in your PATH:

             PRO XCOLORS_NOTIFYOBJ__DEFINE
              struct = {XCOLORS_NOTIFYOBJ, OBJECT:Obj_New(), METHOD:''}
             END

          "Extra" keywords added to the XCOLORS call are passed along to
          the object method, which makes this an alternative way to get information
          to your methods. Your methods should be defined with an _Extra keyword.

       NOTIFYPRO: The name of a procedure to notify or call when the color
          tables are loaded. If the DATA keyword is also defined, it will
          be passed to this program via an DATA keyword. But note that *any*
          keyword appropriate for the procedure can be used in the call to
          XCOLORS. For example, here is a procedure that re-displays and image
          in the current graphics window:

             PRO REFRESH_IMAGE, Image=image, _Extra=extra, WID=wid
             IF N_Elements(wid) NE 0 THEN WSet, wid
             TVIMAGE, image, _Extra=extra
             END

          This program can be invoked with this series of commands:

             IDL> Window, /Free
             IDL> TVImage, image, Position=[0.2, 0.2, 0.8, 0.8]
             IDL> XColors, NotifyPro='Refresh_Image', Image=image, WID=!D.Window

          Note that "extra" keywords added to the XCOLORS call are passed along to
          your procedure, which makes this an alternative way to get information
          to your procedure. Your procedure should be defined with an _Extra keyword
          as illustrated above.

       TITLE: This is the window title. It is "Load Color Tables" by
          default. The program is registered with the name 'XCOLORS:' plus
          the TITLE string. The "register name" is checked before the widgets
          are defined. If a program with that name has already been registered
          you cannot register another with that name. This means that you can
          have several versions of XCOLORS open simultaneously as long as each
          has a unique title or name. For example, like this:

            IDL> XColors, NColors=100, Bottom=0, Title='First 100 Colors'
            IDL> XColors, NColors=100, Bottom=100, Title='Second 100 Colors'

       XOFFSET: This is the X offset of the program on the display. The
          program will be placed approximately in the middle of the display
          by default.

       YOFFSET: This is the Y offset of the program on the display. The
          program will be placed approximately in the middle of the display
          by default.

 COMMON BLOCKS:

       None.

 SIDE EFFECTS:

       Colors are changed. Events are sent to widgets if the NOTIFYID
       keyword is used. Object methods are called if the NOTIFYOBJ keyword
       is used. This program is a non-blocking widget.

 RESTRICTIONS:

       None.

 EXAMPLE:

       To load a color table into 100 colors, starting at color index
       50 and send an event to the widget identified at info.drawID
       in the widget heirarchy of the top-level base event.top, type:

       XCOLORS, NCOLORS=100, BOTTOM=50, NOTIFYID=[info.drawID, event.top]

 MODIFICATION HISTORY:
       Written by:     David Fanning, 15 April 97. Extensive modification
         of an older XCOLORS program with excellent suggestions for
         improvement by Liam Gumley. Now works on 8-bit and 24-bit
         systems. Subroutines renamed to avoid ambiguity. Cancel
         button restores original color table.
       23 April 1997, added color protection for the program. DWF
       24 April 1997, fixed a window initialization bug. DWF
       18 June 1997, fixed a bug with the color protection handler. DWF
       18 June 1997, Turned tracking on for draw widget to fix a bug
         in TLB Tracking Events for WindowsNT machines in IDL 5.0. DWF
       20 Oct 1997, Changed GROUP keyword to GROUP_LEADER. DWF
       19 Dec 1997, Fixed bug with TOP/BOTTOM reversals and CANCEL. DWF.
        9 Jun 1998, Fixed bug when using BOTTOM keyword on 24-bit devices. DWF
        9 Jun 1998, Added Device, Decomposed=0 for TrueColor visual classes. DWF
        9 Jun 1998, Removed all IDL 4 compatibility.
       21 Oct 1998, Fixed problem with gamma not being reset on CANCEL. DWF
        5 Nov 1998. Added the NotifyObj keyword, so that XCOLORS would work
         interactively with objects. DWF.
        9 Nov 1998. Made slider reporting only at the end of the drag. If you
         want continuous updating, set the DRAG keyword. DWF.
        9 Nov 1998. Fixed problem with TOP and BOTTOM sliders not being reset
         on CANCEL. DWF.
       10 Nov 1998. Fixed fixes. Sigh... DWF.
        5 Dec 1998. Added INDEX field to the XCOLORS_LOAD event structure. This
         field holds the current color table index number. DWF.
        5 Dec 1998. Modified the way the colorbar image was created. Results in
         greatly improved display for low number of colors. DWF.
        6 Dec 1998. Added the ability to notify an unlimited number of objects. DWF.
       12 Dec 1998. Removed obsolete Just_Reg keyword and improved documetation. DWF.
       30 Dec 1998. Fixed the way the color table index was working. DWF.
        4 Jan 1999. Added slightly modified CONGRID program to fix floating divide
          by zero problem. DWF
        2 May 1999. Added code to work around a Macintosh bug in IDL through version
          5.2 that tries to redraw the graphics window after a TVLCT command. DWF.
        5 May 1999. Restore the current window index number after drawing graphics.
          Not supported on Macs. DWF.
        9 Jul 1999. Fixed a couple of bugs I introduced with the 5 May changes. Sigh... DWF.
       13 Jul 1999. Scheesh! That May 5th change was a BAD idea! Fixed more bugs. DWF.
       31 Jul 1999. Substituted !D.Table_Size for !D.N_Colors. DWF.
        1 Sep 1999. Got rid of the May 5th fixes and replaced with something MUCH simpler. DWF.
       14 Feb 2000. Removed the window index field from the object notify structure. DWF.
       14 Feb 2000. Added NOTIFYPRO, DATA, and _EXTRA keywords. DWF.
       20 Mar 2000. Added MODAL, BLOCK, and COLORINFO keywords. DWF
       20 Mar 2000. Fixed a slight problem with color protection events triggering
          notification events. DWF.
       31 Mar 2000. Fixed a problem with pointer leakage on Cancel events, and improved
          program documentation. DWF.
       17 Aug 2000. Fixed a problem with CANCEL that occurred only if you first
          changed the gamma settings before loading a color table. DWF.

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/xcolors.pro)


XCTV

[Previous Routine] [Next Routine] [List of Routines]
   NAME:              XCTV

   PURPOSE:
      This set of procedures implements a display widget for
      roaming, zooming, scaling, and examining pixel values in
      an image.

   CALLING SEQUENCE:
      XCTV, Array [, Header]

   POSITIONAL PARAMETERS:
      Input:
         Array:  Image to be displayed.
         Header: FITS header (optional, if you want RA, Dec output)

   KEYWORD PARAMETERS:
      Input:
         GROUP_LEADER:  Widget group leader, if this widget is
            called from another widget program.
         Of the following size keywords, the most useful are
            XLIM and YLIM; the least useful are XSIZE and YSIZE.
         XLIM, YLIM:  Biggest size of image permitted without
            resorting to scrollbars.
         X_SCROLL_SIZE, Y_SCROLL_SIZE:  Size of visible portion
            of main image display.
         XSIZE, YSIZE:  Size of main image display, if not same
            as input array size.
         ZOOM_SIZE:  Size of zoom window (always square), pixels.
         PSFILE:  Initial file name for hardcopy.  
         PSTITLE:  Initial title for hardcopy.
         PAN_SIZE:  Size of pan window (always square), pixels.
         NO_COPY:  Flag to cause input array to be deallocated
            and kept only in the display widget internal storage.
      Output:
         DSP:   Object reference for display.
         GWIN:  Graphics window identifier for the main window.

   METHOD:
      Uses the EXAMDISPLAY object class, which inherits from
      IMGDISPLAY.  Although the coding is object-oriented,
      this class uses IDL direct graphics, not object graphics.
      IMGDISPLAY provides the capabilities for display, roaming,
      hardcopy, etc.

   USAGE NOTES:
      Layout is a panel containing a  main window, a pan window, 
      and a zoom window:
            pan window - a boxaveraged version of the whole image
            main window - the full resolution image, with scroll
               bars if necessary
            zoom window - a subimage at the cursor position,
               enlarged
      To pan, you put the mouse cursor in the pan window, hold down
      the left mouse button, and move around.  To stop, let go of 
      the mouse button.
      To move the zoom window, you do the same maneuver, except with
      the mouse cursor in the main window.

      The following widget buttons are provided:
         QUIT WIDGET
         Display Controls -- creates a popup to do image scaling,
            hardcopy
         Zoom x.x  -- droplist to choose a zoom factor:
            click it, hold mouse button down, and 
            drag highlight to desired value

   EXAMPLE:
      stis_cr, 10001, h, d
      xctv, d

   MODIFICATION HISTORY:
      Written by R. S. Hill, Raytheon ITSS, 26 May 1999    
      Switched from IMGDISPLAY to EXAMDISPLAY.  RSH, 5 Aug 99
      Added RA, Dec readout.  RSH, 14 Sep 99
      Made header more robust.  Eliminated some unused code.
        RSH, 12 Oct. 1999
      Checked for valid header if input.  RSH, 9 May 2000
      Square brackets on subscripts.  MESSAGE error handling.  
        RSH, 28 June 2000

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/xctv.pro)


XCTV2

[Previous Routine] [Next Routine] [List of Routines]
   NAME:              XCTV2

   PURPOSE:
      This set of procedures implements a display widget for
      roaming, zooming, scaling, and examining pixel values in two
      images simultaneously.

   CALLING SEQUENCE:
      XCTV2, Array1, Array2 [, H1, H2]
      XCTV2, Array1, Array2, H1               ; first header only
      XCTV2, Array1, Array2, 0, H2            ; second header only

   POSITIONAL PARAMETERS:
      Input:
         Array1:  First image to be displayed.
         Array2:  Second image to be displyed.  Generally, the two
                  images should be the same size, since direct
                  comparison is the point.
         H1:      Header of first image (optional)
         H2:      Header of second image (optional)

   KEYWORD PARAMETERS:
      Input:
         GROUP_LEADER:  Widget group leader, if this widget is
            called from another widget program.
         Of the following size keywords, the most useful are
            XLIM and YLIM; the least useful are XSIZE and YSIZE.
         XLIM, YLIM:  Biggest size of image permitted without
            resorting to scrollbars.
         X_SCROLL_SIZE, Y_SCROLL_SIZE:  Size of visible portion
            of main image displays.
         XSIZE, YSIZE:  Size of main image displays, if not same
            as input array sizes.
         ZOOM_SIZE:  Size of zoom window (always square), pixels.
         PSFILE:  Initial file name for hardcopy.  
         PSTITLE:  Initial title for hardcopy.
         PAN_SIZE:  Size of pan window (always square), pixels.
         NO_COPY:  Flag to cause input arrays to be deallocated
            and kept only in the display widget internal storage.
      Output:
         DSP1:    Object reference for the first display.
         DSP2:    Object reference for the second display.  These
                  will in general only be useful if you are trying
                  to do something fancy or to use help,/obj to
                  see how the objects are laid out.
         GWIN:  Two-element array containing the graphics window
            identifiers for the left and right main windows,
            respectively.

   METHOD:
      Uses the GANGEXAM object class, which inherits from both
      IMGDISPLAY and REPEATER.  Although the coding is object-oriented,
      these classes use IDL direct graphics, not object graphics.
      IMGDISPLAY provides the capabilities for display, roaming,
      hardcopy, etc., while REPEATER enables one display to broadcast
      its cursor events to the other, so you can operate both displays
      simultaneously.

   USAGE NOTES:
      Layout is two side-by-side panels.  Each panel contains a 
      main window, a pan window, and a zoom window:
            pan window - a boxaveraged version of the whole image
            main window - the full resolution image, with scroll
               bars if necessary
            zoom window - a subimage at the cursor position,
               enlarged
      To pan, you put the mouse cursor in the pan window, hold down
      the left mouse button, and move around.  To stop, let go of 
      the mouse button.
      To move the zoom window, you do the same maneuver, except with
      the mouse cursor in the main window.
      The left and right images will do the same thing if you are
      panning/zooming in the left panel; if you pan/zoom in the
      right panel, then the left panel will not follow along.  You
      can change this and choose the right panel to be the
      controller:  just double click any of the three windows in the
      right panel.  

      The following widget buttons are provided:
         Top left:
            QUIT WIDGET
            Display Controls -- creates a popup to do image scaling,
               hardcopy for left panel only
            Zoom x.x  -- droplist to choose a zoom factor for left
               panel only:  click it, hold mouse button down, and 
               drag highlight to desired value
         Top right:
            Display Controls -- creates a popup to do image scaling,
               hardcopy for right panel only
            Zoom x.x  -- dropllist to choose a zoom factor for right
               panel only
            Same Scale -- push to make the image scaling in absolute
               units the same for both panels (the pan/zoom controlling
               panel is also the controlling panel for this).

   EXAMPLE:
      stis_read, 10001, h1, d1, readout=1
      stis_read, 10001, h2, d2, readout=2
      xctv2, d1, d2

   MODIFICATION HISTORY:
      Written by R. S. Hill, Raytheon ITSS, 26 May 1999    
      Same-scale button.  RSH, RITSS, 11 May 1999
      Made H1 and H2 positional.  Eliminated some unused code. 
        RSH, 12 Oct. 1999
      Square brackets on subscripts.  MESSAGE error handling.  
        RSH, 28 June 2000

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/xctv2.pro)


XDISPLAYFILE

[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.

	MODAL:	Set this keyword to create a modal widget.

  X[Y]OFFSET:	Set these keywords to position the widget a specific number of
		pixels from the upper left corner of the display.

       NO_BLOCK:  Set to make the widget non-blocking.

       MAXLINES:  Maximum number of lines permitted in displayed file.
                  Default=1000

 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.
	Added modal,xoffset,yoffset keywords; 
	    ported to IDL V5.0.  T. Beck ACC/GSFC  6-3-97
       Added NO_BLOCK.  RSH, RSTX, 10 July 1998

(See /host/bluemoon/usr2/idllib/astron/contrib/bhill/xdisplayfile.pro)