Skip to content

Commit

Permalink
Merge branch 'main' into dev_error
Browse files Browse the repository at this point in the history
  • Loading branch information
BeppeC committed Jan 25, 2024
1 parent 8cf3354 commit 8f301df
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 42 deletions.
36 changes: 15 additions & 21 deletions conf/deimos_soleil.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,7 @@ def log_scavenger(self, dataflnm):
. mon_en : monocromator energy
. pol : polarisation identifier
. field : magnetic field value
. tb1 : sample temperature 1
. tb2 : sample temperature 2
. t : average of tb1 and tb2
. t : sample temperature
. rz : sample rotation angle
. tx : sample x position
. tz : sample z position
Expand Down Expand Up @@ -399,10 +397,13 @@ def log_scavenger(self, dataflnm):
# find line with sample temperature and take TB
# values
for ln in par.split('\n'):
if '1_#1' in ln:
tb1 = float(ln.split('=')[1].strip(' K;'))
# nov 2023:
# 1_#1 is no more present in Deimos logfiles
# if '1_#1' in ln:
# tb1 = float(ln.split('=')[1].strip(' K;'))
if '1_#2' in ln:
tb2 = float(ln.split('=')[1].strip(' K;'))
# t once was t2 and the average was returned
t = float(ln.split('=')[1].strip(' K;'))
if 'Position' in par:
# find lines with sample positions and extract
# positions values
Expand All @@ -413,9 +414,8 @@ def log_scavenger(self, dataflnm):
tx = float(ln.split('=')[1].strip(' mm;'))
if 'exp1-mt_tz.2_#2' in ln:
tz = float(ln.split('=')[1].strip(' mm;'))
t = (tb1 + tb2) / 2
return {'mon_en': mon_en, 'pol': pol, 'field': field, 'tb1': tb1,
'tb2': tb2, 't': t, 'rz': rz, 'tx': tx, 'tz': tz}
return {'mon_en': mon_en, 'pol': pol, 'field': field, 't': t,
'rz': rz, 'tx': tx, 'tz': tz}
except:
raise Exception()

Expand All @@ -439,10 +439,8 @@ def escan_logfl_creator(self, guiobj, log_dt):
log_tbl = log_dt['log_tbl']

logtxt += 'Sample temperature\n'
logtxt += 'TB1 : {} +/- {} K\n'.format(log_tbl['tb1'].mean(),
log_tbl['tb1'].std())
logtxt += 'TB2 : {} +/- {} K\n\n'.format(log_tbl['tb2'].mean(),
log_tbl['tb2'].std())
logtxt += 'T : {} +/- {} K\n\n'.format(log_tbl['t'].mean(),
log_tbl['t'].std())
logtxt += 'Magnetic field {} +/- {} T\n\n'.format(
log_tbl['field'].abs().mean(), log_tbl['field'].abs().std())
logtxt += 'Sample position\n'
Expand Down Expand Up @@ -528,10 +526,8 @@ def hscan_logfl_creator(self, log_dt):
log_tbl = log_dt['log_tbl']

logtxt += 'Sample temperature\n'
logtxt += 'TB1 : {} +/- {} K\n'.format(log_tbl['tb1'].mean(),
log_tbl['tb1'].std())
logtxt += 'TB2 : {} +/- {} K\n\n'.format(log_tbl['tb2'].mean(),
log_tbl['tb2'].std())
logtxt += 'T : {} +/- {} K\n\n'.format(log_tbl['t'].mean(),
log_tbl['t'].std())
logtxt += 'Magnetic field {} +/- {} T\n\n'.format(
log_tbl['field'].abs().mean(), log_tbl['field'].abs().std())
logtxt += 'Sample position\n'
Expand Down Expand Up @@ -609,10 +605,8 @@ def ptbypt_logfl_creator(self, log_dt):
log_tbl = log_dt['log_tbl']

logtxt += 'Sample temperature\n'
logtxt += 'TB1 : {} +/- {} K\n'.format(log_tbl['tb1'].mean(),
log_tbl['tb1'].std())
logtxt += 'TB2 : {} +/- {} K\n\n'.format(log_tbl['tb2'].mean(),
log_tbl['tb2'].std())
logtxt += 'T : {} +/- {} K\n\n'.format(log_tbl['t'].mean(),
log_tbl['t'].std())
logtxt += 'Magnetic field {} +/- {} T\n\n'.format(
log_tbl['field'].abs().mean(), log_tbl['field'].abs().std())
logtxt += 'Sample position\n'
Expand Down
36 changes: 15 additions & 21 deletions conf/deimos_soleil_turbotime.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,7 @@ def log_scavenger(self, dataflnm):
. mon_en : monocromator energy
. pol : polarisation identifier
. field : magnetic field value
. tb1 : sample temperature 1
. tb2 : sample temperature 2
. t : average of tb1 and tb2
. t : sample temperature
. rz : sample rotation angle
. tx : sample x position
. tz : sample z position
Expand Down Expand Up @@ -399,10 +397,13 @@ def log_scavenger(self, dataflnm):
# find line with sample temperature and take TB
# values
for ln in par.split('\n'):
if '1_#1' in ln:
tb1 = float(ln.split('=')[1].strip(' K;'))
# nov 2023:
# 1_#1 is no more present in Deimos logfiles
# if '1_#1' in ln:
# tb1 = float(ln.split('=')[1].strip(' K;'))
if '1_#2' in ln:
tb2 = float(ln.split('=')[1].strip(' K;'))
# t once was t2 and the average was returned
t = float(ln.split('=')[1].strip(' K;'))
if 'Position' in par:
# find lines with sample positions and extract
# positions values
Expand All @@ -413,9 +414,8 @@ def log_scavenger(self, dataflnm):
tx = float(ln.split('=')[1].strip(' mm;'))
if 'exp1-mt_tz.2_#2' in ln:
tz = float(ln.split('=')[1].strip(' mm;'))
t = (tb1 + tb2) / 2
return {'mon_en': mon_en, 'pol': pol, 'field': field, 'tb1': tb1,
'tb2': tb2, 't': t, 'rz': rz, 'tx': tx, 'tz': tz}
return {'mon_en': mon_en, 'pol': pol, 'field': field, 't': t,
'rz': rz, 'tx': tx, 'tz': tz}
except:
raise Exception()

Expand All @@ -439,10 +439,8 @@ def escan_logfl_creator(self, guiobj, log_dt):
log_tbl = log_dt['log_tbl']

logtxt += 'Sample temperature\n'
logtxt += 'TB1 : {} +/- {} K\n'.format(log_tbl['tb1'].mean(),
log_tbl['tb1'].std())
logtxt += 'TB2 : {} +/- {} K\n\n'.format(log_tbl['tb2'].mean(),
log_tbl['tb2'].std())
logtxt += 'T : {} +/- {} K\n\n'.format(log_tbl['t'].mean(),
log_tbl['t'].std())
logtxt += 'Magnetic field {} +/- {} T\n\n'.format(
log_tbl['field'].abs().mean(), log_tbl['field'].abs().std())
logtxt += 'Sample position\n'
Expand Down Expand Up @@ -528,10 +526,8 @@ def hscan_logfl_creator(self, log_dt):
log_tbl = log_dt['log_tbl']

logtxt += 'Sample temperature\n'
logtxt += 'TB1 : {} +/- {} K\n'.format(log_tbl['tb1'].mean(),
log_tbl['tb1'].std())
logtxt += 'TB2 : {} +/- {} K\n\n'.format(log_tbl['tb2'].mean(),
log_tbl['tb2'].std())
logtxt += 'T : {} +/- {} K\n\n'.format(log_tbl['t'].mean(),
log_tbl['t'].std())
logtxt += 'Magnetic field {} +/- {} T\n\n'.format(
log_tbl['field'].abs().mean(), log_tbl['field'].abs().std())
logtxt += 'Sample position\n'
Expand Down Expand Up @@ -609,10 +605,8 @@ def ptbypt_logfl_creator(self, log_dt):
log_tbl = log_dt['log_tbl']

logtxt += 'Sample temperature\n'
logtxt += 'TB1 : {} +/- {} K\n'.format(log_tbl['tb1'].mean(),
log_tbl['tb1'].std())
logtxt += 'TB2 : {} +/- {} K\n\n'.format(log_tbl['tb2'].mean(),
log_tbl['tb2'].std())
logtxt += 'T : {} +/- {} K\n\n'.format(log_tbl['t'].mean(),
log_tbl['t'].std())
logtxt += 'Magnetic field {} +/- {} T\n\n'.format(
log_tbl['field'].abs().mean(), log_tbl['field'].abs().std())
logtxt += 'Sample position\n'
Expand Down

0 comments on commit 8f301df

Please sign in to comment.