IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14732


Ignore:
Timestamp:
Sep 4, 2007, 8:57:53 AM (19 years ago)
Author:
eugene
Message:

converting to simple 2D trend model (no flux, Area/flux trends)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20070830/psphot/src/psphotApResid.c

    r13900 r14732  
    5656    psVector *xPos    = psVectorAllocEmpty (300, PS_TYPE_F64);
    5757    psVector *yPos    = psVectorAllocEmpty (300, PS_TYPE_F64);
    58     psVector *flux    = psVectorAllocEmpty (300, PS_TYPE_F64);
    59     psVector *r2rflux = psVectorAllocEmpty (300, PS_TYPE_F64);
    6058    psVector *apResid = psVectorAllocEmpty (300, PS_TYPE_F64);
    6159    psVector *dMag    = psVectorAllocEmpty (300, PS_TYPE_F64);
     
    9088        }
    9189
    92         // sanity clipping : if the model is so discrepant, but your expectation in the recipe
    93         apResid->data.F64[Npsf] = source->apMag - source->psfMag;
    94 
    95         if ((MAX_AP_OFFSET > 0) && (fabs(apResid->data.F64[Npsf]) > MAX_AP_OFFSET)) {
     90        // aperture residual for this source
     91        float dap = source->apMag - source->psfMag;
     92
     93        // sanity clipping : if the model is very discrepant, put your expectation in the recipe
     94        if ((MAX_AP_OFFSET > 0) && (fabs(dap) > MAX_AP_OFFSET)) {
    9695            Nfail ++;
    9796            continue;
    9897        }
    9998
     99        apResid->data.F64[Npsf] = dap
    100100        xPos->data.F64[Npsf]    = model->params->data.F32[PM_PAR_XPOS];
    101101        yPos->data.F64[Npsf]    = model->params->data.F32[PM_PAR_YPOS];
    102 
    103         flux->data.F64[Npsf]    = pow(10.0, -0.4*source->psfMag);
    104         r2rflux->data.F64[Npsf] = PS_SQR(model->radiusFit) / flux->data.F64[Npsf];
    105102
    106103        mask->data.U8[Npsf] = 0;
     
    118115        psVectorExtend (xPos,    100, 1);
    119116        psVectorExtend (yPos,    100, 1);
    120         psVectorExtend (flux,    100, 1);
    121         psVectorExtend (r2rflux, 100, 1);
    122117        psVectorExtend (dMag,    100, 1);
    123118        psVectorExtend (apResid, 100, 1);
     
    139134    }
    140135
     136    // XXX deprecating the old code which allowed the ApResid to be fitted as a function of flux and r^2/flux
    141137    // APTREND options : NONE CONSTANT SKYBIAS XY_LIN XY_QUAD SKY_XY_LIN FULL
    142138    // APTREND options are used in the switch block below
     
    149145    }
    150146
     147    // XXX is this asymmetric clipping still needed?  this analysis should come after neighbors are subtracted...
    151148    // 3hi/1lo sigma clipping on the rflux vs metric fit
    152149    psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
Note: See TracChangeset for help on using the changeset viewer.