Changeset 13143
- Timestamp:
- May 2, 2007, 2:21:43 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/addstar/src/addstar.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/addstar.c
r12732 r13143 3 3 int main (int argc, char **argv) { 4 4 5 int Nmatch, status ;5 int Nmatch, status, loadObjects; 6 6 int i, Nstars, Nimages, Nsubset; 7 7 unsigned long long Naverage, Nmeasure; … … 72 72 if (VERBOSE) fprintf (stderr, "writing to %d regions\n", skylist[0].Nregions); 73 73 74 /* XXX clean this up a bit : for only_image, I don't need to do this loop 75 unless we are getting the calibration. */ 76 /*** match stars to existing catalog data (or otherwise manipulate catalog data) ***/ 74 /* don't load the object tables for only_images, unless we are getting the calibration. */ 75 loadObjects = !options.only_images || options.calibrate; 76 77 /* match stars to existing catalog data (or otherwise manipulate catalog data) */ 77 78 Nmatch = Naverage = Nmeasure = 0; 78 for (i = 0; i < skylist[0].Nregions; i++) {79 for (i = 0; loadObjects && (i < skylist[0].Nregions); i++) { 79 80 80 81 // set the parameters which guide catalog open/load/create … … 86 87 if (options.update) catalog.catflags = LOAD_AVES | LOAD_MEAS_META | LOAD_MISS | LOAD_SECF; 87 88 88 // an error exit status here is a significant error 89 if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) { 90 fprintf (stderr, "ERROR: failure to open/create catalog file %s\n", catalog.filename); 91 exit (2); 89 // open as read or write, depending on desire 90 if (options.only_images && options.calibrate) { 91 if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "r")) { 92 continue; 93 } 94 } else { 95 // an error exit status here is a significant error (disk I/O or file access) 96 if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "w")) { 97 fprintf (stderr, "ERROR: failure to open/create catalog file %s\n", catalog.filename); 98 exit (2); 99 } 92 100 } 101 93 102 // Nave_disk == 0 implies an empty catalog file 94 103 // for only_match, skip empty catalogs
Note:
See TracChangeset
for help on using the changeset viewer.
