Changeset 33738 for branches/eam_branches/ipp-20120405/Ohana
- Timestamp:
- Apr 9, 2012, 2:09:17 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120405/Ohana/src/dvomerge/src
- Files:
-
- 2 edited
-
dvo_image_merge_dbs.c (modified) (2 diffs)
-
dvomergeCreate.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120405/Ohana/src/dvomerge/src/dvo_image_merge_dbs.c
r31450 r33738 116 116 int status; 117 117 118 IDmap->old = NULL; 119 IDmap->new = NULL; 120 121 // it is OK if there are no images in the database, but there should be no imageIDs to map... 122 if (in->dbstate == LCK_EMPTY) { 123 return TRUE; 124 } 125 118 126 images = gfits_table_get_Image (&in[0].ftable, &Nimages, &in[0].swapped); 119 127 if (!images) { … … 199 207 if (oldID == 0) continue; 200 208 209 if (!IDmap->old) { 210 fprintf (stderr, "input database has image IDs, but no Image table\n"); 211 } 212 201 213 newID = dvo_map_image_ID (IDmap, oldID); 202 214 if (newID == 0) { -
branches/eam_branches/ipp-20120405/Ohana/src/dvomerge/src/dvomergeCreate.c
r33657 r33738 124 124 depth2 = insky2[0].regions[Ns].depth; 125 125 126 SkyList *outlist = SkyListByPatch (outsky, -1, &UserPatch); 127 126 128 // loop over the populatable output regions 127 for (i = 0; i < out sky[0].Nregions; i++) {128 if (!out sky[0].regions[i].table) continue;129 if (VERBOSE) fprintf (stderr, "output: %s\n", out sky[0].regions[i].name);129 for (i = 0; i < outlist[0].Nregions; i++) { 130 if (!outlist[0].regions[i][0].table) continue; 131 if (VERBOSE) fprintf (stderr, "output: %s\n", outlist[0].regions[i][0].name); 130 132 131 133 // load / create output catalog 132 LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], "w", NsecfiltOutput);134 LoadCatalog (&outcatalog, outlist[0].regions[i], outlist[0].filename[i], "w", NsecfiltOutput); 133 135 134 136 // combine only tables at equal or larger depth 135 137 136 138 // load in all of the tables from input1 for this region 137 inlist = SkyListByBounds (insky1, depth1, out sky[0].regions[i].Rmin, outsky[0].regions[i].Rmax, outsky[0].regions[i].Dmin, outsky[0].regions[i].Dmax);139 inlist = SkyListByBounds (insky1, depth1, outlist[0].regions[i][0].Rmin + 0.01, outlist[0].regions[i][0].Rmax - 0.01, outlist[0].regions[i][0].Dmin + 0.01, outlist[0].regions[i][0].Dmax - 0.01); 138 140 for (j = 0; j < inlist[0].Nregions; j++) { 139 141 if (VERBOSE) fprintf (stderr, "input 1: %s\n", inlist[0].regions[j][0].name); … … 149 151 } 150 152 dvo_update_image_IDs (&IDmap1, &incatalog); 151 merge_catalogs_new ( &outsky[0].regions[i], &outcatalog, &incatalog, secfiltMap1);153 merge_catalogs_new (outlist[0].regions[i], &outcatalog, &incatalog, secfiltMap1); 152 154 dvo_catalog_unlock (&incatalog); 153 155 dvo_catalog_free (&incatalog); … … 156 158 157 159 // load in all of the tables from input2 for this region 158 inlist = SkyListByBounds (insky2, depth2, out sky[0].regions[i].Rmin, outsky[0].regions[i].Rmax, outsky[0].regions[i].Dmin, outsky[0].regions[i].Dmax);160 inlist = SkyListByBounds (insky2, depth2, outlist[0].regions[i][0].Rmin + 0.01, outlist[0].regions[i][0].Rmax - 0.01, outlist[0].regions[i][0].Dmin + 0.01, outlist[0].regions[i][0].Dmax - 0.01); 159 161 for (j = 0; j < inlist[0].Nregions; j++) { 160 162 if (VERBOSE) fprintf (stderr, "input 2: %s\n", inlist[0].regions[j][0].name); … … 170 172 } 171 173 dvo_update_image_IDs (&IDmap2, &incatalog); 172 merge_catalogs_old ( &outsky[0].regions[i], &outcatalog, &incatalog, RADIUS, secfiltMap2);174 merge_catalogs_old (outlist[0].regions[i], &outcatalog, &incatalog, RADIUS, secfiltMap2); 173 175 dvo_catalog_unlock (&incatalog); 174 176 dvo_catalog_free (&incatalog); … … 219 221 in1DB.mode = dvo_catalog_catmode (CATMODE); 220 222 in1DB.format = dvo_catalog_catformat (CATFORMAT); 221 status = dvo_image_lock (&in1DB, ImageCat, 3600.0, LCK_ XCLD); // shorter timeout?223 status = dvo_image_lock (&in1DB, ImageCat, 3600.0, LCK_SOFT); // shorter timeout? 222 224 if (!status) Shutdown ("ERROR: failure to lock image catalog %s", in1DB.filename); 223 225 224 226 // load the image table 225 if (in1DB.dbstate == LCK_EMPTY) { 226 Shutdown ("can't find input (1) image catalog %s", in1DB.filename); 227 } 228 if (!dvo_image_load (&in1DB, VERBOSE, TRUE)) { 229 Shutdown ("can't read input (1) image catalog %s", in1DB.filename); 230 } 231 227 if (in1DB.dbstate != LCK_EMPTY) { 228 if (!dvo_image_load (&in1DB, VERBOSE, TRUE)) { 229 Shutdown ("can't read input (1) image catalog %s", in1DB.filename); 230 } 231 } 232 232 233 // convert database table to internal structure & add to output image db 234 // if in1DB has no images, we will (later) insist that there are no image IDs to map 233 235 dvo_image_merge_dbs(IDmap1, &outDB, &in1DB); 234 236 dvo_image_unlock (&in1DB); // unlock input1 235 236 237 237 238 /*** load input2/Images.dat ***/ … … 239 240 in2DB.mode = dvo_catalog_catmode (CATMODE); 240 241 in2DB.format = dvo_catalog_catformat (CATFORMAT); 241 status = dvo_image_lock (&in2DB, ImageCat, 3600.0, LCK_ XCLD); // shorter timeout?242 status = dvo_image_lock (&in2DB, ImageCat, 3600.0, LCK_SOFT); // shorter timeout? 242 243 if (!status) Shutdown ("ERROR: failure to lock image catalog %s", in2DB.filename); 243 244 244 245 /* load the image table */ 245 if (in2DB.dbstate == LCK_EMPTY) { 246 Shutdown ("can't find input (2) image catalog %s", in2DB.filename); 247 } 248 if (!dvo_image_load (&in2DB, VERBOSE, TRUE)) { 249 Shutdown ("can't read input (2) image catalog %s", in2DB.filename); 246 if (in2DB.dbstate != LCK_EMPTY) { 247 if (!dvo_image_load (&in2DB, VERBOSE, TRUE)) { 248 Shutdown ("can't read input (2) image catalog %s", in2DB.filename); 249 } 250 250 } 251 251 252 252 // convert database table to internal structure & add to output image db 253 // if in1DB has no images, we will (later) insist that there are no image IDs to map 253 254 dvo_image_merge_dbs(IDmap2, &outDB, &in2DB); 254 255 dvo_image_unlock (&in2DB); // unlock input2
Note:
See TracChangeset
for help on using the changeset viewer.
