Changeset 28426 for trunk/psphot/src/psphotFitSourcesLinearStack.c
- Timestamp:
- Jun 22, 2010, 3:00:02 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotFitSourcesLinearStack.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotFitSourcesLinearStack.c
r28013 r28426 43 43 for (int i = 0; i < objects->n; i++) { 44 44 pmPhotObj *object = objects->data[i]; 45 if (!object) continue;46 if (!object->sources) continue;45 if (!object) continue; 46 if (!object->sources) continue; 47 47 48 // XXX check an element of the group to see if we should use it49 // if (!object->flags & PM_PHOT_OBJ_BAD) continue;48 // XXX check an element of the group to see if we should use it 49 // if (!object->flags & PM_PHOT_OBJ_BAD) continue; 50 50 51 for (int j = 0; j < object->sources->n; j++) {52 pmSource *source = object->sources->data[j];53 if (!source) continue;51 for (int j = 0; j < object->sources->n; j++) { 52 pmSource *source = object->sources->data[j]; 53 if (!source) continue; 54 54 55 // turn this bit off and turn it on again if we keep this source56 source->mode &= ~PM_SOURCE_MODE_LINEAR_FIT;55 // turn this bit off and turn it on again if we keep this source 56 source->mode &= ~PM_SOURCE_MODE_LINEAR_FIT; 57 57 58 // generate model for sources without, or skip if we can't59 if (!source->modelFlux) {58 // generate model for sources without, or skip if we can't 59 if (!source->modelFlux) { 60 60 if (!pmSourceCacheModel (source, maskVal)) continue; 61 }61 } 62 62 63 source->mode |= PM_SOURCE_MODE_LINEAR_FIT;64 psArrayAdd (fitSources, 100, source);65 }63 source->mode |= PM_SOURCE_MODE_LINEAR_FIT; 64 psArrayAdd (fitSources, 100, source); 65 } 66 66 } 67 67 psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "built fitSources: %f sec (%ld objects)\n", psTimerMark ("psphot.linear"), objects->n); … … 85 85 86 86 // diagonal elements of the sparse matrix (auto-cross-product) 87 f = pmSourceModelDotModel (SRCi, SRCi, CONSTANT_PHOTOMETRIC_WEIGHTS, COVAR_FACTOR );87 f = pmSourceModelDotModel (SRCi, SRCi, CONSTANT_PHOTOMETRIC_WEIGHTS, COVAR_FACTOR, maskVal); 88 88 psSparseMatrixElement (sparse, i, i, f); 89 89 90 90 // the formal error depends on the weighting scheme 91 91 if (CONSTANT_PHOTOMETRIC_WEIGHTS) { 92 float var = pmSourceModelDotModel (SRCi, SRCi, false, COVAR_FACTOR );92 float var = pmSourceModelDotModel (SRCi, SRCi, false, COVAR_FACTOR, maskVal); 93 93 errors->data.F32[i] = 1.0 / sqrt(var); 94 94 } else { … … 97 97 98 98 // find the image x model value 99 f = pmSourceDataDotModel (SRCi, SRCi, CONSTANT_PHOTOMETRIC_WEIGHTS, COVAR_FACTOR );99 f = pmSourceDataDotModel (SRCi, SRCi, CONSTANT_PHOTOMETRIC_WEIGHTS, COVAR_FACTOR, maskVal); 100 100 psSparseVectorElement (sparse, i, f); 101 101 … … 104 104 pmSource *SRCj = fitSources->data[j]; 105 105 106 // we only need to generate dot terms for source on the same image107 if (SRCj->imageID != SRCi->imageID) { continue; }106 // we only need to generate dot terms for source on the same image 107 if (SRCj->imageID != SRCi->imageID) { continue; } 108 108 109 109 // skip over disjoint source images, break after last possible overlap … … 114 114 115 115 // got an overlap; calculate cross-product and add to output array 116 f = pmSourceModelDotModel (SRCi, SRCj, CONSTANT_PHOTOMETRIC_WEIGHTS, COVAR_FACTOR );116 f = pmSourceModelDotModel (SRCi, SRCj, CONSTANT_PHOTOMETRIC_WEIGHTS, COVAR_FACTOR, maskVal); 117 117 psSparseMatrixElement (sparse, j, i, f); 118 118 }
Note:
See TracChangeset
for help on using the changeset viewer.
