NAME:
  raw1cat
 PURPOSE:
  Determine standard magnitudes of isolated sources for the raw1 catalog.
 DESCRIPTION:
  This program is meant to be run in the reduced directory of a single
  observing night. It reads in the rundate, image, and data from the
  roboccd database and the transformation coefficients from the transf
  table in the phot database. It puts all the sources through colorsol
  to generate the standard magnitudes. Then it builds the Raw1 catalog
  for the specified catid and writes it into the plphot table in phot.

  The sources chosen from the data are those that are well separated from
    any other sources in the images.  These are processed with the already
    known all-sky large-aperture photometric transformation.  The individual
    magnitudes are saved to the database in the raw1 catalog, so-called
    because these stars have yet to be averaged across nights.  That step
    is handled by stage1cat.pro

 CATEGORY:
  Photometry
 CALLING SEQUENCE:
  raw1cat,objpatt,catid
 INPUTS:
  objpatt - String of the pattern present in object names. Include a % 
            on the end if it's for more than one object, such as PL2010A 
            and PL2010B. (ex: PL2010%)  (this is the mysql wildcard character)
  catid - String of the id for plphot table in the phot database.
             (ex: PL2010)
 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
 OUTPUTS
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
   Uses a few hard-coded paths and fixed database
      (let us know if you want this generalized)
 PROCEDURES:
  In a single night's reduced directory, reads the reduc.inf file to get
    rundate and instrument.
  Reads in data from roboccd for that rundate using the objpatt input -
    for 2010 data, objpatt='PL2010%'.
  Gets coefficients from transf that have already been generated.
  Puts all sources through colorsol, which returns final magnitudes.
  Generates Raw1 catalog using the input id - for 2010 data, id='PL2010' -
    and writes into the plphot table of phot database.
 MODIFICATION HISTORY:
  2011/01/26 Written by Erin R. George, Southwest Research Institute
  2011/03/17 ERG, Changed the database for the data to be inserted into
                  in light of the creation of the plphot table in the 
                  phot database. Also changed the input from catname to catid.
  2011/03/28 ERG, Subid is now internal - this will be Raw1.
  2011/04/01 ERG, final version.
  2012/03/07 MWB, incorporated into library
  2014/11/11 MWB, incorporated bug fixes on counts of observations that were
                     provided by Erin.