Changeset 38446
- Timestamp:
- Jun 12, 2015, 9:43:43 PM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150419/Ohana/src/dvomerge
- Files:
-
- 29 edited
-
Makefile (modified) (1 diff)
-
include/dvomerge.h (modified) (1 diff)
-
src/LoadCatalog.c (modified) (1 diff)
-
src/LoadImages.c (modified) (1 diff)
-
src/args.c (modified) (3 diffs)
-
src/dvo_image_merge_dbs.c (modified) (3 diffs)
-
src/dvoconvert.c (modified) (5 diffs)
-
src/dvomergeContinue.c (modified) (1 diff)
-
src/dvomergeContinue_threaded.c (modified) (1 diff)
-
src/dvomergeCreate.c (modified) (5 diffs)
-
src/dvomergeFromList.c (modified) (1 diff)
-
src/dvomergeImageIDs.c (modified) (4 diffs)
-
src/dvomergeUpdate_catalogs.c (modified) (7 diffs)
-
src/dvomergeUpdate_threaded.c (modified) (1 diff)
-
src/dvorepairCPT.c (modified) (2 diffs)
-
src/dvorepairDeleteImageList.c (modified) (5 diffs)
-
src/dvorepairDeleteImagesByExternID.c (modified) (6 diffs)
-
src/dvorepairFixCPT.c (modified) (3 diffs)
-
src/dvorepairFixImages.c (modified) (2 diffs)
-
src/dvorepairFixTables.c (modified) (4 diffs)
-
src/dvorepairImageVsMeasure.c (modified) (1 diff)
-
src/dvorepairImagesVsMeasures.c (modified) (2 diffs)
-
src/dvosecfilt_catalogs.c (modified) (4 diffs)
-
src/dvoutils_load_image_index.c (modified) (1 diff)
-
src/dvoutils_uniq_images.c (modified) (1 diff)
-
src/dvoverify_utils.c (modified) (4 diffs)
-
src/merge_catalogs.c (modified) (1 diff)
-
src/merge_catalogs_new.c (modified) (1 diff)
-
src/merge_catalogs_old.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/Makefile
r38285 r38446 166 166 $(BIN)/dvoutils.$(ARCH) : $(DVOUTILS) 167 167 168 INSTALL = dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client dvoverify 168 INSTALL = dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client dvoverify dvoutils 169 169 170 170 # dependancy rules for binary code ######################### -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/include/dvomerge.h
r38285 r38446 42 42 int REPLACE_TYCHO; 43 43 int FORCE_MERGE; 44 int MAX_CLIENTS; 44 45 char *UPDATE_CATFORMAT; 46 char *UPDATE_CATCOMPRESS; 45 47 46 48 int MATCHED_TABLES; -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/LoadCatalog.c
r37807 r38446 8 8 9 9 // always load all of the data (if any exists) 10 catalog[0].catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF | LOAD_LENSING | LOAD_LENSOBJ | LOAD_STARPAR;10 catalog[0].catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT | DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ | DVO_LOAD_STARPAR | DVO_LOAD_GALPHOT; 11 11 12 12 catalog[0].catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/LoadImages.c
r29938 r38446 34 34 } 35 35 36 image = gfits_table_get_Image (&db->ftable, Nimage, &db->s wapped);36 image = gfits_table_get_Image (&db->ftable, Nimage, &db->scaledValue, &db->nativeOrder); 37 37 if (!image) { 38 38 fprintf (stderr, "ERROR: failed to read images\n"); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/args.c
r38285 r38446 44 44 } 45 45 46 /* limit the impact of a dvomerge -parallel */ 47 MAX_CLIENTS = 10; 48 if ((N = get_argument (*argc, argv, "-max-clients"))) { 49 remove_argument (N, argc, argv); 50 MAX_CLIENTS = atoi(argv[N]); 51 remove_argument (N, argc, argv); 52 } 53 46 54 /* use a different photcode file to define mean values */ 47 55 if ((N = get_argument (*argc, argv, "-photcode-file"))) { … … 62 70 remove_argument (N, argc, argv); 63 71 UPDATE_CATFORMAT = strcreate (argv[N]); 72 remove_argument (N, argc, argv); 73 } 74 UPDATE_CATCOMPRESS = NULL; 75 if ((N = get_argument (*argc, argv, "-update-catcompress"))) { 76 remove_argument (N, argc, argv); 77 UPDATE_CATCOMPRESS = strcreate (argv[N]); 64 78 remove_argument (N, argc, argv); 65 79 } … … 219 233 remove_argument (N, argc, argv); 220 234 } 235 UPDATE_CATCOMPRESS = NULL; 236 if ((N = get_argument (*argc, argv, "-update-catcompress"))) { 237 remove_argument (N, argc, argv); 238 UPDATE_CATCOMPRESS = strcreate (argv[N]); 239 remove_argument (N, argc, argv); 240 } 221 241 222 242 /* replace measurement, don't duplicate */ -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvo_image_merge_dbs.c
r37807 r38446 16 16 short *TgtCodes; 17 17 18 imagesSrc = gfits_table_get_Image (&src[0].ftable, &NimagesSrc, &src[0].s wapped);18 imagesSrc = gfits_table_get_Image (&src[0].ftable, &NimagesSrc, &src[0].scaledValue, &src[0].nativeOrder); 19 19 if (!imagesSrc) { 20 20 fprintf (stderr, "ERROR: failed to read images from src\n"); … … 22 22 } 23 23 24 imagesTgt = gfits_table_get_Image (&tgt[0].ftable, &NimagesTgt, &tgt[0].s wapped);24 imagesTgt = gfits_table_get_Image (&tgt[0].ftable, &NimagesTgt, &tgt[0].scaledValue, &tgt[0].nativeOrder); 25 25 if (!imagesTgt) { 26 26 fprintf (stderr, "ERROR: failed to read images from tgt\n"); … … 83 83 } 84 84 85 images = gfits_table_get_Image (&in[0].ftable, &Nimages, &in[0].s wapped);85 images = gfits_table_get_Image (&in[0].ftable, &Nimages, &in[0].scaledValue, &in[0].nativeOrder); 86 86 if (!images) { 87 87 fprintf (stderr, "ERROR: failed to read images\n"); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvoconvert.c
r33657 r38446 82 82 83 83 // skip empty input catalogs 84 if (!incatalog.Nave s_disk) {84 if (!incatalog.Naverage_disk) { 85 85 dvo_catalog_unlock (&incatalog); 86 86 dvo_catalog_free (&incatalog); … … 93 93 SkyListFree (inlist); 94 94 95 outcatalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF;95 outcatalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_MISSING | DVO_LOAD_SECFILT; 96 96 dvo_catalog_save (&outcatalog, VERBOSE); 97 97 dvo_catalog_unlock (&outcatalog); … … 122 122 /*** load output/Images.dat ***/ 123 123 sprintf (ImageCat, "%s/Images.dat", output); 124 gfits_db_init (&outDB); 124 125 outDB.mode = dvo_catalog_catmode (CATMODE); 125 126 outDB.format = dvo_catalog_catformat (CATFORMAT); … … 135 136 /*** load input/Images.dat ***/ 136 137 sprintf (ImageCat, "%s/Images.dat", input); 138 gfits_db_init (&inDB); 137 139 // inDB.mode = dvo_catalog_catmode (CATMODE); 138 140 // inDB.format = dvo_catalog_catformat (CATFORMAT); … … 149 151 150 152 // convert the raw image table to Image type (byteswap if needed) 151 images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.s wapped);153 images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.scaledValue, &inDB.nativeOrder); 152 154 if (!images) { 153 155 fprintf (stderr, "ERROR: failed to read images\n"); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvomergeContinue.c
r37116 r38446 109 109 LoadCatalog (&incatalog, &inlist[0].regions[i][0], inlist[0].filename[i], "r", NsecfiltInput); 110 110 // skip empty input catalogs 111 if (!incatalog.Nave s_disk) {111 if (!incatalog.Naverage_disk) { 112 112 dvo_catalog_unlock (&incatalog); 113 113 dvo_catalog_free (&incatalog); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvomergeContinue_threaded.c
r37116 r38446 47 47 LoadCatalog (&incatalog, threadData->region, threadData->filename, "r", threadData->NsecfiltInput); 48 48 // skip empty input catalogs 49 if (!incatalog.Nave s_disk) {49 if (!incatalog.Naverage_disk) { 50 50 dvo_catalog_unlock (&incatalog); 51 51 dvo_catalog_free (&incatalog); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvomergeCreate.c
r37116 r38446 145 145 146 146 // skip empty input catalogs 147 if (!incatalog.Nave s_disk) {147 if (!incatalog.Naverage_disk) { 148 148 dvo_catalog_unlock (&incatalog); 149 149 dvo_catalog_free (&incatalog); … … 166 166 167 167 // skip empty input catalogs 168 if (!incatalog.Nave s_disk) {168 if (!incatalog.Naverage_disk) { 169 169 dvo_catalog_unlock (&incatalog); 170 170 dvo_catalog_free (&incatalog); … … 204 204 /*** load output/Images.dat ***/ 205 205 sprintf (ImageCat, "%s/Images.dat", output); 206 gfits_db_init (&outDB); 206 207 outDB.mode = dvo_catalog_catmode (CATMODE); 207 208 outDB.format = dvo_catalog_catformat (CATFORMAT); … … 218 219 /*** load input1/Images.dat ***/ 219 220 sprintf (ImageCat, "%s/Images.dat", input1); 221 gfits_db_init (&in1DB); 220 222 in1DB.mode = dvo_catalog_catmode (CATMODE); 221 223 in1DB.format = dvo_catalog_catformat (CATFORMAT); … … 237 239 /*** load input2/Images.dat ***/ 238 240 sprintf (ImageCat, "%s/Images.dat", input2); 241 gfits_db_init (&in2DB); 239 242 in2DB.mode = dvo_catalog_catmode (CATMODE); 240 243 in2DB.format = dvo_catalog_catformat (CATFORMAT); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvomergeFromList.c
r37116 r38446 113 113 114 114 // skip empty input catalogs 115 if (!incatalog.Nave s_disk) {115 if (!incatalog.Naverage_disk) { 116 116 dvo_catalog_unlock (&incatalog); 117 117 dvo_catalog_free (&incatalog); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvomergeImageIDs.c
r36833 r38446 10 10 /*** load input1/Images.dat ***/ 11 11 sprintf (ImageCat, "%s/Images.dat", input); 12 gfits_db_init (&inDB); 12 13 inDB.mode = dvo_catalog_catmode (CATMODE); 13 14 inDB.format = dvo_catalog_catformat (CATFORMAT); 14 status = dvo_image_lock (&inDB, ImageCat, 3600.0, LCK_SOFT); // shorter timeout?15 status = dvo_image_lock (&inDB, ImageCat, 3600.0, LCK_SOFT); // shorter timeout? 15 16 if (!status) Shutdown ("ERROR: failure to lock image catalog %s", inDB.filename); 16 17 … … 37 38 /*** load output/Images.dat ***/ 38 39 sprintf (ImageCat, "%s/Images.dat", output); 40 gfits_db_init (&outDB); 39 41 outDB.mode = dvo_catalog_catmode (CATMODE); 40 42 outDB.format = dvo_catalog_catformat (CATFORMAT); … … 93 95 /*** load input1/Images.dat ***/ 94 96 sprintf (ImageCat, "%s/Images.dat", input); 97 gfits_db_init (&inDB); 95 98 inDB.mode = dvo_catalog_catmode (CATMODE); 96 99 inDB.format = dvo_catalog_catformat (CATFORMAT); 97 status = dvo_image_lock (&inDB, ImageCat, 5400.0, LCK_XCLD); // shorter timeout?100 status = dvo_image_lock (&inDB, ImageCat, 5400.0, LCK_XCLD); // shorter timeout? 98 101 if (!status) Shutdown ("ERROR: failure to lock image catalog %s", inDB.filename); 99 102 … … 115 118 /*** load output/Images.dat ***/ 116 119 sprintf (ImageCat, "%s/Images.dat", output); 120 gfits_db_init (&outDB); 117 121 outDB.mode = dvo_catalog_catmode (CATMODE); 118 122 outDB.format = dvo_catalog_catformat (CATFORMAT); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c
r38285 r38446 145 145 146 146 // skip empty input catalogs 147 if (!incatalog.Nave s_disk) {147 if (!incatalog.Naverage_disk) { 148 148 dvo_catalog_unlock (&incatalog); 149 149 dvo_catalog_free (&incatalog); … … 179 179 180 180 // if no catalog already exists, use the input catalog to define the format or the specified format 181 if (outcatalog.Naves_disk == 0) { 182 if (UPDATE_CATFORMAT) { 183 outcatalog.catformat = dvo_catalog_catformat (UPDATE_CATFORMAT); 184 } else { 185 outcatalog.catformat = incatalog.catformat; 186 } 181 if (UPDATE_CATFORMAT) { 182 outcatalog.catformat = dvo_catalog_catformat (UPDATE_CATFORMAT); 183 } else { 184 outcatalog.catformat = incatalog.catformat; 185 } 186 if (UPDATE_CATCOMPRESS) { 187 outcatalog.catcompress = dvo_catalog_catcompress (UPDATE_CATCOMPRESS); 188 } else { 189 outcatalog.catcompress = incatalog.catcompress; 187 190 } 188 191 … … 230 233 return TRUE; 231 234 } 235 236 int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput); 232 237 233 238 // launch the dvomergeUpdate_client jobs to the parallel hosts … … 257 262 } 258 263 259 # if (MACHINE_GROUPS)260 264 int Ngroups; 261 HostTableGroup *groups = HostTableGroups (table, &Ngroups);265 HostTableGroup *groups = HostTableGroupsMaxNumber (table, &Ngroups, MAX_CLIENTS); 262 266 // split the table into Ngroups, each with a unique set of machines (this avoids overloading the remote host machines) 263 267 … … 267 271 dvomergeUpdate_parallel_group (&groups[i], absinput, absoutput, outsky); 268 272 } 269 # else270 dvomergeUpdate_parallel_table (table, absinput, absoutput);271 # endif272 273 273 return TRUE; 274 274 } 275 275 276 // launch the dvomergeUpdate_client jobs to the parallel hosts 277 int dvomergeUpdate_parallel_table (HostTable *table, char *absinput, char *absoutput) { 276 int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput) { 278 277 279 278 int i; 280 for (i = 0; i < table->Nhosts; i++) {279 for (i = 0; i < group->Nhosts; i++) { 281 280 282 281 // ensure that the paths are absolute path names 283 char *tmppath = abspath ( table->hosts[i].pathname, DVO_MAX_PATH);284 free ( table->hosts[i].pathname);285 table->hosts[i].pathname = tmppath;282 char *tmppath = abspath (group->hosts[i][0].pathname, DVO_MAX_PATH); 283 free (group->hosts[i][0].pathname); 284 group->hosts[i][0].pathname = tmppath; 286 285 287 286 // options / arguments that can affect relastro_client -update-objects: 288 287 char command[DVO_MAX_PATH]; 289 288 snprintf (command, DVO_MAX_PATH, "dvomerge_client %s into %s -hostID %d -hostdir %s -region %f %f %f %f -D ADDSTAR_RADIUS %f", 290 absinput, absoutput, table->hosts[i].hostID, table->hosts[i].pathname,289 absinput, absoutput, group->hosts[i][0].hostID, group->hosts[i][0].pathname, 291 290 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS 292 291 ); … … 315 314 int status = system (command); 316 315 if (status) { 317 fprintf (stderr, "ERROR running photdbc_client\n"); 318 exit (2); 319 } 320 } else { 321 // launch the job on the remote machine (no handshake) 322 int errorInfo = 0; 323 int pid = rconnect ("ssh", table->hosts[i].hostname, command, table->hosts[i].stdio, &errorInfo, FALSE); 324 if (!pid) { 325 if (DEBUG) fprintf (stderr, "failure to start %s (error %d)\n", table->hosts[i].hostname, errorInfo); 326 exit (1); 327 } 328 table->hosts[i].pid = pid; // save for future reference 329 } 330 } 331 332 if (PARALLEL_MANUAL) { 333 fprintf (stderr, "run the photdbc_client commands above. when these are done, hit return\n"); 334 getchar(); 335 } 336 if (!PARALLEL_MANUAL && !PARALLEL_SERIAL) { 337 int status = HostTableWaitJobsGetIO (table, __FILE__, __LINE__, VERBOSE); 338 if (!status) { 339 fprintf (stderr, "error running one of the remote clients\n"); 340 return status; 341 } 342 } 343 344 return TRUE; 345 } 346 347 // launch the dvomergeUpdate_client jobs to the parallel hosts 348 int dvomergeUpdate_parallel_group (HostTableGroup *group, char *absinput, char *absoutput, SkyTable *sky) { 349 350 int i, j; 351 for (i = 0; i < group->Nhosts; i++) { 352 353 if (sky->Nregions < group->Nhosts) { 354 // do any of the regions want this host? 355 int wantThisHost = FALSE; 356 for (j = 0; j < sky->Nregions; j++) { 357 if (HostTableTestHost (&sky->regions[j], group->hosts[i][0].hostID)) { 358 wantThisHost = TRUE; 359 break; 360 } 361 } 362 if (!wantThisHost) { 363 // fprintf (stderr, "skip host %s\n", group->hosts[i][0].hostname); 364 continue; 365 } 366 } 367 368 // ensure that the paths are absolute path names 369 char *tmppath = abspath (group->hosts[i][0].pathname, DVO_MAX_PATH); 370 free (group->hosts[i][0].pathname); 371 group->hosts[i][0].pathname = tmppath; 372 373 // options / arguments that can affect relastro_client -update-objects: 374 char command[DVO_MAX_PATH]; 375 snprintf (command, DVO_MAX_PATH, "dvomerge_client %s into %s -hostID %d -hostdir %s -region %f %f %f %f -D ADDSTAR_RADIUS %f", 376 absinput, absoutput, group->hosts[i][0].hostID, group->hosts[i][0].pathname, 377 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS 378 ); 379 380 char tmpline[DVO_MAX_PATH]; 381 if (VERBOSE) { snprintf (tmpline, DVO_MAX_PATH, "%s -v", command); strcpy (command, tmpline); } 382 if (VERIFY) { snprintf (tmpline, DVO_MAX_PATH, "%s -verify", command); strcpy (command, tmpline); } 383 if (VERIFY_CATALOG_ONLY) { snprintf (tmpline, DVO_MAX_PATH, "%s -verify-catalogs", command); strcpy (command, tmpline); } 384 if (REPLACE_BY_PHOTCODE) { snprintf (tmpline, DVO_MAX_PATH, "%s -replace", command); strcpy (command, tmpline); } 385 if (PARALLEL_INPUT) { snprintf (tmpline, DVO_MAX_PATH, "%s -parallel-input", command); strcpy (command, tmpline); } 386 if (FORCE_MERGE) { snprintf (tmpline, DVO_MAX_PATH, "%s -force-merge", command); strcpy (command, tmpline); } 387 if (MATCHED_TABLES) { snprintf (tmpline, DVO_MAX_PATH, "%s -matched-tables", command); strcpy (command, tmpline); } 388 if (UPDATE_CATFORMAT) { snprintf (tmpline, DVO_MAX_PATH, "%s -update-catformat %s", command, UPDATE_CATFORMAT); strcpy (command, tmpline); } 389 390 // add some config variables: 391 snprintf (tmpline, DVO_MAX_PATH, "%s -D CATMODE %s", command, CATMODE); strcpy (command, tmpline); 392 snprintf (tmpline, DVO_MAX_PATH, "%s -D CATFORMAT %s", command, CATFORMAT); strcpy (command, tmpline); 393 snprintf (tmpline, DVO_MAX_PATH, "%s -D SKY_DEPTH %d", command, SKY_DEPTH); strcpy (command, tmpline); 394 395 fprintf (stderr, "command: %s\n", command); 396 397 if (PARALLEL_MANUAL) continue; 398 399 if (PARALLEL_SERIAL) { 400 int status = system (command); 401 if (status) { 402 fprintf (stderr, "ERROR running photdbc_client\n"); 316 fprintf (stderr, "ERROR running dvomerge_client\n"); 403 317 exit (2); 404 318 } … … 416 330 417 331 if (PARALLEL_MANUAL) { 418 fprintf (stderr, "run the photdbc_client commands above. when these are done, hit return\n");332 fprintf (stderr, "run the dvomerge_client commands above. when these are done, hit return\n"); 419 333 getchar(); 420 334 } -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvomergeUpdate_threaded.c
r37116 r38446 44 44 LoadCatalog (&incatalog, threadData->region, threadData->filename, "r", threadData->NsecfiltInput); 45 45 // skip empty input catalogs 46 if (!incatalog.Nave s_disk) {46 if (!incatalog.Naverage_disk) { 47 47 dvo_catalog_unlock (&incatalog); 48 48 dvo_catalog_free (&incatalog); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvorepairCPT.c
r37807 r38446 76 76 } 77 77 78 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat );78 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE); 79 79 myAssert(measure, "failed to convert ftable to measure data"); 80 80 … … 156 156 gfits_modify_alt (&cptHeaderPHU, "SORTED", "%t", 1, FALSE); 157 157 158 myAbort ("test for compression"); 159 158 160 /* convert internal to external format */ 159 if (!AverageToFtable (&cptFtable, average, Naverage, catformat, NULL )) {161 if (!AverageToFtable (&cptFtable, average, Naverage, catformat, NULL, TRUE)) { 160 162 myAbort("trouble converting format"); 161 163 } -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvorepairDeleteImageList.c
r37807 r38446 46 46 FILE *cpmFile = NULL; 47 47 48 charcatformat;48 DVOCatFormat catformat; 49 49 50 50 N = get_argument (argc, argv, "-delete-image-list"); … … 246 246 gfits_scan(&cpmHeaderTBL, "NAXIS1", "%d", 1, &NbytesPerRow); 247 247 248 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat );248 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE); 249 249 myAssert(measure, "failed to convert ftable to measure data"); 250 250 … … 284 284 285 285 // convert internal to external format 286 if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat )) {286 if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat, TRUE)) { 287 287 myAbort("trouble converting format"); 288 288 } … … 467 467 gfits_scan (&cptHeaderPHU, "NSECFILT", "%d", 1, &Nsecfilt); 468 468 469 myAbort ("test for compression"); 470 469 471 /* convert internal to external format */ 470 if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL )) {472 if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL, TRUE)) { 471 473 myAbort("trouble converting format"); 472 474 } … … 529 531 530 532 /* convert internal to external format */ 531 if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat )) {533 if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat, TRUE)) { 532 534 myAbort("trouble converting format"); 533 535 } -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvorepairDeleteImagesByExternID.c
r38319 r38446 38 38 char *imageFilename = NULL; 39 39 40 charcatformat;40 DVOCatFormat catformat; 41 41 42 42 N = get_argument (argc, argv, "-delete-images-by-extern-id"); … … 279 279 gfits_scan(&cpmHeaderTBL, "NAXIS1", "%d", 1, &NbytesPerRow); 280 280 281 myAbort ("fix compression"); 282 281 283 // this function can only handle PS1_V5 and later formats 282 284 // NOTE: FtableToMeasure (and equivalent) free the data associated with cpmFtable. 283 285 // We are left with the data in measure. 284 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat );286 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE); 285 287 myAssert(measure, "failed to convert ftable to measure data"); 286 288 … … 331 333 332 334 // convert internal to external format 333 if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat )) {335 if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat, TRUE)) { 334 336 myAbort("trouble converting format"); 335 337 } … … 493 495 494 496 /* setup image table format and lock */ 497 gfits_db_init (&db); 495 498 db.mode = dvo_catalog_catmode ("SPLIT"); 496 499 db.format = dvo_catalog_catformat ("PS1_V5"); … … 658 661 gfits_scan (&cptHeaderPHU, "NSECFILT", "%d", 1, &Nsecfilt); 659 662 663 myAbort ("test for compression"); 664 660 665 /* convert internal to external format */ 661 if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL )) {666 if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL, TRUE)) { 662 667 myAbort("trouble converting format"); 663 668 } … … 727 732 728 733 /* convert internal to external format */ 729 if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat )) {734 if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat, TRUE)) { 730 735 myAbort("trouble converting format"); 731 736 } -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvorepairFixCPT.c
r37046 r38446 86 86 Matrix matrix; 87 87 88 charcatformat;88 DVOCatFormat catformat; 89 89 90 90 cpmFtable.header = &cpmHeaderTBL; … … 120 120 } 121 121 122 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat); 122 myAbort ("fix cpts"); 123 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE); 123 124 myAssert(measure, "failed to convert ftable to measure data"); 124 125 … … 127 128 128 129 // convert internal to external format 129 if (!MeasureToFtable (&cpmFtable, NULL, measure, Nmeasure, catformat )) {130 if (!MeasureToFtable (&cpmFtable, NULL, measure, Nmeasure, catformat, TRUE)) { 130 131 myAbort("trouble converting format"); 131 132 } -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvorepairFixImages.c
r37807 r38446 255 255 256 256 /* setup image table format and lock */ 257 gfits_db_init (oldDB); 257 258 db.mode = oldDB->mode; 258 259 db.format = oldDB->format; … … 280 281 memset (&db.ftable.buffer[Nx*Nout], ' ', nbytes - Nx*Nout); 281 282 282 db.swapped = TRUE; // internal representation 283 db.nativeOrder = TRUE; // internal representation 284 db.scaledValue = TRUE; // internal representation 283 285 284 286 gfits_modify (&db.header, "NIMAGES", OFF_T_FMT, 1, Nout); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvorepairFixTables.c
r37807 r38446 103 103 104 104 // convert internal to external format 105 if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat )) {105 if (!MeasureToFtable (&cpmFtable, NULL, measureNew, NmeasureNew, catformat, TRUE)) { 106 106 myAbort("trouble converting format"); 107 107 } … … 183 183 gfits_scan(&cpmHeaderTBL, "NAXIS2", "%d", 1, &Nrows); 184 184 185 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat );185 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE); 186 186 myAssert(measure, "failed to convert ftable to measure data"); 187 187 … … 326 326 gfits_scan (&cptHeaderPHU, "NSECFILT", "%d", 1, &Nsecfilt); 327 327 328 myAbort ("test for compression"); 329 328 330 /* convert internal to external format */ 329 if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL )) {331 if (!AverageToFtable (&cptFtable, averageOut, NaverageOut, catformat, NULL, TRUE)) { 330 332 myAbort("trouble converting format"); 331 333 } … … 388 390 389 391 /* convert internal to external format */ 390 if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat )) {392 if (!SecFiltToFtable (&cpsFtable, secfilt, Nrows, catformat, TRUE)) { 391 393 myAbort("trouble converting format"); 392 394 } -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvorepairImageVsMeasure.c
r37046 r38446 128 128 gfits_scan(&cpmHeaderTBL, "NAXIS1", "%d", 1, &NbytesPerRow); 129 129 130 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat );130 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE); 131 131 myAssert(measure, "failed to convert ftable to measure data"); 132 132 -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvorepairImagesVsMeasures.c
r37046 r38446 32 32 FILE *cpmFile = NULL; 33 33 34 charcatformat;34 DVOCatFormat catformat; 35 35 36 36 N = get_argument (argc, argv, "-images-vs-measures"); … … 134 134 gfits_scan(&cpmHeaderTBL, "NAXIS1", "%d", 1, &NbytesPerRow); 135 135 136 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat );136 measure = FtableToMeasure (&cpmFtable, NULL, &Nmeasure, &catformat, FALSE); 137 137 myAssert(measure, "failed to convert ftable to measure data"); 138 138 -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvosecfilt_catalogs.c
r38319 r38446 39 39 // always load all of the data (if any exists) 40 40 catalog.Nsecfilt = 0; 41 catalog.catflags = LOAD_SECF; // XXX this will fail for MEF version41 catalog.catflags = DVO_LOAD_SECFILT; // XXX this will fail for MEF version 42 42 catalog.catformat = dvo_catalog_catformat (CATFORMAT); // set the default catformat from config data 43 43 catalog.catmode = dvo_catalog_catmode (CATMODE); // set the default catmode from config data … … 48 48 } 49 49 50 if (catalog.Nave s_disk == 0) {50 if (catalog.Naverage_disk == 0) { 51 51 dvo_catalog_unlock (&catalog); 52 52 dvo_catalog_free (&catalog); … … 64 64 65 65 insec = catalog.secfilt; 66 ALLOCATE (outsec, SecFilt, catalog.Nave s_disk * Nsecfilt);66 ALLOCATE (outsec, SecFilt, catalog.Naverage_disk * Nsecfilt); 67 67 68 for (k = 0; k < catalog.Nave s_disk; k++) {68 for (k = 0; k < catalog.Naverage_disk; k++) { 69 69 for (j = 0; (j < catalog.Nsecfilt) && (j < Nsecfilt); j++) { 70 70 outsec[k*Nsecfilt + j] = insec[k*NsecInput + j]; … … 77 77 catalog.secfilt = outsec; 78 78 catalog.Nsecfilt = Nsecfilt; 79 catalog.Nsecf _mem = Nsecfilt * catalog.Naves_disk;80 catalog.Nsecf _disk = Nsecfilt * catalog.Naves_disk;79 catalog.Nsecfilt_mem = Nsecfilt * catalog.Naverage_disk; 80 catalog.Nsecfilt_disk = Nsecfilt * catalog.Naverage_disk; 81 81 82 82 dvo_catalog_save (&catalog, VERBOSE); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvoutils_load_image_index.c
r37807 r38446 87 87 88 88 off_t Nimage; 89 Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.s wapped);89 Image *image = gfits_table_get_Image (&db.ftable, &Nimage, &db.scaledValue, &db.nativeOrder); 90 90 if (!image) { 91 91 fprintf (stderr, "ERROR: failed to read images\n"); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvoutils_uniq_images.c
r37807 r38446 132 132 } 133 133 IDlist[n] ++; 134 if (VERBOSE && (IDlist[n] > 1)) { 135 fprintf (stderr, "duplicate ext_id %d in file %s\n", extern_id[i], imFile); 136 } 134 137 } 135 138 -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/dvoverify_utils.c
r37807 r38446 178 178 catalog.catformat = DVO_FORMAT_UNDEF; // read-only,do not set the catformat 179 179 catalog.catmode = DVO_MODE_UNDEF; // read-only, do not set the catmode 180 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_LENSING |LOAD_LENSOBJ;180 catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_MEASURE | DVO_LOAD_LENSING | DVO_LOAD_LENSOBJ; 181 181 catalog.Nsecfilt = 0; 182 182 … … 187 187 } 188 188 189 // Nave s_disk == 0 implies an empty catalog file, skip empty catalogs190 if (catalog.Nave s_disk == 0) {189 // Naverage_disk == 0 implies an empty catalog file, skip empty catalogs 190 if (catalog.Naverage_disk == 0) { 191 191 dvo_catalog_unlock (&catalog); 192 192 dvo_catalog_free (&catalog); … … 467 467 468 468 // load the iage database table 469 gfits_db_init (&inDB); 469 470 status = dvo_image_lock (&inDB, ImageCat, 3600.0, LCK_SOFT); // shorter timeout? 470 471 if (!status) { … … 484 485 } 485 486 486 images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.s wapped);487 images = gfits_table_get_Image (&inDB.ftable, &Nimages, &inDB.scaledValue, &inDB.nativeOrder); 487 488 if (!images) { 488 489 fprintf (stderr, "ERROR: failed to read images from src\n"); -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/merge_catalogs.c
r27435 r38446 57 57 output[0].Naverage = Naverage; 58 58 output[0].Nmeasure = Nmeasure; 59 output[0].Nsecf _mem = Naverage * Nsecfilt;59 output[0].Nsecfilt_mem = Naverage * Nsecfilt; 60 60 61 61 if (VERBOSE) { -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/merge_catalogs_new.c
r37814 r38446 115 115 output[0].Nlensing = Nlensing; 116 116 output[0].Nstarpar = Nstarpar; 117 output[0].Nsecf _mem = Naverage * NsecfiltOut;117 output[0].Nsecfilt_mem = Naverage * NsecfiltOut; 118 118 119 119 // If we are using dvomergeCreate to split an existing catalog, then the max objID in -
branches/eam_branches/ipp-20150419/Ohana/src/dvomerge/src/merge_catalogs_old.c
r38319 r38446 112 112 113 113 /* set up pointers for linked list of measure */ 114 if (output[0].sorted && (output[0].Nmeasure >= output[0].Nmeas _disk)) {114 if (output[0].sorted && (output[0].Nmeasure >= output[0].Nmeasure_disk)) { 115 115 // this version is only valid if we have done a full catalog load, and if the catalog 116 116 // is sorted while processed … … 517 517 output[0].Nlensing = Nlens; 518 518 output[0].Nstarpar = Nstar; 519 output[0].Nsecf _mem = Nave*NsecfiltOut;519 output[0].Nsecfilt_mem = Nave*NsecfiltOut; 520 520 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas, Nlens: "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n", Nstars, Nave, Nmeas, Nlens, Nmatch); 521 521
Note:
See TracChangeset
for help on using the changeset viewer.
