Changeset 34800 for trunk/ppViz
- Timestamp:
- Dec 11, 2012, 2:04:31 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ppViz/src/ppVizPSF/ppVizPSFCamera.c (modified) (2 diffs)
-
ppViz/src/ppVizPSF/ppVizPSFLoop.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
trunk/ppViz/src/ppVizPSF/ppVizPSFCamera.c
r26367 r34800 19 19 files->data[0] = psStringCopy(name); 20 20 if (psMetadataLookup(config->arguments, file)) { 21 21 22 psMetadataRemoveKey(config->arguments, file); 22 23 } … … 42 43 fileArguments("SOURCES", data->sourcesName, "Input sources", data->config); 43 44 pmFPAfile *srcs = pmFPAfileBindFromArgs(&status, psf, data->config, 44 "PSPHOT.INPUT.CMF", "SOURCES"); // File 45 "PSPHOT.INPUT.CMF", "SOURCES"); // File 46 fprintf(stderr,"%ld %d\n",(long) srcs, status); 45 47 if (!status || !srcs) { 46 48 psError(PS_ERR_IO, false, "Failed to build file from PSPHOT.INPUT.CMF"); -
trunk/ppViz/src/ppVizPSF/ppVizPSFLoop.c
r27667 r34800 20 20 return NULL; 21 21 } 22 22 fprintf(stderr,"Woo!\n"); 23 23 pmChip *chip; // Chip from FPA 24 24 while ((chip = pmFPAviewNextChip(view, psfFile->fpa, 1))) { … … 56 56 psWarning("More than one readout present for chip %d, cell %d", view->chip, view->cell); 57 57 } 58 58 fprintf(stderr,"Woo!\n"); 59 59 pmReadout *readout; // Readout from cell 60 60 while ((readout = pmFPAviewNextReadout(view, psfFile->fpa, 1))) { 61 fprintf(stderr,"Woo?\n"); 61 62 if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) { 62 63 psError(PS_ERR_UNKNOWN, false, "Error loading data from files."); 63 64 return false; 64 65 } 65 if (!readout->data_exists) { 66 continue; 67 } 68 66 fprintf(stderr,"Woo2?\n"); 69 67 pmPSF *psf = psMetadataLookupPtr(NULL, chip->analysis, "PSPHOT.PSF"); // PSF 70 68 assert(psf); … … 72 70 bool mdok; // Status of MD lookup 73 71 psArray *sources = psMetadataLookupPtr(&mdok, readout->analysis, "PSPHOT.SOURCES"); // Sources 72 73 if (sources && !readout->data_exists) { // This fails if -sources not specified 74 continue; 75 } 76 readout->data_exists = true; 77 fprintf(stderr,"Woo! %ld\n", sources ? sources->n : -1); 78 79 fprintf(stderr,"%d\n",mdok); 74 80 int numCols = 0, numRows = 0; // Size of image 75 81 psVector *xOffset = NULL, *yOffset = NULL; // Offset from source to true position … … 80 86 psLogMsg("ppVizPSF", PS_LOG_INFO, "Generating %dx%d image", numCols, numRows); 81 87 } 82 if (sources ) {88 if (sources && !sources->n) { 83 89 psMemIncrRefCounter(sources); 84 90 psLogMsg("ppVizPSF", PS_LOG_INFO, "Using %ld input sources from CMF file", sources->n); … … 89 95 90 96 if (data->fakeNum > 0 && isfinite(data->fakeMag)) { 97 fprintf(stderr,"Here! fakes\n"); 91 98 long numOld = 0; // Old number of sources 92 99 long numNew = -1; // New number of sources … … 118 125 } 119 126 if (!sources && !data->input) { 127 fprintf(stderr,"Here! default\n"); 120 128 // Generate fake image with only a single realisation of the PSF 121 129 sources = psArrayAlloc(1); … … 151 159 psFree(psf->residuals); 152 160 psf->residuals = NULL; 153 161 fprintf(stderr,"still here"); 154 162 if (sources) { 163 fprintf(stderr,"Here! sources?\n"); 155 164 if (!pmReadoutFakeFromSources(readout, numCols, numRows, sources, 0, xOffset, yOffset, 156 165 psf, data->minFlux, 0, false, true)) { … … 159 168 } 160 169 } else if (data->input) { 170 161 171 psVector *x = data->input->data[0]; // x coordinates 162 172 psVector *y = data->input->data[1]; // y coordinates 163 173 psVector *mag = data->input->data[2]; // Magnitudes 174 fprintf(stderr,"Here! input? %d %d %g %d %ld\n",numCols,numRows,data->minFlux,1,x->n); 164 175 if (!pmReadoutFakeFromVectors(readout, numCols, numRows, x, y, mag, xOffset, yOffset, 165 176 psf, data->minFlux, 0, false, true)) { … … 168 179 } 169 180 } 170 181 171 182 psFree(sources); 172 183 psFree(xOffset);
Note:
See TracChangeset
for help on using the changeset viewer.
