Changeset 37745 for branches/eam_branches/ipp-20140904
- Timestamp:
- Dec 14, 2014, 4:47:22 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/photdbc
- Files:
-
- 4 edited
-
include/photdbc.h (modified) (1 diff)
-
src/args.c (modified) (3 diffs)
-
src/copy_images.c (modified) (2 diffs)
-
src/photdbc_catalogs.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/photdbc/include/photdbc.h
r37669 r37745 31 31 int PARALLEL_MANUAL; 32 32 int PARALLEL_SERIAL; 33 char *PARALLEL_OUTHOSTS; 33 34 34 35 int HOST_ID; 35 36 char *HOSTDIR; 37 char *HOSTDIR_OUTPUT; 36 38 37 39 // need to get RADIUS from Config -
branches/eam_branches/ipp-20140904/Ohana/src/photdbc/src/args.c
r37669 r37745 146 146 } 147 147 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 148 158 if (argc != 2) usage(); 149 159 … … 186 196 if (!HOSTDIR) usage(); 187 197 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 188 205 VERBOSE = FALSE; 189 206 if ((N = get_argument (argc, argv, "-v"))) { … … 304 321 fprintf (stderr, " photdbc (output)\n\n"); 305 322 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 306 329 fprintf (stderr, " allowed filters / restrictions include:\n\n"); 307 330 -
branches/eam_branches/ipp-20140904/Ohana/src/photdbc/src/copy_images.c
r37378 r37745 55 55 // MARKTIME("build chip match: %f sec\n", dtime); 56 56 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 57 66 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 } 58 83 59 84 dvo_image_addrows (&out, subset, Nsubset); … … 76 101 SavePhotcodesFITS (filename); 77 102 103 // free the astrom offset tables 104 AstromOffsetTableFree (table_src); 105 78 106 return (TRUE); 79 107 } -
branches/eam_branches/ipp-20140904/Ohana/src/photdbc/src/photdbc_catalogs.c
r36833 r37745 42 42 snprintf (outfile, DVO_MAX_PATH, "%s/%s.cpt", outroot, skylist[0].regions[i]->name); 43 43 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 44 50 if (outcatalog.filename == NULL) Shutdown ("error with input catalog name"); 45 51 … … 95 101 } 96 102 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 97 111 int i; 98 112 for (i = 0; i < table->Nhosts; i++) { … … 123 137 if (CATFORMAT) { snprintf (tmpline, DVO_MAX_PATH, "%s -set-format %s", command, CATFORMAT); strcpy (command, tmpline); } 124 138 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 } 125 146 126 147 fprintf (stderr, "command: %s\n", command);
Note:
See TracChangeset
for help on using the changeset viewer.
