- Timestamp:
- Dec 21, 2010, 3:01:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/psphot/src/psphotStackMatchPSFsNext.c
r30101 r30141 26 26 } 27 27 28 float targetFWHM = fwhmValues->data.F32[lastSize + 1];29 float currentFWHM = fwhmValues->data.F32[lastSize];30 31 28 int num = psphotFileruleCount(config, filerule); 32 29 … … 36 33 // loop over the available readouts 37 34 for (int i = 0; i < num; i++) { 38 if (!psphotStackMatchPSFsNextReadout (config, view, filerule, i, recipe, currentFWHM, targetFWHM)) {39 psError (PSPHOT_ERR_CONFIG, false, "failed to smooth image %s (%d) to target PSF %f", filerule, i, targetFWHM);35 if (!psphotStackMatchPSFsNextReadout (config, view, filerule, i, recipe, fwhmValues, lastSize)) { 36 psError (PSPHOT_ERR_CONFIG, false, "failed to smooth image %s (%d) to target PSF %f", filerule, i, fwhmValues->data.F32[lastSize+1]); 40 37 psImageConvolveSetThreads(oldThreads); 41 38 return false; … … 47 44 } 48 45 49 bool psphotStackMatchPSFsNextReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe, float currentFWHM, float targetFWHM) {46 bool psphotStackMatchPSFsNextReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe, psVector *fwhmValues, int lastSize) { 50 47 51 48 bool status = false; … … 70 67 minGauss = 0.5; 71 68 } 69 70 float targetFWHM = fwhmValues->data.F32[lastSize + 1]; 71 float currentFWHM = fwhmValues->data.F32[lastSize]; 72 72 73 73 if (targetFWHM <= currentFWHM) { … … 131 131 // so we save this in a vector. if the vector is not yet defined, create it 132 132 133 psVector *fwhmValues = psMetadataLookupVector(&status, readout->analysis, "STACK.PSF.FWHM.VALUES"); 134 psAssert(fwhmValues, "should already exist.."); 135 psVectorAppend(fwhmValues, targetFWHM); 133 psVector *fwhmValuesOut = psMetadataLookupVector(&status, readout->analysis, "STACK.PSF.FWHM.VALUES"); 134 psAssert(fwhmValuesOut, "should already exist.."); 135 psVectorAppend(fwhmValuesOut, targetFWHM); 136 137 // do not generate a PSF if we already were supplied one 138 pmPSF *psfOld = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF"); 139 if (psfOld) { 140 // save PSF on readout->analysis 141 char psfEntry[64]; 142 snprintf (psfEntry, 64, "PSPHOT.PSF.V%d", lastSize); 143 if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, psfEntry, PS_META_REPLACE | PS_DATA_UNKNOWN, "psphot psf model", psfOld)) { 144 psError (PSPHOT_ERR_UNKNOWN, false, "problem saving sources on readout"); 145 return false; 146 } 147 psMetadataRemoveKey(readout->analysis, "PSPHOT.PSF"); 148 } 136 149 137 150 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
