Changeset 9834 for trunk/psphot/src/psphotEnsemblePSF.c
- Timestamp:
- Nov 3, 2006, 5:05:49 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotEnsemblePSF.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotEnsemblePSF.c
r9813 r9834 141 141 psSparse *sparse = psSparseAlloc (models->n, 100); 142 142 psVector *weight = psVectorAlloc (models->n, PS_TYPE_F32); 143 psVector *errors = psVectorAlloc (models->n, PS_TYPE_F32); 143 144 144 145 for (int i = 0; i < models->n; i++) { … … 150 151 r = pmSourceCrossProduct (Mi, Mi, CONSTANT_PHOTOMETRIC_WEIGHTS); 151 152 weight->data.F32[i] = r; 153 154 // the formal error depends on the weighting scheme 155 if (CONSTANT_PHOTOMETRIC_WEIGHTS) { 156 float var = pmSourceCrossProduct (Mi, Mi, false); 157 errors->data.F32[i] = 1.0 / sqrt(var); 158 } else { 159 errors->data.F32[i] = 1.0 / sqrt(r); 160 } 152 161 153 162 psSparseMatrixElement (sparse, i, i, 1.0); … … 200 209 } 201 210 Fi->modelPSF->params->data.F32[PM_PAR_I0] = norm->data.F32[i]; 202 Fi->modelPSF->dparams->data.F32[PM_PAR_I0] = sqrt(sqrt(2) * norm->data.F32[i] / (sparse->Bfj->data.F32[i] * weight->data.F32[i])); 211 // XXX I was using this before, but it is not strictly accurate 203 212 // XXX EAM : this factor of sqrt(2) makes the errors consistent, but I don't understand it 213 // Fi->modelPSF->dparams->data.F32[PM_PAR_I0] = sqrt(sqrt(2) * norm->data.F32[i] / (sparse->Bfj->data.F32[i] * weight->data.F32[i])); 214 Fi->modelPSF->dparams->data.F32[PM_PAR_I0] = errors->data.F32[i]; 204 215 205 216 // subtract object … … 228 239 psFree (norm); 229 240 psFree (weight); 241 psFree (errors); 230 242 231 243 psLogMsg ("psphot.emsemble", 3, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot"));
Note:
See TracChangeset
for help on using the changeset viewer.
