Changeset 14732
- Timestamp:
- Sep 4, 2007, 8:57:53 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070830/psphot/src/psphotApResid.c
r13900 r14732 56 56 psVector *xPos = psVectorAllocEmpty (300, PS_TYPE_F64); 57 57 psVector *yPos = psVectorAllocEmpty (300, PS_TYPE_F64); 58 psVector *flux = psVectorAllocEmpty (300, PS_TYPE_F64);59 psVector *r2rflux = psVectorAllocEmpty (300, PS_TYPE_F64);60 58 psVector *apResid = psVectorAllocEmpty (300, PS_TYPE_F64); 61 59 psVector *dMag = psVectorAllocEmpty (300, PS_TYPE_F64); … … 90 88 } 91 89 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)) { 96 95 Nfail ++; 97 96 continue; 98 97 } 99 98 99 apResid->data.F64[Npsf] = dap 100 100 xPos->data.F64[Npsf] = model->params->data.F32[PM_PAR_XPOS]; 101 101 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];105 102 106 103 mask->data.U8[Npsf] = 0; … … 118 115 psVectorExtend (xPos, 100, 1); 119 116 psVectorExtend (yPos, 100, 1); 120 psVectorExtend (flux, 100, 1);121 psVectorExtend (r2rflux, 100, 1);122 117 psVectorExtend (dMag, 100, 1); 123 118 psVectorExtend (apResid, 100, 1); … … 139 134 } 140 135 136 // XXX deprecating the old code which allowed the ApResid to be fitted as a function of flux and r^2/flux 141 137 // APTREND options : NONE CONSTANT SKYBIAS XY_LIN XY_QUAD SKY_XY_LIN FULL 142 138 // APTREND options are used in the switch block below … … 149 145 } 150 146 147 // XXX is this asymmetric clipping still needed? this analysis should come after neighbors are subtracted... 151 148 // 3hi/1lo sigma clipping on the rflux vs metric fit 152 149 psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
Note:
See TracChangeset
for help on using the changeset viewer.
