Changeset 9832
- Timestamp:
- Nov 2, 2006, 12:30:06 PM (20 years ago)
- Location:
- trunk/ppMerge/src
- Files:
-
- 3 edited
-
ppMergeCombine.c (modified) (3 diffs)
-
ppMergeOptions.c (modified) (9 diffs)
-
ppMergeOptions.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeCombine.c
r9824 r9832 214 214 } 215 215 numRead++; 216 } else { 217 psTrace("ppMerge", 3, "Unable to read from file %d for chip %d, " 218 "cell %d, scan %d\n", i, view->chip, view->cell, numScan); 216 219 } 217 220 } 218 221 222 psTrace("ppMerge", 5, "Chip %d, cell %d, scan %d\n", view->chip, view->cell, numScan); 219 223 if (numRead > 0) { 220 224 pmReadoutCombine(readout, stack, cellZeros, cellScales, options->combine); 221 psTrace("ppMerge", 5, "Chip %d, cell %d, scan %d\n", view->chip, view->cell, numScan);222 225 } 223 226 numScan++; … … 259 262 } 260 263 261 psFree(readout); // Drop reference262 264 psFree(stack); 263 265 … … 270 272 } 271 273 274 // Measure the fringes for this cell 275 // 276 // XXX Need to deal with multiple components: we will do this by building up the components 277 // Read the existing fringe measurements 278 // Use existing regions to measure fringe statistics 279 // Add the new fringe measurements to the existing fringe measurements. 280 // Write the appended fringe measurements. 281 // Read in the "output" file to get the existing components. 282 // Put the new readout into the cell after the existing readouts. 283 if (options->fringe && readout->image) { 284 pmFringeRegions *regions = pmFringeRegionsAlloc(options->fringeNum, options->fringeSize, 285 options->fringeSize, options->fringeSmoothX, 286 options->fringeSmoothY); // Fringe regions 287 pmFringeStats *fringe = pmFringeStatsMeasure(regions, readout, options->combine->maskVal); 288 psFree(regions); 289 290 psArray *fringes = psArrayAlloc(1); // Array of fringes 291 fringes->data[0] = fringe; 292 293 const char *chipName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of chip 294 const char *cellName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of cell 295 psString extname = NULL; 296 psStringAppend(&extname, "FRINGE_%s_%s", chipName, cellName); 297 298 if (!pmFringesWriteFits(data->outFile, NULL, fringes, extname)) { 299 psWarning("Unable to write fringe data to extension %s\n", extname); 300 } 301 302 psFree(fringes); 303 psFree(extname); 304 } 305 306 psFree(readout); // Drop reference 272 307 273 308 // Statistics on the merged cell -
trunk/ppMerge/src/ppMergeOptions.c
r9539 r9832 35 35 options->scale = false; 36 36 options->darktime = false; 37 options->fringe = false; 37 38 options->shutter = false; 38 39 options->sample = 1; 39 40 options->mean = PS_STAT_SAMPLE_MEDIAN; 40 41 options->stdev = PS_STAT_SAMPLE_STDEV; 42 options->fringeNum = 100; 43 options->fringeSize = 10; 44 options->fringeSmoothX = 5; 45 options->fringeSmoothY = 5; 41 46 options->shutterSize = 10; 42 47 options->shutterIter = 2; … … 122 127 123 128 // First, deal with the recipe. These are parameters that will typically be constant for a camera. 124 OPTION_PARSE(options->rows, recipe, "ROWS", U16 ); 125 OPTION_PARSE(options->minElectrons, recipe, "ELECTRONS", F32 ); 126 OPTION_PARSE(options->sample, recipe, "SAMPLE", S32 ); 127 OPTION_PARSE(options->combine->rej, recipe, "REJ", F32 ); 128 OPTION_PARSE(options->combine->iter, recipe, "ITER", S32 ); 129 OPTION_PARSE(options->combine->fracHigh, recipe, "FRACHIGH", F32 ); 130 OPTION_PARSE(options->combine->fracLow, recipe, "FRACLOW", F32 ); 131 OPTION_PARSE(options->combine->nKeep, recipe, "NKEEP", S32 ); 132 OPTION_PARSE(options->combine->maskVal, recipe, "MASKVAL", S32 ); 133 OPTION_PARSE(options->shutterSize, recipe, "SHUTTER.SIZE", S32 ); 134 OPTION_PARSE(options->shutterIter, recipe, "SHUTTER.ITER", S32 ); 135 OPTION_PARSE(options->shutterRej, recipe, "SHUTTER.REJECT", F32 ); 129 OPTION_PARSE(options->rows, recipe, "ROWS", U16); 130 OPTION_PARSE(options->minElectrons, recipe, "ELECTRONS", F32); 131 OPTION_PARSE(options->sample, recipe, "SAMPLE", S32); 132 OPTION_PARSE(options->combine->rej, recipe, "REJ", F32); 133 OPTION_PARSE(options->combine->iter, recipe, "ITER", S32); 134 OPTION_PARSE(options->combine->fracHigh, recipe, "FRACHIGH", F32); 135 OPTION_PARSE(options->combine->fracLow, recipe, "FRACLOW", F32); 136 OPTION_PARSE(options->combine->nKeep, recipe, "NKEEP", S32); 137 OPTION_PARSE(options->combine->maskVal, recipe, "MASKVAL", S32); 138 OPTION_PARSE(options->fringeNum, recipe, "FRINGE.NUM", S32); 139 OPTION_PARSE(options->fringeSize, recipe, "FRINGE.SIZE", S32); 140 OPTION_PARSE(options->fringeSmoothX, recipe, "FRINGE.XSMOOTH", S32); 141 OPTION_PARSE(options->fringeSmoothY, recipe, "FRINGE.YSMOOTH", S32); 142 OPTION_PARSE(options->shutterSize, recipe, "SHUTTER.SIZE", S32); 143 OPTION_PARSE(options->shutterIter, recipe, "SHUTTER.ITER", S32); 144 OPTION_PARSE(options->shutterRej, recipe, "SHUTTER.REJECT", F32); 136 145 137 146 options->combine->combine = parseStat(recipe, "COMBINE"); … … 148 157 options->scale = false; 149 158 options->darktime = false; 159 options->fringe = false; 150 160 options->shutter = false; 151 161 } else if (strcasecmp(type, "DARK") == 0) { … … 153 163 options->scale = false; 154 164 options->darktime = true; 165 options->fringe = false; 155 166 options->shutter = false; 156 167 } else if (strcasecmp(type, "FLAT") == 0) { … … 158 169 options->scale = true; 159 170 options->darktime = false; 171 options->fringe = false; 160 172 options->shutter = false; 161 173 } else if (strcasecmp(type, "FRINGE") == 0) { … … 163 175 options->scale = true; 164 176 options->darktime = false; 177 options->fringe = true; 165 178 options->shutter = false; 166 179 } else if (strcasecmp(type, "SHUTTER") == 0) { … … 168 181 options->scale = false; 169 182 options->darktime = false; 183 options->fringe = false; 170 184 options->shutter = true; 171 185 } else { … … 174 188 options->scale = false; 175 189 options->darktime = false; 190 options->fringe = false; 176 191 options->shutter = false; 177 192 } … … 181 196 options->scale = false; 182 197 options->darktime = false; 198 options->fringe = false; 199 options->shutter = false; 183 200 } 184 201 -
trunk/ppMerge/src/ppMergeOptions.h
r9463 r9832 22 22 bool scale; // Scale by the background before combining? 23 23 bool darktime; // Normalise by the dark time (time since flush)? 24 bool fringe; // Make fringe measurements? 24 25 bool shutter; // Generate shutter correction? 25 26 unsigned int sample; // Sampling factor for measuring the background 26 27 psStatsOptions mean; // Statistic to use to measure the mean 27 28 psStatsOptions stdev; // Statistic to use to measure the stdev 29 int fringeNum; // Number of fringe regions per cell 30 int fringeSize; // Size of fringe regions 31 int fringeSmoothX; // Number of smoothing regions per cell, in x 32 int fringeSmoothY; // Number of smoothing regions per cell, in y 28 33 int shutterSize; // Size for shutter measurement regions 29 34 int shutterIter; // Number of iterations for shutter measurement
Note:
See TracChangeset
for help on using the changeset viewer.
