Changeset 25197
- Timestamp:
- Aug 25, 2009, 3:25:40 PM (17 years ago)
- Location:
- trunk/pstamp/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/src/ppstamp.c
r16132 r25197 29 29 30 30 // find the pixels that we need to copy, setup the output image 31 if (ppstampMakeStamp(config, options)) { 32 exitCode = 0; 33 } else { 34 exitCode = PS_EXIT_DATA_ERROR; 35 } 31 exitCode = ppstampMakeStamp(config, options); 36 32 37 33 psLogMsg ("ppstamp", 3, "Complete ppstamp run: %f sec\n", psTimerMark(TIMERNAME)); -
trunk/pstamp/src/ppstamp.h
r16132 r25197 20 20 bool ppstampParseCamera(pmConfig *config); 21 21 22 boolppstampMakeStamp(pmConfig *config, ppstampOptions *);22 int ppstampMakeStamp(pmConfig *config, ppstampOptions *); 23 23 pmFPAfile * ppstampBuildMosaic(pmConfig *config, pmFPAfile *input, pmFPAview *view); 24 24 -
trunk/pstamp/src/ppstampMakeStamp.c
r25136 r25197 174 174 static psImage *extractStamp(psImage *image, psRegion region, double value) 175 175 { 176 int width = region.x1 - region.x0 ;177 int height = region.y1 - region.y0 ;176 int width = region.x1 - region.x0 + 0.5; 177 int height = region.y1 - region.y0 + 0.5; 178 178 179 179 if (width < 0) { … … 252 252 // Build the postage stamp output file 253 253 254 static boolmakeStamp(pmConfig *config, ppstampOptions *options, pmFPAfile *input,254 static int makeStamp(pmConfig *config, ppstampOptions *options, pmFPAfile *input, 255 255 pmChip *inChip, pmFPAview *view) 256 256 { … … 260 260 if (!output) { 261 261 psError(PS_ERR_UNKNOWN, false, "Can't find output data\n"); 262 return false;262 return PS_EXIT_DATA_ERROR; 263 263 } 264 264 char *fpaName = psMetadataLookupStr(NULL, input->fpa->concepts, "FPA.OBS"); // Name of FPA … … 284 284 pmFPAfile *mosaic = ppstampBuildMosaic(config, input, view); 285 285 if (mosaic == NULL) { 286 return false;286 return PS_EXIT_UNKNOWN_ERROR; 287 287 } 288 288 srcFile = mosaic; … … 362 362 status = copyMetadata(output, input, inChip, options); 363 363 } 364 return status ;364 return status ? PS_EXIT_SUCCESS : PS_EXIT_UNKNOWN_ERROR; 365 365 } 366 366 … … 574 574 } 575 575 576 boolppstampMakeStamp (pmConfig *config, ppstampOptions *options)576 int ppstampMakeStamp (pmConfig *config, ppstampOptions *options) 577 577 { 578 578 bool status = false; 579 bool returnval = false;;579 int returnval = PS_EXIT_SUCCESS;; 580 580 bool foundOverlap = false; 581 581 … … 583 583 if (!status) { 584 584 psError(PS_ERR_UNKNOWN, true, "Can't find input file!\n"); 585 return false;585 return PS_EXIT_DATA_ERROR; 586 586 } 587 587 … … 591 591 } else if (astrom->camera != input->camera) { 592 592 psError(PS_ERR_UNKNOWN, true, "Input camera and astrometry camera do not match"); 593 return false;593 return PS_EXIT_CONFIG_ERROR; 594 594 } 595 595 … … 600 600 psError(PS_ERR_UNKNOWN, false, "Failed to load input."); 601 601 psFree (view); 602 return false;602 return PS_EXIT_DATA_ERROR; 603 603 } 604 604 bool bilevelAstrometry = false; … … 614 614 psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for input FPA."); 615 615 psFree(view); 616 return false;616 return PS_EXIT_DATA_ERROR; 617 617 } 618 618 } … … 647 647 break; 648 648 case PSTAMP_ERROR: 649 returnval = false;649 returnval = PS_EXIT_UNKNOWN_ERROR; 650 650 allDone = true; 651 651 break; … … 667 667 psFree(view); 668 668 669 if (!foundOverlap ) {669 if (!foundOverlap && (returnval == PS_EXIT_SUCCESS)) { 670 670 fprintf(stderr, "ROI not found in input\n"); 671 returnval = PSTAMP_NO_OVERLAP; 671 672 } 672 673 -
trunk/pstamp/src/pstamp.h
r25077 r25197 42 42 PSTAMP_NOT_AVAILABLE = 25, 43 43 PSTAMP_GONE = 26, 44 PSTAMP_NO_JOBS_QUEUED = 27 44 PSTAMP_NO_JOBS_QUEUED = 27, 45 PSTAMP_NO_OVERLAP = 28 45 46 } pstampJobErrors; 46 47
Note:
See TracChangeset
for help on using the changeset viewer.
