NAME:
  finder
 PURPOSE:   (one line only)
  Interactive finder chart tool
 DESCRIPTION:
  This widget tool will allow you to load a FITS image with astrometric
    information (format generated by astinfo.pro).  From this starting
    point it will resample the image to the scale and orientation needed
    to match your telescope or instrument system.  It has modes to permit
    tracking an object as well as controlling orientation for equatorial
    or alt-az telescopes (with no de-rotator).

  In the main image display window a left click will place the marked at
    that position.  As you move around the window (without clicking) you
    see the coordinates under the cursor and the offset from the current
    marker position.

  Toolbar functions:
    File
      Open Image
        Browse and find a FITS image to be displayed.  Upon sucessfully
          loading an image with astrometric information the display is reset
          for the current scale and orientation but putting the image center
          and marker at the center of this image.  Observatory and time
          settings are not changed.
      Save as PNG
        Snapshot of screen image to a png format graphics file.  The name is
          automatically generated.  The first part of the file name is the
          observatory string as shown in the widget.  Next, the current date
          and time is appended.  These three fields are separated by "_" and
          file suffix is .png.
      Exit
        Quit program.  There is no auto-save of the configuration.

    Tools
      Set Position Angle
        You are prompted for a new position angle for the display.  If in
          equatorial mode this the position of north on the display measured
          clockwise from up.  Center and marker positions are not affected.
      Toggle Horizon Mode
        There are two modes, equatorial and local horizon modes.  In equatorial
          mode the normal display is north up.  in local horizon mode, the
          normal display is the zenith direction to be up.  Any position
          angle in effect is unchanged.
      Toggle Image Flip
        Change the handedness of the display.  The normal display is
        sky-normal (with no rotation and equatorial mode, north is up and
        east is to the left).  This is implemented as an inversion in the
        RA axis.  That means you cannot control the direction of north with
        this control.  Use the position angle control instead.
      Marker to Center
        Shift location of marker to match the current center of the image.
      Center On Marker
        Shift location of image center to match the current position of the
          marker.

    Config
      Load Configuration
        Load and use a configuration setup.  See discussion of CONFIG keyword
           provided below.
      Image Size
        Change image size. You will be asked to input two numbers, the x and
          y sizes of the image to change to.
      Image X Size
        Change image X size. You will be asked to input one number for the
          new x size of the image.
      Image Y Size
        Change image Y size. You will be asked to input one number for the
          new y size of the image.
      Image Scale
        Change the image scale to the provided number in arcsec/pixel.
      Last Config
        Not implemented.

 CATEGORY:
  Astronomy
 CALLING SEQUENCE:
  finder
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
  CONFIG - Name of a configuration file to load on startup.  File suffix used
             for this is '.fdr'.  A configuration file saves the image
             display, orientation, scale information, and the observatory
             information.  At present, the only way to get such a file is to
             make it yourself by hand.  The format is as follows:

    Line 1 - ID line, must say FINDER v1.0 starting at column 1.
    Line 2 - observatory code or location enclosed in quotes.  An observatory
                code is a 3-character string as defined by the Minor Planet
                Center or a a manual position where you list the latitude
                and longitude of the observatory location.  You can provide
                this in either sexigesimal notation or decimal degrees
                (lat and lon are both in degrees in this case).  Direction
                from prime meridian and equator is denoted by a letter (not a
                sign) -- E for east, W for west, N for north and S for south.
    Line 3 - xsize of displayed image.  This is limited to be no bigger than
                80% of your overall screen size.
    Line 4 - ysize of displayed image.  This limited to be no bigger than 95%
                of your overall screen size.
    Line 5 - image scale for displayed image (arcsec/pixel)
    Line 6 - Image flip, 0=no, 1=yes
    Line 7 - Horizon mode, 0=equatorial, 1=local horizon
    Line 8 - position angle (degrees)
             
 OUTPUTS:
 KEYWORD OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
  2010/06/22, Written by Marc W. Buie, Southwest Research Institute
  2010/07/09, MWB, added numerous features
  2011/03/21, MWB, fixed some of the control logic related to the marker
                     tools and added a new "marker to center" tool.
  2016/06/02, MWB, converted to usage of astcvt tools, added support for
                     "standard" WCS supported by Astronomy Users Library
                     tools.  My astrometry information is searched for first,
                     if not found will try extast.
  2016/08/05, MWB, fixed a bug that caused the image to be displayed with the
                     wrong orientation when in the horizon-lock mode.  The
                     image was actually self-consistent with the labels but
                     was not the orientation requested.