- Timestamp:
- Jan 22, 2010, 11:45:18 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/ppStack/src/ppStackPrepare.c
r26475 r26671 176 176 177 177 178 bool redoPhot = psMetadataLookupBool(NULL, recipe, "PHOT");179 psArray *sources = NULL;180 181 if (options->convolve || options->matchZPs || redoPhot) {182 pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources183 sources = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.SOURCES"); // Sources184 if (!sources) {185 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find sources in readout.");186 return NULL;187 }188 options->sourceLists->data[index] = psMemIncrRefCounter(sources);189 }178 bool redoPhot = psMetadataLookupBool(NULL, recipe, "PHOT"); 179 psArray *sources = NULL; 180 181 if (options->convolve || options->matchZPs || redoPhot) { 182 pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources 183 sources = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.SOURCES"); // Sources 184 if (!sources) { 185 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find sources in readout."); 186 return NULL; 187 } 188 options->sourceLists->data[index] = psMemIncrRefCounter(sources); 189 } 190 190 191 191 // Re-do photometry if we don't trust the source lists … … 194 194 pmFPAfileActivate(config->files, false, NULL); 195 195 ppStackFileActivationSingle(config, PPSTACK_FILES_CONVOLVE, true, index); 196 if (options->convolve) {197 pmFPAfileActivate(config->files, true, "PPSTACK.CONV.KERNEL");198 }196 if (options->convolve) { 197 pmFPAfileActivate(config->files, true, "PPSTACK.CONV.KERNEL"); 198 } 199 199 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", index); // File 200 200 pmFPAview *photView = ppStackFilesIterateDown(config); … … 225 225 } 226 226 psFree(fileIter); 227 228 psString log = psStringCopy("Input seeing FWHMs:\n"); // Log message 229 bool havePSFs = false; // Do we have any PSFs? 230 options->inputSeeing = psVectorAlloc(num, PS_TYPE_F32); 231 psVectorInit(options->inputSeeing, NAN); 232 for (int i = 0; i < num; i++) { 233 pmPSF *psf = psfs->data[i]; // PSF for image 234 if (!psf) { 235 continue; 236 } 237 havePSFs = true; 238 float fwhm = pmPSFtoFWHM(psf, 0.5 * numCols, 0.5 * numRows); // FWHM for image 239 psStringAppend(&log, "Input %d: %f\n", i, fwhm); 240 options->inputSeeing->data.F32[i] = fwhm; 241 } 242 if (havePSFs) { 243 psLogMsg("ppStack", PS_LOG_INFO, "%s", log); 244 } 245 psFree(log); 227 246 228 247 // Generate target PSF … … 237 256 psMetadataAddPtr(config->arguments, PS_LIST_TAIL, "PSF.TARGET", PS_DATA_UNKNOWN, 238 257 "Target PSF for stack", options->psf); 258 options->targetSeeing = pmPSFtoFWHM(options->psf, 0.5 * numCols, 0.5 * numRows); // FWHM for target 259 psLogMsg("ppStack", PS_LOG_INFO, "Target seeing FWHM: %f\n", options->targetSeeing); 239 260 240 261 pmChip *outChip = pmFPAfileThisChip(config->files, view, "PPSTACK.OUTPUT"); // Output chip
Note:
See TracChangeset
for help on using the changeset viewer.
