Commit 22051abf authored by 3Yan's avatar 3Yan

BugFix - running program without spectra without crushing

* removed bug from the last commit - annotation routine wont fail
parent 8eb00652
......@@ -13,7 +13,7 @@ from . import zcetools_help
from . import reactivitytools
__version__ = "0.0.31"
__version__ = "0.0.32"
__all__ = ['config', 'datatools', 'docks', 'drltools', 'drltoos_gui', 'filetools',
......
......@@ -379,11 +379,6 @@ def ann_spec(ms_spec, msdata, ann_limit=0.01):
peakline = np.empty([len(maxargs)], dtype=[('x', np.float32), ('y', np.float32)])
peakline['x'], peakline['y'] = xdata[maxargs], ydata[maxargs]
peaks.append(peakline)
peaks = np.concatenate(peaks)
s_peaks = sub_peaks(peaks, msdata['texts'],
np.diff(ms_spec.get_xlim()),
np.diff(ms_spec.get_ylim()))
# delete objects from the spectra
for intensity in msdata['annotation']:
......@@ -391,6 +386,14 @@ def ann_spec(ms_spec, msdata, ann_limit=0.01):
# remove them from tracking
msdata['annotation'].clear()
if len(peaks) == 0:
return
peaks = np.concatenate(peaks)
s_peaks = sub_peaks(peaks, msdata['texts'],
np.diff(ms_spec.get_xlim()),
np.diff(ms_spec.get_ylim()))
dispints = cf.settings().value("view/intensities", type=bool)
for peak in s_peaks:
annotation = '{0:.2f}\n{1: .2e}'.format(peak[0], peak[1])\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment