Changeset 39717
- Timestamp:
- Sep 24, 2016, 2:35:52 PM (10 years ago)
- Location:
- branches/czw_branch/20160809/Ohana/src/delstar
- Files:
-
- 3 edited
- 1 copied
-
include/delstar.h (modified) (2 diffs)
-
src/args.c (modified) (3 diffs)
-
src/delete_duplicate_measures.c (modified) (2 diffs)
-
src/delete_measures_by_match.c (copied) (copied from trunk/Ohana/src/delstar/src/delete_measures_by_match.c ) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20160809/Ohana/src/delstar/include/delstar.h
r39605 r39717 94 94 int SAVE_DUPLICATES; 95 95 int SKIP_IMAGES; 96 char *BACKUP_EXTNAME; 96 97 97 98 time_t START; … … 108 109 109 110 SkyRegion UserPatch; 111 112 // for DELETE_MEASURES_BY_MATCH, these are the ranges to delete: 113 int DELETE_MIN_DET_ID; 114 int DELETE_MAX_DET_ID; 115 int DELETE_MIN_CAT_ID; 116 int DELETE_MAX_CAT_ID; 117 118 int DELETE_MIN_IMAGE_ID; 119 int DELETE_MAX_IMAGE_ID; 120 int DELETE_MIN_PHOTCODE; 121 int DELETE_MAX_PHOTCODE; 122 123 int DELETE_MIN_TIME; 124 int DELETE_MAX_TIME; 110 125 111 126 /*** delstar prototypes ***/ -
branches/czw_branch/20160809/Ohana/src/delstar/src/args.c
r39579 r39717 195 195 } 196 196 197 DELETE_MIN_DET_ID = 0; 198 DELETE_MAX_DET_ID = 0; 199 DELETE_MIN_CAT_ID = 0; 200 DELETE_MAX_CAT_ID = 0; 201 DELETE_MIN_IMAGE_ID = 0; 202 DELETE_MAX_IMAGE_ID = 0; 203 DELETE_MIN_PHOTCODE = 0; 204 DELETE_MAX_PHOTCODE = 0; 205 DELETE_MIN_TIME = 0; 206 DELETE_MAX_TIME = 0; 207 208 if ((N = get_argument (argc, argv, "-delete-min-detID"))) { remove_argument (N, &argc, argv); DELETE_MIN_DET_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 209 if ((N = get_argument (argc, argv, "-delete-max-detID"))) { remove_argument (N, &argc, argv); DELETE_MAX_DET_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 210 if ((N = get_argument (argc, argv, "-delete-min-catID"))) { remove_argument (N, &argc, argv); DELETE_MIN_CAT_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 211 if ((N = get_argument (argc, argv, "-delete-max-catID"))) { remove_argument (N, &argc, argv); DELETE_MAX_CAT_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 212 if ((N = get_argument (argc, argv, "-delete-min-imageID"))) { remove_argument (N, &argc, argv); DELETE_MIN_IMAGE_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 213 if ((N = get_argument (argc, argv, "-delete-max-imageID"))) { remove_argument (N, &argc, argv); DELETE_MAX_IMAGE_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 214 if ((N = get_argument (argc, argv, "-delete-min-photcode"))) { remove_argument (N, &argc, argv); DELETE_MIN_PHOTCODE = atoi(argv[N]); remove_argument (N, &argc, argv); } 215 if ((N = get_argument (argc, argv, "-delete-max-photcode"))) { remove_argument (N, &argc, argv); DELETE_MAX_PHOTCODE = atoi(argv[N]); remove_argument (N, &argc, argv); } 216 if ((N = get_argument (argc, argv, "-delete-min-time"))) { remove_argument (N, &argc, argv); DELETE_MIN_TIME = ohana_date_to_sec(argv[N]); remove_argument (N, &argc, argv); } 217 if ((N = get_argument (argc, argv, "-delete-max-time"))) { remove_argument (N, &argc, argv); DELETE_MAX_TIME = ohana_date_to_sec(argv[N]); remove_argument (N, &argc, argv); } 218 197 219 SAVE_DUPLICATES = FALSE; 198 220 if ((N = get_argument (argc, argv, "-save-duplicates"))) { … … 200 222 remove_argument (N, &argc, argv); 201 223 } 224 BACKUP_EXTNAME = NULL; 225 if ((N = get_argument (argc, argv, "-backup-extname"))) { 226 remove_argument (N, &argc, argv); 227 BACKUP_EXTNAME = strcreate (argv[N]); 228 remove_argument (N, &argc, argv); 229 } 230 if (!BACKUP_EXTNAME) BACKUP_EXTNAME = strcreate (".bck"); 202 231 203 232 if ((N = get_argument (argc, argv, "-fix-LAP"))) { … … 445 474 remove_argument (N, &argc, argv); 446 475 } 476 477 if ((N = get_argument (argc, argv, "-delete-measures-by-match"))) { 478 if (MODE != MODE_NONE) usage(); 479 MODE = MODE_DELETE_MEASURES_BY_MATCH; 480 remove_argument (N, &argc, argv); 481 SKIP_IMAGES = TRUE; // we do not need to load the images for -dup-measures 482 } 483 484 DELETE_MIN_DET_ID = 0; 485 DELETE_MAX_DET_ID = 0; 486 DELETE_MIN_CAT_ID = 0; 487 DELETE_MAX_CAT_ID = 0; 488 DELETE_MIN_IMAGE_ID = 0; 489 DELETE_MAX_IMAGE_ID = 0; 490 DELETE_MIN_PHOTCODE = 0; 491 DELETE_MAX_PHOTCODE = 0; 492 DELETE_MIN_TIME = 0; 493 DELETE_MAX_TIME = 0; 494 495 if ((N = get_argument (argc, argv, "-delete-min-detID"))) { remove_argument (N, &argc, argv); DELETE_MIN_DET_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 496 if ((N = get_argument (argc, argv, "-delete-max-detID"))) { remove_argument (N, &argc, argv); DELETE_MAX_DET_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 497 if ((N = get_argument (argc, argv, "-delete-min-catID"))) { remove_argument (N, &argc, argv); DELETE_MIN_CAT_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 498 if ((N = get_argument (argc, argv, "-delete-max-catID"))) { remove_argument (N, &argc, argv); DELETE_MAX_CAT_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 499 if ((N = get_argument (argc, argv, "-delete-min-imageID"))) { remove_argument (N, &argc, argv); DELETE_MIN_IMAGE_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 500 if ((N = get_argument (argc, argv, "-delete-max-imageID"))) { remove_argument (N, &argc, argv); DELETE_MAX_IMAGE_ID = atoi(argv[N]); remove_argument (N, &argc, argv); } 501 if ((N = get_argument (argc, argv, "-delete-min-photcode"))) { remove_argument (N, &argc, argv); DELETE_MIN_PHOTCODE = atoi(argv[N]); remove_argument (N, &argc, argv); } 502 if ((N = get_argument (argc, argv, "-delete-max-photcode"))) { remove_argument (N, &argc, argv); DELETE_MAX_PHOTCODE = atoi(argv[N]); remove_argument (N, &argc, argv); } 503 if ((N = get_argument (argc, argv, "-delete-min-time"))) { remove_argument (N, &argc, argv); DELETE_MIN_TIME = ohana_date_to_sec(argv[N]); remove_argument (N, &argc, argv); } 504 if ((N = get_argument (argc, argv, "-delete-max-time"))) { remove_argument (N, &argc, argv); DELETE_MAX_TIME = ohana_date_to_sec(argv[N]); remove_argument (N, &argc, argv); } 505 506 SAVE_DELETES = FALSE; 507 if ((N = get_argument (argc, argv, "-save-deletes"))) { 508 SAVE_DELETES = TRUE; 509 remove_argument (N, &argc, argv); 510 } 511 BACKUP_EXTNAME = NULL; 512 if ((N = get_argument (argc, argv, "-backup-extname"))) { 513 remove_argument (N, &argc, argv); 514 BACKUP_EXTNAME = strcreate (argv[N]); 515 remove_argument (N, &argc, argv); 516 } 517 if (!BACKUP_EXTNAME) BACKUP_EXTNAME = strcreate (".bck"); 518 447 519 if ((N = get_argument (argc, argv, "-fix-LAP"))) { 448 520 if (MODE != MODE_NONE) usage(); -
branches/czw_branch/20160809/Ohana/src/delstar/src/delete_duplicate_measures.c
r39605 r39717 111 111 112 112 // save backup of original cpm file 113 if (!dvo_catalog_subset_backup (&catalog, ".dl 1")) {113 if (!dvo_catalog_subset_backup (&catalog, ".dlz")) { 114 114 fprintf (stderr, "ERROR: failed to make backup cpt table for catalog %s\n", catalog.filename); 115 115 exit (1); 116 116 } 117 if (!dvo_catalog_subset_backup (catalog.measure_catalog, ".d1 l")) {117 if (!dvo_catalog_subset_backup (catalog.measure_catalog, ".d1z")) { 118 118 fprintf (stderr, "ERROR: failed to make backup cpm table for catalog %s\n", catalog.filename); 119 119 exit (1); 120 120 } 121 if (!dvo_catalog_subset_backup (catalog.secfilt_catalog, ".dl 1")) {121 if (!dvo_catalog_subset_backup (catalog.secfilt_catalog, ".dlz")) { 122 122 fprintf (stderr, "ERROR: failed to make backup cps table for catalog %s\n", catalog.filename); 123 123 exit (1); … … 377 377 if (SAVE_DUPLICATES) { 378 378 char savename[DVO_MAX_PATH]; 379 snprintf (savename, DVO_MAX_PATH, "%s.save ", catalog->filename);379 snprintf (savename, DVO_MAX_PATH, "%s.save.0914", catalog->filename); 380 380 struct stat filestat; 381 381 int myStatus = stat (savename, &filestat); -
branches/czw_branch/20160809/Ohana/src/delstar/src/delete_measures_by_match.c
r39714 r39717 13 13 14 14 int validOptions = FALSE; 15 validOptions |= DELETE_MAX_CAT_ID; 16 validOptions |= DELETE_MIN_CAT_ID; 17 validOptions |= DELETE_MAX_DET_ID; 18 validOptions |= DELETE_MIN_DET_ID; 15 19 validOptions |= DELETE_MAX_IMAGE_ID; 16 20 validOptions |= DELETE_MIN_IMAGE_ID; … … 26 30 fprintf (stderr, "deleting measurements matching the following\n"); 27 31 fprintf (stderr, "image ID range : %d to %d\n", DELETE_MIN_IMAGE_ID, DELETE_MAX_IMAGE_ID); 32 fprintf (stderr, "det ID range : %d to %d\n", DELETE_MIN_DET_ID, DELETE_MAX_DET_ID); 33 fprintf (stderr, "cat ID range : %d to %d\n", DELETE_MIN_CAT_ID, DELETE_MAX_CAT_ID); 28 34 fprintf (stderr, "photcode range : %d to %d\n", DELETE_MIN_PHOTCODE, DELETE_MAX_PHOTCODE); 29 35 fprintf (stderr, "time range (UNIX) : %d to %d\n", DELETE_MIN_TIME, DELETE_MAX_TIME); … … 133 139 134 140 // save backup of original cpm file 135 if (!dvo_catalog_subset_backup (&catalog, ".dlz")) {141 if (!dvo_catalog_subset_backup (&catalog, BACKUP_EXTNAME)) { 136 142 fprintf (stderr, "ERROR: failed to make backup cpt table for catalog %s\n", catalog.filename); 137 143 exit (1); 138 144 } 139 if (!dvo_catalog_subset_backup (catalog.measure_catalog, ".d1z")) {145 if (!dvo_catalog_subset_backup (catalog.measure_catalog, BACKUP_EXTNAME)) { 140 146 fprintf (stderr, "ERROR: failed to make backup cpm table for catalog %s\n", catalog.filename); 141 147 exit (1); 142 148 } 143 if (!dvo_catalog_subset_backup (catalog.secfilt_catalog, ".dlz")) {149 if (!dvo_catalog_subset_backup (catalog.secfilt_catalog, BACKUP_EXTNAME)) { 144 150 fprintf (stderr, "ERROR: failed to make backup cps table for catalog %s\n", catalog.filename); 145 151 exit (1); … … 214 220 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax); 215 221 222 if (DELETE_MIN_DET_ID) strextend (&command, "-delete-min-detID %d", DELETE_MIN_DET_ID); 223 if (DELETE_MAX_DET_ID) strextend (&command, "-delete-max-detID %d", DELETE_MAX_DET_ID); 224 if (DELETE_MIN_CAT_ID) strextend (&command, "-delete-min-catID %d", DELETE_MIN_CAT_ID); 225 if (DELETE_MAX_CAT_ID) strextend (&command, "-delete-max-catID %d", DELETE_MAX_CAT_ID); 226 216 227 if (DELETE_MIN_IMAGE_ID) strextend (&command, "-delete-min-imageID %d", DELETE_MIN_IMAGE_ID); 217 228 if (DELETE_MAX_IMAGE_ID) strextend (&command, "-delete-max-imageID %d", DELETE_MAX_IMAGE_ID); … … 234 245 if (UPDATE) { strextend (&command, "-update"); } 235 246 if (SAVE_DELETES) { strextend (&command, "-save-deletes"); } 247 248 if (BACKUP_EXTNAME) { strextend (&command, "-backup-extname %s", BACKUP_EXTNAME); } 236 249 237 250 fprintf (stderr, "command: %s\n", command); … … 356 369 357 370 // does this measure match our selection criteria? 371 if (measure[i].detID > DELETE_MAX_DET_ID) continue; 372 if (measure[i].detID < DELETE_MIN_DET_ID) continue; 373 374 if (measure[i].catID > DELETE_MAX_CAT_ID) continue; 375 if (measure[i].catID < DELETE_MIN_CAT_ID) continue; 376 358 377 if (measure[i].imageID > DELETE_MAX_IMAGE_ID) continue; 359 378 if (measure[i].imageID < DELETE_MIN_IMAGE_ID) continue; … … 367 386 measureDrop[i] = TRUE; 368 387 off_t N = measure[i].averef; 369 if (VERBOSE) fprintf (stderr, "0x%08x 0x%08x %8.4f %8.4f %5d\n", measure[i].imageID, measure[i].detID, average[N].R, average[N].D, measure[i].photcode);388 if (VERBOSE) fprintf (stderr, "0x%08x 0x%08x 0x%08x %8.4f %8.4f %5d\n", measure[i].imageID, measure[i].detID, measure[i].catID, average[N].R, average[N].D, measure[i].photcode); 370 389 if (fsave) { 371 fprintf (fsave, "0x%08x 0x%08x %8.4f %8.4f %5d\n", measure[i].imageID, measure[i].detID, average[N].R, average[N].D, measure[i].photcode);390 fprintf (fsave, "0x%08x 0x%08x 0x%08x %8.4f %8.4f %5d\n", measure[i].imageID, measure[i].detID, measure[i].catID, average[N].R, average[N].D, measure[i].photcode); 372 391 } 373 392 if (isGPC1chip(measure[i].photcode)) {
Note:
See TracChangeset
for help on using the changeset viewer.
