Changeset 6064 for trunk/ppImage/src/ppImageOptions.c
- Timestamp:
- Jan 19, 2006, 4:58:42 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageOptions.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageOptions.c
r5976 r6064 17 17 options->doAstrom = false; // Astrometry 18 18 // Overscan options 19 options->overscan Bins = 1; // Number of pixels per bin for overscan20 options->overscanStats = NULL; // Statistics for overscan21 options->overscanFit = NULL; // Overscan fit (polynomial or spline)22 options->overscanFitType = PM_FIT_NONE; // Fit type for overscan23 options->overscanMode = PM_OVERSCAN_NONE; // Axis for overscan19 options->overscan = NULL; // Overscan options 20 bool overscanSingle = false; // A single value for entire overscan? 21 pmFit overscanFit = PM_FIT_NONE; // Fit type for overscan 22 int overscanOrder = 0; // Order for overscan fit 23 psStats *overscanStats = NULL; // Statistics for overscan 24 24 // Non-linearity options 25 25 options->nonLinearType = 0; // Type of non-linearity data (vector, string or metadata) … … 28 28 // Various others 29 29 options->imageLoadDepth = PP_LOAD_NONE; // No load depth specified yet 30 30 31 31 32 bool mdStatus = false; // Result of MD lookup … … 122 123 // XXX EAM : we should abort on invalid options. default options? 123 124 if (psMetadataLookupBool(NULL, config->recipe, "OVERSCAN")) { 124 // XXX EAM : does 'overscanMode = NONE' mean doOverscan = false?125 125 options->doOverscan = true; 126 psString mode = psMetadataLookupStr(NULL, config->recipe, "OVERSCAN.MODE"); 127 if (! strcasecmp(mode, "INDIVIDUAL")) { 128 options->overscanMode = PM_OVERSCAN_EDGE; 129 } else if (! strcasecmp(mode, "ALL")) { 130 options->overscanMode = PM_OVERSCAN_ALL; 131 } else if (strcasecmp(mode, "NONE")) { 132 psLogMsg(__func__, PS_LOG_WARN, "OVERSCAN.MODE (%s) is not one of NONE, INDIVIDUAL, or ALL:" 133 " assuming NONE.\n", mode); 134 } 126 127 // Do the overscan as a single value? 128 overscanSingle = psMetadataLookupBool(NULL, config->recipe, "OVERSCAN.SINGLE"); 129 130 // How do we fit it? 135 131 psString fit = psMetadataLookupStr(NULL, config->recipe, "OVERSCAN.FIT"); 136 132 if (! strcasecmp(fit, "POLYNOMIAL")) { 137 options->overscanFitType = PM_FIT_POLYNOMIAL; 138 int order = psMetadataLookupS32(NULL, config->recipe, "OVERSCAN.ORDER"); // Order of polynomial fit 139 options->overscanFit = psPolynomial1DAlloc(order, PS_POLYNOMIAL_ORD); 133 overscanFit = PM_FIT_POLY_ORD; 134 overscanOrder = psMetadataLookupS32(NULL, config->recipe, "OVERSCAN.ORDER"); 135 } else if (! strcasecmp(fit, "CHEBYSHEV")) { 136 overscanFit = PM_FIT_POLY_CHEBY; 137 overscanOrder = psMetadataLookupS32(NULL, config->recipe, "OVERSCAN.ORDER"); 140 138 } else if (! strcasecmp(fit, "SPLINE")) { 141 options->overscanFit = NULL; 142 options->overscanFitType = PM_FIT_SPLINE; 143 // int order = psMetadataLookupS32(NULL, config->recipe, "OVERSCAN.ORDER"); // Order of polynomial fit 144 // XXX : not in psLib yet : options->overscanFit = psSpline1DAlloc(); 139 overscanFit = PM_FIT_SPLINE; 145 140 } else if (strcasecmp(fit, "NONE")) { 146 141 psLogMsg(__func__, PS_LOG_WARN, "OVERSCAN.FIT (%s) is not one of NONE, POLYNOMIAL, or SPLINE:" 147 142 " assuming NONE.\n", fit); 148 143 } 149 options->overscanBins = psMetadataLookupS32(NULL, config->recipe, "OVERSCAN.BIN"); 150 if (options->overscanBins <= 0) { 151 psErrorStackPrint(stderr, "OVERSCAN.BIN (%d) is non-positive --- assuming 1.\n", options->overscanBins); 152 options->overscanBins = 1; 153 } 144 154 145 psString stat = psMetadataLookupStr(NULL, config->recipe, "OVERSCAN.STAT"); 155 146 if (! strcasecmp(stat, "MEAN")) { 156 o ptions->overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);147 overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 157 148 } else if (! strcasecmp(stat, "MEDIAN")) { 158 o ptions->overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN);149 overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN); 159 150 } else { 160 151 psErrorStackPrint(stderr, "OVERSCAN.STAT (%s) is not one of MEAN, MEDIAN: assuming MEAN\n", stat); 161 o ptions->overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);152 overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 162 153 } 154 155 // Fill in the options 156 options->overscan = pmOverscanOptionsAlloc(overscanSingle, overscanFit, overscanOrder, overscanStats); 163 157 } 164 158
Note:
See TracChangeset
for help on using the changeset viewer.
