NAME: 
  colorsol
 PURPOSE: 
  Find the standard color of an unknown star.
 DESCRIPTION:
 CATEGORY:
  Photometry
 CALLING SEQUENCE:
  colorsol, stand,fil,jd,am,serial,inst,instsig, $
             color1,color2,trans1,trsig1,jdref1,trans2,trsig2,jdref2, $
             object,std1,stdsig1,std2,stdsig2,stdcol,stdcolsig

 INPUTS:
  stand    - String array of standard names.  (See coord.)
  fil      - String array of filter names for observations.
  jd       - Double precision array of the JD of observations.
  am       - Floating point array of the airmass of observations.
  serial   - Serial number of observation.
   inst     - Instrumental magnitude
   instsig  - Uncertainty of the instrumental magnitude
  color1   - Name of filter for the first color.
  color2   - Name of filter for the second color.
   trans1   - Transformation coefficients (vector) for first filter.
                trans1(0) = principal extinction coefficient
                trans1(1) = second order extinction coefficient
                trans1(2) = color term
                trans1(3) = zero-point
                trans1(4) = time-dependent extinction term
  trsig1   - Uncertainty on the transformation coefficients (vector).
  jdref1   - Time reference point for extinction (first filter).
   trans2   - Transformation coefficients (vector) for second filter.
   trsig2   - Transformation coefficients (vector) for second filter.
  jdref2   - Time reference point for extinction (second filter).
  
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
  BADFLAGS - Array of flags that mark data bad (if true).
  DATABASE - Name of MYSQL database to save reduced observations.
                 The default is 'phot'. 
  DB       - Flag, if set, reduced observations will be saved to database.
  DVERBOSE-  Code for dbphot and other routines for db transaction verbosity.
  FILTER1 -  Name of the first filter
  FILTER2 -  Name of the second filter
  FULL    -  Flag, if true, will enable the complete printout, otherwise
                just the final summary for each object will be printed.
  NOEDIT  -  If set, suppresses the interactive editing of the star data.
  NOPRINT -  Flag, if true, will inhibit the summary printout to the screen.
  PATH    -  If SAVE is set, this points to the directory where
                results should be written.
  REFID -    String uniquely identifying observing run. This is used in 
               updating the data table with the reduced observations in the 
               database. It must be specified if DB is used.
  SAVE    -  Flag, if true, will save the final photometry to an output file,
                and, if DB selected, to database.
  TABLE    - Name of table in MYSQL database to save reduced observations.
                The default is 'data'. 
 OUTPUTS:
  object    - Name(s) of program object.
   std1      - Standard magnitude of first filter.
   stdsig1   - Uncertainty of the standard magnitude.
   std2      - Standard magnitude of second filter.
   stdsig2   - Uncertainty of the standard magnitude.
   stdcol    - Standard color, first filter - second filter.
   stdcolsig - Uncertainty of the standard color.
 KEYWORD OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 Data for objects completely removed from colorsol reduction due to bad
 flags will not be removed from the hard files.
 PROCEDURE:
 MODIFICATION HISTORY:
  Written by Marc W. Buie, Lowell Observatory
  96/11/25, MWB, added PATH, SAVE, FILTER1, and FILTER2 keywords
  97/02/11, MWB, added new transformation support (k(t))
  97/02/25, MWB, added NOEDIT keyword and actions
 2006/08/14, Peter L. Collins, Lowell Observatory
             add database support (save reduced observations) and header cleanup.
 2006/09/26, PLC, add INSTRUMENT keyword to pass through to dbphot.
 2006/10/17, PLC, modify effect of SAVE flag to control db update also.
 2006/12/07, PLC, replace instrument and rundate keywords by REFID and
                   change calls to dbphot.
 2006/12/10, PLC, fix bug involving TABLE not passing through to dbphot.
 2006/12/28, PLC, add DVERBOSE keyword, add 1 additional entry to 
                  the db data table per object for the solved color value, and
                  fix handling of hard files for refid length.
 2007/01/04, PLC, further fix for the hard files.
 2007/02/05, PLC, fix for adding color name to database entries. Improve logic
                  for bad flags and data scrubbing.