IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 2, 2019, 8:29:31 PM (7 years ago)
Author:
eugene
Message:

adding vtransitions

Location:
branches/eam_branches/ohana.20190329/src/opihi/cmd.data
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.data/Makefile

    r40662 r40664  
    176176$(SRC)/vzload.$(ARCH).o            \
    177177$(SRC)/vpeaks.$(ARCH).o            \
     178$(SRC)/vtransitions.$(ARCH).o     \
    178179$(SRC)/vpop.$(ARCH).o              \
    179180$(SRC)/vroll.$(ARCH).o             \
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.data/init.c

    r40662 r40664  
    169169int vshift           PROTO((int, char **));
    170170int vpeaks           PROTO((int, char **));
     171int vtransitions     PROTO((int, char **));
    171172int vpop             PROTO((int, char **));
    172173int vsmooth          PROTO((int, char **));
     
    357358  {1, "vload",        vload,            "load vectors as overlay on image display"},
    358359  {1, "vmaxwell",     vmaxwell,         "fit a Maxwellian to a vector"},
    359   {1, "vpeaks",       vpeaks,           "fine coord and flux of peaks in vector"},
     360  {1, "vpeaks",       vpeaks,           "find coord and flux of peaks in vector"},
     361  {1, "vtransitions", vtransitions,     "find points in vector that cross the transition value"},
    360362  {1, "vpop",         vpop,             "remove first element of a vector"},
    361363  {1, "vroll",        vroll,            "roll vector elements by 1 entry"},
  • branches/eam_branches/ohana.20190329/src/opihi/cmd.data/threshold.c

    r40623 r40664  
    7171
    7272  if (!REVERSE) {
     73    // this algorithm assumes vecy[BinMax] > threshold, vecy[BinMin] < threshold
     74    if (vecy[0].elements.Flt[BinMin] > value) {
     75      gprint (GP_ERR, "ERROR: all values above threshold\n");
     76      return FALSE;
     77    }
     78    if (vecy[0].elements.Flt[BinMax] < value) {
     79      gprint (GP_ERR, "ERROR: all values below threshold\n");
     80      return FALSE;
     81    }
    7382    while (Nhi - Nlo > 10) {
    7483      N = 0.5*(Nlo + Nhi);
     
    8998    }
    9099  } else {
     100    // this algorithm assumes vecy[BinMin] > threshold, vecy[BinMax] < threshold
     101    if (vecy[0].elements.Flt[BinMin] < value) {
     102      gprint (GP_ERR, "ERROR: all values below threshold\n");
     103      return FALSE;
     104    }
     105    if (vecy[0].elements.Flt[BinMax] > value) {
     106      gprint (GP_ERR, "ERROR: all values above threshold\n");
     107      return FALSE;
     108    }
    91109    while (Nhi - Nlo > 10) {
    92110      N = 0.5*(Nlo + Nhi);
Note: See TracChangeset for help on using the changeset viewer.