- Timestamp:
- Jul 15, 2010, 6:27:55 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100621/Ohana/src/dvomerge/src/dvomergeUpdate.c
r28354 r28674 6 6 off_t i, j, Ns, Ne; 7 7 SkyTable *outsky, *insky; 8 SkyList * inlist;8 SkyList *outlist; 9 9 Catalog incatalog, outcatalog; 10 10 char filename[256], *input, *output; … … 58 58 depth = insky[0].regions[Ns].depth; 59 59 60 // loop over the populat able output regions60 // loop over the populated input regions 61 61 for (i = 0; i < outsky[0].Nregions; i++) { 62 if (! outsky[0].regions[i].table) continue;63 if (VERBOSE) fprintf (stderr, " output: %s\n", outsky[0].regions[i].name);62 if (!insky[0].regions[i].table) continue; 63 if (VERBOSE) fprintf (stderr, "input: %s\n", insky[0].regions[i].name); 64 64 65 65 // load / create output catalog (if catalog does not exist, it will be created) 66 LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], "w"); 66 LoadCatalog (&incatalog, &insky[0].regions[i], insky[0].filename[i], "r"); 67 // skip empty input catalogs 68 if (!incatalog.Naves_disk) { 69 dvo_catalog_unlock (&incatalog); 70 dvo_catalog_free (&incatalog); 71 continue; 72 } 67 73 68 74 // combine only tables at equal or larger depth … … 72 78 // compare to a slightly reduced footprint 73 79 float dPos = 2.0/3600.0; 74 inlist = SkyListByBounds (insky, depth, outsky[0].regions[i].Rmin + dPos, outsky[0].regions[i].Rmax - dPos, outsky[0].regions[i].Dmin + dPos, outsky[0].regions[i].Dmax - dPos);75 for (j = 0; j < inlist[0].Nregions; j++) {76 if (VERBOSE) fprintf (stderr, " input : %s\n", inlist[0].regions[j][0].name);80 outlist = SkyListByBounds (outsky, depth, insky[0].regions[i].Rmin + dPos, insky[0].regions[i].Rmax - dPos, insky[0].regions[i].Dmin + dPos, insky[0].regions[i].Dmax - dPos); 81 for (j = 0; j < outlist[0].Nregions; j++) { 82 if (VERBOSE) fprintf (stderr, "output : %s\n", outlist[0].regions[j][0].name); 77 83 78 84 // load input catalog 79 LoadCatalog (& incatalog, inlist[0].regions[j], inlist[0].filename[j], "r");85 LoadCatalog (&outcatalog, outlist[0].regions[j], outlist[0].filename[j], "w"); 80 86 81 // skip empty input catalogs82 if (!incatalog.Naves_disk) {83 dvo_catalog_unlock (&incatalog);84 dvo_catalog_free (&incatalog);85 continue;86 }87 87 dvo_update_image_IDs (&IDmap, &incatalog); 88 merge_catalogs_old (&outsky[0].regions[i], &outcatalog, &incatalog, RADIUS); 89 dvo_catalog_unlock (&incatalog); 90 dvo_catalog_free (&incatalog); 88 merge_catalogs_old (&outsky[0].regions[j], &outcatalog, &incatalog, RADIUS); 91 89 92 fprintf (stderr, "merged %s into %s\n", outsky[0].regions[i].name, inlist[0].regions[j][0].name); 90 outcatalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 91 dvo_catalog_save (&outcatalog, VERBOSE); 92 dvo_catalog_unlock (&outcatalog); 93 dvo_catalog_free (&outcatalog); 94 95 fprintf (stderr, "merged %s into %s\n", insky[0].regions[i].name, outlist[0].regions[j][0].name); 93 96 } 94 SkyListFree ( inlist);97 SkyListFree (outlist); 95 98 96 outcatalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF; 97 dvo_catalog_save (&outcatalog, VERBOSE); 98 dvo_catalog_unlock (&outcatalog); 99 dvo_catalog_free (&outcatalog); 99 dvo_catalog_unlock (&incatalog); 100 dvo_catalog_free (&incatalog); 100 101 } 101 102
Note:
See TracChangeset
for help on using the changeset viewer.
