IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20451


Ignore:
Timestamp:
Oct 28, 2008, 2:03:17 PM (18 years ago)
Author:
eugene
Message:

adjust scaling of S/N to use stdev of mean (down by sqrt(N))

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotMakeResiduals.c

    r20307 r20451  
    125125    }
    126126    pmResiduals *resid = pmResidualsAlloc (xSize, ySize, xBin, yBin);
     127    psImageInit (resid->mask, 0);
    127128
    128129    // x(resid) = (x(image) - Xo)*xBin + xCenter
     
    195196
    196197            // mark input pixels which are more than N sigma from the median
     198            int nKeep = 0;
    197199            for (int i = 0; i < fluxes->n; i++) {
    198200                float delta = fluxes->data.F32[i] - fluxClip->robustMedian;
     
    204206                    fmasks->data.U8[i] = clippedMask;
    205207                }
     208                if (!fmasks->data.U8[i]) nKeep++;
    206209            }
    207210
     
    216219                //resid->weight->data.F32[oy][ox] = fluxStats->sampleStdev;
    217220
    218                 if (resid->Ro->data.F32[oy][ox] < pixelSN*fluxStats->sampleStdev) {
     221                if (fabs(resid->Ro->data.F32[oy][ox]) < pixelSN*fluxStats->sampleStdev/sqrt(nKeep)) {
    219222                  resid->mask->data.U8[oy][ox] = 1;
    220223                }
     224
     225                // fprintf (stderr, "res: %2d %2d : %6.4f  %6.4f  %6.4f   %3d  %1d\n", ox, oy, resid->Ro->data.F32[oy][ox], fluxStats->sampleStdev, fluxStats->sampleStdev/sqrt(nKeep), nKeep, resid->mask->data.U8[oy][ox]);
    221226
    222227            } else {
     
    255260
    256261                float dRo = sqrt(A->data.F32[0][0]);
    257                 if (resid->Ro->data.F32[oy][ox] < pixelSN*dRo) {
     262                // fprintf (stderr, "res: %2d %2d : %6.4f  %6.4f  %6.4f   %3d  %1d\n", ox, oy, resid->Ro->data.F32[oy][ox], dRo, dRo/sqrt(nKeep), nKeep, resid->mask->data.U8[oy][ox]);
     263
     264                if (fabs(resid->Ro->data.F32[oy][ox]) < pixelSN*dRo/sqrt(nKeep)) {
    258265                  resid->mask->data.U8[oy][ox] = 1;
    259266                }
Note: See TracChangeset for help on using the changeset viewer.