Changeset 23960 for trunk/psModules/src/camera/pmReadoutFake.c
- Timestamp:
- Apr 23, 2009, 5:48:09 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmReadoutFake.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmReadoutFake.c
r23955 r23960 82 82 83 83 int numSources = sources->n; // Number of stars 84 85 float flux0 = NAN; // Flux for central intensity of 1.086 if (normalisePeak) {87 pmModel *fakeModel = pmModelFromPSFforXY(psf, (float)numCols / 2.0, (float)numRows / 2.0,88 1.0); // Fake model, with central intensity of 1.089 psAssert(fakeModel, "failed to generate model: should this be an error or not?");90 91 if (circularise && !circulariseModel(fakeModel)) {92 psError(PS_ERR_UNKNOWN, false, "Unable to circularise PSF model.");93 psFree(fakeModel);94 return false;95 }96 97 flux0 = fakeModel->modelFlux(fakeModel->params); // Flux for central intensity of 1.098 psFree(fakeModel);99 }100 101 84 for (int i = 0; i < numSources; i++) { 102 85 pmSource *source = sources->data[i]; // Source of interest … … 120 103 121 104 float flux = powf(10.0, -0.4 * source->psfMag); // Flux of source 105 122 106 if (normalisePeak) { 123 flux /= flux0; 107 // Normalise flux 108 pmModel *normModel = pmModelFromPSFforXY(psf, x, y, 1.0); // Model for normalisation 109 if (!normModel || (normModel->flags & MODEL_MASK)) { 110 psFree(normModel); 111 continue; 112 } 113 if (circularise && !circulariseModel(normModel)) { 114 psError(PS_ERR_UNKNOWN, false, "Unable to circularise PSF model."); 115 psFree(normModel); 116 return false; 117 } 118 119 flux /= normModel->modelFlux(normModel->params); 120 psFree(normModel); 124 121 } 125 122
Note:
See TracChangeset
for help on using the changeset viewer.
