IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 17, 2006, 10:13:04 AM (20 years ago)
Author:
Paul Price
Message:

Documenting pmReadoutCombine.[ch]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmReadoutCombine.c

    r9541 r9611  
    1 /** @file  pmReadoutCombine.c
    2  *
    3  *  This file will contain a module which will combine multiple readout images.
    4  *
    5  *  @author GLG, MHPCC
    6  *
    7  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2006-10-13 22:11:02 $
    9  *
    10  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    11  *
    12  */
    13 
    141#ifdef HAVE_CONFIG_H
    152#include <config.h>
     
    2714#include "pmReadoutCombine.h"
    2815
    29 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
    30 // File-static (private) functions
    31 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
    32 
    33 // Return the statistic of interest
    34 static inline double getStat(const psStats *stats, // Statistics structure
    35                              psStatsOptions option // Statistics option
    36                             )
    37 {
    38     assert(stats);
    39 
    40     switch (option) {
    41     case PS_STAT_SAMPLE_MEAN:
    42         return stats->sampleMean;
    43     case PS_STAT_SAMPLE_MEDIAN:
    44         return stats->sampleMedian;
    45     case PS_STAT_SAMPLE_STDEV:
    46         return stats->sampleStdev;
    47     case PS_STAT_ROBUST_MEDIAN:
    48         return stats->robustMedian;
    49     case PS_STAT_ROBUST_STDEV:
    50         return stats->robustStdev;
    51     case PS_STAT_FITTED_MEAN:
    52         return stats->fittedMean;
    53     case PS_STAT_FITTED_STDEV:
    54         return stats->fittedStdev;
    55     case PS_STAT_CLIPPED_MEAN:
    56         return stats->clippedMean;
    57     case PS_STAT_CLIPPED_STDEV:
    58         return stats->clippedStdev;
    59     case PS_STAT_MAX:
    60         return stats->max;
    61     case PS_STAT_MIN:
    62         return stats->min;
    63     default:
    64         psAbort(__func__, "Bad option: %x\n", option);
    65     }
    66     return NAN;
    67 }
     16//#define SHOW_BUSY 1                   // Show that the function is busy
    6817
    6918//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    8231    params->fracHigh = 0.0;
    8332    params->iter = 1;
    84     params->rej = 3.0;
     33    params->rej = INFINITY;
    8534
    8635    return params;
     
    8837
    8938
    90 /******************************************************************************
    91 XXX: Maybe add support for S16 and S32 types.  Currently, only F32 supported.
    92  *****************************************************************************/
    93 bool pmReadoutCombine(pmReadout *output,
    94                       psArray *inputs,
    95                       const psVector *zero,
    96                       const psVector *scale,
    97                       pmCombineParams *params
    98                      )
     39// XXX: Maybe add support for S16 and S32 types.  Currently, only F32 supported.
     40bool pmReadoutCombine(pmReadout *output, const psArray *inputs, const psVector *zero, const psVector *scale,
     41                      const pmCombineParams *params)
    9942{
    10043    // Check inputs
    10144    PS_ASSERT_PTR_NON_NULL(output, false);
    102     PS_ASSERT_PTR_NON_NULL(inputs, false);
     45    PS_ASSERT_ARRAY_NON_NULL(inputs, false);
    10346    PS_ASSERT_PTR_NON_NULL(params, false);
    10447    if (zero) {
     
    307250    for (int i = minInputRows; i < maxInputRows; i++) {
    308251        int yOut = i - output->row0; // y position on output readout
    309         #if 0
     252        #ifdef SHOW_BUSY
    310253
    311254        if (psTraceGetLevel("psModules.imcombine") > 9) {
     
    325268                psImage *image = readout->image; // The readout image
    326269
    327                 #if 0
    328                 // This should have been taken care of already:
     270                #if 0 // This should have been taken care of already:
    329271                // Check bounds
    330272                if (xIn < 0 || xIn >= image->numCols || yIn < 0 || yIn >= image->numRows) {
     
    382324            // Combination
    383325            psVectorStats(stats, pixels, weights, mask, 1);
    384             outputImage[yOut][xOut] = getStat(stats, params->combine);
     326            outputImage[yOut][xOut] = psStatsGetValue(stats, params->combine);
    385327            if (haveWeights) {
    386                 float stdev = getStat(stats, combineStdev);
     328                float stdev = psStatsGetValue(stats, combineStdev);
    387329                outputWeight[yOut][xOut] = PS_SQR(stdev); // Variance
    388330            }
    389331        }
    390332    }
    391     #if 0
     333    #ifdef SHOW_BUSY
    392334    if (psTraceGetLevel("psModules.imcombine") > 9) {
    393335        printf("\n");
Note: See TracChangeset for help on using the changeset viewer.