def phaseFirstOrder(self, fromPos, toPos, phi1, degree = True, noChangeOnResonance=False, pivot = 0, scale= "Hz"):
"""This should only be applied to Fourier transformed spectral data
It will lead to a zero phase shift at the upper end of the spectrum and to a
phase shift of phi1 at the lower end, linear interpolation inbetween.
this is the spinsight convention.
If a pivot is provided the phase will not be changed at the pivot, but the total change accross the entire spectrum will still amount to phi1.
"""
self.checkToPos(toPos)
phaseValues = np.linspace(0,phi1,num=len(self.frequency))
if noChangeOnResonance == True:
pivot = 0
elif pivot !=0:
print("Using pivot for first order phase correction")
index = self.getIndex(pivot, scale= scale)
phaseValues = phaseValues - phaseValues[index]
0
if degree == True:
phaseValues = phaseValues*np.pi/180
self.allFid[toPos] = [spectrum*np.exp(-1j*phaseValues) for spectrum in self.allFid[fromPos]]
评论列表
文章目录