Changeset 27667 for trunk/ppViz/src/ppVizPSF/ppVizPSFLoop.c
- Timestamp:
- Apr 12, 2010, 2:18:52 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ppViz/src/ppVizPSF/ppVizPSFLoop.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppViz/src/ppVizPSF/ppVizPSFLoop.c
r27666 r27667 75 75 psVector *xOffset = NULL, *yOffset = NULL; // Offset from source to true position 76 76 77 if (sources || (data->fakeNum > 0 && isfinite(data->fakeMag))) {77 if (sources || data->input || (data->fakeNum > 0 && isfinite(data->fakeMag))) { 78 78 numCols = psf->fieldNx; 79 79 numRows = psf->fieldNy; … … 82 82 if (sources) { 83 83 psMemIncrRefCounter(sources); 84 psLogMsg("ppVizPSF", PS_LOG_INFO, "Using %ld input sources", sources->n); 85 } 84 psLogMsg("ppVizPSF", PS_LOG_INFO, "Using %ld input sources from CMF file", sources->n); 85 } else if (data->input) { 86 psVector *x = data->input->data[0]; // x coordinates 87 psLogMsg("ppVizPSF", PS_LOG_INFO, "Using %ld input sources from text file", x->n); 88 } 89 86 90 if (data->fakeNum > 0 && isfinite(data->fakeMag)) { 87 91 long numOld = 0; // Old number of sources … … 113 117 } 114 118 } 115 if (!sources ) {119 if (!sources && !data->input) { 116 120 // Generate fake image with only a single realisation of the PSF 117 121 sources = psArrayAlloc(1); … … 137 141 psRegion *trimsec = psMetadataLookupPtr(NULL, cell->concepts, "CELL.TRIMSEC"); 138 142 *trimsec = psRegionSet(0, numCols, 0, numRows); 139 140 // We have trouble with PSF residuals in this case, so don't use them141 psFree(psf->residuals);142 psf->residuals = NULL;143 143 } 144 144 … … 148 148 } 149 149 150 if (!pmReadoutFakeFromSources(readout, numCols, numRows, sources, 0, xOffset, yOffset, psf, 151 data->minFlux, 0, false, true)) { 152 psError(PS_ERR_UNKNOWN, false, "Unable to generate fake readout."); 153 return false; 150 // We have trouble with PSF residuals, so don't use them 151 psFree(psf->residuals); 152 psf->residuals = NULL; 153 154 if (sources) { 155 if (!pmReadoutFakeFromSources(readout, numCols, numRows, sources, 0, xOffset, yOffset, 156 psf, data->minFlux, 0, false, true)) { 157 psError(PS_ERR_UNKNOWN, false, "Unable to generate fake readout."); 158 return false; 159 } 160 } else if (data->input) { 161 psVector *x = data->input->data[0]; // x coordinates 162 psVector *y = data->input->data[1]; // y coordinates 163 psVector *mag = data->input->data[2]; // Magnitudes 164 if (!pmReadoutFakeFromVectors(readout, numCols, numRows, x, y, mag, xOffset, yOffset, 165 psf, data->minFlux, 0, false, true)) { 166 psError(PS_ERR_UNKNOWN, false, "Unable to generate fake readout."); 167 return false; 168 } 154 169 } 155 170
Note:
See TracChangeset
for help on using the changeset viewer.
