IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 14, 2014, 4:47:22 AM (12 years ago)
Author:
eugene
Message:

define parallel output; copy astrom map table

Location:
branches/eam_branches/ipp-20140904/Ohana/src/photdbc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/photdbc/include/photdbc.h

    r37669 r37745  
    3131int    PARALLEL_MANUAL;
    3232int    PARALLEL_SERIAL;
     33char  *PARALLEL_OUTHOSTS;
    3334
    3435int          HOST_ID;
    3536char        *HOSTDIR;
     37char        *HOSTDIR_OUTPUT;
    3638
    3739// need to get RADIUS from Config
  • branches/eam_branches/ipp-20140904/Ohana/src/photdbc/src/args.c

    r37669 r37745  
    146146  }
    147147
     148  // XXX for the moment, make this selection manual.  it needs to be automatic
     149  // based on the state of the SkyTable
     150  HOSTDIR_OUTPUT = NULL;
     151  PARALLEL_OUTHOSTS = NULL;
     152  if ((N = get_argument (argc, argv, "-parallel-output"))) {
     153    remove_argument (N, &argc, argv);
     154    PARALLEL_OUTHOSTS = strcreate (argv[N]);
     155    remove_argument (N, &argc, argv);
     156  }
     157
    148158  if (argc != 2) usage();
    149159
     
    186196  if (!HOSTDIR) usage();
    187197
     198  HOSTDIR_OUTPUT = NULL;
     199  if ((N = get_argument (argc, argv, "-hostdir-output"))) {
     200    remove_argument (N, &argc, argv);
     201    HOSTDIR_OUTPUT = strcreate (argv[N]);
     202    remove_argument (N, &argc, argv);
     203  }
     204
    188205  VERBOSE = FALSE;
    189206  if ((N = get_argument (argc, argv, "-v"))) {
     
    304321  fprintf (stderr, " photdbc (output)\n\n");
    305322
     323  fprintf (stderr, " parallel options:\n");
     324  fprintf (stderr, "  -parallel:\n");
     325  fprintf (stderr, "  -parallel-output HostTable : HostTable should be relative path in OUTPUT directory\n");
     326  fprintf (stderr, "  -parallel-manual\n");
     327  fprintf (stderr, "  -parallel-serial\n\n");
     328
    306329  fprintf (stderr, " allowed filters / restrictions include:\n\n");
    307330
  • branches/eam_branches/ipp-20140904/Ohana/src/photdbc/src/copy_images.c

    r37378 r37745  
    5555  // MARKTIME("build chip match: %f sec\n", dtime);
    5656
     57  char mapfile[DVO_MAX_PATH];
     58  snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", CATDIR);
     59  AstromOffsetTable *table_src = AstromOffsetMapLoad (mapfile, VERBOSE);
     60
     61  // assign images.coords.offsetMap -> table->map[i]
     62  if (table_src) {
     63    AstromOffsetTableMatchChips (image, Nimage, table_src);
     64  }
     65
    5766  subset = select_images (skylist, image, Nimage, &LineNumber, &Nsubset, FALSE);
     67
     68  if (table_src) {
     69    AstromOffsetTable *table_tgt = AstromOffsetTableInit ();
     70   
     71    off_t i;
     72    for (i = 0; i < Nsubset; i++) {
     73      if (!subset[i].coords.offsetMap) continue;
     74      if (subset[i].coords.Npolyterms != -1) continue; // assert on this?
     75      AstromOffsetTableAddMapFromImage (table_tgt, &subset[i]);
     76    }
     77    snprintf (mapfile, DVO_MAX_PATH, "%s/AstroMap.fits", outdir);
     78    AstromOffsetMapSave (table_tgt, mapfile);
     79    free (table_tgt->imageIDtoTableSeq);
     80    free (table_tgt->map);
     81    free (table_tgt);
     82  }
    5883
    5984  dvo_image_addrows (&out, subset, Nsubset);
     
    76101  SavePhotcodesFITS (filename);
    77102
     103  // free the astrom offset tables
     104  AstromOffsetTableFree (table_src);
     105
    78106  return (TRUE);
    79107}
  • branches/eam_branches/ipp-20140904/Ohana/src/photdbc/src/photdbc_catalogs.c

    r36833 r37745  
    4242    snprintf (outfile, DVO_MAX_PATH, "%s/%s.cpt", outroot, skylist[0].regions[i]->name);
    4343    outcatalog.filename = outfile;
     44
     45    if (HOSTDIR_OUTPUT) {
     46      // parallel-ouput puts the output in a per-host directory (keeps the source sky partition)
     47      snprintf (outfile, DVO_MAX_PATH, "%s/%s.cpt", HOSTDIR_OUTPUT, skylist[0].regions[i]->name);
     48    }
     49
    4450    if (outcatalog.filename == NULL) Shutdown ("error with input catalog name");
    4551
     
    95101  }   
    96102
     103  HostTable *table_output = NULL;
     104  if (PARALLEL_OUTHOSTS) {
     105    table_output = HostTableLoad (outroot, PARALLEL_OUTHOSTS);
     106    if (!table_output) {
     107      fprintf (stderr, "%s not found in %s, please create\n", PARALLEL_OUTHOSTS, outroot);
     108    }
     109  }
     110
    97111  int i;
    98112  for (i = 0; i < table->Nhosts; i++) {
     
    123137    if (CATFORMAT)          { snprintf (tmpline, DVO_MAX_PATH, "%s -set-format %s",    command, CATFORMAT);                     strcpy (command, tmpline); }
    124138    if (CATMODE)            { snprintf (tmpline, DVO_MAX_PATH, "%s -set-mode %s",      command, CATMODE);                       strcpy (command, tmpline); }
     139
     140    if (PARALLEL_OUTHOSTS) {
     141      tmppath = abspath (table_output->hosts[i].pathname, DVO_MAX_PATH);
     142      free  (table_output->hosts[i].pathname);
     143      table_output->hosts[i].pathname = tmppath;
     144      snprintf (tmpline, DVO_MAX_PATH, "%s -hostdir-output %s", command, table_output->hosts[i].pathname); strcpy (command, tmpline);
     145    }
    125146
    126147    fprintf (stderr, "command: %s\n", command);
Note: See TracChangeset for help on using the changeset viewer.