IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 14, 2018, 2:27:25 PM (8 years ago)
Author:
eugene
Message:

add avperiodogram function; fix sorts to put NAN at one end; fix impeaks and findrowpeaks to ignore NAN values

Location:
trunk/Ohana/src/opihi/cmd.data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/impeaks.c

    r36679 r40398  
    100100  int Npeaks = 0;
    101101  for (ix = 1; ix < Nx - 1; ix++) {
     102    if (!isfinite(row[ix])) continue; // ignore NAN values
    102103    if (row[ix] <  threshold) continue;   // only accept pixels above threshold
    103104    if (row[ix] <  row[ix - 1]) continue; // peak pixel must be at least preceeding pixel
  • trunk/Ohana/src/opihi/cmd.data/sort.c

    r20936 r40398  
    77  itmp = IDX[A]; IDX[A] = IDX[B]; IDX[B] = itmp; \
    88}
    9 # define COMPARE(A,B)(X[A] < X[B])
     9
     10// # define COMPARE(A,B)(X[A] < X[B])
     11# define COMPARE(A,B)((!isfinite(X[A]) && isfinite(X[B])) || (X[A] < X[B]))
    1012
    1113  OHANA_SORT (N, COMPARE, SWAPFUNC);
     
    2224  itmp = IDX[A]; IDX[A] = IDX[B]; IDX[B] = itmp; \
    2325}
     26
    2427# define COMPARE(A,B)(X[A] < X[B])
     28// # define COMPARE(A,B)((!isfinite(X[A]) && isfinite(X[B])) || (X[A] < X[B]))
    2529
    2630  OHANA_SORT (N, COMPARE, SWAPFUNC);
Note: See TracChangeset for help on using the changeset viewer.