Changeset 36996
- Timestamp:
- Jul 10, 2014, 4:04:51 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140610/Ohana/src/libdvo/src/dvo_catalog_split.c
r36918 r36996 134 134 if (!gfits_scan (&catalog[0].header, name, "%s", 1, string)) { 135 135 free (path); 136 // databases created prior to ~2014.07.01 did not have the LENSING or LENSOBJ paths in their headers. 137 // in these cases, we do not try to lock or open the relevant file 138 if (!strcmp (name, "LENSING")) return (DVO_CAT_OPEN_EMPTY); 139 if (!strcmp (name, "LENSOBJ")) return (DVO_CAT_OPEN_EMPTY); 136 140 return (DVO_CAT_OPEN_FAIL); 137 141 } … … 192 196 193 197 /* get the components from the header - these duplicate information in the split files (NAXIS2) */ 198 // NSTARS, NMEAS, NMISS are required; NLENSING, NLENSOBJ are not (0 if not found) 194 199 if (!gfits_scan (&catalog[0].header, "NSTARS", OFF_T_FMT, 1, &Naverage)) return (FALSE); 195 200 if (!gfits_scan (&catalog[0].header, "NMEAS", OFF_T_FMT, 1, &Nmeasure)) return (FALSE); 196 201 if (!gfits_scan (&catalog[0].header, "NMISS", OFF_T_FMT, 1, &Nmissing)) return (FALSE); 197 if (!gfits_scan (&catalog[0].header, "NSECFILT", "%d", 1,&Nsecfilt)) Nsecfilt = 0;198 if (!gfits_scan (&catalog[0].header, "NLENSING", OFF_T_FMT, 1, &Nlensing)) return (FALSE);199 if (!gfits_scan (&catalog[0].header, "NLENSOBJ", OFF_T_FMT, 1, &Nlensobj)) return (FALSE);202 if (!gfits_scan (&catalog[0].header, "NSECFILT", "%d", 1, &Nsecfilt)) Nsecfilt = 0; 203 if (!gfits_scan (&catalog[0].header, "NLENSING", OFF_T_FMT, 1, &Nlensing)) Nlensing = 0; 204 if (!gfits_scan (&catalog[0].header, "NLENSOBJ", OFF_T_FMT, 1, &Nlensobj)) Nlensobj = 0; 200 205 201 206 /* the OBJID is a counter that uniquely defines an average entry and never changes. if … … 382 387 /*** Lensing Table ***/ 383 388 if (!(catalog[0].catflags & SKIP_LENSING)) { 384 // unless we specify 'skip', we still need to load the 389 // unless we specify 'skip', we still need to load the Lensing table 385 390 status = dvo_catalog_open_subcat (catalog, &catalog[0].lensing_catalog, ftable.header, "LENSING", VERBOSE); 386 391 if (status == DVO_CAT_OPEN_FAIL) { 387 392 return (FALSE); 388 393 } 394 // the Lensing file need not exist, unless we expect data to exist 389 395 if ((status == DVO_CAT_OPEN_EMPTY) && (catalog[0].Nlensing_disk > 0)) { 390 396 return (FALSE); … … 392 398 } 393 399 if ((status != DVO_CAT_OPEN_EMPTY) && (catalog[0].catflags & LOAD_LENSING)) { 394 // XXX this allows an empty Lensing catalog with non-empty Average catalog : is that OK?400 // only read the Lensing table if the file actually exists 395 401 /* read Lensing table data */ 396 402 if (!gfits_fread_ftable_data (catalog[0].lensing_catalog[0].f, &ftable, FALSE)) { … … 406 412 catalog[0].Nlensing_off = 0; 407 413 } else { 408 // XXX is it necessary to generate a template header here?409 // XXX this is a memory leak, right?410 414 if (catalog[0].lensing_catalog) { 411 415 gfits_free_header (&catalog[0].lensing_catalog[0].header); … … 428 432 return (FALSE); 429 433 } 434 // the Lensobj file need not exist, unless we expect data to exist 430 435 if ((status == DVO_CAT_OPEN_EMPTY) && (catalog[0].Nlensobj_disk > 0)) { 431 436 return (FALSE); … … 433 438 } 434 439 if ((status != DVO_CAT_OPEN_EMPTY) && (catalog[0].catflags & LOAD_LENSOBJ)) { 435 // XXX this allows an empty Lensobj catalog with non-empty Average catalog : is that OK?440 // only read the Lensobj table if the file actually exists 436 441 /* read Lensobj table data */ 437 442 if (!gfits_fread_ftable_data (catalog[0].lensobj_catalog[0].f, &ftable, FALSE)) { … … 447 452 catalog[0].Nlensobj_off = 0; 448 453 } else { 449 // XXX is it necessary to generate a template header here?450 // XXX this is a memory leak, right?451 454 if (catalog[0].lensobj_catalog) { 452 455 gfits_free_header (&catalog[0].lensobj_catalog[0].header);
Note:
See TracChangeset
for help on using the changeset viewer.
