Changeset 13570
- Timestamp:
- May 31, 2007, 2:52:04 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMakeResiduals.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMakeResiduals.c
r13529 r13570 65 65 // - re-measure the robust median & sigma 66 66 // - set output pixel, weight, and mask 67 68 const int badMask = 1; // mask bits 69 const int poorMask = 2; // from psImageInterpolate 70 const int clippedMask = 4; // mask bit set for clipped values 71 72 bool offImage = false; // pixel is off the image 67 73 68 74 // determine the maximum image size from the input sources … … 97 103 // we will interpolate the image and weight - include the mask or not? 98 104 // XXX consider better values for the mask bits 99 psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(mode, image, weight, NULL, 0xff, 0.0, 0.0, 1, 2, 0.0); 105 psImageInterpolateOptions *interp = 106 psImageInterpolateOptionsAlloc(mode, image, weight, NULL, 0xff, 0.0, 0.0, badMask, poorMask, 0.0); 100 107 psArrayAdd (input, 100, interp); 101 108 … … 149 156 150 157 mflux = 0; 151 psImageInterpolate (&flux, &dflux, &mflux, ix, iy, interp); 158 offImage = false; 159 if (psImageInterpolate (&flux, &dflux, &mflux, ix, iy, interp) == PS_INTERPOLATE_STATUS_OFF) { 160 // This pixel is off the image 161 offImage = true; 162 } 152 163 fluxes->data.F32[i] = flux; 153 164 dfluxes->data.F32[i] = dflux; … … 169 180 // make this a user option 170 181 if (swing > nSigma) { 171 fmasks->data.U8[i] = 1;182 fmasks->data.U8[i] = clippedMask; 172 183 } 173 184 } 174 185 175 if ( SPATIAL_ORDER == 0) {186 if (offImage || SPATIAL_ORDER == 0) { 176 187 // measure the desired statistic on the unclipped pixels 177 188 *fluxStats = *fluxStatsDef; 178 189 psVectorStats (fluxStats, fluxes, NULL, fmasks, 0xff); 179 190 180 resid->Ro->data.F32[oy][ox] = psStatsGetValue (fluxStats, statOption); 191 resid->Ro->data.F32[oy][ox] = psStatsGetValue(fluxStats, statOption); 192 resid->Rx->data.F32[oy][ox] = resid->Ry->data.F32[oy][ox] = 0.0; 181 193 //resid->weight->data.F32[oy][ox] = fluxStats->sampleStdev; 182 194 } else { … … 213 225 resid->Rx->data.F32[oy][ox] = B->data.F64[1]; 214 226 resid->Ry->data.F32[oy][ox] = B->data.F64[2]; 227 //resid->weight->data.F32[oy][ox] = XXX; 215 228 } 216 229 }
Note:
See TracChangeset
for help on using the changeset viewer.
