You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello all,
it appears that getting the tau1 / tau2 values are crucial to initiate your simulation.
I found tiresome to check in the .SPC files to get this info.
So here is a way to access it if you need by calling this function :
def GetExpParamValues(filename=str):
'''
Function to catch pulse_EPR parameters from Bruker pulse experiment data.
The function uses deerlab.deerload function to import the parameters description.
Parameters
----------
filename : full path to the filename
DESCRIPTION. string
Returns
-------
BrukerParamDict : Dictionnary of Bruker common parameters name.
By instance BrukerParamDict['d1'] will return the value of d1 (tau1 in Bruker language
DESCRIPTION. Dictionnary
'''
_, _, par = dl.deerload(filename, full_output=True)
PulseParameters = par['DSL']['ftEpr']['PlsSPELGlbTxt']
ListBrukerNames = ['d0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8',
'd9', 'd10', 'd11', 'd12', 'd30', 'd31', 'p0', 'p1',
'p2', 'p3', 'p4', 'p5', 'DAF', 'af0', 'af1', 'af2']
BrukerParamDict = {}
for i in range(len(ListBrukerNames)):
KeywordToFind = ListBrukerNames[i]
keywordlength = int(len(ListBrukerNames[i]))
a = int()
b = int()
c = str()
a = PulseParameters.find(KeywordToFind) # find 1st index of keyword
if a != -1:
# find second index with adjacent ;
b = PulseParameters.find(';', a)
if b != -1:
c = PulseParameters[a+keywordlength:b-1]
try:
value = float(c.replace('=', '').strip())
BrukerParamDict.update({KeywordToFind: value, })
except ValueError:
pass # do nothing
return BrukerParamDict
I don't like the try/except part of this code. But it works.
Would it be interesting to implement this in the deerlab package ?
Feel free to use it...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello all,
it appears that getting the tau1 / tau2 values are crucial to initiate your simulation.
I found tiresome to check in the .SPC files to get this info.
So here is a way to access it if you need by calling this function :
def GetExpParamValues(filename=str):
'''
Function to catch pulse_EPR parameters from Bruker pulse experiment data.
The function uses deerlab.deerload function to import the parameters description.
I don't like the try/except part of this code. But it works.
Would it be interesting to implement this in the deerlab package ?
Feel free to use it...
Best
Timothee
Beta Was this translation helpful? Give feedback.
All reactions