# include "absphot.h"

int main (int argc, char **argv) {

  int i, status, Ncatalog;
  Catalog *catalog;
  FITS_DB db;

  SkyList *skylist = NULL;

  // get configuration info, interpret args
  initialize (argc, argv);

  // lock and load the photcode table
  // XXX need to define this
  // if (UPDATE) dvo_photcode_lock (); 

  // restrict to user-specified region
  skylist = find_regions (&db, &UserPatch);

  // load catalog data from selected regions
  catalog = load_catalogs (skylist);
  
  // fit the trend of the obs - ref vs color...
  // XXX define this
  // fit_trend (catalog);

  if (PLOTSTUFF) {
    // XXX define this
    // plot_residuals (catalog);
  }

  if (!UPDATE) exit (0);

  // write out modifications to the photcode table (how do we record historical values?)
  // XXX define these
  // dvo_photcode_update ();
  // dvo_photcode_unlock (); 

  exit (0);
}

