IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 21, 2011, 11:32:03 AM (15 years ago)
Author:
eugene
Message:

adjust scale if radial moment and fwhm disagree too much

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/psModules/src/imcombine/pmSubtractionMatch.c

    r30332 r30334  
    690690            }
    691691
     692            // check on the kernel scaling -- if the kron-based radial moments are very different, adjust to match them
     693            {
     694                float fwhm1;
     695                float fwhm2;
     696                pmSubtractionGetFWHMs(&fwhm1, &fwhm2);
     697                psAssert(isfinite(fwhm1), "fwhm 1 not set");
     698                psAssert(isfinite(fwhm2), "fwhm 2 not set");
     699
     700                // XXX this is BAD: depends on the relationship below:
     701                // stamps->normWindow1 = 2.75*R1;
     702                // stamps->normWindow2 = 2.75*R2;
     703                float radMoment1 = stamps->normWindow1 / 2.75;
     704                float radMoment2 = stamps->normWindow2 / 2.75;
     705
     706                float maxFWHM = PS_MAX(fwhm1, fwhm2);
     707                float maxRadial = PS_MAX(radMoment1, radMoment2);
     708           
     709                if (fabs(2.0*(maxFWHM - maxRadial)/(maxFWHM + maxRadial)) > 0.25) {
     710
     711                    float scale = maxRadial / maxFWHM;
     712                    psLogMsg ("psModules.imcombine", PS_LOG_INFO, "Kron and FWHM scales are quite different, re-scale by %f to use Kron", scale);
     713                   
     714                    for (int i = 0; i < isisWidths->n; i++) {
     715                        isisWidths->data.F32[i] *= scale;
     716                    }
     717                }
     718            }
     719
    692720            // Define kernel basis functions
    693721            if (optimum && (type == PM_SUBTRACTION_KERNEL_ISIS || type == PM_SUBTRACTION_KERNEL_GUNK)) {
Note: See TracChangeset for help on using the changeset viewer.