Changeset 25930 for trunk/ppImage/src
- Timestamp:
- Oct 22, 2009, 4:54:27 PM (17 years ago)
- Location:
- trunk/ppImage/src
- Files:
-
- 1 added
- 6 edited
-
Makefile.am (modified) (1 diff)
-
ppImage.h (modified) (1 diff)
-
ppImageDetrendFringe.c (modified) (4 diffs)
-
ppImageDetrendPattern.c (added)
-
ppImageDetrendReadout.c (modified) (1 diff)
-
ppImageLoop.c (modified) (1 diff)
-
ppImageOptions.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/Makefile.am
r25299 r25930 41 41 ppImageDetrendFringe.c \ 42 42 ppImageDetrendFree.c \ 43 ppImageDetrendPattern.c \ 43 44 ppImageRebinReadout.c \ 44 45 ppImageMosaic.c \ -
trunk/ppImage/src/ppImage.h
r25875 r25930 159 159 bool ppImageBurntoolMask(pmConfig *config, ppImageOptions *options, pmFPAview *view, pmReadout *mask); 160 160 161 bool ppImageDetrendPatternApply(pmConfig *config, pmChip *chip, const pmFPAview *inputView, const ppImageOptions *options); 162 161 163 // Record which detrend file was used for the detrending 162 164 bool ppImageDetrendRecord( -
trunk/ppImage/src/ppImageDetrendFringe.c
r24911 r25930 84 84 psArray *cells = chip->cells; // Component cells 85 85 psArray *fringes = psArrayAlloc(cells->n); // Fringes, to return 86 int video_cell_zero = 0; 87 86 88 for (int i = 0; i < cells->n; i++) { 87 89 fringes->data[i] = NULL; … … 89 91 pmCell *cell = cells->data[i]; // Cell of interest 90 92 93 psTrace("psModules.detrend",7,"Readouts: Cell %d chip: %ld\n",i,cell->readouts->n); 91 94 // XXX for now, skip the video cells (cell->readouts->n > 1) 92 if (cell->readouts->n > 1) { 93 psWarning ("Skipping Video Cell (%d) for ppImageDetrendFringe.c:getFringes", i); 94 continue; 95 } 96 95 // CZW: This mess creates a fake set of fringe stats by stealing the previous one. 96 // We let the fitting code know that this is all lies by scaling the weights by a crazy amount. 97 98 if ( (cell->readouts->n > 1) ) { 99 psTrace("psModules.detrend",7,"Should be skipping scichip: %d\n",i); 100 psWarning ("Skipping Video Cell (%d) for ppImageDetrendFringe.c:getFringes", i); 101 102 if (i == 0) { 103 video_cell_zero = 1; 104 } 105 else { 106 pmFringeStats *prevFringe = fringes->data[i-1]; 107 pmFringeStats *fringe = pmFringeStatsAlloc(prevFringe->regions); 108 for (int j = 0; j < fringe->regions->nRequested; j++) { 109 fringe->f->data.F32[j] = prevFringe->f->data.F32[j]; 110 fringe->df->data.F32[j] = prevFringe->df->data.F32[j] / 1e6; 111 } 112 fringes->data[i] = fringe; 113 } 114 115 continue; 116 } 117 97 118 fringes->data[i] = psMemIncrRefCounter(psMetadataLookupPtr(NULL, cell->analysis, source)); 98 119 } 99 120 121 if (video_cell_zero == 1) { 122 pmFringeStats *prevFringe = fringes->data[1]; 123 pmFringeStats *fringe = pmFringeStatsAlloc(prevFringe->regions); 124 for (int j = 0; j < fringe->regions->nRequested; j++) { 125 fringe->f->data.F32[j] = NAN; 126 fringe->df->data.F32[j] = 1.0; 127 } 128 fringes->data[0] = fringe; 129 } 130 100 131 return fringes; 101 132 } … … 112 143 psArray *science = NULL; 113 144 if (isResidual) { 114 science = getFringes(scienceChip, "FRINGE.RESIDUALS"); // Fringe residuals on science chip145 science = getFringes(scienceChip, "FRINGE.RESIDUALS"); // Fringe residuals on science chip 115 146 } else { 116 147 science = getFringes(scienceChip, "FRINGE.MEASUREMENTS"); // Fringe measurements on science chip … … 124 155 psArray *references = getFringes(refChip, "FRINGE.MEASUREMENTS"); // Fringe measurements on reference chip 125 156 int numRefs = ((psArray*)references->data[0])->n; // Number of reference fringes 126 psArray *referencesCat = psArrayAlloc(numRefs); // Reference fringes 127 for (int i = 0; i < numRefs; i++) { // Iterate over fringes 128 psArray *refs = psArrayAlloc(references->n); // Array of fringes for each cell 129 for (int j = 0; j < references->n; j++) { // Iterate over cells 130 psArray *ref = references->data[j]; // Array of references for this cell 157 psArray *referencesCat = psArrayAlloc(numRefs); // Reference fringes 158 for (int i = 0; i < numRefs; i++) { // Iterate over fringes 159 psArray *refs = psArrayAlloc(references->n); // Array of fringes for each cell 160 for (int j = 0; j < references->n; j++) { // Iterate over cells 161 psArray *ref = references->data[j]; // Array of references for this cell 162 131 163 refs->data[j] = psMemIncrRefCounter(ref->data[i]); 132 164 } 133 referencesCat->data[i] = pmFringeStatsConcatenate(refs, NULL, NULL);165 referencesCat->data[i] = pmFringeStatsConcatenate(refs, NULL, NULL); 134 166 psFree(refs); 135 167 } -
trunk/ppImage/src/ppImageDetrendReadout.c
r25299 r25930 128 128 } 129 129 130 // Pattern noise correction 131 if (options->doPattern) { 132 if (!pmPatternRow(input, options->patternOrder, options->patternIter, options->patternRej, 133 options->patternThresh, options->patternMean, options->patternStdev, 134 options->maskValue, options->darkMask)) { 135 psFree(detview); 136 return false; 137 } 138 } 130 /* // Pattern noise correction */ 131 /* if (options->doPattern) { */ 132 /* if (!pmPatternRow(input, options->patternOrder, options->patternIter, options->patternRej, */ 133 /* options->patternThresh, options->patternMean, options->patternStdev, */ 134 /* options->maskValue, options->darkMask)) { */ 135 /* psFree(detview); */ 136 /* return false; */ 137 /* } */ 138 /* } */ 139 139 140 140 // Normalization by a single (known) constant -
trunk/ppImage/src/ppImageLoop.c
r25875 r25930 163 163 } 164 164 165 // Apply the pattern noise correction 166 if (options->doPattern) { 167 if (!ppImageDetrendPatternApply(config,chip,view,options)) { 168 ESCAPE("Unable to apply pattern corrections"); 169 } 170 } 171 165 172 // measure various pixel-based statistics for this image 166 173 if (!ppImagePixelStats(config, stats, options, view)) { -
trunk/ppImage/src/ppImageOptions.c
r25324 r25930 249 249 250 250 options->burntoolTrails = psMetadataLookupS32(&status, recipe, "BURNTOOL.TRAILS"); 251 fprintf(stderr,"TRAILS: %d %d %d\n",options->burntoolTrails,psMetadataLookupS32(&status,recipe,"BURNTOOL.TRAILS"),status); 251 psTrace("psModules.detrend", 7, "burntoolTrails: %d BURNTOOL.TRAILS: %d Status: %d\n", 252 options->burntoolTrails,psMetadataLookupS32(&status,recipe,"BURNTOOL.TRAILS"),status); 252 253 if (!status) { 253 254 psWarning("BURNTOOL.TRAILS not found in recipe: setting to default value.\n");
Note:
See TracChangeset
for help on using the changeset viewer.
