Changeset 29794
- Timestamp:
- Nov 18, 2010, 11:37:50 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20101103/Ohana/src/dvomerge
- Files:
-
- 11 edited
-
Makefile (modified) (1 diff)
-
include/dvomerge.h (modified) (3 diffs)
-
src/LoadCatalog.c (modified) (1 diff)
-
src/args.c (modified) (1 diff)
-
src/dvoconvert.c (modified) (4 diffs)
-
src/dvomerge.c (modified) (1 diff)
-
src/dvomergeContinue.c (modified) (8 diffs)
-
src/dvomergeCreate.c (modified) (10 diffs)
-
src/dvomergeFromList.c (modified) (7 diffs)
-
src/dvomergeUpdate.c (modified) (7 diffs)
-
src/help.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101103/Ohana/src/dvomerge/Makefile
r29789 r29794 27 27 $(SRC)/dvomergeCreate.$(ARCH).o \ 28 28 $(SRC)/dvomergeContinue.$(ARCH).o \ 29 $(SRC)/dvomergeContinue_threaded.$(ARCH).o \ 29 30 $(SRC)/dvomergeFromList.$(ARCH).o \ 30 31 $(SRC)/dvo_image_merge_dbs.$(ARCH).o \ -
branches/eam_branches/ipp-20101103/Ohana/src/dvomerge/include/dvomerge.h
r29789 r29794 28 28 float RADIUS; 29 29 int SKY_DEPTH; 30 int NTHREADS; 30 31 char *ALTERNATE_PHOTCODE_FILE; 31 32 … … 68 69 SkyList *SkyTablePopulatedList_old PROTO((SkyTable *sky, off_t Ns, off_t Ne)); 69 70 70 int LoadCatalog PROTO((Catalog *catalog, SkyRegion *region, char *filename, char *mode ));71 int LoadCatalog PROTO((Catalog *catalog, SkyRegion *region, char *filename, char *mode, int Nsecfilt)); 71 72 72 73 int merge_catalogs_new PROTO((SkyRegion *region, Catalog *output, Catalog *input, int *secflitMap)); … … 112 113 int dvomergeContinue PROTO((int argc, char **argv)); 113 114 int dvomergeFromList PROTO((int argc, char **argv)); 115 int dvomergeContinue_threaded PROTO((int argc, char **argv)); -
branches/eam_branches/ipp-20101103/Ohana/src/dvomerge/src/LoadCatalog.c
r28329 r29794 1 1 # include "dvomerge.h" 2 2 3 int LoadCatalog (Catalog *catalog, SkyRegion *region, char *filename, char *mode ) {3 int LoadCatalog (Catalog *catalog, SkyRegion *region, char *filename, char *mode, int Nsecfilt) { 4 4 5 5 // set the parameters which guide catalog open/load/create 6 6 catalog[0].filename = filename; 7 catalog[0].Nsecfilt = GetPhotcodeNsecfilt ();7 catalog[0].Nsecfilt = Nsecfilt; 8 8 9 9 // always load all of the data (if any exists) -
branches/eam_branches/ipp-20101103/Ohana/src/dvomerge/src/args.c
r29788 r29794 15 15 remove_argument (N, argc, argv); 16 16 ALTERNATE_PHOTCODE_FILE = strdup(argv[N]); 17 remove_argument (N, argc, argv); 18 } 19 20 NTHREADS = 0; 21 if ((N = get_argument (*argc, argv, "-threads"))) { 22 remove_argument (N, argc, argv); 23 NTHREADS = MAX(0, atoi(argv[N])); 17 24 remove_argument (N, argc, argv); 18 25 } -
branches/eam_branches/ipp-20101103/Ohana/src/dvomerge/src/dvoconvert.c
r29001 r29794 6 6 char filename[256], *input, *output; 7 7 8 int depth ;8 int depth, Nsecfilt; 9 9 off_t i, j, Ns, Ne; 10 10 SkyTable *outsky, *insky; … … 32 32 exit (1); 33 33 } 34 Nsecfilt = GetPhotcodeNsecfilt(); 35 34 36 // save the photcodes in the output catdir 35 37 sprintf (filename, "%s/Photcodes.dat", output); … … 67 69 68 70 // load / create output catalog 69 LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], "w" );71 LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], "w", Nsecfilt); 70 72 71 73 // combine only tables at equal or larger depth … … 77 79 78 80 // load input catalog 79 LoadCatalog (&incatalog, inlist[0].regions[j], inlist[0].filename[j], "r" );81 LoadCatalog (&incatalog, inlist[0].regions[j], inlist[0].filename[j], "r", Nsecfilt); 80 82 81 83 // skip empty input catalogs -
branches/eam_branches/ipp-20101103/Ohana/src/dvomerge/src/dvomerge.c
r29789 r29794 18 18 } 19 19 if (argc == 4) dvomergeUpdate (argc, argv); 20 if (argc == 5) dvomergeContinue (argc, argv); 20 if (argc == 5) { 21 if (NTHREADS) { 22 dvomergeContinue_threaded (argc, argv); 23 } else { 24 dvomergeContinue (argc, argv); 25 } 26 } 21 27 dvomerge_usage(); 22 28 exit (2); // cannot reach here. -
branches/eam_branches/ipp-20101103/Ohana/src/dvomerge/src/dvomergeContinue.c
r29789 r29794 13 13 PhotCodeData *outputPhotcodes; 14 14 int *secfiltMap = NULL; 15 int NsecfiltInput, NsecfiltOutput; 16 17 double dtime; 18 struct timeval start, stop; 19 gettimeofday (&start, NULL); 15 20 16 21 if (strcasecmp (argv[2], "into")) dvomerge_usage(); … … 32 37 } 33 38 inputPhotcodes = GetPhotcodeTable(); 39 NsecfiltInput = GetPhotcodeNsecfilt(); 34 40 35 41 // since we are merging the input db into the output db, the output defines the photcode … … 42 48 43 49 outputPhotcodes = GetPhotcodeTable(); 50 NsecfiltOutput = GetPhotcodeNsecfilt(); 44 51 45 52 secfiltMap = GetSecFiltMap(outputPhotcodes, inputPhotcodes); … … 51 58 fprintf(stderr, "%s not found using photcodes from %s/Photcodes.dat\n", filename, input); 52 59 outputPhotcodes = inputPhotcodes; 60 NsecfiltOutput = NsecfiltInput; 61 53 62 if (!check_dir_access (output, VERBOSE)) { 54 63 fprintf (stderr, "error creating output database directory %s\n", output); … … 87 96 depth = inlist[0].regions[Ns][0].depth; 88 97 98 // XXX test: are we using the table (if so, if it is NULL, we should get errors) 99 SetPhotcodeTable(NULL); 100 89 101 // loop over the populated input regions 90 102 for (i = 0; i < inlist[0].Nregions; i++) { … … 92 104 if (VERBOSE) fprintf (stderr, "input: %s\n", inlist[0].regions[i][0].name); 93 105 94 SetPhotcodeTable(inputPhotcodes);95 106 // load / create output catalog (if catalog does not exist, it will be created) 96 LoadCatalog (&incatalog, &inlist[0].regions[i][0], inlist[0].filename[i], "r" );107 LoadCatalog (&incatalog, &inlist[0].regions[i][0], inlist[0].filename[i], "r", NsecfiltInput); 97 108 // skip empty input catalogs 98 109 if (!incatalog.Naves_disk) { … … 113 124 114 125 // load input catalog 115 SetPhotcodeTable(outputPhotcodes); 116 LoadCatalog (&outcatalog, outlist[0].regions[j], outlist[0].filename[j], "w"); 126 LoadCatalog (&outcatalog, outlist[0].regions[j], outlist[0].filename[j], "w", NsecfiltOutput); 117 127 118 128 dvo_update_image_IDs (&IDmap, &incatalog); … … 148 158 } 149 159 160 gettimeofday (&stop, NULL); 161 dtime = DTIME (stop, start); 162 fprintf (stderr, "SUCCESS: elapsed time %9.4f sec\n", dtime); 163 150 164 exit (0); 151 165 } -
branches/eam_branches/ipp-20101103/Ohana/src/dvomerge/src/dvomergeCreate.c
r28855 r29794 15 15 char *input1, *input2, *output; 16 16 IDmapType IDmap1, IDmap2; 17 int NsecfiltInput1, NsecfiltInput2, NsecfiltOutput; 17 18 18 19 if (strcasecmp (argv[2], "and")) dvomerge_usage(); … … 39 40 } 40 41 input1Photcodes = GetPhotcodeTable(); 42 NsecfiltInput1 = GetPhotcodeNsecfilt(); 41 43 42 44 // Read the input2 photcodes … … 48 50 } 49 51 input2Photcodes = GetPhotcodeTable(); 52 NsecfiltInput2 = GetPhotcodeNsecfilt(); 50 53 51 54 if (ALTERNATE_PHOTCODE_FILE) { … … 60 63 } 61 64 outputPhotcodes = GetPhotcodeTable(); 65 NsecfiltOutput = GetPhotcodeNsecfilt(); 62 66 63 67 secfiltMap1 = GetSecFiltMap(outputPhotcodes, input1Photcodes); … … 74 78 outputPhotcodes = input1Photcodes; 75 79 codesFilename = filename1; 80 NsecfiltOutput = NsecfiltInput1; 76 81 // secfitMap1 can remain NULL since input1 defines the set of codes 77 82 } … … 84 89 } 85 90 91 // trigger any dependencies, if any 92 SetPhotcodeTable(NULL); 93 86 94 // save the output photcodes in the output catdir 87 SetPhotcodeTable(outputPhotcodes);95 // SetPhotcodeTable(outputPhotcodes); 88 96 sprintf (filename, "%s/Photcodes.dat", output); 89 97 if (!check_file_access (filename, TRUE, TRUE, VERBOSE)) { … … 121 129 if (VERBOSE) fprintf (stderr, "output: %s\n", outsky[0].regions[i].name); 122 130 123 if (outputPhotcodes) {124 SetPhotcodeTable(outputPhotcodes);125 }131 // if (outputPhotcodes) { 132 // SetPhotcodeTable(outputPhotcodes); 133 // } 126 134 // load / create output catalog 127 LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], "w" );128 129 if (input1Photcodes) {130 SetPhotcodeTable(input1Photcodes);131 }135 LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], "w", NsecfiltOutput); 136 137 // if (input1Photcodes) { 138 // SetPhotcodeTable(input1Photcodes); 139 // } 132 140 // combine only tables at equal or larger depth 133 141 … … 138 146 139 147 // load input catalog (1) 140 LoadCatalog (&incatalog, inlist[0].regions[j], inlist[0].filename[j], "r" );148 LoadCatalog (&incatalog, inlist[0].regions[j], inlist[0].filename[j], "r", NsecfiltInput1); 141 149 142 150 // skip empty input catalogs … … 153 161 SkyListFree (inlist); 154 162 155 if (input2Photcodes) {156 SetPhotcodeTable(input2Photcodes);157 }163 // if (input2Photcodes) { 164 // SetPhotcodeTable(input2Photcodes); 165 // } 158 166 159 167 // load in all of the tables from input2 for this region … … 163 171 164 172 // load input catalog (2) 165 LoadCatalog (&incatalog, inlist[0].regions[j], inlist[0].filename[j], "r" );173 LoadCatalog (&incatalog, inlist[0].regions[j], inlist[0].filename[j], "r", NsecfiltInput2); 166 174 167 175 // skip empty input catalogs -
branches/eam_branches/ipp-20101103/Ohana/src/dvomerge/src/dvomergeFromList.c
r29789 r29794 12 12 char *listname, **list, inputfile[256], outputfile[256]; 13 13 int Nlist, NLIST; 14 int NsecfiltInput, NsecfiltOutput; 14 15 15 16 if (strcasecmp (argv[2], "into")) dvomerge_usage(); … … 56 57 } 57 58 inputPhotcodes = GetPhotcodeTable(); 59 NsecfiltInput = GetPhotcodeNsecfilt(); 58 60 59 61 // since we are merging the input db into the output db, the output defines the photcode … … 66 68 67 69 outputPhotcodes = GetPhotcodeTable(); 70 NsecfiltOutput = GetPhotcodeNsecfilt(); 68 71 69 72 secfiltMap = GetSecFiltMap(outputPhotcodes, inputPhotcodes); … … 75 78 fprintf(stderr, "%s not found using photcodes from %s/Photcodes.dat\n", filename, input); 76 79 outputPhotcodes = inputPhotcodes; 80 NsecfiltOutput = NsecfiltInput; 81 77 82 if (!check_dir_access (output, VERBOSE)) { 78 83 fprintf (stderr, "error creating output database directory %s\n", output); … … 89 94 dvomergeImagesGetMap (&IDmap, input, output); 90 95 96 SetPhotcodeTable(NULL); 97 91 98 // loop over the populated input regions 92 99 for (i = 0; i < Nlist; i++) { … … 96 103 sprintf (outputfile, "%s/%s", output, list[i]); 97 104 98 SetPhotcodeTable(inputPhotcodes); 99 LoadCatalog (&incatalog, NULL, inputfile, "r"); 105 LoadCatalog (&incatalog, NULL, inputfile, "r", NsecfiltInput); 100 106 101 107 // skip empty input catalogs … … 115 121 116 122 // load input catalog 117 SetPhotcodeTable(outputPhotcodes);118 LoadCatalog (&outcatalog, NULL, outputfile, "w" );123 // SetPhotcodeTable(outputPhotcodes); 124 LoadCatalog (&outcatalog, NULL, outputfile, "w", NsecfiltOutput); 119 125 120 126 if (outcatalog.Naverage == 0) { -
branches/eam_branches/ipp-20101103/Ohana/src/dvomerge/src/dvomergeUpdate.c
r29693 r29794 13 13 PhotCodeData *outputPhotcodes; 14 14 int *secfiltMap = NULL; 15 int NsecfiltInput, NsecfiltOutput; 15 16 16 17 if (strcasecmp (argv[2], "into")) dvomerge_usage(); … … 31 32 } 32 33 inputPhotcodes = GetPhotcodeTable(); 34 NsecfiltInput = GetPhotcodeNsecfilt(); 33 35 34 36 // since we are merging the input db into the output db, the output defines the photcode … … 41 43 42 44 outputPhotcodes = GetPhotcodeTable(); 45 NsecfiltOutput = GetPhotcodeNsecfilt(); 43 46 44 47 secfiltMap = GetSecFiltMap(outputPhotcodes, inputPhotcodes); … … 50 53 fprintf(stderr, "%s not found using photcodes from %s/Photcodes.dat\n", filename, input); 51 54 outputPhotcodes = inputPhotcodes; 55 NsecfiltOutput = NsecfiltInput; 56 52 57 if (!check_dir_access (output, VERBOSE)) { 53 58 fprintf (stderr, "error creating output database directory %s\n", output); … … 85 90 depth = inlist[0].regions[Ns][0].depth; 86 91 92 SetPhotcodeTable(NULL); 93 87 94 // loop over the populated input regions 88 95 for (i = 0; i < inlist[0].Nregions; i++) { … … 90 97 if (VERBOSE) fprintf (stderr, "input: %s\n", inlist[0].regions[i][0].name); 91 98 92 SetPhotcodeTable(inputPhotcodes);99 // SetPhotcodeTable(inputPhotcodes); 93 100 // load / create output catalog (if catalog does not exist, it will be created) 94 LoadCatalog (&incatalog, &inlist[0].regions[i][0], inlist[0].filename[i], "r" );101 LoadCatalog (&incatalog, &inlist[0].regions[i][0], inlist[0].filename[i], "r", NsecfiltInput); 95 102 // skip empty input catalogs 96 103 if (!incatalog.Naves_disk) { … … 111 118 112 119 // load input catalog 113 SetPhotcodeTable(outputPhotcodes);114 LoadCatalog (&outcatalog, outlist[0].regions[j], outlist[0].filename[j], "w" );120 // SetPhotcodeTable(outputPhotcodes); 121 LoadCatalog (&outcatalog, outlist[0].regions[j], outlist[0].filename[j], "w", NsecfiltOutput); 115 122 116 123 dvo_update_image_IDs (&IDmap, &incatalog); -
branches/eam_branches/ipp-20101103/Ohana/src/dvomerge/src/help.c
r29789 r29794 19 19 void dvosecfilt_usage(void) { 20 20 21 fprintf (stderr, "USAGE: dvosecfilt ( input) -photcodes (photcodes.txt)\n");21 fprintf (stderr, "USAGE: dvosecfilt (catdir) (Nsecfilt)\n"); 22 22 23 23 exit (2); … … 80 80 81 81 fprintf (stderr, "USAGE\n"); 82 fprintf (stderr, " dvosecfilt ( input) (Nsecfilt)\n\n");82 fprintf (stderr, " dvosecfilt (catdir) (Nsecfilt)\n\n"); 83 83 84 fprintf (stderr, " change number of secfilt entries in photcode table (updates secfilt tables only)\n"); 84 fprintf (stderr, " change number of secfilt entries in photcode table (updates secfilt tables (cps), NSECFILT in cpt files)\n"); 85 fprintf (stderr, " NOTE: the user must change the photcode table to reflect the change (use photcode-table -export / -import)\n"); 85 86 86 87 fprintf (stderr, " optional flags:\n");
Note:
See TracChangeset
for help on using the changeset viewer.
