IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 8, 2023, 12:17:35 PM (3 years ago)
Author:
eugene
Message:

merge from eam_branches/ipp-20220316. fixes for more pendantic gcc; add opihi memory stats; string vector improvements; use named macros for fixed string lengths

Location:
trunk/Ohana
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/opihi/cmd.data/threshold.c

    r42277 r42389  
    33int QUIET = FALSE;
    44
    5 void _threshold_set_values (double value, int Nbin, double level) {
     5void _threshold_set_values (double value, int Nbin, double level, int thresherr) {
    66
    77  set_variable ("threshval", value);
    88  set_int_variable ("threshbin", Nbin);
    99  set_variable ("threshold", level);
     10  set_int_variable ("thresherr", thresherr);
    1011
    1112  if (!QUIET) gprint (GP_LOG, "theshold %f (bin %d is %f)\n", level, Nbin, value);
     
    117118    if (vecy[0].elements.Flt[BinMin] > value) {
    118119      if (SATURATE) {
    119         _threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin]);
     120        _threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin], 1);
    120121        return TRUE;
    121122      } else {
    122123        gprint (GP_ERR, "ERROR: all values above threshold\n");
    123         _threshold_set_values (NAN, -1, NAN);
     124        _threshold_set_values (NAN, -1, NAN, 1);
    124125        return FALSE;
    125126      }
     
    127128    if (vecy[0].elements.Flt[BinMax] < value) {
    128129      if (SATURATE) {
    129         _threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax]);
     130        _threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax], 1);
    130131        return TRUE;
    131132      } else {
    132133        gprint (GP_ERR, "ERROR: all values below threshold\n");
    133         _threshold_set_values (NAN, -1, NAN);
     134        _threshold_set_values (NAN, -1, NAN, 1);
    134135        return FALSE;
    135136      }
     
    156157    if (vecy[0].elements.Flt[BinMin] < value) {
    157158      if (SATURATE) {
    158         _threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin]);
     159        _threshold_set_values (vecy[0].elements.Flt[BinMin], BinMin, vecx[0].elements.Flt[BinMin], 1);
    159160        return TRUE;
    160161      } else {
    161162        gprint (GP_ERR, "ERROR: all values below threshold\n");
    162         _threshold_set_values (NAN, -1, NAN);
     163        _threshold_set_values (NAN, -1, NAN, 1);
    163164        return FALSE;
    164165      }
     
    166167    if (vecy[0].elements.Flt[BinMax] > value) {
    167168      if (SATURATE) {
    168         _threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax]);
     169        _threshold_set_values (vecy[0].elements.Flt[BinMax], BinMax, vecx[0].elements.Flt[BinMax], 1);
    169170        return TRUE;
    170171      } else {
    171172        gprint (GP_ERR, "ERROR: all values above threshold\n");
    172         _threshold_set_values (NAN, -1, NAN);
     173        _threshold_set_values (NAN, -1, NAN, 1);
    173174        return FALSE;
    174175      }
     
    219220  }
    220221
    221   _threshold_set_values (y1, Nhi, Xvalue);
     222  _threshold_set_values (y1, Nhi, Xvalue, 0);
    222223  return (TRUE);
    223224}
Note: See TracChangeset for help on using the changeset viewer.