# include "addstar.h"
# include "2mass.h"

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

  char *path;
  int i;
  SkyTable *sky, *sky2mass;
  AddstarClientOptions options;

  // need to construct these options with args_load2mass...
  options = ConfigInit (&argc, argv);
  options = args_load2mass (argc, argv, options);

  sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, SKY_DEPTH, VERBOSE);
  SkyTableSetFilenames (sky, CATDIR, "cpt");
  
  path = TWO_MASS_DIR_AS;

  // the accel.dat file has the raw filenames
  // test if the file exists, or else try the .gz version
  sky2mass = load2mass_acc (path, "accel.dat");
  
  for (i = 0; i < sky2mass[0].Nregions; i++) {
    fprintf (stderr, "loading %s\n", sky2mass[0].filename[i]);
    load2mass_as_rawdata (sky, sky2mass[0].filename[i], options);
  }
  exit (0);
}  
