Changeset 28330
- Timestamp:
- Jun 15, 2010, 9:47:00 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/dvomerge/src/dvomergeUpdate.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/dvomerge/src/dvomergeUpdate.c
r27583 r28330 16 16 output = argv[3]; 17 17 18 // the first input defines the photcode table & db layout 19 sprintf (filename, "%s/Photcodes.dat", input); 18 // since we are merging the input db into the output db, the output defines the photcode 19 // table & db layout but, this requires the output to exist. if it does not, instead use the 20 // input. 21 sprintf (filename, "%s/Photcodes.dat", output); 20 22 if (!LoadPhotcodes (filename, NULL, FALSE)) { 21 fprintf (stderr, "error loading photcode table %s\n", filename); 22 exit (1); 23 sprintf (filename, "%s/Photcodes.dat", input); 24 if (!LoadPhotcodes (filename, NULL, FALSE)) { 25 fprintf (stderr, "error loading photcode table: tried %s/Photcodes.dat and %s/Photcodes.dat\n", output, input); 26 exit (1); 27 } 23 28 } 24 29 … … 27 32 // load the sky table for the existing database 28 33 insky = SkyTableLoadOptimal (input, NULL, NULL, FALSE, SKY_DEPTH_HST, VERBOSE); 34 if (!insky) { 35 Shutdown ("can't read SkyTable for %s", input); 36 } 29 37 SkyTableSetFilenames (insky, input, "cpt"); 30 38 31 39 // generate an output table populated at the desired depth 32 outsky = SkyTableLoadOptimal (output, NULL, NULL, TRUE, SKY_DEPTH, VERBOSE); 40 outsky = SkyTableLoadOptimal (output, NULL, GSCFILE, TRUE, SKY_DEPTH, VERBOSE); 41 if (!outsky) { 42 Shutdown ("can't read or create SkyTable for %s", output); 43 } 33 44 SkyTableSetFilenames (outsky, output, "cpt"); 34 45 … … 43 54 if (VERBOSE) fprintf (stderr, "output: %s\n", outsky[0].regions[i].name); 44 55 45 // load / create output catalog 46 LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], " a");56 // load / create output catalog (if catalog does not exist, it will be created) 57 LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], "w"); 47 58 48 59 // combine only tables at equal or larger depth … … 102 113 // load the image table 103 114 if (inDB.dbstate == LCK_EMPTY) { 104 Shutdown ("can't find input (1)image catalog %s", inDB.filename);115 Shutdown ("can't find input image catalog %s", inDB.filename); 105 116 } 106 117 if (!dvo_image_load (&inDB, VERBOSE, TRUE)) { 107 Shutdown ("can't read input (1)image catalog %s", inDB.filename);118 Shutdown ("can't read input image catalog %s", inDB.filename); 108 119 } 109 120 … … 117 128 /* load the image table */ 118 129 if (outDB.dbstate == LCK_EMPTY) { 119 Shutdown ("can't find input (2) image catalog %s", outDB.filename); 120 } 121 if (!dvo_image_load (&outDB, VERBOSE, TRUE)) { 122 Shutdown ("can't read input (2) image catalog %s", outDB.filename); 130 dvo_image_create (&outDB, GetZeroPoint()); 131 } else { 132 if (!dvo_image_load (&outDB, VERBOSE, TRUE)) { 133 Shutdown ("can't read output image catalog %s", outDB.filename); 134 } 123 135 } 124 136
Note:
See TracChangeset
for help on using the changeset viewer.
