Changeset 10076 for trunk/psphot/src/psphotEnsemblePSF.c
- Timestamp:
- Nov 17, 2006, 9:35:22 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotEnsemblePSF.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotEnsemblePSF.c
r10052 r10076 10 10 // the analysis is performed wrt the simulated pixel values 11 11 12 static bool SetBorderT (psSparseBorder *border, pmReadout *readout, psArray *refSources, bool fitSlope);12 static bool SetBorderT (psSparseBorder *border, pmReadout *readout, psArray *refSources, psArray *fitSources, psVector *index, bool fitSlope); 13 13 14 14 bool psphotEnsemblePSF (pmReadout *readout, psArray *refSources, psMetadata *recipe, pmPSF *psf, bool final) { … … 162 162 // set the sky, sky_x, sky_y components of border matrix 163 163 // XXX ignore sky slope terms for now 164 SetBorderT (border, readout, refSources, f alse);164 SetBorderT (border, readout, refSources, fitSources, index, false); 165 165 166 166 psSparseConstraint constraint; … … 170 170 171 171 // solve for normalization terms (need include local sky?) 172 # if (0) 172 173 psVector *norm = NULL; 173 174 psVector *skyfit = NULL; 174 175 psSparseBorderSolve (&norm, &skyfit, constraint, border, 3); 176 # else 177 psVector *norm = psSparseSolve (NULL, constraint, sparse, 3); 178 # endif 175 179 176 180 // adjust fitSources, set refSources and subtract … … 215 219 psFree (weight); 216 220 psFree (errors); 221 psFree (border); 217 222 218 223 psLogMsg (__func__, 3, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot")); … … 221 226 222 227 // calculate the weight terms for the sky fit component of the matrix 223 static bool SetBorderT (psSparseBorder *border, pmReadout *readout, psArray *refSources, bool fitSlope) {228 static bool SetBorderT (psSparseBorder *border, pmReadout *readout, psArray *refSources, psArray *fitSources, psVector *index, bool fitSlope) { 224 229 225 230 // generate the image-wide weight terms … … 231 236 // turn off MARK for all object pixels 232 237 // we must use the refSources here since their pixels point at the science image 233 for (int i = 0; i < refSources->n; i++) { 234 pmSource *refSource = refSources->data[i]; 238 for (int i = 0; i < fitSources->n; i++) { 239 int N = index->data.U32[i]; 240 pmSource *refSource = refSources->data[N]; 235 241 pmModel *model = pmSourceGetModel (NULL, refSource); 242 if (model == NULL) continue; 236 243 float x = model->params->data.F32[PM_PAR_XPOS]; 237 244 float y = model->params->data.F32[PM_PAR_YPOS];
Note:
See TracChangeset
for help on using the changeset viewer.
