Changeset 9463
- Timestamp:
- Oct 10, 2006, 10:59:09 AM (20 years ago)
- Location:
- trunk/ppMerge/src
- Files:
-
- 5 edited
-
ppMerge.c (modified) (1 diff)
-
ppMergeCombine.c (modified) (1 diff)
-
ppMergeOptions.c (modified) (5 diffs)
-
ppMergeOptions.h (modified) (1 diff)
-
ppMergeScaleZero.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMerge.c
r8883 r9463 71 71 psFree(config); 72 72 73 psLibFinalize();74 73 pmConceptsDone(); 75 74 pmConfigDone(); 75 psLibFinalize(); 76 76 77 77 // ppMemCheck(); -
trunk/ppMerge/src/ppMergeCombine.c
r9376 r9463 258 258 } 259 259 260 // Set the dark time for the output image, since we normalised 261 if (options->darktime) { 262 psMetadataItem *darkItem = psMetadataLookup(cell->concepts, "CELL.DARKTIME"); 263 darkItem->data.F32 = 1.0; 264 psMetadataItem *expItem = psMetadataLookup(cell->concepts, "CELL.EXPOSURE"); 265 expItem->data.F32 = 1.0; 266 } 267 260 268 memCheck(); 261 269 #endif -
trunk/ppMerge/src/ppMergeOptions.c
r9385 r9463 34 34 options->zero = false; 35 35 options->scale = false; 36 options-> exptime = false;36 options->darktime = false; 37 37 options->shutter = false; 38 38 options->sample = 1; … … 147 147 options->zero = false; 148 148 options->scale = false; 149 options-> exptime = false;149 options->darktime = false; 150 150 options->shutter = false; 151 151 } else if (strcasecmp(type, "DARK") == 0) { 152 152 options->zero = false; 153 153 options->scale = false; 154 options-> exptime = true;154 options->darktime = true; 155 155 options->shutter = false; 156 156 } else if (strcasecmp(type, "FLAT") == 0) { 157 157 options->zero = false; 158 158 options->scale = true; 159 options-> exptime = false;159 options->darktime = false; 160 160 options->shutter = false; 161 161 } else if (strcasecmp(type, "FRINGE") == 0) { 162 162 options->zero = true; 163 163 options->scale = true; 164 options-> exptime = false;164 options->darktime = false; 165 165 options->shutter = false; 166 166 } else if (strcasecmp(type, "SHUTTER") == 0) { 167 167 options->zero = false; 168 168 options->scale = false; 169 options-> exptime = false;169 options->darktime = false; 170 170 options->shutter = true; 171 171 } else { … … 173 173 options->zero = false; 174 174 options->scale = false; 175 options-> exptime = false;175 options->darktime = false; 176 176 options->shutter = false; 177 177 } … … 180 180 options->zero = false; 181 181 options->scale = false; 182 options-> exptime = false;182 options->darktime = false; 183 183 } 184 184 … … 186 186 #if 0 187 187 // Or you can set them individually 188 OPTION_PARSE(options->zero, config->arguments, "-zero", Bool);189 OPTION_PARSE(options->scale, config->arguments, "-scale", Bool);190 OPTION_PARSE(options-> exptime, config->arguments, "-exptime", Bool);188 OPTION_PARSE(options->zero, config->arguments, "-zero", Bool); 189 OPTION_PARSE(options->scale, config->arguments, "-scale", Bool); 190 OPTION_PARSE(options->darktime, config->arguments, "-exptime", Bool); 191 191 #endif 192 192 -
trunk/ppMerge/src/ppMergeOptions.h
r9341 r9463 21 21 bool zero; // Subtract background before combining? 22 22 bool scale; // Scale by the background before combining? 23 bool exptime; // Normalise by the exposure time?23 bool darktime; // Normalise by the dark time (time since flush)? 24 24 bool shutter; // Generate shutter correction? 25 25 unsigned int sample; // Sampling factor for measuring the background -
trunk/ppMerge/src/ppMergeScaleZero.c
r9325 r9463 47 47 assert(config); 48 48 49 if (!options->scale && !options->zero && !options-> exptime) {49 if (!options->scale && !options->zero && !options->darktime) { 50 50 return true; // We did everything we were asked for 51 51 } … … 161 161 psStats *bgStats = psStatsAlloc(options->mean); // Statistic to measure the background 162 162 psVector *gains = NULL; // The gains for each cell 163 psImage * exptime = NULL; // The exposuretime for each integration of each cell163 psImage *darktime = NULL; // The dark time for each integration of each cell 164 164 if (options->scale) { 165 165 gains = psVectorAlloc(data->numCells, PS_TYPE_F32); 166 166 gains->n = data->numCells; 167 167 } 168 if (options-> exptime) {169 exptime = psImageAlloc(data->numCells, filenames->n, PS_TYPE_F32);168 if (options->darktime) { 169 darktime = psImageAlloc(data->numCells, filenames->n, PS_TYPE_F32); 170 170 } 171 171 … … 199 199 200 200 // Normalising by the exposure time 201 if (options-> exptime) {202 exptime->data.F32[i][cellNum] = psMetadataLookupF32(&mdok, cell->concepts,203 "CELL. EXPOSURE");204 if (!mdok || isnan( exptime->data.F32[i][cellNum])) {205 psLogMsg(__func__, PS_LOG_WARN, "CELL. EXPOSURE for file %s chip %d cell %d is not "201 if (options->darktime) { 202 darktime->data.F32[i][cellNum] = psMetadataLookupF32(&mdok, cell->concepts, 203 "CELL.DARKTIME"); 204 if (!mdok || isnan(darktime->data.F32[i][cellNum])) { 205 psLogMsg(__func__, PS_LOG_WARN, "CELL.DARKTIME for file %s chip %d cell %d is not " 206 206 "set.\n", name, j, k); 207 exptime->data.F32[i][cellNum] = NAN;207 darktime->data.F32[i][cellNum] = NAN; 208 208 status = false; 209 209 } … … 302 302 } 303 303 304 if (options-> exptime) {304 if (options->darktime) { 305 305 if (!options->scale) { 306 306 // Copy over the exposure times 307 *scales = psImageCopy(*scales, exptime, PS_TYPE_F32);307 *scales = psImageCopy(*scales, darktime, PS_TYPE_F32); 308 308 } else { 309 *scales = (psImage*)psBinaryOp(*scales, *scales, "*", exptime);309 *scales = (psImage*)psBinaryOp(*scales, *scales, "*", darktime); 310 310 } 311 311 }
Note:
See TracChangeset
for help on using the changeset viewer.
