- Timestamp:
- Oct 17, 2010, 9:15:54 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20100823/ppSub/src/ppSubMatchPSFs.c
r29323 r29452 110 110 pmReadout *kernelRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNELS"); // RO with kernel 111 111 if (kernelRO) { 112 psAbort("we probably need to set the FWHM values"); 112 113 psFree(view); 113 114 return true; … … 117 118 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSim 118 119 psAssert(recipe, "We checked this earlier, so it should be here."); 119 if (!psMetadataLookupBool(NULL, recipe, "SCALE")) {120 // No scaling requested121 psFree(view);122 return true;123 }124 120 125 121 // Input images … … 131 127 pmReadout *refSourceRO = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.SOURCES"); 132 128 if (!inSourceRO || !refSourceRO) { 133 ps Warning("Unable to scale kernel, since no sources were provided.");134 return true;129 psError(PPSUB_ERR_DATA, false, "Unable to scale kernel, since no sources were provided."); 130 return false; 135 131 } 136 132 … … 141 137 142 138 if (!inDetections || !refDetections) { 143 ps Warning("Unable toscale kernel, since no sources were provided.");144 return true;139 psError(PPSUB_ERR_DATA, false, "Unable to set FWHM or scale kernel, since no sources were provided."); 140 return false; 145 141 } 146 142 … … 161 157 psLogMsg("ppSub", PS_LOG_INFO, "Input FWHM: %f\nReference FWHM: %f\n", inFWHM, refFWHM); 162 158 if (!isfinite(inFWHM) || !isfinite(refFWHM)) { 163 psWarning("Unable to scale kernel, since unable to measure PSFs."); 159 psError(PPSUB_ERR_DATA, false, "Cannot determine FHWM for images, giving up."); 160 return false; 161 } 162 163 // we need to register the FWHM values for use downstream 164 pmSubtractionSetFWHMs(inFWHM, refFWHM); 165 166 // is auto-scaling needed? 167 if (!psMetadataLookupBool(NULL, recipe, "SCALE")) { 168 // No scaling requested 169 psFree(view); 164 170 return true; 165 171 } … … 175 181 } 176 182 177 if (!pmSubtractionParamsScale(kernelSize, stampSize, kernelWidths, inFWHM, refFWHM, 178 scaleRef, scaleMin, scaleMax)) { 183 if (!pmSubtractionParamsScale(kernelSize, stampSize, kernelWidths, scaleRef, scaleMin, scaleMax)) { 179 184 psError(PPSUB_ERR_DATA, false, "Unable to scale parameters."); 180 185 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
