Changeset 27075 for trunk/ppStack/src/ppStackLoop.c
- Timestamp:
- Feb 25, 2010, 10:58:13 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackLoop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackLoop.c
r27004 r27075 9 9 #include "ppStack.h" 10 10 #include "ppStackLoop.h" 11 12 /// Print a summary of the inputs, and return the number of good inputs 13 static int stackSummary(const ppStackOptions *options, // Stack options, with input mask 14 const char *place // Place in code 15 ) 16 { 17 int numGood = 0; // Number of good inputs 18 psString summary = NULL; // Summary of images 19 for (int i = 0; i < options->num; i++) { 20 char *reason; // Reason for rejecting 21 switch (options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) { 22 case PPSTACK_MASK_NONE: 23 reason = "Good"; 24 numGood++; 25 break; 26 case PPSTACK_MASK_CAL: 27 reason = "Calibration failed"; 28 break; 29 case PPSTACK_MASK_PSF: 30 reason = "PSF measurement failed"; 31 break; 32 case PPSTACK_MASK_MATCH: 33 reason = "PSF matching failed"; 34 break; 35 case PPSTACK_MASK_CHI2: 36 reason = "PSF matching chi^2 deviant"; 37 break; 38 case PPSTACK_MASK_REJECT: 39 reason = "Rejection exceeded threshold"; 40 break; 41 default: 42 psAbort("Unrecognised mask value: %x", options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]); 43 } 44 psStringAppend(&summary, "Image %d: %s\n", i, reason); 45 } 46 psLogMsg("ppStack", PS_LOG_INFO, "Summary of images for %s:\n%s", place, summary); 47 psFree(summary); 48 49 return numGood; 50 } 51 52 11 53 12 54 bool ppStackLoop(pmConfig *config) … … 53 95 ppStackMemDump("convolve"); 54 96 97 // Ensure sufficient inputs 98 { 99 int numGood = stackSummary(options, "initial combination"); 100 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe 101 bool safe = psMetadataLookupBool(NULL, recipe, "SAFE"); // Be safe when combining 102 if (safe && numGood <= 1) { 103 psError(PPSTACK_ERR_REJECTED, true, "Insufficient inputs for combination with safety on"); 104 return false; 105 } 106 } 55 107 56 108 // Start threading … … 94 146 ppStackMemDump("reject"); 95 147 148 // Check inputs 149 { 150 int numGood = stackSummary(options, "final combination"); 151 if (numGood <= 0) { 152 psError(PPSTACK_ERR_REJECTED, true, "Insufficient inputs for combination"); 153 return false; 154 } 155 } 96 156 97 157 // Final combination
Note:
See TracChangeset
for help on using the changeset viewer.
