Changeset 16842 for trunk/ppMerge/src/ppMergeScaleZero.c
- Timestamp:
- Mar 6, 2008, 10:49:03 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppMerge/src/ppMergeScaleZero.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeScaleZero.c
r13957 r16842 25 25 assert(config); 26 26 27 if (!options->scale && !options->zero && !options-> darktime && !options->shutter) {27 if (!options->scale && !options->zero && !options->shutter) { 28 28 return true; // We did everything we were asked for 29 29 } … … 151 151 psStats *bgStats = psStatsAlloc(options->mean); // Statistic to measure the background 152 152 psVector *gains = NULL; // The gains for each cell 153 psImage *darktime = NULL; // The dark time for each integration of each cell154 153 if (options->scale) { 155 154 gains = psVectorAlloc(data->numCells, PS_TYPE_F32); 156 }157 if (options->darktime) {158 darktime = psImageAlloc(data->numCells, filenames->n, PS_TYPE_F32);159 155 } 160 156 … … 187 183 if (!pmCellReadHeader(cell, inFile)) { 188 184 continue; 189 }190 191 // Normalising by the exposure time192 if (options->darktime) {193 darktime->data.F32[i][cellNum] = psMetadataLookupF32(NULL, cell->concepts,194 "CELL.DARKTIME");195 if (isnan(darktime->data.F32[i][cellNum])) {196 psWarning("CELL.DARKTIME for file %s chip %d cell %d is not set.\n", name, j, k);197 status = false;198 } else {199 view->chip = j;200 view->cell = k;201 202 // This step applies the dark exptime / background relationship: F =203 // polymomial(exptime). Below, the input images are scaled by the204 // output of this relationship.205 206 // For devices with linear dark and no residual bias, this relationship207 // is not defined in the configuration system, and the transformation208 // is defined (when loaded by the concepts) to be F = exptime. Thus,209 // in this case, the resulting dark image consists of counts/sec.210 211 // For devices with a different relationship, the transformation yields212 // the expected number of counts in the given exposure, based on the213 // recorded exptime. Thus, in this case, the resulting dark image214 // should have a median value of 1.0.215 216 // note that these corrections must be applied differently when used to217 // correct a science image.218 219 darktime->data.F32[i][cellNum] = pmFPADarkNorm(fpa, view,220 darktime->data.F32[i][cellNum]);221 if (isnan(darktime->data.F32[i][cellNum])) {222 psWarning("Cannot get dark normalisation for file %s chip %d cell %d.\n",223 name, j, k);224 status = false;225 }226 }227 185 } 228 186 … … 355 313 } 356 314 357 if (options->darktime) {358 if (!options->scale) {359 // Copy over the exposure times360 *scales = psImageCopy(*scales, darktime, PS_TYPE_F32);361 } else {362 *scales = (psImage*)psBinaryOp(*scales, *scales, "*", darktime);363 }364 }365 366 315 if (options->zero) { 367 316 if (!*zeros) {
Note:
See TracChangeset
for help on using the changeset viewer.
