mass zero results fixed

adists_release
Youcef AOUAD 2024-11-28 08:31:40 +01:00
parent 49aab685fb
commit 19a3f3d310
4 changed files with 35 additions and 27 deletions

View File

@ -709,6 +709,7 @@ class AdisTSwc(AdisTS):
###print("pol keys: ", pollutants_keys)
###print("t keys: ", timestamps_keys)
###print("phys var: ", phys_data_names)
###print("phys data names mass zero:", list(data_tmp[pollutants_keys[1]][timestamps_keys[0]].keys()))
#print("set timestamps keys: ", set(timestamps_keys))
#print("isma")
###print("iprofiles: ", iprofiles)

View File

@ -64,9 +64,10 @@ class TableModel(PamhyrTableModel):
self._lst = tmp_list
###print("=====table pollutants: ", self._lst)
def __init__(self, **kwargs):
def __init__(self, type_pol, **kwargs):
self._timestamp = 0.0
#####self._type_pol = type_pol
self._type_pol = type_pol
print("typ pol from raw data: ", self._type_pol)
super(TableModel, self).__init__(**kwargs)
def data(self, index, role=Qt.DisplayRole):
@ -110,7 +111,7 @@ class TableModel(PamhyrTableModel):
if self._headers[column] == header_name:
v = self._lst[row].get_ts_key(self._timestamp, "pols")[pol_index][0]
return f"{v:.4f}"
elif self._headers[column] == pol + " Mass" and self._: #####
elif self._headers[column] == pol + " Mass" and self._type_pol==7: #####
print(self._lst[row].get_ts_key(self._timestamp, "pols")[pol_index])
m1 = self._lst[row].get_ts_key(self._timestamp, "pols")[pol_index][1]
m2 = self._lst[row].get_ts_key(self._timestamp, "pols")[pol_index][2]

View File

@ -138,12 +138,12 @@ class ResultsWindowAdisTS(PamhyrWindow):
print("t: ", t)
table = self.find(QTableView, f"tableView_{t}")
self._table[t] = TableModel(
self._type_pol,
table_view=table,
table_headers=self._trad.get_dict(f"table_headers_{t}"),
data=self._results,
undo=self._undo_stack,
opt_data=t,
#####type_pol= self._type_pol,
)
def setup_slider(self):
@ -197,29 +197,35 @@ class ResultsWindowAdisTS(PamhyrWindow):
print("///plot c adists correct")
self.canvas_3 = MplCanvas(width=5, height=4, dpi=100)
self.canvas_3.setObjectName("canvas_3")
self.toolbar_3 = PamhyrPlotToolbar(
self.canvas_3, self, items=[
"home", "move", "zoom", "save",
"iso", "back/forward"
]
)
self.plot_layout_3 = self.find(
QVBoxLayout, "verticalLayout_mass")
self.plot_layout_3.addWidget(self.toolbar_3)
self.plot_layout_3.addWidget(self.canvas_3)
if self._type_pol == 7:
self.canvas_3 = MplCanvas(width=5, height=4, dpi=100)
self.canvas_3.setObjectName("canvas_3")
self.toolbar_3 = PamhyrPlotToolbar(
self.canvas_3, self, items=[
"home", "move", "zoom", "save",
"iso", "back/forward"
]
)
self.plot_layout_3 = self.find(
QVBoxLayout, "verticalLayout_mass")
self.plot_layout_3.addWidget(self.toolbar_3)
self.plot_layout_3.addWidget(self.canvas_3)
self.plot_m = PlotM(
canvas=self.canvas_3,
results=self._results,
reach_id=0,
profile_id=0,
pol_id=0,
trad=self._trad,
toolbar=self.toolbar_3
)
self.plot_m.draw()
self.plot_m = PlotM(
canvas=self.canvas_3,
results=self._results,
reach_id=0,
profile_id=0,
pol_id=0,
trad=self._trad,
toolbar=self.toolbar_3
)
self.plot_m.draw()
else:
print("hear -------------------------------------------------------------------------------")
#self.find(QVBoxLayout, "verticalLayout_mass").setDisabled(True)
self.find(QTabWidget, "tabWidget").setTabVisible(2, False) ###setTabEnabled(2, False)
print("///plot m adists correct")

View File

@ -130,7 +130,7 @@
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab_4">
<attribute name="title">