Changeset 7067 for trunk/ppMerge/src/ppMergeOptions.c
- Timestamp:
- May 4, 2006, 3:53:10 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ppMerge/src/ppMergeOptions.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeOptions.c
r7061 r7067 2 2 #include <pslib.h> 3 3 #include <psmodules.h> 4 5 #include "ppMerge.h" 6 #include "ppMergeOptions.h" 4 7 5 8 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 7 10 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 8 11 9 #if 010 12 // Free function 11 13 static void mergeOptionsFree(ppMergeOptions *options // Options to free 12 14 ) 13 15 { 16 psFree(options->combine); 14 17 } 15 #endif16 18 17 19 // Allocator … … 19 21 { 20 22 ppMergeOptions *options = psAlloc(sizeof(ppMergeOptions)); // The options, to return 21 //psMemSetDeallocator(options, (psFreeFunc)mergeOptionsFree);23 psMemSetDeallocator(options, (psFreeFunc)mergeOptionsFree); 22 24 23 25 options->rows = 0; … … 29 31 options->background = PS_STAT_SAMPLE_MEDIAN; 30 32 options->onOff = 0; 31 options->combine = PS_STAT_SAMPLE_MEAN;32 options-> ref= 3.0;33 options-> iter = 1;34 options-> fracHigh = 0.0;35 options-> fracLow = 0.0;36 options-> nKeep = 1;37 options-> maskVal = 0xffff;33 options->combine = pmCombineParamsAlloc(PS_STAT_SAMPLE_MEAN); 34 options->combine->rej = 3.0; 35 options->combine->iter = 1; 36 options->combine->fracHigh = 0.0; 37 options->combine->fracLow = 0.0; 38 options->combine->nKeep = 1; 39 options->combine->maskVal = 0xff; 38 40 39 41 return options; … … 84 86 85 87 // Parse the options 86 ppMergeOptions *ppMergeOptionsParse(p pConfig *config // Configuration88 ppMergeOptions *ppMergeOptionsParse(pmConfig *config // Configuration 87 89 ) 88 90 { 89 91 ppMergeOptions *options = ppMergeOptionsAlloc(); // The merge options 90 92 93 bool mdok = true; // Status of MD lookup 94 psMetadata *recipe = psMetadataLookupMD(&mdok, config->recipes, RECIPENAME); // Recipe information 95 if (!mdok || !recipe) { 96 psError(PS_ERR_IO, true, "Unable to find recipe %s", RECIPENAME); 97 exit(EXIT_FAILURE); 98 } 99 91 100 // First, deal with the recipe. These are parameters that will typically be constant for a camera. 92 OPTION_PARSE(options->rows, config->recipe, "ROWS", U16 );93 OPTION_PARSE(options->minElectrons, config->recipe, "ELECTRONS", F32 );94 OPTION_PARSE(options->sample, config->recipe, "SAMPLE", S32 );95 OPTION_PARSE(options-> rej, config->recipe, "REJ", F32 );96 OPTION_PARSE(options-> iter, config->recipe, "ITER", S32 );97 OPTION_PARSE(options-> fracHigh, config->recipe, "FRACHIGH", F32 );98 OPTION_PARSE(options-> fracLow, config->recipe, "FRACLOW", F32 );99 OPTION_PARSE(options-> nKeep, config->recipe, "NKEEP", S32 );100 OPTION_PARSE(options-> maskVal, config->recipe, "MASKVAL", U8 );101 options->combine = parseStat(config->recipe, "COMBINE");102 options->background = parseStat(config->recipe, "BACKGROUND");101 OPTION_PARSE(options->rows, recipe, "ROWS", U16 ); 102 OPTION_PARSE(options->minElectrons, recipe, "ELECTRONS", F32 ); 103 OPTION_PARSE(options->sample, recipe, "SAMPLE", S32 ); 104 OPTION_PARSE(options->combine->rej, recipe, "REJ", F32 ); 105 OPTION_PARSE(options->combine->iter, recipe, "ITER", S32 ); 106 OPTION_PARSE(options->combine->fracHigh, recipe, "FRACHIGH", F32 ); 107 OPTION_PARSE(options->combine->fracLow, recipe, "FRACLOW", F32 ); 108 OPTION_PARSE(options->combine->nKeep, recipe, "NKEEP", S32 ); 109 OPTION_PARSE(options->combine->maskVal, recipe, "MASKVAL", U8 ); 110 options->combine->combine = parseStat(recipe, "COMBINE"); 111 options->background = parseStat(recipe, "BACKGROUND"); 103 112 104 113 // Now the command-line options. These are parameters that depend on what type of frame is being combined … … 127 136 128 137 // Or you can set them individually 129 OPTION_PARSE(options->zero, config-> recipe, "-zero", Bool);130 OPTION_PARSE(options->scale, config-> recipe, "-scale", Bool);131 OPTION_PARSE(options->exptime, config-> recipe, "-exptime", Bool);138 OPTION_PARSE(options->zero, config->arguments, "-zero", Bool); 139 OPTION_PARSE(options->scale, config->arguments, "-scale", Bool); 140 OPTION_PARSE(options->exptime, config->arguments, "-exptime", Bool); 132 141 133 142 // Number of on/off images 134 OPTION_PARSE(options->on off, config->recipe, "-onoff", S32);143 OPTION_PARSE(options->onOff, config->arguments, "-onoff", S32); 135 144 136 145 return options;
Note:
See TracChangeset
for help on using the changeset viewer.
