IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20581


Ignore:
Timestamp:
Nov 7, 2008, 3:51:01 PM (18 years ago)
Author:
eugene
Message:

require 10 stars per spatial bin, use a soften mag for residual fit

File:
1 edited

Legend:

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

    r20453 r20581  
    190190    psVector *dMagSys = (psVector *) psBinaryOp (NULL, (void *) dMag, "*", (void *) psScalarAlloc(errorScale, PS_TYPE_F32));
    191191
    192     if (psTraceGetLevel("psphot") >= 5) {
     192    if (psTraceGetLevel("psphot") >= 2) {
    193193        FILE *dumpFile = fopen ("apresid.dat", "w");
    194194        for (int i = 0; i < xPos->n; i++) {
     
    289289            dMo->data.F32[i] = statsM->sampleMean;
    290290            dRo->data.F32[i] = statsS->robustStdev / statsM->sampleMean;
     291            fprintf (stderr, "%d (%d) : sys: %f, phot: %f, rat: %f\n", i, j, dSo->data.F32[i], dMo->data.F32[i], dRo->data.F32[i]);
    291292        } else {
    292293            dSo->data.F32[i] = NAN;
     
    339340        Nx = PS_MAX (1, Nx);
    340341    }
    341 
    342     if (Npsf < 3*Nx*Ny) {
     342   
     343    // require at least 10 stars per spatial bin
     344    if (Npsf < 10*Nx*Ny) {
    343345        return false;
    344346    }
     
    356358    psf->ApTrend = pmTrend2DAlloc (PM_TREND_MAP, readout->image, Nx, Ny, stats);
    357359
     360    // XXX somewhat arbitrary: soften the errors so the few bright stars do not totally dominate:
     361    psVector *dMagSoft = psVectorAlloc (dMag->n, PS_TYPE_F32);
     362    for (int i = 0; i < dMag->n; i++) {
     363        dMagSoft->data.F32[i] = hypot(dMag->data.F32[i], 0.01);
     364    }
     365
    358366    // XXX test for errors here
    359     pmTrend2DFit (psf->ApTrend, mask, 0xff, xPos, yPos, apResid, dMag);
     367    pmTrend2DFit (psf->ApTrend, mask, 0xff, xPos, yPos, apResid, dMagSoft);
    360368   
    361369    // construct the fitted values and the residuals
     
    373381
    374382    psFree (stats);
     383    psFree (dMagSoft);
    375384    psFree (apResidFit);
    376385    psFree (apResidRes);
Note: See TracChangeset for help on using the changeset viewer.