Changeset 38986 for trunk/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c
- Timestamp:
- Oct 27, 2015, 4:49:06 PM (11 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/dvomerge/src/dvomergeUpdate_catalogs.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/ipp-20150625/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/dvomerge/src/dvomergeUpdate_catalogs.c
r38470 r38986 177 177 LoadCatalog (&outcatalog, outlist[0].regions[j], outcatalog.filename, "w", NsecfiltOutput); 178 178 179 // if no catalog already exists, use the input catalog to define the format or the specified format180 179 if (UPDATE_CATFORMAT) { 181 180 outcatalog.catformat = dvo_catalog_catformat (UPDATE_CATFORMAT); 182 181 } else { 183 outcatalog.catformat = incatalog.catformat; 184 } 182 // IF no catalog already exists, use the input catalog to define the format 183 if (outcatalog.Naverage_disk == 0) { 184 outcatalog.catformat = incatalog.catformat; 185 } 186 } 187 185 188 if (UPDATE_CATCOMPRESS) { 186 189 outcatalog.catcompress = dvo_catalog_catcompress (UPDATE_CATCOMPRESS); 187 190 } else { 188 outcatalog.catcompress = incatalog.catcompress; 191 // IF no catalog already exists, use the input catalog to define the compression 192 if (outcatalog.Naverage_disk == 0) { 193 outcatalog.catcompress = incatalog.catcompress; 194 } 195 } 196 197 if (REPAIR_BY_OBJID) { 198 // For gpc1 / PV3, I broke some catalogs with dvomerge -replace: the last object can 199 // contaminate the first set of new measurements 200 repair_catalog_by_objID (&outcatalog); 189 201 } 190 202 … … 195 207 } 196 208 197 if (!dvo_catalog_backup (&outcatalog, TRUE)) {209 if (!dvo_catalog_backup (&outcatalog, "~", TRUE)) { 198 210 fprintf (stderr, "ERROR: failed to make backup for catalog %s\n", outlist[0].filename[j]); 199 211 exit (1); … … 202 214 // if we receive a signal which would cause us to exit, wait until the full catalog is written 203 215 SetProtect (TRUE); 204 if (!dvo_catalog_save (&outcatalog, VERBOSE)) { 205 fprintf (stderr, "ERROR: failed to save catalog %s\n", outlist[0].filename[j]); 206 exit (1); 207 } 216 if (!dvo_catalog_save (&outcatalog, VERBOSE)) { fprintf (stderr, "ERROR: failed to save catalog %s\n", outcatalog.filename); exit (1); } 217 if (!dvo_catalog_unlock (&outcatalog)) { fprintf (stderr, "ERROR: failed to unlock catalog %s\n", outcatalog.filename); exit (1); } 208 218 SetProtect (FALSE); 209 219 210 if (!dvo_catalog_unlock (&outcatalog)) { 211 fprintf (stderr, "ERROR: failed to unlock catalog %s\n", outlist[0].filename[j]); 212 exit (1); 213 } 214 215 if (!dvo_catalog_unlink_backup (&outcatalog, TRUE)) { 220 if (!dvo_catalog_unlink_backup (&outcatalog, "~", TRUE)) { 216 221 fprintf (stderr, "WARNING: failed to remove backup for catalog %s\n", outlist[0].filename[j]); 217 222 } … … 282 287 283 288 // options / arguments that can affect relastro_client -update-objects: 284 char command[DVO_MAX_PATH];285 s nprintf (command, DVO_MAX_PATH, "dvomerge_client %s into %s -hostID %d -hostdir %s -region %f %f %f %f -D ADDSTAR_RADIUS %f",286 absinput, absoutput, group->hosts[i][0].hostID, group->hosts[i][0].pathname,287 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS288 ); 289 290 char tmpline[DVO_MAX_PATH];291 if (VER BOSE) { snprintf (tmpline, DVO_MAX_PATH, "%s -v", command); strcpy (command, tmpline); }292 if ( VERIFY) { snprintf (tmpline, DVO_MAX_PATH, "%s -verify", command); strcpy (command, tmpline); }293 if ( VERIFY_CATALOG_ONLY) { snprintf (tmpline, DVO_MAX_PATH, "%s -verify-catalogs", command); strcpy (command, tmpline); }294 if ( REPLACE_BY_PHOTCODE) { snprintf (tmpline, DVO_MAX_PATH, "%s -replace", command); strcpy (command, tmpline); }295 if ( REPLACE_TYCHO) { snprintf (tmpline, DVO_MAX_PATH, "%s -replace-tycho", command); strcpy (command, tmpline); }296 if ( PARALLEL_INPUT) { snprintf (tmpline, DVO_MAX_PATH, "%s -parallel-input", command); strcpy (command, tmpline); }297 if ( FORCE_MERGE) { snprintf (tmpline, DVO_MAX_PATH, "%s -force-merge", command); strcpy (command, tmpline); }298 if ( MATCHED_TABLES) { snprintf (tmpline, DVO_MAX_PATH, "%s -matched-tables", command); strcpy (command, tmpline); }299 if ( UPDATE_CATFORMAT) { snprintf (tmpline, DVO_MAX_PATH, "%s -update-catformat %s", command, UPDATE_CATFORMAT); strcpy (command, tmpline); }289 char *command = NULL; 290 strextend (&command, "dvomerge_client %s into %s -hostID %d -hostdir %s -region %f %f %f %f -D ADDSTAR_RADIUS %f", 291 absinput, absoutput, group->hosts[i][0].hostID, group->hosts[i][0].pathname, 292 UserPatch.Rmin, UserPatch.Rmax, UserPatch.Dmin, UserPatch.Dmax, RADIUS); 293 294 if (VERBOSE) { strextend (&command, "-v"); } 295 if (VERIFY) { strextend (&command, "-verify"); } 296 if (VERIFY_CATALOG_ONLY) { strextend (&command, "-verify-catalogs"); } 297 if (REPLACE_BY_PHOTCODE) { strextend (&command, "-replace"); } 298 if (REPLACE_TYCHO) { strextend (&command, "-replace-tycho"); } 299 if (PARALLEL_INPUT) { strextend (&command, "-parallel-input"); } 300 if (FORCE_MERGE) { strextend (&command, "-force-merge"); } 301 if (MATCHED_TABLES) { strextend (&command, "-matched-tables"); } 302 if (UPDATE_CATFORMAT) { strextend (&command, "-update-catformat %s", UPDATE_CATFORMAT); } 303 if (UPDATE_CATCOMPRESS) { strextend (&command, "-update-catcompress %s", UPDATE_CATCOMPRESS); } 304 if (REPAIR_BY_OBJID) { strextend (&command, "-repair-by-objid"); } 300 305 301 306 // add some config variables: 302 s nprintf (tmpline, DVO_MAX_PATH, "%s -D CATMODE %s", command, CATMODE); strcpy (command, tmpline);303 s nprintf (tmpline, DVO_MAX_PATH, "%s -D CATFORMAT %s", command, CATFORMAT); strcpy (command, tmpline);304 s nprintf (tmpline, DVO_MAX_PATH, "%s -D SKY_DEPTH %d", command, SKY_DEPTH); strcpy (command, tmpline);307 strextend (&command, "-D CATMODE %s", CATMODE); 308 strextend (&command, "-D CATFORMAT %s", CATFORMAT); 309 strextend (&command, "-D SKY_DEPTH %d", SKY_DEPTH); 305 310 306 311 fprintf (stderr, "command: %s\n", command);
Note:
See TracChangeset
for help on using the changeset viewer.
