Commit 79b374bd authored by Yan's avatar Yan
Browse files

VERSION 0.0.37

* Export TimTOF working
* everything seems fine
* BUGS TO BE EXPECTED
* TODO:CHECK FUNCTIONALITY ON KNOWN DATASETS
parent 2194b3b7
......@@ -13,7 +13,7 @@ from . import zcetools_help
from . import reactivitytools
__version__ = "0.0.36"
__version__ = "0.0.37"
__all__ = ['config', 'datatools', 'docks', 'drltools', 'drltoos_gui', 'filetools',
......
......@@ -7,6 +7,7 @@ from PyQt5 import QtWidgets
from PyQt5 import QtGui
import matplotlib
import numpy as np
import prasopes.datasets as ds
import prasopes.datatools as dt
import prasopes.graphtools as gt
import prasopes.filetools as ft
......@@ -33,7 +34,7 @@ def update_profile(table, row, dataset):
"""parent table profile spectrum updating procedure"""
logger.debug("updating parent table row {} profile".format(row))
# Dont do anything to graph when the spectrum is not populated
if not dataset:
if not dataset or isinstance(dataset, ds.ThermoRawDataset):
return
spectrum = table.cellWidget(row, 5).figure.get_axes()[0]
spectrum.clear()
......@@ -123,6 +124,25 @@ def remove_rows(ionstable, rows=None):
return
def export_dial(augCanvas, grph):
"""exports the reactivity into the .dat file format"""
if not augCanvas.ds or isinstance(augCanvas.ds, ds.ThermoRawDataset):
QtWidgets.QMessageBox.warning(
None, "Export spectrum",
"Nothing to export, cancelling request")
return
exp_f_name = ft.get_save_filename(
"Export spectrum", "dat table (*.dat)", "dat", None)
if exp_f_name != '':
names = ["time", "intensity"]
units = ["sec??", ""]
description = os.path.basename(augCanvas.ds.filename) + " " +\
" -- ".join([line._label for line in grph.get_lines()])
expf = open(exp_f_name, 'w')
expf.write(dt.specttostr(grph, " ", names, units, description))
expf.close
def main_window(parent, augCanvas, update_signal):
reactlabels = dict(name="", xlabel="$time (??seconds??)\ \\it→$",
ylabel="$Intensity\ \\it→$")
......@@ -174,8 +194,8 @@ def main_window(parent, augCanvas, update_signal):
rmbtn.clicked.connect(lambda: remove_rows(ionstable))
expbtn = QtWidgets.QPushButton("Export")
"""expbtn.clicked.connect(lambda: export_dial(
augCanvas, drls, dialspect, reactlabels, parselect))"""
expbtn.clicked.connect(lambda: export_dial(
augCanvas, dialspect))
buttlayout = QtWidgets.QHBoxLayout()
buttlayout.addWidget(updatebtn)
......
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