- Timestamp:
- Apr 4, 2022, 3:59:15 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20220316/Ohana/src/opihi/cmd.data/threshold.c
r41341 r42156 95 95 // this algorithm assumes vecy[BinMax] > threshold, vecy[BinMin] < threshold 96 96 if (vecy[0].elements.Flt[BinMin] > value) { 97 gprint (GP_ERR, "ERROR: all values above threshold\n"); 98 return FALSE; 97 if (!QUIET) gprint (GP_ERR, "ERROR: all values above threshold\n"); 98 set_int_variable ("threshbin", BinMin); 99 set_variable ("threshval", vecy[0].elements.Flt[BinMin]); 100 set_variable ("threshold", vecx[0].elements.Flt[BinMin]); 101 set_int_variable ("thresherr", 1); 102 if (!QUIET) gprint (GP_LOG, "theshold %f (bin %d is %f)\n", 103 vecx[0].elements.Flt[BinMin], BinMin, 104 vecy[0].elements.Flt[BinMin]); 105 return TRUE; 99 106 } 100 107 if (vecy[0].elements.Flt[BinMax] < value) { 101 gprint (GP_ERR, "ERROR: all values below threshold\n"); 102 return FALSE; 108 if (!QUIET) gprint (GP_ERR, "ERROR: all values below threshold\n"); 109 set_int_variable ("threshbin", BinMax); 110 set_variable ("threshval", vecy[0].elements.Flt[BinMax]); 111 set_variable ("threshold", vecx[0].elements.Flt[BinMax]); 112 set_int_variable ("thresherr", 1); 113 if (!QUIET) gprint (GP_LOG, "theshold %f (bin %d is %f)\n", 114 vecx[0].elements.Flt[BinMax], BinMax, 115 vecy[0].elements.Flt[BinMax]); 116 return TRUE; 103 117 } 104 118 while (Nhi - Nlo > 10) { … … 122 136 // this algorithm assumes vecy[BinMin] > threshold, vecy[BinMax] < threshold 123 137 if (vecy[0].elements.Flt[BinMin] < value) { 124 gprint (GP_ERR, "ERROR: all values below threshold\n"); 125 return FALSE; 138 if (!QUIET) gprint (GP_ERR, "ERROR: all values below threshold\n"); 139 set_int_variable ("threshbin", BinMin); 140 set_variable ("threshval", vecy[0].elements.Flt[BinMin]); 141 set_variable ("threshold", vecx[0].elements.Flt[BinMin]); 142 set_int_variable ("thresherr", 1); 143 if (!QUIET) gprint (GP_LOG, "theshold %f (bin %d is %f)\n", 144 vecx[0].elements.Flt[BinMin], BinMin, 145 vecy[0].elements.Flt[BinMin]); 146 return TRUE; 126 147 } 127 148 if (vecy[0].elements.Flt[BinMax] > value) { 128 gprint (GP_ERR, "ERROR: all values above threshold\n"); 129 return FALSE; 149 if (!QUIET) gprint (GP_ERR, "ERROR: all values above threshold\n"); 150 set_int_variable ("threshbin", BinMax); 151 set_variable ("threshval", vecy[0].elements.Flt[BinMax]); 152 set_variable ("threshold", vecx[0].elements.Flt[BinMax]); 153 set_int_variable ("thresherr", 1); 154 if (!QUIET) gprint (GP_LOG, "theshold %f (bin %d is %f)\n", 155 vecx[0].elements.Flt[BinMax], BinMax, 156 vecy[0].elements.Flt[BinMax]); 157 return TRUE; 130 158 } 131 159 while (Nhi - Nlo > 10) { … … 175 203 176 204 set_variable ("threshval", y1); 205 set_variable ("threshold", Xvalue); 177 206 set_int_variable ("threshbin", Nhi); 178 set_ variable ("threshold", Xvalue);207 set_int_variable ("thresherr", 0); 179 208 180 209 if (!QUIET) gprint (GP_LOG, "theshold %f (bin %d is %f)\n", Xvalue, Nhi, y1);
Note:
See TracChangeset
for help on using the changeset viewer.
