IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 17, 2011, 5:18:09 PM (16 years ago)
Author:
eugene
Message:

apply window only to the moments portions of the calculation; apply weights only to the chisq portion of the calculation; do not renormalize the chisq portion by the flux (keeps SINGLE and DUAL on same scale); move stamp convolution out of CalculateEquation; explicit tests if the convolutions are needed; remove the old unused matrix solution functions; calculate the coefficient errors; add function to calculate chisq and moments statistics, and to generate a subtraction quality statistic; pull model visualization out of CalculateDeviations; adjust the size of the normalization window (if too small, we likely miss some of the flux); exclude excessively faint sources from model fit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/psModules/src/imcombine/pmSubtractionStamps.c

    r30266 r30289  
    122122            if ((image1 && image1->data.F32[y][x] < thresh1) ||
    123123                (image2 && image2->data.F32[y][x] < thresh2)) {
     124                // fprintf (stderr, "%f,%f : thresh\n", xRaw, yRaw);
    124125                continue;
    125126            }
     
    429430        stamps = pmSubtractionStampListAlloc(numCols, numRows, region, footprint, spacing,
    430431                                             normFrac, sysErr, skyErr);
     432    }
     433
     434    // XXX TEST : dump all stars in the stamps here
     435    if (0) {
     436        FILE *f = fopen ("stamp.dat", "w");
     437        for (int i = 0; i < stamps->num; i++) {
     438            psVector *xList = stamps->x->data[i];
     439            psVector *yList = stamps->y->data[i]; // Coordinate lists
     440            psVector *fluxList = stamps->flux->data[i]; // List of stamp fluxes
     441
     442            for (int j = 0; j < xList->n; j++) {
     443                fprintf (f, "%d %d  %f %f  %f\n", i, j, xList->data.F32[j], yList->data.F32[j], fluxList->data.F32[j]);
     444            }
     445        }
     446        fclose (f);
    431447    }
    432448
     
    636652    }
    637653
     654    int nTotal = 0;
     655
    638656    // Sort the list by flux, with the brightest last
    639657    for (int i = 0; i < numStamps; i++) {
     
    662680        stamps->y->data[i] = ySorted;
    663681        stamps->flux->data[i] = fluxSorted;
    664     }
    665 
     682        nTotal += num;
     683    }
     684    // fprintf (stderr, "nTotal %d\n", nTotal);
     685   
    666686    return stamps;
    667687}
     
    809829    float R2 = Sr2 / Sf2;
    810830
    811     stamps->normWindow1 = 2.0*R1;
    812     stamps->normWindow2 = 2.0*R2;
     831    stamps->normWindow1 = 2.75*R1;
     832    stamps->normWindow2 = 2.75*R2;
    813833    psLogMsg ("psModules.imcombine", PS_LOG_DETAIL, "Kron Radii: %f for 1, %f for 2\n", stamps->normWindow1, stamps->normWindow2);
    814834
    815835    // Generate a weighting window based on the kron radii
    816836    {
    817         float radius = 1.5 * PS_MAX(R1, R2);
     837        float radius = 2.0 * PS_MAX(R1, R2);
    818838
    819839        psImageInit(stamps->window->image, 0.0);
     
    826846        }
    827847    }
     848
     849    // complain if normWindow1 or normWindow2 are larger than size
     850    psAssert(stamps->normWindow1 < size, "norm Window 1 too large");
     851    psAssert(stamps->normWindow2 < size, "norm Window 2 too large");
    828852
    829853# else
     
    11421166            continue;
    11431167        }
     1168       
     1169        // XXX TEST
     1170        if (source->errMag > 0.1) continue;
     1171
    11441172        if (source->modelPSF) {
    11451173            x->data.F32[numOut] = source->modelPSF->params->data.F32[PM_PAR_XPOS];
Note: See TracChangeset for help on using the changeset viewer.