IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21126


Ignore:
Timestamp:
Jan 17, 2009, 10:30:35 AM (17 years ago)
Author:
eugene
Message:

rename maskU8 to maskVector, allocate as vector mask

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081230/psLib/src/math/psStats.c

    r21074 r21126  
    1313 * use ->min and ->max (PS_STAT_USE_RANGE)
    1414 *
    15  *  @version $Revision: 1.230.8.1 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2008-12-30 20:40:00 $
     15 *  @version $Revision: 1.230.8.2 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2009-01-17 20:30:35 $
    1717 *
    1818 *  Copyright 2006 IfA, University of Hawaii
     
    728728    // XXX this would be better if we had globally defined mask values
    729729    psVectorMaskType maskVal = MASK_MARK | maskValInput;
    730     psVector *mask = psVectorAlloc(myVector->n, PS_TYPE_MASK); // The actual mask we will use
     730    psVector *mask = psVectorAlloc(myVector->n, PS_TYPE_VECTOR_MASK); // The actual mask we will use
    731731    psVectorInit(mask, 0);
    732732    if (maskInput) {
     
    22562256        }
    22572257    }
    2258     psVector *maskU8 = NULL;            // Input mask vector, U8 version
     2258    psVector *maskVector = NULL;            // Input mask vector, U8 version
    22592259    if (mask) {
    2260         if (mask->type.type == PS_TYPE_MASK) {
    2261             maskU8 = psMemIncrRefCounter((psPtr)mask);
     2260        if (mask->type.type == PS_TYPE_VECTOR_MASK) {
     2261            maskVector = psMemIncrRefCounter((psPtr)mask);
    22622262        } else {
    2263             maskU8 = psVectorCopy(NULL, mask, PS_TYPE_MASK);
     2263            maskVector = psVectorCopy(NULL, mask, PS_TYPE_VECTOR_MASK);
    22642264        }
    22652265    }
     
    22802280    // ************************************************************************
    22812281    if (stats->options & PS_STAT_SAMPLE_MEAN) {
    2282         if (!vectorSampleMean(inF32, errorsF32, maskU8, maskVal, stats)) {
     2282        if (!vectorSampleMean(inF32, errorsF32, maskVector, maskVal, stats)) {
    22832283            psError(PS_ERR_UNKNOWN, false, "Failed to calculate vector sample mean");
    22842284            status &= false;
     
    22882288    // ************************************************************************
    22892289    if (stats->options & (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_QUARTILE)) {
    2290         if (!vectorSampleMedian(inF32, maskU8, maskVal, stats)) {
     2290        if (!vectorSampleMedian(inF32, maskVector, maskVal, stats)) {
    22912291            psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample median");
    22922292            status &= false;
     
    22962296    // ************************************************************************
    22972297    if (stats->options & PS_STAT_SAMPLE_STDEV) {
    2298         if (!vectorSampleStdev(inF32, errorsF32, maskU8, maskVal, stats)) {
     2298        if (!vectorSampleStdev(inF32, errorsF32, maskVector, maskVal, stats)) {
    22992299            psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample stdev");
    23002300            status &= false;
     
    23032303
    23042304    if (stats->options & (PS_STAT_SAMPLE_SKEWNESS | PS_STAT_SAMPLE_KURTOSIS)) {
    2305         if (!vectorSampleMoments(inF32, maskU8, maskVal, stats)) {
     2305        if (!vectorSampleMoments(inF32, maskVector, maskVal, stats)) {
    23062306            psError(PS_ERR_UNKNOWN, false, "Failed to calculate sample moments");
    23072307            status &= false;
     
    23112311    // ************************************************************************
    23122312    if (stats->options & (PS_STAT_MAX | PS_STAT_MIN)) {
    2313         if (vectorMinMax(inF32, maskU8, maskVal, stats) == 0) {
     2313        if (vectorMinMax(inF32, maskVector, maskVal, stats) == 0) {
    23142314            psError(PS_ERR_UNKNOWN, false, "Failed to calculate vector minimum and maximum");
    23152315            status &= false;
     
    23192319    // ************************************************************************
    23202320    if (stats->options & (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV | PS_STAT_ROBUST_QUARTILE)) {
    2321         if (!vectorRobustStats(inF32, errorsF32, maskU8, maskVal, stats)) {
     2321        if (!vectorRobustStats(inF32, errorsF32, maskVector, maskVal, stats)) {
    23222322            psError(PS_ERR_UNKNOWN, false, _("Failed to calculate robust statistics"));
    23232323            status &= false;
     
    23272327    // ************************************************************************
    23282328    if (stats->options & (PS_STAT_FITTED_MEAN | PS_STAT_FITTED_STDEV)) {
    2329         if (!vectorFittedStats(inF32, errorsF32, maskU8, maskVal, stats)) {
     2329        if (!vectorFittedStats(inF32, errorsF32, maskVector, maskVal, stats)) {
    23302330            psError(PS_ERR_UNKNOWN, false, _("Failed to calculate fitted statistics"));
    23312331            status &= false;
     
    23382338            psAbort("you may not specify both FITTED_MEAN and FITTED_MEAN_V2");
    23392339        }
    2340         if (!vectorFittedStats_v2(inF32, errorsF32, maskU8, maskVal, stats)) {
     2340        if (!vectorFittedStats_v2(inF32, errorsF32, maskVector, maskVal, stats)) {
    23412341            psError(PS_ERR_UNKNOWN, false, _("Failed to calculate fitted statistics"));
    23422342            status &= false;
     
    23492349            psAbort("you may not specify both FITTED_MEAN and FITTED_MEAN_V3");
    23502350        }
    2351         if (!vectorFittedStats_v3(inF32, errorsF32, maskU8, maskVal, stats)) {
     2351        if (!vectorFittedStats_v3(inF32, errorsF32, maskVector, maskVal, stats)) {
    23522352            psError(PS_ERR_UNKNOWN, false, _("Failed to calculate fitted statistics"));
    23532353            status &= false;
     
    23602360            psAbort("you may not specify both FITTED_MEAN and FITTED_MEAN_V4");
    23612361        }
    2362         if (!vectorFittedStats_v4(inF32, errorsF32, maskU8, maskVal, stats)) {
     2362        if (!vectorFittedStats_v4(inF32, errorsF32, maskVector, maskVal, stats)) {
    23632363            psError(PS_ERR_UNKNOWN, false, _("Failed to calculate fitted statistics"));
    23642364            status &= false;
     
    23682368    // ************************************************************************
    23692369    if ((stats->options & PS_STAT_CLIPPED_MEAN) || (stats->options & PS_STAT_CLIPPED_STDEV)) {
    2370         if (!vectorClippedStats(inF32, errorsF32, maskU8, maskVal, stats)) {
     2370        if (!vectorClippedStats(inF32, errorsF32, maskVector, maskVal, stats)) {
    23712371            psError(PS_ERR_UNKNOWN, false, "Failed to calculate clipped statistics\n");
    23722372            status &= false;
     
    23762376    psFree(inF32);
    23772377    psFree(errorsF32);
    2378     psFree(maskU8);
     2378    psFree(maskVector);
    23792379    psTrace(TRACE, 3,"---- %s() end  ----\n", __func__);
    23802380    return status;
Note: See TracChangeset for help on using the changeset viewer.