Changeset 5862 for trunk/ppMerge/src/ppMergeOptions.c
- Timestamp:
- Dec 30, 2005, 6:32:45 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ppMerge/src/ppMergeOptions.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeOptions.c
r5860 r5862 1 # include "pp Image.h"1 # include "ppMerge.h" 2 2 3 3 // XXX EAM : optionally choose the mask image based on the detrend database … … 26 26 } 27 27 28 // how do we calculate the merge stack? 29 options->mergeStats = NULL; 30 psString stat = psMetadataLookupStr(NULL, config->recipe, "MERGE.STAT"); 31 if (! strcasecmp(stat, "MEAN")) { 32 options->mergeStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 33 } else if (! strcasecmp(stat, "MEDIAN")) { 34 options->mergeStats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN); 35 } else { 36 psErrorStackPrint(stderr, "MERGE.STAT (%s) is not one of MEAN, MEDIAN: assuming MEAN\n", stat); 37 options->mergeStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 38 } 39 40 // mask - recipe options 28 // global pixel mask 29 options->doMask = false; 41 30 if (psMetadataLookupBool(NULL, config->recipe, "MASK")) { 42 31 data->mask->filename = psMetadataLookupStr(NULL, config->arguments, "-mask"); … … 49 38 } 50 39 40 // how do we calculate the merge stack? 41 psStatsOptions mergeStats = 0; 42 psString stat = psMetadataLookupStr(NULL, config->recipe, "MERGE.STAT"); 43 if (! strcasecmp(stat, "MEAN")) { 44 mergeStats = PS_STAT_SAMPLE_MEAN; 45 } else if (! strcasecmp(stat, "MEDIAN")) { 46 mergeStats = PS_STAT_SAMPLE_MEDIAN; 47 } else { 48 psAbort ("merge", "MERGE.STAT (%s) is not one of MEAN, MEDIAN\n", stat); 49 } 50 options->combineParams = pmCombineParamsAlloc (mergeStats); 51 52 // other merge stack options 53 options->applyZeroScale = psMetadataLookupBool(NULL, config->recipe, "MERGE.RESCALE"); 54 55 int nKeep = psMetadataLookupS32(&status, config->recipe, "MERGE.NKEEP"); 56 if (status && nKeep > 0) { 57 options->combineParams->nKeep = nKeep; 58 } 59 60 float fracHigh = psMetadataLookupF32(&status, config->recipe, "MERGE.FRAC.HIGH"); 61 if (status) { 62 options->combineParams->fracHigh = fracHigh; 63 } 64 65 float fracLow = psMetadataLookupF32(&status, config->recipe, "MERGE.FRAC.LOW"); 66 if (status) { 67 options->combineParams->fracLow = fracLow; 68 } 69 70 // XXX need to set the masking value somehow... 71 72 // gain and readnoise come from camera parameters and depend on chip/cell 73 // XXX drop these from the options structure? 74 options->gain = 1.0; 75 options->readnoise = 0.0; 76 51 77 return true; 52 78 }
Note:
See TracChangeset
for help on using the changeset viewer.
