Changeset 27884
- Timestamp:
- May 8, 2010, 1:55:26 PM (16 years ago)
- Location:
- branches/eam_branches/psphot.20100506/src
- Files:
-
- 7 edited
-
psphot.h (modified) (1 diff)
-
psphotStackImageLoop.c (modified) (1 diff)
-
psphotStackMatchPSFs.c (modified) (3 diffs)
-
psphotStackMatchPSFsPrepare.c (modified) (3 diffs)
-
psphotStackMatchPSFsUtils.c (modified) (9 diffs)
-
psphotStackOptions.c (modified) (2 diffs)
-
psphotStackParseCamera.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psphot.20100506/src/psphot.h
r27883 r27884 453 453 psphotStackOptions *psphotStackOptionsAlloc (int num); 454 454 psphotStackConvolveSource psphotStackConvolveSourceFromString (const char *string); 455 pmFPAfile *psphotStackGetConvolveSource (pmConfig *config, psphotStackOptions *options, int index); 455 456 456 457 #endif -
branches/eam_branches/psphot.20100506/src/psphotStackImageLoop.c
r27876 r27884 33 33 psLogMsg ("psphot", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 34 34 if (! chip->process || ! chip->file_exists) { continue; } 35 //if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphotStack.");35 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphotStack."); 36 36 37 37 // there is now only a single chip (multiple readouts?). loop over it and process 38 38 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 39 39 psLogMsg ("psphot", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 40 //if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Cell in psphotStack.");40 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Cell in psphotStack."); 41 41 42 42 // process each of the readouts -
branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFs.c
r27883 r27884 64 64 bool psphotStackMatchPSFsReadout (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index) { 65 65 66 // find the currently selected readout 67 pmFPAfile *fileRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", index); // File of interest 68 psAssert (fileRaw, "missing file?"); 66 pmFPAfile *fileSrc = psphotStackGetConvolveSource(config, options, index); 67 if (!fileSrc) { 68 psError(PSPHOT_ERR_CONFIG, false, "desired convolution source is missing"); 69 return false; 70 } 69 71 70 pmFPAfile *file Cnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", index); // File of interest71 psAssert (file Cnv, "missingfile?");72 pmFPAfile *fileOut = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.OUTPUT.IMAGE", index); // File of interest 73 psAssert (fileOut, "missing output file?"); 72 74 73 pmReadout *readout Raw = pmFPAviewThisReadout(view, fileRaw->fpa);74 psAssert (readout Raw, "missing readout?");75 pmReadout *readoutSrc = pmFPAviewThisReadout(view, fileSrc->fpa); 76 psAssert (readoutSrc, "missing readout?"); 75 77 76 pmReadout *readoutCnv = pmFPAviewThisReadout(view, fileCnv->fpa); 77 psAssert (readoutCnv, "missing readout?"); 78 pmReadout *readoutOut = pmFPAviewThisReadout(view, fileOut->fpa); 79 if (readoutOut == NULL) { 80 readoutOut = pmFPAGenerateReadout(config, view, "PSPHOT.STACK.OUTPUT.IMAGE", fileSrc->fpa, NULL, 0); 81 psAssert (readoutOut, "missing readout?"); 82 } 78 83 79 84 // set NAN pixels to 'SAT' 80 85 psImageMaskType maskVal = pmConfigMaskGet("SAT", config); 81 if (!pmReadoutMaskNonfinite(readout Raw, maskVal)) {86 if (!pmReadoutMaskNonfinite(readoutSrc, maskVal)) { 82 87 psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels in readout."); 83 88 return false; … … 86 91 // Image Matching (PSFs or just flux) 87 92 if (options->convolve) { 88 matchKernel(config, readout Cnv, readoutRaw, options, index);89 saveMatchData(readout Cnv, options, index);93 matchKernel(config, readoutOut, readoutSrc, options, index); 94 saveMatchData(readoutOut, options, index); 90 95 // renormKernel(readoutCnv, options, index); 91 96 } else { … … 97 102 } 98 103 99 rescaleData(readout Cnv, config, options, index);104 rescaleData(readoutOut, config, options, index); 100 105 101 dumpImage(readout Cnv, readoutRaw, index, "convolved");106 dumpImage(readoutOut, readoutSrc, index, "convolved"); 102 107 103 108 return true; -
branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFsPrepare.c
r27883 r27884 1 1 # include "psphotInternal.h" 2 3 pmPSF *selectPSF (pmFPAfile *fileSrc, const pmFPAview *view, psphotStackOptions *options, int index); 4 bool determineSeeing (pmPSF *psf, psphotStackOptions *options, int index); 2 5 3 6 // set up the stacking parameters … … 9 12 } 10 13 11 // which image do we want to convolve? RAW, CNV, AUTO? 12 // find the currently selected readout 13 pmFPAfile *fileRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", index); // File of interest 14 pmFPAfile *fileCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", index); // File of interest 15 16 pmFPAfile *fileSrc = NULL; 17 pmPSF *psf = NULL; 18 19 switch (options->convolveSource) { 20 case PSPHOT_CNV_SRC_AUTO: 21 fileSrc = fileCnv ? fileCnv : fileRaw; 22 break; 23 24 case PSPHOT_CNV_SRC_RAW: 25 fileSrc = fileRaw; 26 break; 27 28 case PSPHOT_CNV_SRC_CNV: 29 fileSrc = fileCnv; 30 break; 31 32 default: 33 psAbort("impossible case"); 34 } 14 pmFPAfile *fileSrc = psphotStackGetConvolveSource(config, options, index); 35 15 if (!fileSrc) { 36 psError(PSPHOT_ERR_CONFIG, true, "desired convolution source is missing (cnv : %llx, raw : %llx)", (long long) fileCnv, (long long) fileRaw);16 psError(PSPHOT_ERR_CONFIG, false, "desired convolution source is missing"); 37 17 return false; 38 18 } 39 19 40 // select the corresponding input psf 41 { 42 pmChip *chip = pmFPAviewThisChip(view, fileSrc->fpa); // The chip holds the PSF 43 pmPSF *psf = psMetadataLookupPtr(NULL, chip->analysis, "PSPHOT.PSF"); // PSF 44 if (!psf) { 45 // XXX if we were not supplied a PSF, we should be able to generate one by calling psphot 46 psError(PSPHOT_ERR_PROG, false, "Unable to find PSF."); 47 return false; 48 } 49 options->psfs->data[index] = psMemIncrRefCounter(psf); 20 pmPSF *psf = selectPSF (fileSrc, view, options, index); 21 if (!psf) { 22 psError(PSPHOT_ERR_PSF, false, "Problem with PSF."); 23 return false; 24 } 50 25 51 // find the image size 52 pmCell *cell = pmFPAviewThisCell(view, fileSrc->fpa); // Cell of interest 53 pmHDU *hdu = pmHDUFromCell(cell); 54 assert(hdu && hdu->header); 55 int naxis1 = psMetadataLookupS32(NULL, hdu->header, "NAXIS1"); // Number of columns 56 int naxis2 = psMetadataLookupS32(NULL, hdu->header, "NAXIS2"); // Number of rows 57 psAssert ((naxis1 > 0) && (naxis2 > 0), "Unable to determine size of image from PSF."); 58 if (!options->numCols) { 59 options->numCols = naxis1; 60 } else { 61 if (options->numCols != naxis1) { 62 psError (PSPHOT_ERR_CONFIG, true, "mismatched sizes (NAXIS1) for input images"); 63 return false; 64 } 65 } 66 if (!options->numRows) { 67 options->numRows = naxis2; 68 } else { 69 if (options->numRows != naxis2) { 70 psError (PSPHOT_ERR_CONFIG, true, "mismatched sizes (NAXIS2) for input images"); 71 return false; 72 } 73 } 74 } 26 determineSeeing (psf, options, index); 75 27 76 28 // load the sources (used to find reference sources for the kernel stamps) 77 29 { 78 pmFPAfile * outputImage = pmFPAfileDefineOutput(config, NULL, "PSPHOT.STACK.OUTPUT.IMAGE");79 pmReadout *readout = pmFPAviewThisReadout(view, outputImage->fpa); // Readout with sources30 pmFPAfile *inputSrc = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.SOURCES", index); // File of interest 31 pmReadout *readout = pmFPAviewThisReadout(view, inputSrc->fpa); // Readout with sources 80 32 pmDetections *detections = psMetadataLookupPtr(NULL, readout->analysis, "PSPHOT.DETECTIONS"); // Sources 81 33 if (!detections || !detections->allSources) { … … 88 40 } 89 41 42 return true; 43 } 44 45 // select the corresponding input psf 46 pmPSF *selectPSF (pmFPAfile *fileSrc, const pmFPAview *view, psphotStackOptions *options, int index) { 47 48 bool status; 49 50 pmChip *chip = pmFPAviewThisChip(view, fileSrc->fpa); // The chip holds the PSF 51 pmPSF *psf = psMetadataLookupPtr(&status, chip->analysis, "PSPHOT.PSF"); // PSF 52 if (!psf) { 53 // XXX if we were not supplied a PSF, we should be able to generate one by calling psphot 54 psError(PSPHOT_ERR_PROG, true, "Unable to find PSF."); 55 return NULL; 56 } 57 options->psfs->data[index] = psMemIncrRefCounter(psf); 58 59 // find the image size 60 pmCell *cell = pmFPAviewThisCell(view, fileSrc->fpa); // Cell of interest 61 pmHDU *hdu = pmHDUFromCell(cell); 62 assert(hdu && hdu->header); 63 int naxis1 = psMetadataLookupS32(NULL, hdu->header, "NAXIS1"); // Number of columns 64 int naxis2 = psMetadataLookupS32(NULL, hdu->header, "NAXIS2"); // Number of rows 65 psAssert ((naxis1 > 0) && (naxis2 > 0), "Unable to determine size of image from PSF."); 66 if (!options->numCols) { 67 options->numCols = naxis1; 68 } else { 69 if (options->numCols != naxis1) { 70 psError (PSPHOT_ERR_CONFIG, true, "mismatched sizes (NAXIS1) for input images"); 71 return NULL; 72 } 73 } 74 if (!options->numRows) { 75 options->numRows = naxis2; 76 } else { 77 if (options->numRows != naxis2) { 78 psError (PSPHOT_ERR_CONFIG, true, "mismatched sizes (NAXIS2) for input images"); 79 return NULL; 80 } 81 } 82 return psf; 83 } 84 90 85 // determine the input seeing 91 {92 // XXX set this based on the mode (+1 for poly, +0 for map) 93 float xNum = PS_MAX(psf->trendNx, 1); 94 float yNum = PS_MAX(psf->trendNy, 1); // Number of realisations 95 float sumFWHM = 0.0; // FWHM for image 96 int numFWHM = 0; // Number of FWHM measurements 97 for (float y = 0; y < yNum; y += 1.0) { 98 float yPos = options->numRows * ((y + 0.5) / yNum); 99 for (float x = 0; x < xNum; x++) {100 float xPos = options->numCols * ((x + 0.5) / xNum);101 float fwhm = pmPSFtoFWHM(psf, xPos, yPos); // FWHM for image102 if (isfinite(fwhm)) {103 sumFWHM += fwhm;104 numFWHM++;105 }86 bool determineSeeing (pmPSF *psf, psphotStackOptions *options, int index) { 87 88 // XXX set this based on the mode (+1 for poly, +0 for map) 89 float xNum = PS_MAX(psf->trendNx, 1); 90 float yNum = PS_MAX(psf->trendNy, 1); // Number of realisations 91 float sumFWHM = 0.0; // FWHM for image 92 int numFWHM = 0; // Number of FWHM measurements 93 for (float y = 0; y < yNum; y += 1.0) { 94 float yPos = options->numRows * ((y + 0.5) / yNum); 95 for (float x = 0; x < xNum; x++) { 96 float xPos = options->numCols * ((x + 0.5) / xNum); 97 float fwhm = pmPSFtoFWHM(psf, xPos, yPos); // FWHM for image 98 if (isfinite(fwhm)) { 99 sumFWHM += fwhm; 100 numFWHM++; 106 101 } 107 102 } 108 if (numFWHM == 0) {109 options->inputSeeing->data.F32[index] = NAN;110 options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[index] = 0x02;111 psLogMsg("ppStack", PS_LOG_INFO, "Unable to measure PSF FWHM for image %d --- rejected.", index);112 } else {113 options->inputSeeing->data.F32[index] = sumFWHM / (float)numFWHM;114 }115 psLogMsg ("psphotStack", PS_LOG_INFO, "Input Seeing for %d: %f\n", index, options->inputSeeing->data.F32[index]);116 103 } 117 104 if (numFWHM == 0) { 105 options->inputSeeing->data.F32[index] = NAN; 106 options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[index] = 0x02; 107 psLogMsg("ppStack", PS_LOG_INFO, "Unable to measure PSF FWHM for image %d --- rejected.", index); 108 } else { 109 options->inputSeeing->data.F32[index] = sumFWHM / (float)numFWHM; 110 } 111 psLogMsg ("psphotStack", PS_LOG_INFO, "Input Seeing for %d: %f\n", index, options->inputSeeing->data.F32[index]); 118 112 return true; 119 113 } 114 -
branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFsUtils.c
r27883 r27884 259 259 260 260 // perform the bulk of the PSF-matching 261 bool matchKernel(pmConfig *config, pmReadout *readout Cnv, pmReadout *readoutRaw, psphotStackOptions *options, int index) {261 bool matchKernel(pmConfig *config, pmReadout *readoutOut, pmReadout *readoutSrc, psphotStackOptions *options, int index) { 262 262 263 263 bool mdok; … … 338 338 stampSources = stackSourcesFilter(options->sourceLists->data[index], footprint); // Filtered list of sources 339 339 340 fake = makeFakeReadout(config, readout Raw, stampSources, options->psf, maskVal | maskBad, footprint + size);340 fake = makeFakeReadout(config, readoutSrc, stampSources, options->psf, maskVal | maskBad, footprint + size); 341 341 if (!fake) goto escape; 342 342 343 dumpImage(fake, readout Raw, index, "fake");344 dumpImage(readout Raw, readoutRaw, index, "real");343 dumpImage(fake, readoutSrc, index, "fake"); 344 dumpImage(readoutSrc, readoutSrc, index, "real"); 345 345 346 346 if (threads) pmSubtractionThreadsInit(); 347 347 348 348 // Do the image matching 349 pmSubtractionKernels *kernel = psMetadataLookupPtr(&mdok, readout Raw->analysis, PM_SUBTRACTION_ANALYSIS_KERNEL); // Conv kernel349 pmSubtractionKernels *kernel = psMetadataLookupPtr(&mdok, readoutSrc->analysis, PM_SUBTRACTION_ANALYSIS_KERNEL); // Conv kernel 350 350 if (kernel) { 351 if (!pmSubtractionMatchPrecalc(NULL, readout Cnv, fake, readoutRaw, readoutRaw->analysis, stride, kernelError, covarFrac, maskVal, maskBad, maskPoor, poorFrac, badFrac)) {351 if (!pmSubtractionMatchPrecalc(NULL, readoutOut, fake, readoutSrc, readoutSrc->analysis, stride, kernelError, covarFrac, maskVal, maskBad, maskPoor, poorFrac, badFrac)) { 352 352 psError(psErrorCodeLast(), false, "Unable to convolve images."); 353 353 goto escape; … … 361 361 } 362 362 363 if (!pmSubtractionMatch(NULL, readout Cnv, fake, readoutRaw, footprint, stride, regionSize, spacing, threshold, stampSources, stampsName, type, size, order, widthsCopy, orders, inner, ringsOrder, binning, penalty, optimum, optWidths, optOrder, optThresh, iter, rej, normFrac, sysError, skyErr, kernelError, covarFrac, maskVal, maskBad, maskPoor, poorFrac, badFrac, PM_SUBTRACTION_MODE_2)) {363 if (!pmSubtractionMatch(NULL, readoutOut, fake, readoutSrc, footprint, stride, regionSize, spacing, threshold, stampSources, stampsName, type, size, order, widthsCopy, orders, inner, ringsOrder, binning, penalty, optimum, optWidths, optOrder, optThresh, iter, rej, normFrac, sysError, skyErr, kernelError, covarFrac, maskVal, maskBad, maskPoor, poorFrac, badFrac, PM_SUBTRACTION_MODE_2)) { 364 364 psError(psErrorCodeLast(), false, "Unable to match images."); 365 365 goto escape; … … 369 369 // Reject image completely if the maximum deconvolution fraction exceeds the limit 370 370 float deconvLimit = psMetadataLookupF32(NULL, stackRecipe, "DECONV.LIMIT"); // Limit on deconvolution fraction 371 float deconv = psMetadataLookupF32(NULL, readout Cnv->analysis, PM_SUBTRACTION_ANALYSIS_DECONV_MAX); // Max deconvolution fraction371 float deconv = psMetadataLookupF32(NULL, readoutOut->analysis, PM_SUBTRACTION_ANALYSIS_DECONV_MAX); // Max deconvolution fraction 372 372 if (deconv > deconvLimit) { 373 373 psWarning("Maximum deconvolution fraction (%f) exceeds limit (%f) --- rejecting image %d\n", deconv, deconvLimit, index); … … 375 375 } 376 376 377 dumpImage(readout Cnv, readoutRaw, index, "conv");378 dumpImageDiff(readout Cnv, fake, readoutRaw, index, "diff");377 dumpImage(readoutOut, readoutSrc, index, "conv"); 378 dumpImageDiff(readoutOut, fake, readoutSrc, index, "diff"); 379 379 380 380 psFree(fake); … … 542 542 543 543 // generate a fake readout against which to PSF match 544 pmReadout *makeFakeReadout(pmConfig *config, pmReadout *readout Raw, psArray *sources, pmPSF *psf, psImageMaskType maskVal, int fullSize) {544 pmReadout *makeFakeReadout(pmConfig *config, pmReadout *readoutSrc, psArray *sources, pmPSF *psf, psImageMaskType maskVal, int fullSize) { 545 545 546 546 pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout with target PSF … … 548 548 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_STDEV); // Statistics for background 549 549 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator 550 if (!psImageBackground(bg, NULL, readout Raw->image, readoutRaw->mask, maskVal, rng)) {550 if (!psImageBackground(bg, NULL, readoutSrc->image, readoutSrc->mask, maskVal, rng)) { 551 551 psError(PSPHOT_ERR_DATA, false, "Can't measure background for image."); 552 552 psFree(fake); … … 560 560 561 561 bool oldThreads = pmReadoutFakeThreads(true); // Old threading state 562 if (!pmReadoutFakeFromSources(fake, readout Raw->image->numCols, readoutRaw->image->numRows, sources, SOURCE_MASK, NULL, NULL, psf, minFlux, fullSize, false, true)) {562 if (!pmReadoutFakeFromSources(fake, readoutSrc->image->numCols, readoutSrc->image->numRows, sources, SOURCE_MASK, NULL, NULL, psf, minFlux, fullSize, false, true)) { 563 563 psError(PSPHOT_ERR_DATA, false, "Unable to generate fake image with target PSF."); 564 564 psFree(fake); … … 567 567 pmReadoutFakeThreads(oldThreads); 568 568 569 fake->mask = psImageCopy(NULL, readout Raw->mask, PS_TYPE_IMAGE_MASK);569 fake->mask = psImageCopy(NULL, readoutSrc->mask, PS_TYPE_IMAGE_MASK); 570 570 571 571 // Add the background into the target image 572 psImage *bgImage = stackBackgroundModel(readout Raw, config); // Image of background572 psImage *bgImage = stackBackgroundModel(readoutSrc, config); // Image of background 573 573 psBinaryOp(fake->image, fake->image, "+", bgImage); 574 574 psFree(bgImage); -
branches/eam_branches/psphot.20100506/src/psphotStackOptions.c
r27883 r27884 29 29 options->convolve = false; 30 30 options->convolveSource = PSPHOT_CNV_SRC_NONE; 31 32 options->psfs = psArrayAlloc(num);33 34 options->inputSeeing = psVectorAlloc(num, PS_TYPE_F32);35 psVectorInit(options->inputSeeing, NAN);36 37 options->matchChi2 = psVectorAlloc(num, PS_TYPE_F32);38 psVectorInit(options->matchChi2, NAN);39 40 options->inputMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs41 psVectorInit(options->inputMask, 0);42 43 31 options->targetSeeing = NAN; 44 32 33 options->psfs = psArrayAlloc(num); 45 34 options->sourceLists = psArrayAlloc(num); // Individual lists of sources for matching 46 options-> norm = psVectorAlloc(num, PS_TYPE_F32);47 psVectorInit(options->norm, NAN);35 options->kernels = psArrayAlloc(num); 36 options->regions = psArrayAlloc(num); 48 37 49 options->kernels = NULL; 50 options->regions = NULL; 51 options->matchChi2 = NULL; 52 options->weightings = NULL; 38 options->inputMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs 39 options->inputSeeing = psVectorAlloc(num, PS_TYPE_F32); 40 options->norm = psVectorAlloc(num, PS_TYPE_F32); 41 options->matchChi2 = psVectorAlloc(num, PS_TYPE_F32); // chi^2 for stamps when matching 42 options->weightings = psVectorAlloc(num, PS_TYPE_F32); // Combination weightings for images (1/noise^2) 43 44 psVectorInit(options->inputMask, 0); 45 psVectorInit(options->inputSeeing, NAN); 46 psVectorInit(options->norm, NAN); 47 psVectorInit(options->matchChi2, NAN); 48 psVectorInit(options->weightings, NAN); 53 49 54 50 return options; … … 62 58 return PSPHOT_CNV_SRC_NONE; 63 59 } 60 61 pmFPAfile *psphotStackGetConvolveSource (pmConfig *config, psphotStackOptions *options, int index) { 62 63 // which image do we want to convolve? RAW, CNV, AUTO? 64 // find the currently selected readout 65 pmFPAfile *fileRaw = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.RAW", index); // File of interest 66 pmFPAfile *fileCnv = pmFPAfileSelectSingle(config->files, "PSPHOT.STACK.INPUT.CNV", index); // File of interest 67 68 pmFPAfile *fileSrc = NULL; 69 70 switch (options->convolveSource) { 71 case PSPHOT_CNV_SRC_AUTO: 72 fileSrc = fileCnv ? fileCnv : fileRaw; 73 break; 74 75 case PSPHOT_CNV_SRC_RAW: 76 fileSrc = fileRaw; 77 break; 78 79 case PSPHOT_CNV_SRC_CNV: 80 fileSrc = fileCnv; 81 break; 82 83 default: 84 psAbort("impossible case"); 85 } 86 if (!fileSrc) { 87 psError(PSPHOT_ERR_CONFIG, true, "desired convolution source is missing (cnv : %llx, raw : %llx)", (long long) fileCnv, (long long) fileRaw); 88 } 89 90 return fileSrc; 91 } -
branches/eam_branches/psphot.20100506/src/psphotStackParseCamera.c
r27883 r27884 29 29 30 30 // RAW (unconvolved) input data (RAW:IMAGE, RAW:MASK, RAW:VARIANCE, RAW:PSF) 31 psString rawImage = psMetadataLookupStr( NULL, input, "RAW:IMAGE"); // Name of image31 psString rawImage = psMetadataLookupStr(&status, input, "RAW:IMAGE"); // Name of image 32 32 if (rawImage && strlen(rawImage) > 0) { 33 pmFPAfile *rawInputFile = defineFile(config, NULL, "PSPHOT.STACK.INPUT.RAW", rawImage, PM_FPA_FILE_IMAGE); // File for image33 rawInputFile = defineFile(config, NULL, "PSPHOT.STACK.INPUT.RAW", rawImage, PM_FPA_FILE_IMAGE); // File for image 34 34 if (!rawInputFile) { 35 35 psError(PS_ERR_UNKNOWN, false, "Unable to define file from image %d (%s)", i, rawImage); … … 60 60 61 61 // CNV (convolved) input data (CNV:IMAGE, CNV:MASK, CNV:VARIANCE, CNV:PSF) 62 psString cnvImage = psMetadataLookupStr( NULL, input, "CNV:IMAGE"); // Name of image62 psString cnvImage = psMetadataLookupStr(&status, input, "CNV:IMAGE"); // Name of image 63 63 if (cnvImage && strlen(cnvImage) > 0) { 64 pmFPAfile *cnvInputFile = defineFile(config, NULL, "PSPHOT.STACK.INPUT.CNV", cnvImage, PM_FPA_FILE_IMAGE); // File for image64 cnvInputFile = defineFile(config, NULL, "PSPHOT.STACK.INPUT.CNV", cnvImage, PM_FPA_FILE_IMAGE); // File for image 65 65 if (!cnvInputFile) { 66 66 psError(PS_ERR_UNKNOWN, false, "Unable to define file from image %d (%s)", i, cnvImage); … … 96 96 97 97 psString sources = psMetadataLookupStr(&status, input, "SOURCES"); // Name of mask 98 pmFPAfile *srcInputFile = rawInputFile ? rawInputFile : cnvInputFile;98 // pmFPAfile *srcInputFile = rawInputFile ? rawInputFile : cnvInputFile; 99 99 if (sources && strlen(sources) > 0) { 100 if (!defineFile(config, srcInputFile, "PSPHOT.STACK.SOURCES.CNV", sources, PM_FPA_FILE_CMF)) {100 if (!defineFile(config, NULL, "PSPHOT.STACK.SOURCES", sources, PM_FPA_FILE_CMF)) { 101 101 psError(PS_ERR_UNKNOWN, false, "Unable to define file from sources %d (%s)", i, sources); 102 102 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
