- Timestamp:
- Feb 14, 2011, 1:05:28 PM (15 years ago)
- Location:
- branches/czw_branch/20101203
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20101203
- Property svn:mergeinfo changed
-
branches/czw_branch/20101203/psphot
- Property svn:mergeinfo changed
-
branches/czw_branch/20101203/psphot/src/psphotStackMatchPSFs.c
r30118 r30631 65 65 bool psphotStackMatchPSFsReadout (pmConfig *config, const pmFPAview *view, psphotStackOptions *options, int index) { 66 66 67 psImageMaskType maskValue; 68 psImageMaskType markValue; 69 70 // get the PSPHOT.MASK value from the config 71 if (!pmConfigMaskSetBits (&maskValue, &markValue, config)) { 72 psError (PS_ERR_UNKNOWN, true, "Unable to define the mask bit values"); 73 return false; 74 } 75 67 76 pmFPAfile *fileSrc = psphotStackGetConvolveSource(config, options, index); 68 77 if (!fileSrc) { … … 84 93 85 94 // set NAN pixels to 'SAT' 86 // XXX replace this is pmReadoutMaskInvalid? 87 psImageMaskType maskVal = pmConfigMaskGet("SAT", config); 88 if (!pmReadoutMaskNonfinite(readoutSrc, maskVal)) { 95 psImageMaskType maskSat = pmConfigMaskGet("SAT", config); 96 if (!pmReadoutMaskInvalid(readoutSrc, maskValue, maskSat)) { 89 97 psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels in readout."); 90 98 return false; … … 95 103 matchKernel(config, readoutOut, readoutSrc, options, index); 96 104 saveMatchData(readoutOut, options, index); 97 // renormKernel(readoutCnv, options, index);98 } else {99 // only match the flux (NO! not for multi-filter, at least!)100 // XXX do not generate readoutCnv in this case?101 // float norm = powf(10.0, -0.4 * options->norm->data.F32[index]); // Normalisation102 // psBinaryOp(readoutRaw->image, readoutRaw->image, "*", psScalarAlloc(norm, PS_TYPE_F32));103 // psBinaryOp(readoutRaw->variance, readoutRaw->variance, "*", psScalarAlloc(PS_SQR(norm), PS_TYPE_F32));104 105 } 105 106 106 rescaleData(readoutOut, config, options, index); 107 107 108 // dumpImage(readoutOut, readoutSrc, index, "convolved"); 108 // save the output fwhm values in the readout->analysis. we may have / will have multiple output PSF sizes, 109 // so we save this in a vector. if the vector is not yet defined, create it 110 bool mdok = false; 111 psVector *fwhmValues = psMetadataLookupVector(&mdok, readoutOut->analysis, "STACK.PSF.FWHM.VALUES"); 112 if (!fwhmValues) { 113 fwhmValues = psVectorAllocEmpty(10, PS_TYPE_F32); 114 psMetadataAddVector(readoutOut->analysis, PS_LIST_TAIL, "STACK.PSF.FWHM.VALUES", PS_META_REPLACE, "PSF sizes", fwhmValues); 115 psFree(fwhmValues); // drops the extra copy 116 } 117 psVectorAppend(fwhmValues, options->targetSeeing); 109 118 110 119 return true; 111 120 } 112 113 114 # if (0)115 // Read previously produced kernel116 if (psMetadataLookupBool(NULL, config->arguments, "PPSTACK.DEBUG.STACK")) {117 loadKernel(config, readoutCnv, options, index);118 } else {119 matchKernel(config, readoutCnv, readoutRaw, options, index);120 }121 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
