University of Bergen

PHYS291 - Data for fysikk

Fluid Tank Monitoring

Made by Ørjan Silgjerd, modified 13. june 2016.


Introduction:

This is the presentation of the semester project in the course PHYS291 – Data for fysikk. All student projects should implement use of ROOT for data analysis . “ROOT is a modular scientific software framework. It provides all the functionalities needed to deal with big data processing, statistical analysis, visualisation and storage. It is mainly written in C++ but integrated with other languages such as Python and R.”

https://root.cern.ch/


Project Description:

Create a user friendly GUI (Graphical User Interface) for opening data files with the following measurements from a liquid fluid tank:

- Level measurements.

- Temperature measurements.

- Pressure measurements.

The program code shall open the data files (when input is given from the user through a push button in the GUI), where the data files are collected. The data shall be calculated and presented as a averaged value, and measurement error shall be calculated and presented. All measurements shall be presented as numerical values and plotted in the GUI vs time. A push button in the GUI for saving plot into file. Test the program code with a dummy "measurement file" with sufficient data.


Program code:

Link to code and data file: sourcefile.zip

The files could be extracted to ROOT Macro folder/directory, start up ROOT Terminal and run the application by typing .x tankmonitor.cpp.


tankmonitor.cpp is a ROOT C/C++ code with GUI.

The application read measurement ASCII formated files into vectors,

after the user activates "Open file" button, and selects a readable data file.

The columns in the data file are written into vectors. (If the data files contain three columns, level, temperature and pressure.

The data is then plotted into height, temperature, and pressure graphs on the GUI.

Where total mean and standard deviation for each plot is calculated and presented into numerical indicators (in fact status bars are used displaying number as string). The TH1 class is used to calculate mean and RMS value that is said to be equal to estimated standard deviation.

If real measurements files are lacking, the program can create pseudo data.

Push the "Test data" button, and the program writes then the signal into arrays and thereafter into "pseudodata.txt" in the “ROTsys” directory .

The “Pring gr

Random numbers are implemented to generate some measurements noise and randomness in signal behavior.

The main frame or program window is fixed into 1024x768, that is regarded as minimum screen resolution.


The code is based on a ROOT example script, statusBar.C:

https://root.cern.ch/root/html/tutorials/gui/statusBar.C.html


A screen-shoot of tankmonitor.cpp running is placed underneath, with operator file buttons to left, graphs in center and indicators to right:




Summary:

A good upgrade for this code would be;

- adjustable main frame with floating canvas and sub-frames/buttons/indicators.

- possibility to handle "live" measurement data, more or less directly from the instruments via communication protocols.

- multi-graph possibility, in order to evaluate and compare different graph plots.


Lesson learned:

GUI programming is time demanding, steels time , otherwise used on programming the data analysis application. GUI also grow code lines fast, making simple scripts unnecessary large.

It is therefore recommended to avoid GUI when there is no demand or need for that interface.

For the experienced user ROOT's Command Line Interface is powerful and more time efficient, compared to Graphical User Interface .



--- End of Page ---