Changeset 42389 for trunk/Ohana/src/opihi/cmd.data/threshold.c
- Timestamp:
- Feb 8, 2023, 12:17:35 PM (3 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/opihi/cmd.data/threshold.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
trunk/Ohana/src/opihi/cmd.data/threshold.c
r42277 r42389 3 3 int QUIET = FALSE; 4 4 5 void _threshold_set_values (double value, int Nbin, double level ) {5 void _threshold_set_values (double value, int Nbin, double level, int thresherr) { 6 6 7 7 set_variable ("threshval", value); 8 8 set_int_variable ("threshbin", Nbin); 9 9 set_variable ("threshold", level); 10 set_int_variable ("thresherr", thresherr); 10 11 11 12 if (!QUIET) gprint (GP_LOG, "theshold %f (bin %d is %f)\n", level, Nbin, value); … … 117 118 if (vecy[0].elements.Flt[BinMin] > value) { 118 119 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); 120 121 return TRUE; 121 122 } else { 122 123 gprint (GP_ERR, "ERROR: all values above threshold\n"); 123 _threshold_set_values (NAN, -1, NAN );124 _threshold_set_values (NAN, -1, NAN, 1); 124 125 return FALSE; 125 126 } … … 127 128 if (vecy[0].elements.Flt[BinMax] < value) { 128 129 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); 130 131 return TRUE; 131 132 } else { 132 133 gprint (GP_ERR, "ERROR: all values below threshold\n"); 133 _threshold_set_values (NAN, -1, NAN );134 _threshold_set_values (NAN, -1, NAN, 1); 134 135 return FALSE; 135 136 } … … 156 157 if (vecy[0].elements.Flt[BinMin] < value) { 157 158 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); 159 160 return TRUE; 160 161 } else { 161 162 gprint (GP_ERR, "ERROR: all values below threshold\n"); 162 _threshold_set_values (NAN, -1, NAN );163 _threshold_set_values (NAN, -1, NAN, 1); 163 164 return FALSE; 164 165 } … … 166 167 if (vecy[0].elements.Flt[BinMax] > value) { 167 168 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); 169 170 return TRUE; 170 171 } else { 171 172 gprint (GP_ERR, "ERROR: all values above threshold\n"); 172 _threshold_set_values (NAN, -1, NAN );173 _threshold_set_values (NAN, -1, NAN, 1); 173 174 return FALSE; 174 175 } … … 219 220 } 220 221 221 _threshold_set_values (y1, Nhi, Xvalue );222 _threshold_set_values (y1, Nhi, Xvalue, 0); 222 223 return (TRUE); 223 224 }
Note:
See TracChangeset
for help on using the changeset viewer.
