IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27105


Ignore:
Timestamp:
Feb 26, 2010, 2:27:07 PM (16 years ago)
Author:
Paul Price
Message:

Make 1/noise2 weighting optional. This is an attempt to reduce the massive print-through with PR images of M42, where there is no background subtraction.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippconfig/recipes/ppStack.config

    r26902 r27105  
    2424VARIANCE        BOOL    TRUE            # Use variance in rejection?
    2525SAFE            BOOL    TRUE            # Play safe when combining small number of values?
     26WEIGHTS         BOOL    TRUE            # Use 1/noise^2 weighting?
    2627BIN1            S32     4               # Binning factor for first level
    2728BIN2            S32     4               # Binning factor for second level
     
    8485# Faster processing for PR images
    8586PR      METADATA
    86         IMAGE.REJ           F32   0.5   
     87        IMAGE.REJ           F32   0.5
     88        WEIGHTS             BOOL  FALSE
    8789        CONVOLVE            BOOL  FALSE
    8890        SKIP.BG.SUB         BOOL  FALSE
  • trunk/ppStack/src/ppStackMatch.c

    r27004 r27105  
    628628
    629629    // Measure the variance level for the weighting
    630     if (!psImageBackground(bg, NULL, readout->variance, readout->mask, maskVal | maskBad, rng)) {
    631         psError(PPSTACK_ERR_DATA, false, "Can't measure mean variance for image.");
    632         psFree(rng);
    633         psFree(bg);
    634         return false;
    635     }
    636     options->weightings->data.F32[index] = 1.0 / (psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN) *
    637                                                   psImageCovarianceFactor(readout->covariance));
     630    if (psMetadataLookupBool(NULL, recipe, "WEIGHTS")) {
     631        if (!psImageBackground(bg, NULL, readout->variance, readout->mask, maskVal | maskBad, rng)) {
     632            psError(PPSTACK_ERR_DATA, false, "Can't measure mean variance for image.");
     633            psFree(rng);
     634            psFree(bg);
     635            return false;
     636        }
     637        options->weightings->data.F32[index] = 1.0 / (psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN) *
     638                                                      psImageCovarianceFactor(readout->covariance));
     639    } else {
     640        options->weightings->data.F32[index] = 1.0;
     641    }
    638642    psLogMsg("ppStack", PS_LOG_INFO, "Weighting for image %d is %f\n",
    639643             index, options->weightings->data.F32[index]);
    640     psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "PPSTACK.WEIGHTING", 0,
    641                      "Weighting by 1/noise^2 for stack", options->weightings->data.F32[index]);
    642644
    643645    psFree(rng);
  • trunk/ppStack/src/ppStackReadout.c

    r26898 r27105  
    143143        }
    144144
    145 #if 0
    146         // This doesn't seem to work, so getting the weightings directly from a vector
    147         float weighting = psMetadataLookupF32(&mdok, ro->analysis, "PPSTACK.WEIGHTING"); // Relative weight
    148         if (!mdok || !isfinite(weighting)) {
    149             psWarning("No weighting supplied for image %d --- set to unity.", i);
    150             weighting = 1.0;
    151         } else {
    152             psLogMsg("ppStack", PS_LOG_INFO, "Weighting for image %d is %f", i, weighting);
    153         }
    154 #endif
    155 
    156145        // Ensure there is a mask, or pmStackCombine will complain
    157146        if (!ro->mask) {
     
    243232        }
    244233
    245 #if 0
    246         // This doesn't seem to work, so getting the weightings directly from a vector
    247         bool mdok;                      // Status of MD lookup
    248         float weighting = psMetadataLookupF32(&mdok, ro->analysis, "PPSTACK.WEIGHTING"); // Relative weight
    249         if (!mdok || !isfinite(weighting)) {
    250             psWarning("No WEIGHTING supplied for image %d --- set to unity.", i);
    251             weighting = 1.0;
    252         }
    253 #endif
    254 
    255234        // Ensure there is a mask, or pmStackCombine will complain
    256235        if (!ro->mask) {
Note: See TracChangeset for help on using the changeset viewer.