Changeset 28529 for trunk/ippToPsps/src
- Timestamp:
- Jun 28, 2010, 4:26:47 PM (16 years ago)
- Location:
- trunk/ippToPsps/src
- Files:
-
- 3 edited
-
ippToPsps.c (modified) (5 diffs)
-
ippToPsps.h (modified) (1 diff)
-
ippToPspsBatchDetection.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/src/ippToPsps.c
r28249 r28529 53 53 } 54 54 55 // save XML document for results 56 if (this->resultsXmlDoc) { 57 58 xmlSaveFormatFileEnc(this->resultsPath, this->resultsXmlDoc, "UTF-8", 1); 59 60 xmlFreeDoc(this->resultsXmlDoc); 61 xmlCleanupParser(); 62 xmlMemoryDump(); 63 } 64 55 65 psFree(this->fitsInPath); 56 66 psFree(this->resultsPath); … … 59 69 psFree(this->pmconfig); 60 70 61 if (this->resultsFile) fclose(this->resultsFile);62 71 63 72 for(uint32_t i=0; i<this->numOfInputFiles; i++) … … 246 255 this->fitsInPath = NULL; 247 256 this->resultsPath = NULL; 248 this->results File= NULL;257 this->resultsXmlDoc = NULL; 249 258 this->numOfInputFiles = 0; 250 259 this->inputFiles = NULL; … … 304 313 } 305 314 315 // create a config object 306 316 this->config = ippToPspsConfig_Constructor(this->configsDir); 307 317 if (this->config == NULL) { … … 311 321 } 312 322 313 // ready results file, if necessary323 // create XML document for results 314 324 if (this->resultsPath) { 315 325 316 this->resultsFile = fopen (this->resultsPath, "w+"); 317 318 if (this->resultsFile == NULL) { 319 320 psError(PS_ERR_UNKNOWN, false, "Unable to open results file at %s", this->resultsPath); 321 // not essential to write results, so don't bail out 322 } 323 else { 324 if (fprintf(this->resultsFile, "%s\n", outputName) < 1 ) 325 psError(PS_ERR_IO, false, "Unable to write FITS output filename to'%s'\n", this->resultsPath); 326 } 326 this->resultsXmlDoc = xmlNewDoc(BAD_CAST "1.0"); 327 xmlNodePtr rootNode = xmlNewNode(NULL, BAD_CAST "ippToPsps_Results"); 328 xmlDocSetRootElement(this->resultsXmlDoc, rootNode); 329 xmlNewChild(rootNode, NULL, BAD_CAST "filename", BAD_CAST outputName); 327 330 } 328 331 -
trunk/ippToPsps/src/ippToPsps.h
r28249 r28529 20 20 typedef struct { 21 21 22 uint32_t expId; // the exposure ID to be used23 psString expName; // the exposure name24 psString surveyType; // the survey type, eg 3PI, MD01, STS, SSS25 uint8_t batchType; // PSPS batch type26 psString fitsInPath; // path to FITS input27 psString resultsPath; // path to results file28 FILE* resultsFile; // file for results29 uint16_t numOfInputFiles; // number of input files30 char** inputFiles; // array of input file names31 psString fitsOutPath; // path to FITS output32 fitsfile *fitsOut; // output FITS file33 psString configsDir; // path to IPP/PSPS mapping file34 pmConfig* pmconfig; // pmConfig35 dvoConfig* dvoConfig; // dvo database36 IppToPspsConfig* config; // config structure37 int exitCode; // ps exit code22 uint32_t expId; // the exposure ID to be used 23 psString expName; // the exposure name 24 psString surveyType; // the survey type, eg 3PI, MD01, STS, SSS 25 uint8_t batchType; // PSPS batch type 26 psString fitsInPath; // path to FITS input 27 psString resultsPath; // path to results file 28 xmlDocPtr resultsXmlDoc; // pointer to XML document for results 29 uint16_t numOfInputFiles; // number of input files 30 char** inputFiles; // array of input file names 31 psString fitsOutPath; // path to FITS output 32 fitsfile *fitsOut; // output FITS file 33 psString configsDir; // path to IPP/PSPS mapping file 34 pmConfig* pmconfig; // pmConfig 35 dvoConfig* dvoConfig; // dvo database 36 IppToPspsConfig* config; // config structure 37 int exitCode; // ps exit code 38 38 39 39 int (*run)(); -
trunk/ippToPsps/src/ippToPspsBatchDetection.c
r28424 r28529 386 386 387 387 // write results 388 if (this->resultsFile) { 389 390 if (fprintf(this->resultsFile, "%ld\n", minObjID) < 1 ) 391 psError(PS_ERR_IO, false, "Unable to write min Object ID to'%s'\n", this->resultsPath); 392 if (fprintf(this->resultsFile, "%ld\n", maxObjID) < 1 ) 393 psError(PS_ERR_IO, false, "Unable to write max Object ID to'%s'\n", this->resultsPath); 394 if (fprintf(this->resultsFile, "%ld\n", totalDetectionsOut) < 1 ) 395 psError(PS_ERR_IO, false, "Unable to write totalDetectionsOut to'%s'\n", this->resultsPath); 388 if (this->resultsXmlDoc) { 389 390 xmlNodePtr rootNode = xmlDocGetRootElement(this->resultsXmlDoc); 391 char tmp[100]; 392 sprintf(tmp, "%ld", minObjID); 393 xmlNewChild(rootNode, NULL, BAD_CAST "minObjID", BAD_CAST tmp); 394 sprintf(tmp, "%ld", maxObjID); 395 xmlNewChild(rootNode, NULL, BAD_CAST "maxObjID", BAD_CAST tmp); 396 sprintf(tmp, "%ld", totalDetectionsOut); 397 xmlNewChild(rootNode, NULL, BAD_CAST "totalDetections", BAD_CAST tmp); 396 398 } 397 399
Note:
See TracChangeset
for help on using the changeset viewer.
