/home/thomas/.conda/envs/nmrglue/lib/python3.12/site-packages/nmrglue/fileio/sparky.py:517: UserWarning: Bad file size in header
14417920692 vs 0
warn(f'Bad file size in header {seek_pos} vs {expected_seek_pos}')
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
Cell In[44], line 38
35 threshold = 8.5e4
37 # Detect all peaks within the extracted slice with a threshold
---> 38 peaks = ng.peakpick.pick(data_slice, pthres=threshold, algorithm="thres", msep=[1, 1])
40 # Contour levels
41 clevs = [threshold * 1.4 ** i for i in range(10)]
File ~/.conda/envs/nmrglue/lib/python3.12/site-packages/nmrglue/analysis/peakpick.py:214, in pick(data, pthres, nthres, msep, algorithm, est_params, lineshapes, edge, diag, c_struc, c_ndil, cluster, table, axis_names)
210 # scales = np.zeros(np.array(locations).shape,dtype=float)
211 # amps = np.zeros(len(locations),dtype=float)
213 for i, (l, seg_slice) in enumerate(zip(locations, seg_slices)):
--> 214 null, scales[i], amps[i] = guess_params_slice(data, l, seg_slice,
215 ls_classes)
217 ########################################################
218 # return locations, scales and amplitudes as requested #
219 ########################################################
220 if cluster:
File ~/.conda/envs/nmrglue/lib/python3.12/site-packages/nmrglue/analysis/peakpick.py:370, in guess_params_slice(data, location, seg_slice, ls_classes)
345 """
346 Guess the parameter of a peak in a segment.
347
(...)
367
368 """
369 # find the rectangular region around the segment
--> 370 region = data[seg_slice]
371 edge = [s.start for s in seg_slice]
372 rlocation = [l - s.start for l, s in zip(location, seg_slice)]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices