Commit 7e4630a2 authored by Michael Rudolf's avatar Michael Rudolf
Browse files

Fixes in GUI Script

- Fixed the import statements which was overseen previously.
- Updated README with new version.
parent 8830a539
# RST Evaluation
Scripts for analysing shear experiments from the Schulze RST.pc01 ring shear tester.
# Quick Guide to rst-evaluation
## Quick Guide to rst-evaluation
The software `rst-evaluation` is a series of scripts to semi-automatically
evaluate shear experiments done at the Helmholtz Laboratory for Tectonic
Modelling. In principle, it may be used for other measurements done in a
similar setup, but it was build with our standardized workflow in mind.
# Installation / Download
## Windows Installer
## Installation / Download
### Windows Installer
Download the latest Windows release: [setup_RST_pick_GUI.exe](/uploads/fe1418e420e8235d6f473020e8751484/setup_RST_pick_GUI.exe)
## Linux or Windows Command Line (without sample data)
### Linux or Windows Command Line (without sample data)
To install for Linux or to use it from a Windows command line we advise to
install the the software using pip:
......@@ -19,22 +24,35 @@ install the the software using pip:
To run the GUI-Version:
`python -m RSTpicking.RST_pick_GUI`
```bash
rstevaluation
```
if the Python script folder is on your `$PATH$` variable, alternatively
```bash
python -m rstevaluation
```
should work for all systems (in some cases you need to use `python3`).
Using this version you can also access the functions for your personal project,
for example by using:
Using this version you can also access the functions for your personal project
by using:
```Python
import RSTpicking.RST_Func as rnfc
import rstevaluation.tools.analysis
```
## Linux or Windows Command Line (with sample data)
### Linux or Windows Command Line (with sample data)
Download the repository and run the scripts as needed.
The main scripts are located in RSTpicking and to run the scripts you should
use `python RST_main.py` (Windows) or `python3 RST_main.py` (Unix). That will
open a GUI providing the necessary details to open data files and analyse full
folders.
## RSTpicking
### RSTpicking
The software features several independent components that can be used for file
conversion, manual picking, analysis or a fully featured analysis.
......@@ -45,18 +63,20 @@ makes use of a user interface and allows the user to easily change the
parameters and projects. `RST_main.py` is an older version that is less
flexible and requires the user to manually edit the settings in the script.
## Other Components
### Other Components
For a more detailed description of the other components see the
[Documentation](https://gitext.gfz-potsdam.de/analab-code/rst-evaluation/blob/master/Documentation/)
and the readme files in the individual folders.
# Acknowledgements
## Acknowledgements
The original scripts for version 0.0.1 (4260ec45) in this repository have been provided by M. Warsitzka @warsitzka_at_ig.cas.cz and contain scripts that have been developed by M. Ritter.
Warsitzka, Michael; Ge, Zhiyuan; Schönebeck, Jan-Michael; Pohlenz, Andre; Kukowski, Nina (2019): Ring-shear test data of foam glass beads used for analogue experiments in the Helmholtz Laboratory for Tectonic Modelling (HelTec) at the GFZ German Research Centre for Geosciences in Potsdam and the Institute of Geosciences, Friedrich Schiller University Jena. GFZ Data Services. http://doi.org/10.5880/GFZ.4.1.2019.002
# Citation
## Citation
Please cite this repository as:
Rudolf, Michael; Warsitzka, Michael (2021): RST Evaluation - Scripts for analysing shear experiments from the Schulze RST.pc01 ring shear tester. GFZ Data Services. https://doi.org/10.5880/GFZ.4.1.2021.001
......@@ -22,9 +22,12 @@ import sys
import tkinter as tk
import warnings
from pathlib import Path
from tkinter import filedialog
from tkinter import filedialog, messagebox
import rstevaluation.RST_Func as rfnc
import rstevaluation.tools.analysis as rstanalysis
import rstevaluation.tools.files as rstfiles
import rstevaluation.tools.picking as rstpicking
import rstevaluation.tools.plots as rstplots
warnings.filterwarnings("ignore")
log = logging.getLogger()
......@@ -165,7 +168,7 @@ class RST_pick_GUI(tk.Tk):
from ctypes import pointer, windll, wintypes
try:
windll.shcore.SetProcessDpiAwareness(1)
except Exception as _:
except Exception:
logging.info('High-DPI scaling failed')
pass # this will fail on Win Server and maybe early Windows
DPI100pc = 96 # DPI 96 is 100% scaling
......@@ -276,14 +279,14 @@ class RST_pick_GUI(tk.Tk):
]
# Data is stored as a list of dictionaries containing the data
exp_data = [rfnc.convert(path_in, f, Vars) for f in file_list]
exp_data = [rstfiles.convert(path_in, f, Vars) for f in file_list]
if self.is_VST.get() == 0:
if self.rst.get() == 1:
# Evaluate all data sets and store results in a list
if self.rev_pick.get() == 1:
eval_data = [
rfnc.eval_shearstress(
rstpicking.eval_shearstress(
cur_dat,
Vars,
review='auto'
......@@ -292,14 +295,14 @@ class RST_pick_GUI(tk.Tk):
]
else:
eval_data = [
rfnc.eval_shearstress(cur_dat, Vars)
rstpicking.eval_shearstress(cur_dat, Vars)
for cur_dat in exp_data
]
print('Automatic analysis successful')
else:
print('Automatic analysis skipped, initiating manual picking')
eval_data = [
rfnc.eval_shearstress(cur_dat, Vars, review='manual')
rstpicking.eval_shearstress(cur_dat, Vars, review='manual')
for cur_dat in exp_data
]
......@@ -315,23 +318,23 @@ class RST_pick_GUI(tk.Tk):
# ==========ANALYSIS OF FRICTION COEFFICIENTS AND COHESIONS=======
# ===========Analysis 1: Mutual linear regression=================
peakfric_mut, peakdata_mut = rfnc.rst_analmut(
peakfric_mut, peakdata_mut = rstanalysis.rst_analmut(
normal_stress,
peak_stress
)
dynfric_mut, dyndata_mut = rfnc.rst_analmut(
dynfric_mut, dyndata_mut = rstanalysis.rst_analmut(
normal_stress,
dyn_stress
)
reactfric_mut, reactdata_mut = rfnc.rst_analmut(
reactfric_mut, reactdata_mut = rstanalysis.rst_analmut(
normal_stress,
stat_stress
)
# ===========ANALYSIS 2: Standard regression of all data pairs ==
peakfric_std = rfnc.rst_analstd(normal_stress, peak_stress)
dynfric_std = rfnc.rst_analstd(normal_stress, dyn_stress)
reactfric_std = rfnc.rst_analstd(normal_stress, stat_stress)
peakfric_std = rstanalysis.rst_analstd(normal_stress, peak_stress)
dynfric_std = rstanalysis.rst_analstd(normal_stress, dyn_stress)
reactfric_std = rstanalysis.rst_analstd(normal_stress, stat_stress)
# ==========MERGE DATA===========================================
strength = (normal_stress, peak_stress, dyn_stress,
......@@ -341,50 +344,50 @@ class RST_pick_GUI(tk.Tk):
fric_std = (peakfric_std, dynfric_std, reactfric_std)
# ===================PLOT DATA=====================================
rfnc.plotstd(path_out, projectname, strength, fric_std)
rfnc.plothist(path_out, projectname, strength, data_mut)
rstplots.plotstd(path_out, projectname, strength, fric_std)
rstplots.plothist(path_out, projectname, strength, data_mut)
print('>>> Friction data plotted')
if self.plot_ts.get() == 1:
rfnc.plotts(path_out, projectname, exp_data, normal_stress)
rstplots.plotts(path_out, projectname, exp_data, normal_stress)
print('>>> Time series data plotted')
# ====================Save DATA===================================
if self.rst.get() == 1:
rfnc.saveStrength(path_out, projectname, strength)
rfnc.saveFric(path_out, projectname, fric_mut, fric_std)
lid_pos = rfnc.savelidpos(
path_out,
projectname,
p_ind,
exp_data
)
rstfiles.saveStrength(path_out, projectname, strength)
rstfiles.saveFric(path_out, projectname, fric_mut, fric_std)
# lid_pos = rstfiles.savelidpos(
# path_out,
# projectname,
# p_ind,
# exp_data
# )
print('>>> Friction data saved')
prop_file = [
path_in + f
for f in os.listdir(path_in)
if f.endswith('csv')
]
if prop_file:
print(
'>>> Prop file detected! Starting dilation analysis...'
)
rfnc.dilation(
path_out, projectname,
lid_pos, exp_data,
prop_file[0], self.cfg
)
else:
print('>>> There is no prop file! Going on as usual.')
# prop_file = [
# path_in + f
# for f in os.listdir(path_in)
# if f.endswith('csv')
# ]
# if prop_file:
# print(
# '>>> Prop file detected! Starting dilation analysis...'
# )
# rfnc.dilation(
# path_out, projectname,
# lid_pos, exp_data,
# prop_file[0], self.cfg
# )
# else:
# print('>>> There is no prop file! Going on as usual.')
if self.save_ts.get() == 1:
rfnc.saveTS(path_out, projectname, exp_data, normal_stress)
rstfiles.saveTS(path_out, projectname, exp_data, normal_stress)
print('>>> Time series data saved')
else:
print('Velocity Stepping Test')
for exp in exp_data:
pfit, perr, name_fit = rfnc.vst_analysis(exp)
rfnc.plotVST(path_out, exp, pfit, perr, name_fit)
pfit, perr, name_fit = rstanalysis.vst_analysis(exp)
rstplots.plotVST(path_out, exp, pfit, perr, name_fit)
if sys.platform == "linux" or sys.platform == "linux2":
p = subprocess.Popen(
......@@ -401,7 +404,7 @@ class RST_pick_GUI(tk.Tk):
def closing_menu(self):
"""Shows a confirmation dialogue for closing"""
if tk.messagebox.askyesno('Close Program', 'Quit?'):
if messagebox.askyesno('Close Program', 'Quit?'):
sys.exit(0)
def more_options(self, event):
......
from . import RST_Func, RST_pick_GUI
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