IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41824


Ignore:
Timestamp:
Sep 29, 2021, 12:05:40 PM (5 years ago)
Author:
eugene
Message:

fix the sense of the mask for the nan/inf values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-dev-20210817/Ohana/src/opihi/cmd.data/vstats.c

    r41820 r41824  
    8888      mask[i] = 0; // do not mask unless we have a reason below
    8989      if (tvec) {
    90         // note the logical vector is 0 == bad (ignore)
     90        // note the logical vector is 0 == bad (ignore) while mask[i] has the opposite sense (0 is good)
    9191        mask[i] = (tvec->type == OPIHI_FLT) ? (tvec->elements.Flt[i] == 0.0) : (tvec->elements.Int[i] == 0);
    9292      }
    93       if (!finite (*X)) { mask[i] = 0; }
    94       if (Ignore && (*X == IgnoreValue)) { mask[i] = 0; }
     93      if (!finite (*X)) { mask[i] = 1; }
     94      if (Ignore && (*X == IgnoreValue)) { mask[i] = 1; }
    9595    }     
    9696  } else {
     
    9999      mask[i] = 0; // do not mask unless we have a reason below
    100100      if (tvec) {
    101         // note the logical vector is 0 == bad (ignore)
     101        // note the logical vector is 0 == bad (ignore) while mask[i] has the opposite sense (0 is good)
    102102        mask[i] = (tvec->type == OPIHI_FLT) ? (tvec->elements.Flt[i] == 0.0) : (tvec->elements.Int[i] == 0);
    103103      }
    104       if (!finite (*X)) { mask[i] = 0; }
    105       if (Ignore && (*X == IgnoreValue)) { mask[i] = 0; }
     104      if (!finite (*X)) { mask[i] = 1; }
     105      if (Ignore && (*X == IgnoreValue)) { mask[i] = 1; }
    106106    }     
    107107  }
Note: See TracChangeset for help on using the changeset viewer.