"""
This widget contains the functionality to read out statistical property
during the experiment. The widget can be executed as a standalone
version.
########################################
Functionalities provided in this widget:
########################################
Note:
Technically the functionality is not completely provided here
1. Select input Pixel/ Channel for which to show statistics. It is also
possible to select channels which are not pixels (i.e. chopper,
wobbler,...)
2. Displays wavenumber in cm-1 of current pixel.
3. Display the average intensity: Average value for selected pixel.
Intensity corresponds to linearized raw data.
4. Display the Standart deviation of selected pixel/ channel.
5. Display the mean state intensity: Average relative intensity (probe
pixel divided by reference pixel) over all different states.
6. Display the mean state standard deviation: Averaged standard
deviation over all states. E.g. in experiment with a chopper, this
would calculate the standard deviation for chopper on and chopper off
and average these two.
7. Display the Average (pump-probe) signal amplitude.
8. Standard deviation of shot-to-shot pump-probe signal over all pixels/
wavenumbers. Corresponds to the big red number in the old software
(but not time sqrt(sample to acquire)).
"""
if __name__ == "__main__":
# Add directories to path for imports
import os, sys, inspect
currentdir = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe()))
)
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, os.path.join(currentdir, "ui_files"))
sys.path.insert(0, parentdir)
# PyQt imports
from PyQt5 import QtWidgets
from PyQt5.QtCore import QRunnable, QThreadPool, pyqtSignal, QObject
# Import RegEx input validators
from regex_validators import *
# Import Qt Threading wrapper
from qt_multithreading_wrapper import Worker
# Import of file made from UI designer
from ui_statistics import Ui_GroupBox_stats as Ui_stats
# Logger Settings
import logging
# logging.basicConfig(level=logging.INFO)
if __name__ == "__main__":
# TESTING -----------------------------------------------------------
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, *args, obj=None, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.setWindowTitle("Please god let this work")
widget = WidgetStatistics()
self.setCentralWidget(widget)
app = QtWidgets.QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec()