NAME:
  occtime
 PURPOSE:   (one line only)
  Extract simple occultation timing from an occultation lightcurve
 DESCRIPTION:
  This program reads a lightcurve file that containes an occultation and 
    fits a perfect occultation model to get the start and stop times of
    the occultation.
  There are other files expected that provide supporting information for
    the occultation.
   xtrack.in   - contains general information about the occultation
                   leading and trailing blanks on a line do not matter
                   any lines after the required set are ignored
     line 1 - Object code (for geteph, see ephem.pro)
     line 2 - RA of the star (sexigesimal string)
     line 3 - Dec of the star (sexigesimal string)
     line 4 - geocentric UT date and time of appulse
     line 5 - 1-sigma down-track uncertainty (in seconds)
     line 6 - 1-sigma cross-track uncertainty (in km)

   crosstrack.dat - created by occxtrack

   lcinfo.dat  - definition of region of fitting for the lightcurves for
                   all stations
     col 1 - Site code
     col 2 - Number of points in perfect model
     col 3 - Start time of model relative to prediction
     col 4 - End time of model relative to prediction
     col 5 - point number of ingress (first point showing a drop)
     col 6 - point number of egress (last point showing a drop)

 CATEGORY:
  Occultations
 CALLING SEQUENCE:
  occtime,fnlc
 INPUTS:
  fnlc - Name of lightcurve file.  The data are expected to be in tabular
           format, space separated.  The first column is often the point
           number but is not used by this program.  Only these columns are
           used:
           col 2 - Julian Date of lightcurve measurement (mid-time, UTC)
           col 3 - Flux from target star, usually normalized

           Anything after column 3 is ignored but usually contains
             then non-normalized flux, x,y position, and FWHM in pixels.

           If the filename is of the form ..lc, the
              string is used to provide the default value for TEAM

 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
  NOSAVE - Flag, if set suppresses saving the output grapics
  TEAM   - String, name of the team/data [default from fnlc if the right form]
  XRANGE - time range to plot [seconds], default is to plot it all
  YRANGE - flux range to plot, default is to plot full range
  NOTSIG - Flag, if set suppresses showing the time sigma hacks on the plot
  MCMC   - Flag, if set runs a MCMC fit and error analysis run on the
              event.  This should not be run until you have a good simple
              fit for the event and lcinfo.dat is set properly.  Note that
              that the event times found in chords.dat are not used by
              this program and are not updated automatically.
 OUTPUTS:
   plots mostly but window 0 is saved to Results/_lc.png
 KEYWORD OUTPUT PARAMETERS:
 CONFIGURATION:
   File: config.ini
   [global]
     objectid - string with the object id (see ephem.pro)
     ora      - Apparent position of star at time of occultation
     odec     - Apparent position of star at time of occultation
     geomid   - UT date and time of geocentric closest approach
     tsig     - 1-sigma uncertainty in event time (down-track) in seconds
     xsig     - 1-sigma cross-track uncertainty in km
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 MODIFICATION HISTORY:
  Written by Marc W. Buie, Southwest Research Institute, 2020/01/31
  2020/03/29, MWB, code simplifications
  2020/10/06, MWB, added support for config.ini file