IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4138


Ignore:
Timestamp:
Jun 7, 2005, 1:11:54 PM (21 years ago)
Author:
gusciora
Message:

I added comments to not the following dtats members are never being used, or
set:

stats->robustN50
stats->clippedNvalues
stats->binsize

Location:
trunk/psLib/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psStats.c

    r4101 r4138  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.130 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-06-03 22:30:20 $
     11 *  XXX: The following stats members are never used, or set in this code.
     12 *      stats->robustN50
     13 *      stats->clippedNvalues
     14 *      stats->binsize
     15 *
     16 *  @version $Revision: 1.131 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2005-06-07 23:11:54 $
    1318 *
    1419 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    16291634            (stats->options & PS_STAT_ROBUST_STDEV)) {
    16301635        // We fit a 1-D polynomial to the data.
     1636        // XXX: I implement the changes requested in bug 366.  However, this
     1637        // code no longer produces sensible results.
    16311638        // XXX: Since we are no longer fitting a 1-D Gaussian, we can probably
    16321639        // remove some of theabove code that calculated the initial estimate
     
    16341641
    16351642        psVector *y = psVectorAlloc(2 * dL + 1, PS_TYPE_F32);
     1643        psVector *x = psVectorAlloc(2 * dL + 1, PS_TYPE_F32);
    16361644        for (i = modeBinNum - dL; i <= modeBinNum + dL; i++) {
    16371645            int index = i - modeBinNum + dL;
     
    16391647            y->data.F32[index] = robustHistogramVector->data.F32[i];
    16401648            //            y->data.F32[index] = logf(robustHistogramVector->data.F32[i]);
     1649            x->data.F32[index] = (psF32) index;
    16411650        }
    16421651
     
    16591668            stats->robustStdev = polyFitSigma;
    16601669        }
     1670        // For testing only.  This shows that the polynomial fit is successful.
     1671        if (0) {
     1672            printf("--- Results of the 1-D polynomial fit:\n");
     1673            for (i = modeBinNum - dL; i <= modeBinNum + dL; i++) {
     1674                int index = i - modeBinNum + dL;
     1675                printf("(x, y, poly(x)) is (%.2f, %.2f, %.2f)\n",
     1676                       x->data.F32[index],
     1677                       y->data.F32[index],
     1678                       psPolynomial1DEval(tmpPoly, x->data.F32[index]));
     1679            }
     1680        }
     1681
     1682        psFree(x);
    16611683        psFree(y);
    16621684        psFree(tmpPoly);
     
    17501772    newStruct->robustUQ = NAN;
    17511773    newStruct->robustLQ = NAN;
    1752     newStruct->robustN50 = 0;
    1753     newStruct->robustNfit = 0;
     1774    newStruct->robustN50 = -1;            // XXX: This is never used
     1775    newStruct->robustNfit = -1;
    17541776    newStruct->clippedMean = NAN;
    17551777    newStruct->clippedStdev = NAN;
     1778    newStruct->clippedNvalues = -1;     // XXX: This is never used
    17561779    newStruct->clipSigma = 3.0;
    1757     newStruct->clipIter = 3.0;
     1780    newStruct->clipIter = 3;
    17581781    newStruct->min = NAN;
    17591782    newStruct->max = NAN;
    1760     newStruct->binsize = NAN;
     1783    newStruct->binsize = NAN;          // XXX: This is never used
    17611784    newStruct->options = options;
    17621785
  • trunk/psLib/src/dataManip/psStats.h

    r3547 r4138  
    1 
    21/** @file  psStats.h
    32 *  \brief basic statistical operations
    43 *  @ingroup Stats
    54 *
    6 xd *  This file will hold the definition of the histogram and stats data
     5 *  This file will hold the definition of the histogram and stats data
    76 *  structures.  It also contains prototypes for procedures which operate
    87 *  on those data structures.
    98 *
    10  *  @author George Gusciora, MHPCC
     9 *  XXX: The following stats members are never used, or set in this code.
     10 *      stats->robustN50
     11 *      stats->clippedNvalues
     12 *      stats->binsize
    1113 *
    12  *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-03-29 22:34:59 $
     14 *  @author GLG, MHPCC
     15 *
     16 *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2005-06-07 23:11:54 $
    1418 *
    1519 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6771    psF64 robustUQ;            ///< robust upper quartile
    6872    psF64 robustLQ;            ///< robust lower quartile
    69     psS32 robustN50;              ///<
    70     psS32 robustNfit;             ///<
     73    psS32 robustN50;           ///< Number of points in Gaussian fit.  XXX: This is currently never set.
     74    psS32 robustNfit;          ///< The number of points between the quartiles.
    7175    psF64 clippedMean;         ///< Nsigma clipped mean
    7276    psF64 clippedStdev;        ///< standard deviation after clipping
    73     psS32 clippedNvalues;         ///< ???
     77    psS32 clippedNvalues;      ///< Number of data points used for clipped mean:  This value is never used.
    7478    psF64 clipSigma;           ///< Nsigma used for clipping; user input
    75     psS32 clipIter;               ///< Number of clipping iterations; user input
     79    psS32 clipIter;            ///< Number of clipping iterations; user input
    7680    psF64 min;                 ///< minimum data value in array
    7781    psF64 max;                 ///< maximum data value in array
    78     psF64 binsize;             ///<
    79     psStatsOptions options;     ///< bitmask of calculated values
     82    psF64 binsize;             ///< binsize for robust fit (input/ouput)
     83    psStatsOptions options;    ///< bitmask of calculated values
    8084}
    8185psStats;
     
    8690 */
    8791psStats* psVectorStats(
    88     psStats* stats,    ///< stats structure defines stats to be calculated and how
     92    psStats* stats,          ///< stats structure defines stats to be calculated and how
    8993    const psVector* in,      ///< Vector to be analysed.
    9094    const psVector* errors,  ///< Errors.
    9195    const psVector* mask,    ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
    92     psU32 maskVal      ///< Only mask elements with one of these bits set in maskVector
     96    psU32 maskVal            ///< Only mask elements with one of these bits set in maskVector
    9397);
    9498
     
    119123    psVector* bounds;                  ///< Bounds for the bins (type F32)
    120124    psVector* nums;                    ///< Number in each of the bins (INT)
    121     psS32 minNum;                        ///< Number below the minimum
    122     psS32 maxNum;                        ///< Number above the maximum
    123     psBool uniform;                      ///< Is it a uniform distribution?
     125    psS32 minNum;                      ///< Number below the minimum
     126    psS32 maxNum;                      ///< Number above the maximum
     127    psBool uniform;                    ///< Is it a uniform distribution?
    124128}
    125129psHistogram;
     
    134138    psF32 lower,                       ///< Lower limit for the bins
    135139    psF32 upper,                       ///< Upper limit for the bins
    136     psS32 n                              ///< Number of bins
     140    psS32 n                            ///< Number of bins
    137141);
    138142
     
    165169 *
    166170 *  @return psBool    If more than one statistic result is set in stats->options,
    167  *                  false is returned and the value parameter is not set,
    168  *                  otherwise true is returned.
     171 *                    false is returned and the value parameter is not set,
     172 *                    otherwise true is returned.
    169173 */
    170174psBool p_psGetStatValue(
    171     const psStats* stats,
    172     ///< the statistic struct to operate on
     175    const psStats* stats, ///< the statistic struct to operate on
    173176
    174     psF64 *value
    175     ///< if return is true, this is set to the specified statistic value by stats->options
     177    psF64 *value ///< if return is true, this is set to the specified statistic value by stats->options
    176178);
    177179
     180// XXX: Create a single, generic, version of the vector normalize function.
     181// XXX: Ask IfA for a public psLib function.
    178182void p_psNormalizeVectorRangeU8(psVector* myData, psU8 low, psU8 high);
    179183void p_psNormalizeVectorRangeU16(psVector* myData, psU16 low, psU16 high);
  • trunk/psLib/src/math/psStats.c

    r4101 r4138  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.130 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-06-03 22:30:20 $
     11 *  XXX: The following stats members are never used, or set in this code.
     12 *      stats->robustN50
     13 *      stats->clippedNvalues
     14 *      stats->binsize
     15 *
     16 *  @version $Revision: 1.131 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2005-06-07 23:11:54 $
    1318 *
    1419 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    16291634            (stats->options & PS_STAT_ROBUST_STDEV)) {
    16301635        // We fit a 1-D polynomial to the data.
     1636        // XXX: I implement the changes requested in bug 366.  However, this
     1637        // code no longer produces sensible results.
    16311638        // XXX: Since we are no longer fitting a 1-D Gaussian, we can probably
    16321639        // remove some of theabove code that calculated the initial estimate
     
    16341641
    16351642        psVector *y = psVectorAlloc(2 * dL + 1, PS_TYPE_F32);
     1643        psVector *x = psVectorAlloc(2 * dL + 1, PS_TYPE_F32);
    16361644        for (i = modeBinNum - dL; i <= modeBinNum + dL; i++) {
    16371645            int index = i - modeBinNum + dL;
     
    16391647            y->data.F32[index] = robustHistogramVector->data.F32[i];
    16401648            //            y->data.F32[index] = logf(robustHistogramVector->data.F32[i]);
     1649            x->data.F32[index] = (psF32) index;
    16411650        }
    16421651
     
    16591668            stats->robustStdev = polyFitSigma;
    16601669        }
     1670        // For testing only.  This shows that the polynomial fit is successful.
     1671        if (0) {
     1672            printf("--- Results of the 1-D polynomial fit:\n");
     1673            for (i = modeBinNum - dL; i <= modeBinNum + dL; i++) {
     1674                int index = i - modeBinNum + dL;
     1675                printf("(x, y, poly(x)) is (%.2f, %.2f, %.2f)\n",
     1676                       x->data.F32[index],
     1677                       y->data.F32[index],
     1678                       psPolynomial1DEval(tmpPoly, x->data.F32[index]));
     1679            }
     1680        }
     1681
     1682        psFree(x);
    16611683        psFree(y);
    16621684        psFree(tmpPoly);
     
    17501772    newStruct->robustUQ = NAN;
    17511773    newStruct->robustLQ = NAN;
    1752     newStruct->robustN50 = 0;
    1753     newStruct->robustNfit = 0;
     1774    newStruct->robustN50 = -1;            // XXX: This is never used
     1775    newStruct->robustNfit = -1;
    17541776    newStruct->clippedMean = NAN;
    17551777    newStruct->clippedStdev = NAN;
     1778    newStruct->clippedNvalues = -1;     // XXX: This is never used
    17561779    newStruct->clipSigma = 3.0;
    1757     newStruct->clipIter = 3.0;
     1780    newStruct->clipIter = 3;
    17581781    newStruct->min = NAN;
    17591782    newStruct->max = NAN;
    1760     newStruct->binsize = NAN;
     1783    newStruct->binsize = NAN;          // XXX: This is never used
    17611784    newStruct->options = options;
    17621785
  • trunk/psLib/src/math/psStats.h

    r3547 r4138  
    1 
    21/** @file  psStats.h
    32 *  \brief basic statistical operations
    43 *  @ingroup Stats
    54 *
    6 xd *  This file will hold the definition of the histogram and stats data
     5 *  This file will hold the definition of the histogram and stats data
    76 *  structures.  It also contains prototypes for procedures which operate
    87 *  on those data structures.
    98 *
    10  *  @author George Gusciora, MHPCC
     9 *  XXX: The following stats members are never used, or set in this code.
     10 *      stats->robustN50
     11 *      stats->clippedNvalues
     12 *      stats->binsize
    1113 *
    12  *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-03-29 22:34:59 $
     14 *  @author GLG, MHPCC
     15 *
     16 *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2005-06-07 23:11:54 $
    1418 *
    1519 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6771    psF64 robustUQ;            ///< robust upper quartile
    6872    psF64 robustLQ;            ///< robust lower quartile
    69     psS32 robustN50;              ///<
    70     psS32 robustNfit;             ///<
     73    psS32 robustN50;           ///< Number of points in Gaussian fit.  XXX: This is currently never set.
     74    psS32 robustNfit;          ///< The number of points between the quartiles.
    7175    psF64 clippedMean;         ///< Nsigma clipped mean
    7276    psF64 clippedStdev;        ///< standard deviation after clipping
    73     psS32 clippedNvalues;         ///< ???
     77    psS32 clippedNvalues;      ///< Number of data points used for clipped mean:  This value is never used.
    7478    psF64 clipSigma;           ///< Nsigma used for clipping; user input
    75     psS32 clipIter;               ///< Number of clipping iterations; user input
     79    psS32 clipIter;            ///< Number of clipping iterations; user input
    7680    psF64 min;                 ///< minimum data value in array
    7781    psF64 max;                 ///< maximum data value in array
    78     psF64 binsize;             ///<
    79     psStatsOptions options;     ///< bitmask of calculated values
     82    psF64 binsize;             ///< binsize for robust fit (input/ouput)
     83    psStatsOptions options;    ///< bitmask of calculated values
    8084}
    8185psStats;
     
    8690 */
    8791psStats* psVectorStats(
    88     psStats* stats,    ///< stats structure defines stats to be calculated and how
     92    psStats* stats,          ///< stats structure defines stats to be calculated and how
    8993    const psVector* in,      ///< Vector to be analysed.
    9094    const psVector* errors,  ///< Errors.
    9195    const psVector* mask,    ///< Ignore elements where (maskVector & maskVal) != 0: must be INT or NULL
    92     psU32 maskVal      ///< Only mask elements with one of these bits set in maskVector
     96    psU32 maskVal            ///< Only mask elements with one of these bits set in maskVector
    9397);
    9498
     
    119123    psVector* bounds;                  ///< Bounds for the bins (type F32)
    120124    psVector* nums;                    ///< Number in each of the bins (INT)
    121     psS32 minNum;                        ///< Number below the minimum
    122     psS32 maxNum;                        ///< Number above the maximum
    123     psBool uniform;                      ///< Is it a uniform distribution?
     125    psS32 minNum;                      ///< Number below the minimum
     126    psS32 maxNum;                      ///< Number above the maximum
     127    psBool uniform;                    ///< Is it a uniform distribution?
    124128}
    125129psHistogram;
     
    134138    psF32 lower,                       ///< Lower limit for the bins
    135139    psF32 upper,                       ///< Upper limit for the bins
    136     psS32 n                              ///< Number of bins
     140    psS32 n                            ///< Number of bins
    137141);
    138142
     
    165169 *
    166170 *  @return psBool    If more than one statistic result is set in stats->options,
    167  *                  false is returned and the value parameter is not set,
    168  *                  otherwise true is returned.
     171 *                    false is returned and the value parameter is not set,
     172 *                    otherwise true is returned.
    169173 */
    170174psBool p_psGetStatValue(
    171     const psStats* stats,
    172     ///< the statistic struct to operate on
     175    const psStats* stats, ///< the statistic struct to operate on
    173176
    174     psF64 *value
    175     ///< if return is true, this is set to the specified statistic value by stats->options
     177    psF64 *value ///< if return is true, this is set to the specified statistic value by stats->options
    176178);
    177179
     180// XXX: Create a single, generic, version of the vector normalize function.
     181// XXX: Ask IfA for a public psLib function.
    178182void p_psNormalizeVectorRangeU8(psVector* myData, psU8 low, psU8 high);
    179183void p_psNormalizeVectorRangeU16(psVector* myData, psU16 low, psU16 high);
Note: See TracChangeset for help on using the changeset viewer.