Changeset 35560 for trunk/psModules/src/objects/pmSourceFitModel.c
- Timestamp:
- May 9, 2013, 12:19:21 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceFitModel.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceFitModel.c
r34403 r35560 75 75 PS_ASSERT_PTR_NON_NULL(source->pixels, false); 76 76 PS_ASSERT_PTR_NON_NULL(source->maskObj, false); 77 PS_ASSERT_PTR_NON_NULL(source->variance, false); 77 78 // XXX if variance is NULL, use pixels instead (wrong, but not badly wrong) 79 // PS_ASSERT_PTR_NON_NULL(source->variance, false); 78 80 79 81 psBool fitStatus = true; … … 93 95 float Xo = model->params->data.F32[PM_PAR_XPOS]; 94 96 float Yo = model->params->data.F32[PM_PAR_YPOS]; 97 98 // if variance is NULL, we pretend pixels == variance 99 float **vWgt = source->variance ? source->variance->data.F32 : source->pixels->data.F32; 95 100 96 101 // fill in the coordinate and value entries … … 103 108 } 104 109 // skip zero-variance points 105 if ( source->variance->data.F32[i][j] == 0) {110 if (vWgt[i][j] == 0) { 106 111 continue; 107 112 } 108 113 // skip nan values in image 109 114 if (!isfinite(source->pixels->data.F32[i][j])) { 115 fprintf (stderr, "WARNING: unmasked nan in image : %x vs %x\n", source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j], maskVal); 110 116 continue; 111 117 } 112 118 113 119 // skip nan values in image 114 if (!isfinite( source->variance->data.F32[i][j])) {115 fprintf (stderr, " impossible!%x vs %x\n", source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j], maskVal);120 if (!isfinite(vWgt[i][j])) { 121 fprintf (stderr, "WARNING: unmasked nan in variance : %x vs %x\n", source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[i][j], maskVal); 116 122 continue; 117 123 } … … 140 146 // source sky variance 141 147 if (options->poissonErrors) { 142 yErr->data.F32[nPix] = 1.0 / source->variance->data.F32[i][j];148 yErr->data.F32[nPix] = 1.0 / vWgt[i][j]; 143 149 } else { 144 150 yErr->data.F32[nPix] = 1.0 / options->weight;
Note:
See TracChangeset
for help on using the changeset viewer.
