Changeset 20307 for trunk/psphot/src
- Timestamp:
- Oct 21, 2008, 4:11:36 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMakeResiduals.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMakeResiduals.c
r18583 r20307 105 105 // we will interpolate the image and weight - include the mask or not? 106 106 // XXX consider better values for the mask bits 107 psImageInterpolat eOptions*interp =108 psImageInterpolat eOptionsAlloc(mode, image, weight, NULL, 0xff, 0.0, 0.0, badMask, poorMask, 0.0);107 psImageInterpolation *interp = 108 psImageInterpolationAlloc(mode, image, weight, NULL, 0xff, 0.0, 0.0, badMask, poorMask, 0.0, 0); 109 109 psArrayAdd (input, 100, interp); 110 110 … … 149 149 for (int ox = 0; ox < resid->Ro->numCols; ox++) { 150 150 151 int nGoodPixel = 0; // pixel is off the image152 151 int nGoodPixel = 0; // pixel is off the image 152 153 153 // build the vector of data values for this output pixel 154 154 for (int i = 0; i < input->n; i++) { 155 155 156 psImageInterpolat eOptions*interp = input->data[i];156 psImageInterpolation *interp = input->data[i]; 157 157 158 158 // fractional image position … … 165 165 // This pixel is off the image 166 166 offImage = true; 167 fmasks->data.U8[i] = 1;168 // fprintf (stderr, "off image: %f %f : %f %f\n", ix, iy, flux, dflux);169 } 167 fmasks->data.U8[i] = 1; 168 // fprintf (stderr, "off image: %f %f : %f %f\n", ix, iy, flux, dflux); 169 } 170 170 fluxes->data.F32[i] = flux; 171 171 dfluxes->data.F32[i] = dflux; 172 172 fmasks->data.U8[i] = mflux; 173 if (isnan(flux)) { 174 fmasks->data.U8[i] = 1;175 }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);173 if (isnan(flux)) { 174 fmasks->data.U8[i] = 1; 175 } 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 183 if (!validPixel) { 184 184 resid->Ro->data.F32[oy][ox] = 0.0; 185 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;186 resid->Ry->data.F32[oy][ox] = 0.0; 187 resid->mask->data.U8[oy][ox] = 1; 188 continue; 189 189 } 190 190 … … 216 216 //resid->weight->data.F32[oy][ox] = fluxStats->sampleStdev; 217 217 218 if (resid->Ro->data.F32[oy][ox] < pixelSN*fluxStats->sampleStdev) {219 resid->mask->data.U8[oy][ox] = 1;220 }218 if (resid->Ro->data.F32[oy][ox] < pixelSN*fluxStats->sampleStdev) { 219 resid->mask->data.U8[oy][ox] = 1; 220 } 221 221 222 222 } else { … … 254 254 resid->Ry->data.F32[oy][ox] = B->data.F64[2]; 255 255 256 float dRo = sqrt(A->data.F32[0][0]);257 if (resid->Ro->data.F32[oy][ox] < pixelSN*dRo) {258 resid->mask->data.U8[oy][ox] = 1;259 }256 float dRo = sqrt(A->data.F32[0][0]); 257 if (resid->Ro->data.F32[oy][ox] < pixelSN*dRo) { 258 resid->mask->data.U8[oy][ox] = 1; 259 } 260 260 //resid->weight->data.F32[oy][ox] = XXX; 261 261 }
Note:
See TracChangeset
for help on using the changeset viewer.
