Changeset 27004 for trunk/ppStack/src/ppStackMatch.c
- Timestamp:
- Feb 18, 2010, 6:42:01 PM (16 years ago)
- Location:
- trunk/ppStack/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppStackMatch.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src
- Property svn:ignore
-
old new 10 10 stamp-h1 11 11 ppStackVersionDefinitions.h 12 ppStackErrorCodes.c 13 ppStackErrorCodes.h
-
- Property svn:ignore
-
trunk/ppStack/src/ppStackMatch.c
r26898 r27004 31 31 psFree(resolved); 32 32 if (!fits) { 33 psError(P S_ERR_IO, false, "Unable to open previously produced image: %s", name);33 psError(PPSTACK_ERR_IO, false, "Unable to open previously produced image: %s", name); 34 34 return false; 35 35 } 36 36 psImage *image = psFitsReadImage(fits, psRegionSet(0,0,0,0), 0); // Image of interest 37 37 if (!image) { 38 psError(P S_ERR_IO, false, "Unable to read previously produced image: %s", name);38 psError(PPSTACK_ERR_IO, false, "Unable to read previously produced image: %s", name); 39 39 psFitsClose(fits); 40 40 return false; … … 150 150 psImage *unbinned = psImageAlloc(numCols, numRows, PS_TYPE_F32); // Unbinned background model 151 151 if (!psImageUnbin(unbinned, binned, binning)) { 152 psError(P S_ERR_UNKNOWN, false, "Unable to unbin background model");152 psError(PPSTACK_ERR_DATA, false, "Unable to unbin background model"); 153 153 psFree(unbinned); 154 154 return NULL; … … 177 177 int num = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); 178 178 if (!mdok) { 179 psError(P S_ERR_BAD_PARAMETER_VALUE, true, "RENORM.NUM is not set in the recipe");179 psError(PPSTACK_ERR_CONFIG, true, "RENORM.NUM is not set in the recipe"); 180 180 return false; 181 181 } 182 182 float minValid = psMetadataLookupF32(&mdok, recipe, "RENORM.MIN"); 183 183 if (!mdok) { 184 psError(P S_ERR_BAD_PARAMETER_VALUE, true, "RENORM.MIN is not set in the recipe");184 psError(PPSTACK_ERR_CONFIG, true, "RENORM.MIN is not set in the recipe"); 185 185 return false; 186 186 } 187 187 float maxValid = psMetadataLookupF32(&mdok, recipe, "RENORM.MAX"); 188 188 if (!mdok) { 189 psError(P S_ERR_BAD_PARAMETER_VALUE, true, "RENORM.MAX is not set in the recipe");189 psError(PPSTACK_ERR_CONFIG, true, "RENORM.MAX is not set in the recipe"); 190 190 return false; 191 191 } … … 229 229 230 230 if (!pmReadoutMaskNonfinite(readout, maskVal)) { 231 psError( PS_ERR_UNKNOWN, false, "Unable to mask non-finite pixels in readout.");231 psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels in readout."); 232 232 return false; 233 233 } … … 256 256 psFree(resolved); 257 257 if (!fits || !pmReadoutReadSubtractionKernels(conv, fits)) { 258 psError(P S_ERR_IO, false, "Unable to read previously produced kernel");258 psError(PPSTACK_ERR_IO, false, "Unable to read previously produced kernel"); 259 259 psFitsClose(fits); 260 260 return false; … … 265 265 !readImage(&readout->mask, options->convMasks->data[index], config) || 266 266 !readImage(&readout->variance, options->convVariances->data[index], config)) { 267 psError(P S_ERR_IO, false, "Unable to read previously produced image.");267 psError(PPSTACK_ERR_IO, false, "Unable to read previously produced image."); 268 268 return false; 269 269 } … … 326 326 float scaleMax = psMetadataLookupF32(NULL, ppsub, "SCALE.MAX"); // Maximum for scaling 327 327 if (!isfinite(scaleRef) || !isfinite(scaleMin) || !isfinite(scaleMax)) { 328 psError(P S_ERR_BAD_PARAMETER_VALUE, false,328 psError(PPSTACK_ERR_CONFIG, false, 329 329 "Scale parameters (SCALE.REF=%f, SCALE.MIN=%f, SCALE.MAX=%f) not set in PPSUB recipe.", 330 330 scaleRef, scaleMin, scaleMax); … … 346 346 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator 347 347 if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskVal | maskBad, rng)) { 348 psError(P S_ERR_UNKNOWN, false, "Can't measure background for image.");348 psError(PPSTACK_ERR_DATA, false, "Can't measure background for image."); 349 349 psFree(fake); 350 350 psFree(optWidths); … … 366 366 stampSources, SOURCE_MASK, NULL, NULL, options->psf, 367 367 minFlux, footprint + size, false, true)) { 368 psError(P S_ERR_UNKNOWN, false, "Unable to generate fake image with target PSF.");368 psError(PPSTACK_ERR_DATA, false, "Unable to generate fake image with target PSF."); 369 369 psFree(fake); 370 370 psFree(optWidths); … … 417 417 stride, kernelError, covarFrac, maskVal, maskBad, maskPoor, 418 418 poorFrac, badFrac)) { 419 psError( PS_ERR_UNKNOWN, false, "Unable to convolve images.");419 psError(psErrorCodeLast(), false, "Unable to convolve images."); 420 420 psFree(fake); 421 421 psFree(optWidths); … … 433 433 options->inputSeeing->data.F32[index], 434 434 options->targetSeeing, scaleRef, scaleMin, scaleMax)) { 435 psError( PS_ERR_UNKNOWN, false, "Unable to scale kernel parameters");435 psError(psErrorCodeLast(), false, "Unable to scale kernel parameters"); 436 436 psFree(fake); 437 437 psFree(optWidths); … … 451 451 sysError, skyErr, kernelError, covarFrac, maskVal, maskBad, maskPoor, 452 452 poorFrac, badFrac, PM_SUBTRACTION_MODE_2)) { 453 psError( PS_ERR_UNKNOWN, false, "Unable to match images.");453 psError(psErrorCodeLast(), false, "Unable to match images."); 454 454 psFree(fake); 455 455 psFree(optWidths); … … 464 464 psFree(widthsCopy); 465 465 } 466 466 467 467 468 #ifdef TESTING … … 628 629 // Measure the variance level for the weighting 629 630 if (!psImageBackground(bg, NULL, readout->variance, readout->mask, maskVal | maskBad, rng)) { 630 psError(P S_ERR_UNKNOWN, false, "Can't measure mean variance for image.");631 psError(PPSTACK_ERR_DATA, false, "Can't measure mean variance for image."); 631 632 psFree(rng); 632 633 psFree(bg);
Note:
See TracChangeset
for help on using the changeset viewer.
