IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 24, 2007, 11:48:31 AM (19 years ago)
Author:
Paul Price
Message:

Use seeing information provided to perform additional rejection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackReadout.c

    r13493 r13512  
    1212
    1313
    14 #define SEEING 1.0                      // Seeing FWHM (pixels)
    1514#define WEIGHT 1.0                      // Weighting
    1615
     
    1817{
    1918    // Get the recipe values
     19    bool mdok;                          // Status of MD lookup
    2020    int iter = psMetadataLookupS32(NULL, config->arguments, "ITER"); // Rejection iterations
    2121    float combineRej = psMetadataLookupF32(NULL, config->arguments, "COMBINE.REJ"); // Combination threshold
     
    2424    psMaskType maskBad = psMetadataLookupU8(NULL, config->arguments, "MASK.BAD"); // Value to mask
    2525    psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg.
     26    psVector *seeing = psMetadataLookupPtr(&mdok, config->arguments, "SEEING"); // Seeing in each image
    2627
    2728    // Get the output target
     
    3940    psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); // Statistics
    4041    psRandom *rng = psRandomAlloc(0, PS_RANDOM_TAUS); // Random number generator
     42    int fileNum = 0;                    // Number of file
    4143    while ((item = psMetadataGetAndIncrement(inputIter))) {
    4244        assert(item->type == PS_DATA_UNKNOWN);
     
    6971        }
    7072        (void)psBinaryOp(ro->image, ro->image, "/", psScalarAlloc(exposure, PS_TYPE_F32));
    71         pmStackData *data = pmStackDataAlloc(ro, SEEING, WEIGHT); // Data to stack
     73        pmStackData *data = pmStackDataAlloc(ro, seeing ? seeing->data.F32[fileNum] : 0.0,
     74                                             WEIGHT); // Data to stack
    7275        psArrayAdd(stack, ARRAY_BUFFER, data);
    7376        psFree(data);                   // Drop reference
     77        fileNum++;
    7478    }
    7579    psFree(inputIter);
     
    107111#endif
    108112
    109     if (!pmStackReject(stack, maskBad, extent, convolveRej)) {
     113    // Only perform the additional rejection if we have seeing information
     114    if (seeing && !pmStackReject(stack, maskBad, extent, convolveRej)) {
    110115        psError(PS_ERR_UNKNOWN, false, "Unable to reject input pixels.");
    111116        psFree(stack);
Note: See TracChangeset for help on using the changeset viewer.