Changeset 18583
- Timestamp:
- Jul 16, 2008, 1:07:15 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMakeResiduals.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMakeResiduals.c
r18038 r18583 69 69 // - set output pixel, weight, and mask 70 70 71 // XXX need to set these correctly!! 71 72 const int badMask = 1; // mask bits 72 73 const int poorMask = 2; // from psImageInterpolate 73 74 const int clippedMask = 4; // mask bit set for clipped values 74 75 bool offImage = false; // pixel is off the image76 75 77 76 // determine the maximum image size from the input sources … … 150 149 for (int ox = 0; ox < resid->Ro->numCols; ox++) { 151 150 151 int nGoodPixel = 0; // pixel is off the image 152 152 153 // build the vector of data values for this output pixel 153 154 for (int i = 0; i < input->n; i++) { … … 160 161 161 162 mflux = 0; 162 offImage = false;163 bool offImage = false; 163 164 if (psImageInterpolate (&flux, &dflux, &mflux, ix, iy, interp) == PS_INTERPOLATE_STATUS_OFF) { 164 165 // This pixel is off the image 165 166 offImage = true; 166 } 167 fmasks->data.U8[i] = 1; 168 // fprintf (stderr, "off image: %f %f : %f %f\n", ix, iy, flux, dflux); 169 } 167 170 fluxes->data.F32[i] = flux; 168 171 dfluxes->data.F32[i] = dflux; … … 171 174 fmasks->data.U8[i] = 1; 172 175 } 173 // fprintf (stderr, "%f %f : %f %f (%d)\n", ix, iy, flux, dflux, fmasks->data.U8[i]); 176 if (fmasks->data.U8[i] == 0) { 177 nGoodPixel ++; 178 } 179 } 180 181 // skip pixels which are off the image... 182 bool validPixel = (SPATIAL_ORDER == 0) ? (nGoodPixel > 1) : (nGoodPixel > 3); 183 if (!validPixel) { 184 resid->Ro->data.F32[oy][ox] = 0.0; 185 resid->Rx->data.F32[oy][ox] = 0.0; 186 resid->Ry->data.F32[oy][ox] = 0.0; 187 resid->mask->data.U8[oy][ox] = 1; 188 continue; 174 189 } 175 190 … … 191 206 } 192 207 193 if ( offImage ||SPATIAL_ORDER == 0) {208 if (SPATIAL_ORDER == 0) { 194 209 // measure the desired statistic on the unclipped pixels 195 210 *fluxStats = *fluxStatsDef;
Note:
See TracChangeset
for help on using the changeset viewer.
