Changeset 8456
- Timestamp:
- Aug 21, 2006, 4:00:06 PM (20 years ago)
- Location:
- trunk/Ohana/src/libdvo/src
- Files:
-
- 4 edited
-
dvo_catalog.c (modified) (7 diffs)
-
dvo_catalog_raw.c (modified) (1 diff)
-
dvo_catalog_split.c (modified) (7 diffs)
-
dvo_convert.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libdvo/src/dvo_catalog.c
r8429 r8456 75 75 catalog[0].catflags = 0; 76 76 catalog[0].sorted = 0; 77 catalog[0].Nsecfilt = 0; 77 78 } 78 79 … … 88 89 catalog[0].Nmeasure = 0; 89 90 catalog[0].Nmissing = 0; 90 catalog[0].Nsecfilt = 0;91 91 92 92 catalog[0].Nave_disk = 0; … … 173 173 if (mode == DVO_OPEN_NONE) return (FALSE); 174 174 175 // save the expected Nsecfilt value for testing 176 Nsecfilt = catalog[0].Nsecfilt; 177 178 dvo_catalog_init (catalog, FALSE); 179 175 180 catalog[0].lockmode = LCK_XCLD; 176 181 if (mode == DVO_OPEN_READ) catalog[0].lockmode = LCK_SOFT; 177 182 178 183 // XXX make a backup? always? 179 184 if (!check_file_access (catalog[0].filename, TRUE, VERBOSE)) { … … 182 187 } 183 188 184 if (VERBOSE) fprintf (stderr, "adding to %s\n", catalog[0].filename); 185 186 // save the expected Nsecfilt value for testing 187 Nsecfilt = catalog[0].Nsecfilt; 188 189 if (VERBOSE) fprintf (stderr, "opening %s\n", catalog[0].filename); 190 189 191 switch (dvo_catalog_lock (catalog, catalog[0].lockmode)) { 190 192 case 0: … … 203 205 break; 204 206 case 2: 205 if (DVO_OPEN_READ || DVO_OPEN_UPDATE) return (TRUE); 207 if ((mode == DVO_OPEN_READ) || (mode == DVO_OPEN_UPDATE)) return (TRUE); 208 catalog[0].Nsecfilt = Nsecfilt; 206 209 dvo_catalog_create (region, catalog); /* fills in new header info */ 207 210 if (VERBOSE) fprintf (stderr, "creating new file %s\n", catalog[0].filename); … … 256 259 if (VERBOSE) fprintf (stderr, "reading catalog (mode DVO_MODE_SPLIT)\n"); 257 260 dvo_catalog_load_split (catalog, VERBOSE); 258 dvo_catalog_test (catalog, TRUE);259 261 break; 260 262 default: … … 326 328 SecFilt *insec, *outsec; 327 329 330 if (Nsecfilt == 0) return (TRUE); // if Nsecfilt is not set, don't do this check 328 331 if (catalog[0].Nsecfilt == Nsecfilt) return (TRUE); 329 332 if (catalog[0].Nsecfilt > Nsecfilt) return (FALSE); -
trunk/Ohana/src/libdvo/src/dvo_catalog_raw.c
r8328 r8456 35 35 if (catalog[0].catformat != DVO_FORMAT_UNDEF) goto got_format; 36 36 } 37 /* special cases: old versions of the DB tables which were poorly identified */ 37 38 if (gfits_scan (&catalog[0].header, "NEWMEAS", "%t", 1, &NewMeasure)) { 38 39 catalog[0].catformat = DVO_FORMAT_ELIXIR; -
trunk/Ohana/src/libdvo/src/dvo_catalog_split.c
r8386 r8456 3 3 int dvo_catalog_load_split (Catalog *catalog, int VERBOSE) { 4 4 5 int Nitems, Nexpect, Naverage, Nmeasure, Nmissing, Nsecfilt ;5 int Nitems, Nexpect, Naverage, Nmeasure, Nmissing, Nsecfilt, status; 6 6 char *path, string[80]; 7 7 Header header; … … 60 60 gfits_free_header (&header); 61 61 } 62 dvo_catalog_test (catalog, FALSE);63 62 64 63 /*** Measure Table ***/ … … 111 110 gfits_free_matrix (&matrix); 112 111 } 113 dvo_catalog_test (catalog, FALSE);114 112 115 113 /* (Meta Load) */ … … 143 141 } 144 142 catalog[0].measure_catalog = measure; 145 dvo_catalog_test (catalog, FALSE);146 143 147 144 /*** Missing Table ***/ … … 158 155 159 156 /* lock & open catalog file */ 160 if (dvo_catalog_lock (missing, catalog[0].lockmode) != 1) { 161 fprintf (stderr, "cannot access missing file %s\n", missing[0].filename); 157 status = dvo_catalog_lock (missing, catalog[0].lockmode); 158 if (!status) { 159 fprintf (stderr, "ERROR: cannot access missing file %s\n", missing[0].filename); 162 160 exit (2); 161 } 162 if (status == 2) { 163 /* MISSING table is empty (this is not an error) */ 164 gfits_create_header (&missing[0].header); 165 goto missing_empty; 163 166 } 164 167 … … 191 194 gfits_free_matrix (&matrix); 192 195 } 196 missing_empty: 193 197 catalog[0].missing_catalog = missing; 194 dvo_catalog_test (catalog, FALSE);195 198 196 199 /*** Secfilt Table ***/ … … 241 244 } 242 245 catalog[0].secfilt_catalog = secfilt; 243 dvo_catalog_test (catalog, FALSE);244 246 245 247 /* save the current number so we can do partial updates */ -
trunk/Ohana/src/libdvo/src/dvo_convert.c
r7080 r8456 428 428 return (TRUE); 429 429 case DVO_FORMAT_PANSTARRS: 430 case DVO_FORMAT_PMTEST: 430 431 /* convert table rows from internal to external format */ 431 432 for (i = 0; i < Nrow; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
