Changeset 39300
- Timestamp:
- Jan 4, 2016, 7:59:05 AM (11 years ago)
- Location:
- trunk/Ohana/src/dvomerge
- Files:
-
- 5 edited
-
Makefile (modified) (1 diff)
-
include/dvomerge.h (modified) (1 diff)
-
src/args.c (modified) (2 diffs)
-
src/dvomergeFromList.c (modified) (7 diffs)
-
src/dvomergeUpdate.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/dvomerge/Makefile
r39281 r39300 25 25 dvoutils : $(BIN)/dvoutils.$(ARCH) 26 26 27 all: dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client dvoutils 27 # all: dvomerge dvomerge_client dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client dvoutils 28 all: dvoconvert dvosecfilt dvosecfilt_client dvorepair dvoverify dvoverify_client dvoutils 28 29 29 30 # $(SRC)/dvomergeContinue.$(ARCH).o -
trunk/Ohana/src/dvomerge/include/dvomerge.h
r39299 r39300 45 45 char *UPDATE_CATFORMAT; 46 46 char *UPDATE_CATCOMPRESS; 47 char *RESTRICT_CPT; 47 48 48 49 int MATCH_BY_EXTERN_ID; -
trunk/Ohana/src/dvomerge/src/args.c
r39299 r39300 74 74 if ((N = get_argument (*argc, argv, "-force-merge"))) { 75 75 FORCE_MERGE = TRUE; 76 remove_argument (N, argc, argv); 77 } 78 79 RESTRICT_CPT = NULL; 80 if ((N = get_argument (*argc, argv, "-restrict-cpt"))) { 81 remove_argument (N, argc, argv); 82 RESTRICT_CPT = strcreate (argv[N]); 76 83 remove_argument (N, argc, argv); 77 84 } … … 259 266 } 260 267 268 RESTRICT_CPT = NULL; 269 if ((N = get_argument (*argc, argv, "-restrict-cpt"))) { 270 remove_argument (N, argc, argv); 271 RESTRICT_CPT = strcreate (argv[N]); 272 remove_argument (N, argc, argv); 273 } 274 261 275 UPDATE_CATFORMAT = NULL; 262 276 if ((N = get_argument (*argc, argv, "-update-catformat"))) { -
trunk/Ohana/src/dvomerge/src/dvomergeFromList.c
r38986 r39300 1 1 # include "dvomerge.h" 2 2 3 char **load_cptlist (char *filename, int *nlist); 4 5 // merge from list implies 'continue' (ie, we must have already done a partial merge) 3 6 int dvomergeFromList (int argc, char **argv) { 4 7 … … 7 10 char filename[256], *input, *output; 8 11 IDmapType IDmap; 9 PhotCodeData *inputPhotcodes;10 PhotCodeData *outputPhotcodes;11 12 int *secfiltMap = NULL; 12 char *listname, **list, inputfile[256], outputfile[256]; 13 int Nlist, NLIST; 13 char inputfile[256], outputfile[256]; 14 14 int NsecfiltInput, NsecfiltOutput; 15 16 INITTIME; 17 18 dvo_image_map_init (&IDmap); 15 19 16 20 if (strcasecmp (argv[2], "into")) dvomerge_usage(); … … 21 25 listname = argv[5]; 22 26 23 Nlist = 0; 24 NLIST = 100; 25 ALLOCATE(list, char *, NLIST); 26 for (i = 0; i < NLIST; i++) { 27 ALLOCATE(list[i], char, 256); 28 memset(list[i], 0, 256); 29 } 30 31 FILE *listfile = fopen(listname, "r"); 32 myAssert(listfile, "error opening list"); 33 34 for (i = 0; fscanf (listfile, "%s", list[i]) != EOF; i++) { 35 if (i == NLIST - 1) { 36 NLIST += 100; 37 REALLOCATE(list, char *, NLIST); 38 for (j = i + 1; j < NLIST; j++) { 39 ALLOCATE(list[j], char, 256); 40 memset(list[j], 0, 256); 41 } 42 } 43 } 44 Nlist = i; 45 fclose(listfile); 27 char *cptlist = load_cptlist (listname, &Ncptlist); 46 28 47 29 if (ALTERNATE_PHOTCODE_FILE) { … … 49 31 exit (1); 50 32 } 33 34 PhotCodeData *inputPhotcodes = NULL; 35 PhotCodeData *outputPhotcodes = NULL; 51 36 52 37 SetPhotcodeTable(NULL); … … 58 43 inputPhotcodes = GetPhotcodeTable(); 59 44 NsecfiltInput = GetPhotcodeNsecfilt(); 45 46 if (REPLACE_TYCHO) replace_tycho_init(); 60 47 61 48 // since we are merging the input db into the output db, the output defines the photcode … … 91 78 } 92 79 93 // XXX need to determine the mapping from the input to the output images 80 // need to determine the mapping from the input to the output images 81 // output dvo images must already have been merged 94 82 dvomergeImagesGetMap (&IDmap, input, output); 95 83 84 // XXX we are not loading the skytable info 85 96 86 SetPhotcodeTable(NULL); 87 88 // XXX the stuff below is equiv to stuff in dvomergeUpdate_catalogs() 97 89 98 90 // loop over the populated input regions … … 162 154 } 163 155 156 // XXX we do not update the skytable 157 158 // XXX need to free things 159 164 160 exit (0); 165 161 } 162 163 char **load_cptlist (char *filename, int *nlist) { 164 165 int NLIST = 100; 166 167 char **list = NULL; 168 ALLOCATE(list, char *, NLIST); 169 170 int i; 171 for (i = 0; i < NLIST; i++) { 172 ALLOCATE(list[i], char, DVO_MAX_PATH); 173 memset(list[i], 0, DVO_MAX_PATH); 174 } 175 176 FILE *listfile = fopen(filename, "r"); 177 myAssert(listfile, "error opening list"); 178 179 for (i = 0; fscanf (listfile, "%s", list[i]) != EOF; i++) { 180 if (i == NLIST - 1) { 181 NLIST += 100; 182 REALLOCATE(list, char *, NLIST); 183 for (j = i + 1; j < NLIST; j++) { 184 ALLOCATE(list[j], char, DVO_MAX_PATH); 185 memset(list[j], 0, DVO_MAX_PATH); 186 } 187 } 188 } 189 *nlist = i; 190 fclose(listfile); 191 192 return list; 193 } -
trunk/Ohana/src/dvomerge/src/dvomergeUpdate.c
r38553 r39300 99 99 inlist = SkyListByPatch (insky, -1, &UserPatch); 100 100 101 // modify the list if we are restricting: 102 inlist = SkyListSubset (inlist, cptlist); 103 101 104 // generate an output table populated at the desired depth 102 105 outsky = SkyTableLoadOptimal (output, NULL, GSCFILE, TRUE, SKY_DEPTH, VERBOSE);
Note:
See TracChangeset
for help on using the changeset viewer.
