NAME:
  raw2cat

 PURPOSE:
  Determine standard magnitudes of crowded sources for the raw2 catalog.

 DESCRIPTION:
  Works on one night's worth of data

 CATEGORY:
  Photometry

 CALLING SEQUENCE:
  raw2cat,catid,rundate

 INPUTS:
  catid   - String, catid of data you wish to use (ex: PL2010)
  rundate - String, night of data you wish to use (ex. 100704)

 OPTIONAL INPUT PARAMETERS:
 KEYWORD INPUT PARAMETERS:
  nosave - Flag, stops writing into database

 OUTPUTS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
  At the moment, this routine is pretty specific to our local data reductions
   here.  Paths, filter handling, and database setup are all very specific.

 PROCEDURES:
  In a single night's reduced directory, reads the reduc.inf file to get
   rundate and instrument.
  Gets coefficients from psf hdr.
  Reads in data from roboccd for that rundate using objpatt input - for 
   2010 data, objpatt='PL2010%' - and from .sr2 files.
  Subtracts the Stage1 catalog from the data.
  Puts remaining sources through colorsol, which returns final magnitudes.
  Generates Raw2 catalog using input catid - for 2010 data, id='PL2010' -
   and writes into the plphot table of phot database.

 MODIFICATION HISTORY:
  2013/12/15 Written by Erin R. George, Southwest Research Institute
  2014/12/29, MWB, updates for final processing based on new phocal.