IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 22, 2010, 10:58:17 AM (16 years ago)
Author:
Paul Price
Message:

Move scaling into psModules so ppStack can use it too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/ppSub/src/ppSubMatchPSFs.c

    r26649 r26667  
    131131    }
    132132
    133 
    134133    float inFWHM = subImagePSF(data, inRO, inSources); // FWHM for input
    135134    float refFWHM = subImagePSF(data, refRO, refSources); // FWHM for reference
     
    139138        return true;
    140139    }
    141 
    142 //    float diff = sqrtf(PS_SQR(PS_MAX(inFWHM, refFWHM)) - PS_SQR(PS_MIN(inFWHM, refFWHM))); // Difference
    143     float diff = PS_MAX(inFWHM, refFWHM);
    144140
    145141    float scaleRef = psMetadataLookupF32(NULL, recipe, "SCALE.REF"); // Reference for scaling
     
    153149    }
    154150
    155     float scale = diff / scaleRef;      // Scaling factor
    156     if (scale < scaleMin) {
    157         scale = scaleMin;
    158     }
    159     if (scale > scaleMax) {
    160         scale = scaleMax;
    161     }
    162 
    163     for (int i = 0; i < kernelWidths->n; i++) {
    164         kernelWidths->data.F32[i] *= scale;
    165     }
    166     *kernelSize = *kernelSize * scale + 0.5;
    167     *stampSize = *stampSize * scale + 0.5;
    168 
    169     psLogMsg("ppSub", PS_LOG_INFO, "Scaled kernel parameters by %f: %d %d", scale, *kernelSize, *stampSize);
     151    if (!pmSubtractionParamsScale(kernelSize, stampSize, kernelWidths, inFWHM, refFWHM,
     152                                  scaleRef, scaleMin, scaleMax)) {
     153        psError(PS_ERR_UNKNOWN, false, "Unable to scale parameters.");
     154        return false;
     155    }
    170156
    171157    return true;
Note: See TracChangeset for help on using the changeset viewer.