Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
rs = np.ones(len(data_liste))
record_std = np.zeros((len(data_liste),2))
rois = data_liste.loc[:,"ROI1 lb":"ROI6 hb"]
for i in range(len(data_liste)):
# importing the spectra
sp = np.genfromtxt(path_in+data_liste["Name"][i],delimiter=delim,skip_header=1)
# constructing an interpolator: this will allow an output of all data with the same X axis
f = scipy.interpolate.interp1d(sp[:,0], sp[:,1],fill_value="extrapolate")
# temperature and excitation line correction (see Rameau help)
x, y_all[:,i], sdf = rp.tlcorrection(x,f(x),23.0,laser,normalisation='intensity')
# getting the roi
roi = np.array(rois.loc[i]).reshape(int(len(rois.loc[i])/2),2)
# calculating baseline
if method == "LL2012": # spline
try:
c_hf, b_hf = rp.baseline(x,y_all[:,i],roi,"gcvspline",s=spline_coeff)
except:
break
y_all_corr[:,i]=c_hf[:,0]
y_all_base[:,i]=b_hf[:,0]
elif method == "DG2017": # polynomial 3 following DG2017 method