Commit 432e2398 authored by Thomas Vincent's avatar Thomas Vincent

display phi and energy for each scan in project summary

parent 491bc01e
......@@ -187,20 +187,6 @@ class ProjectSummaryWidget(Qt.QWidget):
inputItem.addChild(Qt.QTreeWidgetItem(['Full path', xsocsFile]))
view.addTopLevelItem(inputItem)
# getting scan angles
errMsg = 'Failed to read scan angles.'
# TODO : check that there are at least 2 angles
text = '{0} [{1} -> {2}]'.format(
str(len(entries)),
str(xsocsH5.scan_angle(entries[0])),
str(xsocsH5.scan_angle(entries[-1])))
entriesItem = Qt.QTreeWidgetItem(['Angles', text])
for entryIdx, entry in enumerate(entries):
text = 'eta = {0}'.format(str(xsocsH5.scan_angle(entry)))
entryItem = Qt.QTreeWidgetItem([str(entryIdx), text])
entriesItem.addChild(entryItem)
view.addTopLevelItem(entriesItem)
# getting acquisition params
errMsg = 'Failed to read Acquisition parameters.'
title = ' '.join(str(value) for value in params.values())
......@@ -211,7 +197,31 @@ class ProjectSummaryWidget(Qt.QWidget):
commandItem.addChild(Qt.QTreeWidgetItem([key, str(value)]))
view.addTopLevelItem(commandItem)
# getting scan angles and energies
errMsg = 'Failed to read scan angles and energies.'
text = '{nb_scan} (eta:[{eta1:g}°;{eta2:g}°] ' \
'phi:[{phi1:g}°;{phi2:g}°] ' \
'energy:[{energy1:g}eV;{energy2:g}eV])'.format(
nb_scan=len(entries),
eta1=xsocsH5.positioner(entries[0], 'eta'),
eta2=xsocsH5.positioner(entries[-1], 'eta'),
phi1=xsocsH5.positioner(entries[0], 'phi'),
phi2=xsocsH5.positioner(entries[-1], 'phi'),
energy1=xsocsH5.beam_energy(entries[0]),
energy2=xsocsH5.beam_energy(entries[-1]))
entriesItem = Qt.QTreeWidgetItem(['Scans', text])
for entry in entries:
text = 'eta:{eta:g}°\tphi:{phi:g}°\tenergy:{nrj:g}eV'.format(
eta=xsocsH5.positioner(entry, 'eta'),
phi=xsocsH5.positioner(entry, 'phi'),
nrj=xsocsH5.beam_energy(entry))
entryItem = Qt.QTreeWidgetItem([entry, text])
entriesItem.addChild(entryItem)
view.addTopLevelItem(entriesItem)
for key, value in xsocsH5.acquisition_params(entries[0]).items():
if key == 'beam_energy':
continue # Skip beam_energy
view.addTopLevelItem(Qt.QTreeWidgetItem([key, str(value)]))
except Exception as ex:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment