Changeset 7531 for trunk/ppImage/src/ppImageOptions.c
- Timestamp:
- Jun 12, 2006, 4:49:23 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageOptions.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageOptions.c
r7508 r7531 18 18 options->nonLinearSource = NULL; 19 19 20 return options;21 }22 23 ppImageOptions *ppImageOptionsParse(pmConfig *config)24 {25 bool status;26 ppImageOptions *options = ppImageOptionsAlloc ();27 28 20 // default flags for various activities 29 21 options->doMask = false; // Mask bad pixels … … 36 28 options->doFlat = false; // Flat-field normalisation 37 29 options->doFringe = false; // Fringe subtraction 38 options->do Source= false; // Source identification and photometry30 options->doPhotom = false; // Source identification and photometry 39 31 options->doAstrom = false; // Astrometry 32 33 options->doBin1 = false; // create binned image (scale 1) 34 options->doBin2 = false; // create binned image (scale 2) 35 options->doBin1JPG = false; // create jpg of binned image (scale 1) 36 options->doBin2JPG = false; // create jpg of binned image (scale 2) 40 37 41 38 // Overscan defaults 42 39 options->overscan = NULL; // Overscan options 43 bool overscanSingle = false; // A single value for entire overscan?44 pmFit overscanFit = PM_FIT_NONE; // Fit type for overscan45 int overscanOrder = 0; // Order for overscan fit46 psStats *overscanStats = NULL; // Statistics for overscan47 40 48 41 // Non-linearity default options … … 50 43 options->nonLinearData = NULL; // The non-linearity data 51 44 options->nonLinearSource = NULL; // If the non-linearity data is a menu, this provides the key 45 46 return options; 47 } 48 49 ppImageOptions *ppImageOptionsParse(pmConfig *config) 50 { 51 bool status; 52 ppImageOptions *options = ppImageOptionsAlloc (); 52 53 53 54 // select the recipe for this analysis … … 105 106 106 107 // Do the overscan as a single value? 107 overscanSingle = psMetadataLookupBool(NULL, recipe, "OVERSCAN.SINGLE");108 bool overscanSingle = psMetadataLookupBool(NULL, recipe, "OVERSCAN.SINGLE"); 108 109 109 110 // How do we fit it? 111 pmFit overscanFit = PM_FIT_NONE; // Fit type for overscan 112 int overscanOrder = 0; // Order for overscan fit 110 113 psString fit = psMetadataLookupStr(NULL, recipe, "OVERSCAN.FIT"); 111 114 if (! strcasecmp(fit, "POLYNOMIAL")) { … … 118 121 overscanFit = PM_FIT_SPLINE; 119 122 } else if (strcasecmp(fit, "NONE")) { 120 psLogMsg(__func__, PS_LOG_WARN, "OVERSCAN.FIT (%s) in recipe %s is not one of NONE, "121 "POLYNOMIAL, or SPLINE: assuming NONE.\n", fit, RECIPE_NAME);123 psLogMsg(__func__, PS_LOG_WARN, "OVERSCAN.FIT (%s) in recipe %s is not one of NONE, POLYNOMIAL, or SPLINE", fit, RECIPE_NAME); 124 exit(EXIT_FAILURE); 122 125 } 123 126 127 // What method do we use to measure the overscan statistics? 128 psStats *overscanStats = NULL; // Statistics for overscan 124 129 psString stat = psMetadataLookupStr(NULL, recipe, "OVERSCAN.STAT"); 125 130 if (! strcasecmp(stat, "MEAN")) { … … 128 133 overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN); 129 134 } else { 130 psErrorStackPrint(stderr, "OVERSCAN.STAT (%s) in recipe %s is not one of MEAN, MEDIAN: " 131 "assuming MEAN\n", stat, RECIPE_NAME); 132 overscanStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 135 psErrorStackPrint(stderr, "OVERSCAN.STAT (%s) in recipe %s is not one of MEAN or MEDIAN", stat, RECIPE_NAME); 136 exit(EXIT_FAILURE); 133 137 } 134 138 … … 161 165 162 166 options->doBin1 = psMetadataLookupBool(NULL, recipe, "BIN1.FITS"); 167 options->doBin1JPG = psMetadataLookupBool(NULL, recipe, "BIN1.JPEG"); 168 if (options->doBin1JPG && !options->doBin1) { 169 psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot make JPG of Bin1 image without Bin1 image"); 170 exit(EXIT_FAILURE); 171 } 172 163 173 options->doBin2 = psMetadataLookupBool(NULL, recipe, "BIN2.FITS"); 174 options->doBin2JPG = psMetadataLookupBool(NULL, recipe, "BIN2.JPEG"); 175 if (options->doBin2JPG && !options->doBin2) { 176 psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot make JPG of Bin2 image without Bin2 image"); 177 exit(EXIT_FAILURE); 178 } 179 180 options->doPhotom = psMetadataLookupBool(NULL, recipe, "PHOTOM"); 181 options->doAstrom = psMetadataLookupBool(NULL, recipe, "ASTROM"); 182 if (options->doAstrom && !options->doPhotom) { 183 psLogMsg(__func__, PS_LOG_ERROR, "Invalid Phase2 Options: cannot do ASTROMetry without PHOTOMetry"); 184 exit(EXIT_FAILURE); 185 } 164 186 165 // options->doBin1JPEG = psMetadataLookupBool(NULL, recipe, "BIN1.JPEG");166 // options->doBin2JPEG = psMetadataLookupBool(NULL, recipe, "BIN2.JPEG");167 168 187 return options; 169 188 }
Note:
See TracChangeset
for help on using the changeset viewer.
