IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 17, 2010, 9:15:54 AM (16 years ago)
Author:
eugene
Message:

call pmVisualClose; update to auto-scaling (set up fwhm separately for windowing)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100823/ppSub/src/ppSubMatchPSFs.c

    r29323 r29452  
    110110    pmReadout *kernelRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT.KERNELS"); // RO with kernel
    111111    if (kernelRO) {
     112        psAbort("we probably need to set the FWHM values");
    112113        psFree(view);
    113114        return true;
     
    117118    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSim
    118119    psAssert(recipe, "We checked this earlier, so it should be here.");
    119     if (!psMetadataLookupBool(NULL, recipe, "SCALE")) {
    120         // No scaling requested
    121         psFree(view);
    122         return true;
    123     }
    124120
    125121    // Input images
     
    131127    pmReadout *refSourceRO = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.SOURCES");
    132128    if (!inSourceRO || !refSourceRO) {
    133         psWarning("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;
    135131    }
    136132
     
    141137
    142138    if (!inDetections || !refDetections) {
    143         psWarning("Unable to scale 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;
    145141    }
    146142
     
    161157    psLogMsg("ppSub", PS_LOG_INFO, "Input FWHM: %f\nReference FWHM: %f\n", inFWHM, refFWHM);
    162158    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);
    164170        return true;
    165171    }
     
    175181    }
    176182
    177     if (!pmSubtractionParamsScale(kernelSize, stampSize, kernelWidths, inFWHM, refFWHM,
    178                                   scaleRef, scaleMin, scaleMax)) {
     183    if (!pmSubtractionParamsScale(kernelSize, stampSize, kernelWidths, scaleRef, scaleMin, scaleMax)) {
    179184        psError(PPSUB_ERR_DATA, false, "Unable to scale parameters.");
    180185        return false;
Note: See TracChangeset for help on using the changeset viewer.