Changeset 35707
- Timestamp:
- Jun 24, 2013, 5:19:54 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130509/Ohana/src/delstar
- Files:
-
- 1 added
- 7 edited
-
Makefile (modified) (2 diffs)
-
include/delstar.h (modified) (5 diffs)
-
src/args.c (modified) (6 diffs)
-
src/delete_duplicate_images.c (modified) (6 diffs)
-
src/delete_duplicate_measures.c (added)
-
src/delete_photcodes.c (modified) (3 diffs)
-
src/delstar.c (modified) (1 diff)
-
src/delstar_client.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130509/Ohana/src/delstar/Makefile
r35416 r35707 30 30 $(SRC)/delete_imagefile.$(ARCH).o \ 31 31 $(SRC)/delete_duplicate_images.$(ARCH).o \ 32 $(SRC)/delete_duplicate_measures.$(ARCH).o \ 32 33 $(SRC)/delete_image_photcodes.$(ARCH).o \ 33 34 $(SRC)/delete_photcodes.$(ARCH).o \ … … 48 49 $(SRC)/args.$(ARCH).o \ 49 50 $(SRC)/delete_duplicate_images.$(ARCH).o \ 51 $(SRC)/delete_duplicate_measures.$(ARCH).o \ 50 52 $(SRC)/delete_photcodes.$(ARCH).o \ 51 53 $(SRC)/delete_photcodes_single.$(ARCH).o \ -
branches/eam_branches/ipp-20130509/Ohana/src/delstar/include/delstar.h
r35416 r35707 52 52 int HOST_ID; 53 53 char *HOSTDIR; 54 char *SINGLE_CPT; 54 55 55 56 int SKIP_IMAGES; … … 62 63 63 64 int MODE; 64 enum {MODE_NONE, MODE_IMAGENAME, MODE_IMAGEFILE, MODE_TIME, MODE_ORPHAN, MODE_MISSED, MODE_PHOTCODES, MODE_DUP_IMAGES };65 enum {MODE_NONE, MODE_IMAGENAME, MODE_IMAGEFILE, MODE_TIME, MODE_ORPHAN, MODE_MISSED, MODE_PHOTCODES, MODE_DUP_IMAGES, MODE_DUP_MEASURES}; 65 66 66 67 char DateKeyword[64], DateMode[64], UTKeyword[64], MJDKeyword[64], JDKeyword[64]; … … 109 110 void SortAveMeasMatch (off_t *MEAS, off_t *AVE, off_t N); 110 111 111 int delete_photcodes ( int hostID, char *hostpath);112 int delete_photcodes (); 112 113 int delete_photcodes_parallel (SkyList *sky); 113 114 int delete_photcodes_catalog (Catalog *catalog, PhotCode **photcodes, int Nphotcodes); … … 115 116 int delete_photcodes_single (char *cptname); 116 117 117 int delete_duplicate_images ( int hostID, char *hostpath,FITS_DB *db);118 int delete_duplicate_image_measures ( int hostID, char *hostpath,IndexArray *imageID);118 int delete_duplicate_images (FITS_DB *db); 119 int delete_duplicate_image_measures (IndexArray *imageID); 119 120 int delete_duplicate_image_measures_parallel (SkyList *sky, IndexArray *imageID); 120 121 int delete_duplicate_image_measures_catalog (Catalog *catalog, IndexArray *imageID); … … 125 126 IndexArray *ImageIDLoad(char *filename); 126 127 int ImageIDSave(char *filename, IndexArray *imageID); 128 129 int delete_duplicate_measures (); 130 int delete_duplicate_measures_parallel (SkyList *sky); 131 int delete_duplicate_measures_catalog (Catalog *catalog); 132 -
branches/eam_branches/ipp-20130509/Ohana/src/delstar/src/args.c
r35416 r35707 11 11 fprintf (stderr, " delstar -photcodes (list) : delete by photcode\n\n"); 12 12 fprintf (stderr, " delstar -dup-images : delete duplicate images (by externID)\n\n"); 13 fprintf (stderr, " delstar -dup-measures : delete duplicate measures (by imageID + detID)\n\n"); 13 14 fprintf (stderr, " optional flags:\n"); 14 15 fprintf (stderr, " -v : verbose mode\n"); 15 16 fprintf (stderr, " -photcode (code) : restrict by photcode\n"); 16 fprintf (stderr, " -update : apply changes (-dup-images o nly)\n");17 fprintf (stderr, " -update : apply changes (-dup-images or -dup-measures only)\n"); 17 18 fprintf (stderr, " -image-details : list info about the deleted images (-dup-images only)\n"); 18 19 fprintf (stderr, " -image-only : only examine the image table (changes are NOT saved; -dup-images only)\n"); … … 79 80 } 80 81 82 SINGLE_CPT = NULL; 83 if ((N = get_argument (argc, argv, "-cpt"))) { 84 remove_argument (N, &argc, argv); 85 SINGLE_CPT = strcreate (argv[N]); 86 remove_argument (N, &argc, argv); 87 } 88 81 89 // region of interest 82 90 UserPatch.Rmin = 0; … … 104 112 // XXX for the moment, make this selection manual. it needs to be automatic 105 113 // based on the state of the SkyTable 114 HOST_ID = 0; 106 115 PARALLEL = FALSE; 107 116 if ((N = get_argument (argc, argv, "-parallel"))) { … … 159 168 if (MODE != MODE_NONE) usage(); 160 169 MODE = MODE_DUP_IMAGES; 170 remove_argument (N, &argc, argv); 171 } 172 if ((N = get_argument (argc, argv, "-dup-measures"))) { 173 if (MODE != MODE_NONE) usage(); 174 MODE = MODE_DUP_MEASURES; 161 175 remove_argument (N, &argc, argv); 162 176 } … … 303 317 } 304 318 319 SINGLE_CPT = NULL; 320 if ((N = get_argument (argc, argv, "-cpt"))) { 321 remove_argument (N, &argc, argv); 322 SINGLE_CPT = strcreate (argv[N]); 323 remove_argument (N, &argc, argv); 324 } 325 305 326 /* specify portion of the sky */ 306 327 UserPatch.Rmin = 0; … … 333 354 remove_argument (N, &argc, argv); 334 355 } 356 if ((N = get_argument (argc, argv, "-dup-measures"))) { 357 if (MODE != MODE_NONE) usage(); 358 MODE = MODE_DUP_MEASURES; 359 remove_argument (N, &argc, argv); 360 } 335 361 336 362 if (MODE == MODE_NONE) delstar_client_usage (); -
branches/eam_branches/ipp-20130509/Ohana/src/delstar/src/delete_duplicate_images.c
r35416 r35707 6 6 // find & delete duplicate images 7 7 // duplicates based on externID (skip 0s) 8 int delete_duplicate_images ( int hostID, char *hostpath,FITS_DB *db) {8 int delete_duplicate_images (FITS_DB *db) { 9 9 10 10 off_t i, Nimage; … … 28 28 29 29 if (!IMAGE_ONLY) { 30 delete_duplicate_image_measures ( hostID, hostpath,imageID);30 delete_duplicate_image_measures (imageID); 31 31 } 32 32 … … 63 63 } 64 64 65 int delete_duplicate_image_measures ( int hostID, char *hostpath,IndexArray *imageID) {65 int delete_duplicate_image_measures (IndexArray *imageID) { 66 66 67 67 int i; … … 83 83 84 84 // launch the remote jobs 85 if (PARALLEL && ! hostID) {85 if (PARALLEL && !HOST_ID) { 86 86 int status = delete_duplicate_image_measures_parallel (skylist, imageID); 87 87 return status; … … 92 92 93 93 // does this host ID match the desired location for the table? 94 if (!HostTableTestHost(skylist[0].regions[i], hostID)) continue;94 if (!HostTableTestHost(skylist[0].regions[i], HOST_ID)) continue; 95 95 96 96 // set up the basic catalog info 97 97 char hostfile[1024]; 98 snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);99 catalog.filename = hostID ? hostfile : skylist[0].filename[i];98 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name); 99 catalog.filename = HOST_ID ? hostfile : skylist[0].filename[i]; 100 100 catalog.Nsecfilt = GetPhotcodeNsecfilt (); 101 101 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; … … 241 241 // mark the measures to be dropped 242 242 for (i = 0; i < Nmeasure; i++) { 243 measureDrop[i] = 0; 243 244 if (measure[i].imageID == 0) continue; 244 245 off_t Ni = measure[i].imageID - imageID->minID; -
branches/eam_branches/ipp-20130509/Ohana/src/delstar/src/delete_photcodes.c
r34844 r35707 1 1 # include "delstar.h" 2 2 3 int delete_photcodes ( int hostID, char *hostpath) {3 int delete_photcodes () { 4 4 5 5 int i; … … 21 21 22 22 // launch the remote jobs 23 if (PARALLEL && ! hostID) {23 if (PARALLEL && !HOST_ID) { 24 24 int status = delete_photcodes_parallel (skylist); 25 25 return status; … … 34 34 35 35 // does this host ID match the desired location for the table? 36 if (!HostTableTestHost(skylist[0].regions[i], hostID)) continue;36 if (!HostTableTestHost(skylist[0].regions[i], HOST_ID)) continue; 37 37 38 38 // set up the basic catalog info 39 39 char hostfile[1024]; 40 snprintf (hostfile, 1024, "%s/%s.cpt", hostpath, skylist[0].regions[i]->name);41 catalog.filename = hostID ? hostfile : skylist[0].filename[i];40 snprintf (hostfile, 1024, "%s/%s.cpt", HOSTDIR, skylist[0].regions[i]->name); 41 catalog.filename = HOST_ID ? hostfile : skylist[0].filename[i]; 42 42 catalog.Nsecfilt = GetPhotcodeNsecfilt (); 43 43 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; -
branches/eam_branches/ipp-20130509/Ohana/src/delstar/src/delstar.c
r35301 r35707 21 21 switch (MODE) { 22 22 case MODE_DUP_IMAGES: 23 if (!delete_duplicate_images (0, NULL, &db)) exit (1); 23 if (!delete_duplicate_images (&db)) exit (1); 24 exit (0); 25 break; 26 case MODE_DUP_MEASURES: 27 if (!delete_duplicate_measures ()) exit (1); 24 28 exit (0); 25 29 break; -
branches/eam_branches/ipp-20130509/Ohana/src/delstar/src/delstar_client.c
r35416 r35707 22 22 exit (1); 23 23 } 24 if (!delete_duplicate_image_measures (HOST_ID, HOSTDIR, imageID)) exit (1); 24 if (!delete_duplicate_image_measures (imageID)) exit (1); 25 exit (0); 26 break; 27 case MODE_DUP_MEASURES: 28 if (!delete_duplicate_measures ()) exit (1); 25 29 exit (0); 26 30 break; … … 32 36 break; 33 37 case MODE_PHOTCODES: 34 if (!delete_photcodes ( HOST_ID, HOSTDIR)) {38 if (!delete_photcodes ()) { 35 39 fprintf (stderr, "failure deleting measurements from %s\n", HOSTDIR); 36 40 exit (1);
Note:
See TracChangeset
for help on using the changeset viewer.
