- Timestamp:
- Mar 5, 2012, 5:19:48 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (2 props)
-
psphot/src/psphotStackMatchPSFs.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/psphot
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/psphot/src
- Property svn:ignore
-
old new 22 22 psphotMakePSF 23 23 psphotStack 24 psphotModelTest
-
- Property svn:mergeinfo set to
- Property svn:ignore
-
branches/meh_branches/ppstack_test/psphot/src/psphotStackMatchPSFs.c
r31154 r33415 25 25 } 26 26 27 // loop over the available readouts (ignore chisq image)27 // loop over the available readouts 28 28 for (int i = 0; i < num; i++) { 29 // set up the PSF-matching parameters describing the input images 29 30 if (!psphotStackMatchPSFsPrepare (config, view, options, i)) { 30 31 psError (PSPHOT_ERR_CONFIG, false, "failed to set PSF matching options for entry %d", i); … … 33 34 } 34 35 35 // Generate target PSF36 // XXX convolve == false might not be valid at the moment 36 37 if (options->convolve) { 37 options->psf = psphotStackPSF(config, options->numCols, options->numRows, options->psfs, options->inputMask); 38 if (!options->psf) { 38 // Determine the 1st target PSF (either AUTO or defined by PSPHOT.STACK.TARGET.PSF.FWHM) 39 // NOTE: this also set the full list of target FWHMs (options->targetSeeing) 40 if (!psphotStackPSF(config, options)) { 39 41 psError(psErrorCodeLast(), false, "Unable to determine output PSF."); 40 42 return false; 41 43 } 42 psMetadataAddPtr(config->arguments, PS_LIST_TAIL, "PSF.TARGET", PS_DATA_UNKNOWN, "Target PSF for stack", options->psf);43 options->targetSeeing = pmPSFtoFWHM(options->psf, 0.5 * options->numCols, 0.5 * options->numRows); // FWHM for target44 psLogMsg("psphotStack", PS_LOG_INFO, "Target seeing FWHM: %f\n", options->targetSeeing);45 46 // XXX is this needed to supply the psf to psphot??47 // pmChip *outChip = pmFPAfileThisChip(config->files, view, "PPSTACK.TARGET.PSF"); // Output chip48 // psMetadataAddPtr(outChip->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN, "Target PSF", options->psf);49 // outChip->data_exists = true;50 44 } 51 45 … … 63 57 64 58 // convolve the image to match desired PSF 59 // XXX is this code consistent with 'convolve' = false? 65 60 bool psphotStackMatchPSFsReadout (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index) { 66 61 … … 106 101 // Image Matching (PSFs or just flux) 107 102 if (options->convolve) { 108 matchKernel(config, readoutOut, readoutSrc, options, index); 103 if (!matchKernel(config, readoutOut, readoutSrc, options, index)){ 104 psError(psErrorCodeLast(), false, "Unable to match image PSF in readout."); 105 return false; 106 } 109 107 saveMatchData(readoutOut, options, index); 110 108 } 111 rescaleData(readoutOut, config, options, index); 109 110 // renormalize the stack variances to have sigma = 1.0 111 if (!psphotStackRenormaliseVariance(config, readoutOut)) { 112 psError(psErrorCodeLast(), false, "Unable to renormalise variance."); 113 return false; 114 } 112 115 113 116 // save the output fwhm values in the readout->analysis. we may have / will have multiple output PSF sizes, 114 117 // so we save this in a vector. if the vector is not yet defined, create it 115 bool mdok = false; 116 psVector *fwhmValues = psMetadataLookupVector(&mdok, readoutOut->analysis, "STACK.PSF.FWHM.VALUES"); 117 if (!fwhmValues) { 118 fwhmValues = psVectorAllocEmpty(10, PS_TYPE_F32); 119 psMetadataAddVector(readoutOut->analysis, PS_LIST_TAIL, "STACK.PSF.FWHM.VALUES", PS_META_REPLACE, "PSF sizes", fwhmValues); 120 psFree(fwhmValues); // drops the extra copy 118 // NOTE: fwhmValues as defined here has 1 + nMatched PSF : 0 == unmatched 119 psVector *fwhmValues = psVectorAllocEmpty(10, PS_TYPE_F32); 120 psVectorAppend(fwhmValues, NAN); // XXX this corresponds to the unmatched image set 121 for (int i = 0; i < options->targetSeeing->n; i++) { 122 psVectorAppend(fwhmValues, options->targetSeeing->data.F32[i]); 121 123 } 122 psVectorAppend(fwhmValues, options->targetSeeing); 124 psMetadataAddVector(readoutSrc->analysis, PS_LIST_TAIL, "STACK.PSF.FWHM.VALUES", PS_META_REPLACE, "PSF sizes", fwhmValues); 125 psMetadataAddVector(readoutOut->analysis, PS_LIST_TAIL, "STACK.PSF.FWHM.VALUES", PS_META_REPLACE, "PSF sizes", fwhmValues); 126 psFree(fwhmValues); // drops the extra copy 123 127 124 128 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
