Changeset 18179 for trunk/pswarp/src/pswarpTransformReadout_Opt.c
- Timestamp:
- Jun 18, 2008, 2:39:33 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpTransformReadout_Opt.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpTransformReadout_Opt.c
r17780 r18179 86 86 87 87 // Iterate over the output image pixels (parent frame) 88 bool goodPixels = false; // Any input pixels landing on the output image?88 long goodPixels = 0; // Number of input pixels landing on the output image 89 89 for (int y = minY; y < maxY; y++) { 90 90 if (y >= nextGridY) { … … 117 117 if (inPix->y - inRow0 >= inImage->numRows) continue; 118 118 119 goodPixels = true;119 goodPixels++; 120 120 121 121 // XXX include mask … … 146 146 psFree(grid); 147 147 148 // Store the variance factor and number of good pixels 149 if (goodPixels > 0) { 150 float varFactor = psImageInterpolateVarianceFactor(output->image->numCols, output->image->numRows, 151 interp); // Variance factor: large --> small scale 152 psMetadataItem *vfItem = psMetadataLookup(output->analysis, PSWARP_ANALYSIS_VARFACTOR); 153 if (vfItem) { 154 psMetadataItem *goodpixItem = psMetadataLookup(output->analysis, PSWARP_ANALYSIS_GOODPIX); 155 psAssert(goodpixItem, "It should be where we left it!"); 156 psAssert(vfItem->type == PS_TYPE_F32 && goodpixItem->type == PS_TYPE_S64, 157 "Should be the type we said."); 158 159 vfItem->data.F32 += varFactor * goodPixels; 160 goodpixItem->data.S64 += goodPixels; 161 } else { 162 psMetadataAddF32(output->analysis, PS_LIST_TAIL, PSWARP_ANALYSIS_VARFACTOR, 0, 163 "Variance factor weighted by the good pixels", varFactor * goodPixels); 164 psMetadataAddS64(output->analysis, PS_LIST_TAIL, PSWARP_ANALYSIS_GOODPIX, 0, 165 "Number of good pixels", goodPixels); 166 } 167 } 168 148 169 // Transform sources 149 170 psArray *inSources = psMetadataLookupPtr(&mdok, input->analysis, "PSPHOT.SOURCES"); // Sources in source 150 if (goodPixels && mdok && inSources) {171 if (goodPixels > 0 && mdok && inSources) { 151 172 pswarpMapGrid *sourceGrid = pswarpMapGridFromImage(output, input, nGridX, nGridY); // Grid for sources 152 173
Note:
See TracChangeset
for help on using the changeset viewer.
