cms-gem-daq-project / gem-plotting-tools

Repository for GEM commissioning plotting tools
GNU General Public License v3.0
1 stars 26 forks source link

SBit threshold analysis crashes when one or more vfats are masked during the scan #275

Closed mexanick closed 4 years ago

mexanick commented 4 years ago

Brief summary of issue

@bregnery During analysis of per-VFAT scan the code fails to find the inflection point and crashes in case one or more VFATs were masked during the scan (i.e. no data is provided) Error message:

Traceback (most recent call last):
  File "/opt/cmsgemos/bin/anaSBitThresh.py", line 95, in <module>
    scandate = scandate)
  File "/usr/lib/python2.7/site-packages/gempython/gemplotting/utils/threshAlgos.py", line 1409, in sbitRateAnalysis
    dict_dacInflectPts[dacName][ohKey][vfat] = findInflectionPts(dict_Rate1DVsDACNameX[dacName][ohKey][vfat])
  File "/usr/lib/python2.7/site-packages/gempython/gemplotting/utils/anautilities.py", line 491, in findInflectionPts
    grad = np.gradient(y, x)
  File "/home/gemuser/.local/lib/python2.7/site-packages/numpy/lib/function_base.py", line 1009, in gradient
    if (diffx == diffx[0]).all():
IndexError: index 0 is out of bounds for axis 0 with size 0

Types of issue

Expected Behavior

This is a place for discussion. Definitely, the analysis should not crash, but somehow the user should be notified of a potential problem

Current Behavior

The non-empty VFAT mask is not used during inflection point search thus leading to the crash when no data is stored for a given VFAT

Steps to Reproduce (for bugs)

Run analysis on any per-VFAT sbitRate scan with masked VFAT(s)

Possible Solution (for bugs)

Use the previously determined in the routine non-zero VFAT mask

Context (for feature requests)

Impossible to determine the threshold values for a chamber in case one or more chips aren't working.

Your Environment

bregnery commented 4 years ago

This was fixed in Pull Request #268

It has not been merged yet

jsturdy commented 4 years ago

268 has been merged, if this issue no longer is present, we can close