Skip to content
Snippets Groups Projects
Commit 39aa6335 authored by Henri Payno's avatar Henri Payno Committed by payno
Browse files

scanoverview: add more metadata

add scan range + estimated cor
use tomoscan.scanbase.FOV instead of _FOV (deprecated)

/close #868
parent 169c71fe
No related branches found
No related tags found
No related merge requests found
......@@ -41,3 +41,5 @@ PSI_CHAR = (b"\xcf\x88").decode("utf-8")
THETA_CHAR = (b"\xce\xb8").decode("utf-8")
MU_CHAR = (b"\xce\xbc").decode("utf-8")
DEGREE_CHAR = (b"\xc2\xb0").decode("utf-8")
......@@ -36,7 +36,7 @@ from nabu.pipeline.fullfield.nabu_config import (
from silx.gui import icons as silx_icons
from silx.gui import qt
from silx.utils.enum import Enum as _Enum
from tomoscan.scanbase import _FOV
from tomoscan.scanbase import FOV
from tomwer.core.process.reconstruction.nabu.utils import ConfigurationLevel, _NabuMode
from tomwer.core.scan.scanbase import TomwerScanBase
......@@ -553,9 +553,9 @@ class NabuWidget(qt.QWidget):
"""Tune the configuration from scan information if possible"""
assert isinstance(scan, TomwerScanBase)
if scan.field_of_view is not None and not self.isModeLocked():
if scan.field_of_view == _FOV.FULL:
if scan.field_of_view == FOV.FULL:
self.setMode(_NabuMode.FULL_FIELD)
elif scan.field_of_view == _FOV.HALF:
elif scan.field_of_view == FOV.HALF:
self.setMode(_NabuMode.HALF_ACQ)
if scan.sa_delta_beta_params is not None:
db = scan.sa_delta_beta_params.selected_delta_beta_value
......
......@@ -32,9 +32,11 @@ import logging
import weakref
from silx.gui import qt
from tomoscan.scanbase import FOV
from tomwer.core.scan.edfscan import EDFTomoScan
from tomwer.core.scan.scanbase import TomwerScanBase
from tomwer.core.utils.char import DEGREE_CHAR
_logger = logging.getLogger(__name__)
......@@ -68,6 +70,8 @@ class ScanOverviewWidget(qt.QWidget):
self._flats.setText(0, "flats")
self._alignments = qt.QTreeWidgetItem(self._frames)
self._alignments.setText(0, "alignments")
self._estimatedCOR = qt.QTreeWidgetItem(self._frames)
self._estimatedCOR.setText(0, "estimated cor")
self._x_pixel_size = qt.QTreeWidgetItem(self._instrument)
self._x_pixel_size.setText(0, "x pixel size")
......@@ -87,6 +91,8 @@ class ScanOverviewWidget(qt.QWidget):
self._endTime.setText(0, "end_time")
self._title = qt.QTreeWidgetItem(self._tree)
self._title.setText(0, "title")
self._scanRangeQLE = qt.QTreeWidgetItem(self._tree)
self._scanRangeQLE.setText(0, "scan range")
# set up
self._instrument.setExpanded(True)
......@@ -116,6 +122,7 @@ class ScanOverviewWidget(qt.QWidget):
self._updateSample,
self._updateTimes,
self._updateNames,
self._updateScanRange,
):
try:
fct()
......@@ -190,6 +197,14 @@ class ScanOverviewWidget(qt.QWidget):
text=str(n_alignment),
)
if scan.field_of_view == FOV.HALF:
if scan.estimated_cor_frm_motor is None:
self._estimatedCOR.setText("???")
else:
self._estimatedCOR.setText(str(scan.estimated_cor_frm_motor))
else:
self._estimatedCOR.setText("only for half")
def _updateEnergy(self):
scan = self.getScan()
assert isinstance(scan, TomwerScanBase)
......@@ -221,6 +236,10 @@ class ScanOverviewWidget(qt.QWidget):
scan = self.getScan()
assert isinstance(scan, TomwerScanBase)
scan_range = scan.scan_range
if scan_range is None:
scan_range = "???"
else:
scan_range = f"{scan_range}{DEGREE_CHAR}"
self._setColoredTxt(
item=self._scanRangeQLE,
text=str(scan_range),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment