Skip to content
Snippets Groups Projects
Commit 0467a7e8 authored by Emmanuel Heriberto Oceguera Conchas's avatar Emmanuel Heriberto Oceguera Conchas
Browse files

we add the child

parent 006d70a5
No related branches found
No related tags found
No related merge requests found
...@@ -109,9 +109,9 @@ class maskAndFuntionality (BASE, WIDGET): ...@@ -109,9 +109,9 @@ class maskAndFuntionality (BASE, WIDGET):
def removeSelection(self): def removeSelection(self):
"""this function remove the selection in the tree widget""" """this function remove the selection in the tree widget"""
#remove the selection in the tree widget #we remmove the selectec TopLevelItems from the tree widget
self.tree_data.clearSelection() for item in self.tree_data.selectedItems():
self.tree_data.takeTopLevelItem(self.tree_data.indexOfTopLevelItem(item))
def loadNetCDF(self): def loadNetCDF(self):
...@@ -134,27 +134,64 @@ class maskAndFuntionality (BASE, WIDGET): ...@@ -134,27 +134,64 @@ class maskAndFuntionality (BASE, WIDGET):
ncFileVariablesName = list(ncFile.variables.keys()) ncFileVariablesName = list(ncFile.variables.keys())
#we get the groups of the file #we get the groups of the file
ncFileGroupsName = list(ncFile.groups.keys()) ncFileGroupsName = list(ncFile.groups.keys())
#we set the top of the tree that it is the name od the file #we set the top of the tree that it is the name od the file
self.tree_data.addTopLevelItem(top_level) self.tree_data.addTopLevelItem(top_level)
"""we shoe the variables of the file in the QTreeWidgetite""" """we show the variables of the file in the QTreeWidgetite"""
for i in range(len(ncFileVariablesName)): for i in range(len(ncFileVariablesName)):
child = QTreeWidgetItem([ncFileVariablesName[i]]) child = QTreeWidgetItem([ncFileVariablesName[i]])
top_level.addChild(child) top_level.addChild(child)
#we show the groups of the file in the QTreeWidgetite
for i in range(len(ncFileGroupsName)): for i in range(len(ncFileGroupsName)):
child = QTreeWidgetItem([ncFileGroupsName[i]]) child = QTreeWidgetItem([ncFileGroupsName[i]])
top_level.addChild(child) top_level.addChild(child)
#we get the groups of the groups
ncFileGroupsName2 = list(ncFile.groups[ncFileGroupsName[i]].groups.keys())
#we show the groups of the groups in the QTreeWidgetite
for j in range(len(ncFileGroupsName2)):
child2 = QTreeWidgetItem([ncFileGroupsName2[j]])
child.addChild(child2)
#we get the variables of the groups of the groups
ncFileVariablesName2 = list(ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables.keys())
#we show the variables of the groups of the groups in the QTreeWidgetite
for k in range(len(ncFileVariablesName2)):
child3 = QTreeWidgetItem([ncFileVariablesName2[k]])
child2.addChild(child3)
#we get the variables of the groups
ncFileGroupsVariablesName = list(ncFile.groups[ncFileGroupsName[i]].variables.keys())
#we show the variables of the groups in the QTreeWidgetite
for j in range(len(ncFileGroupsVariablesName)):
child2 = QTreeWidgetItem([ncFileGroupsVariablesName[j], ncFileGroupsVariablesLongName[j]])
child.addChild(child2)
#we get the long name of the variables
ncFileGroupsVariablesLongName = list(ncFile.groups[ncFileGroupsName[i]].variables[ncFileGroupsVariablesName[j]].long_name)
#we show the long name of the variables in the QTreeWidgetite
for j in range(len(ncFileGroupsVariablesLongName)):
child2 = QTreeWidgetItem([ncFileGroupsVariablesLongName[j]])
child.addChild(child2)
# #we set the dimensions in the ListWidget # #we set the dimensions in the ListWidget
# self.column_data.addItems(ncFileDimensions) # self.column_data.addItems(ncFileDimensions)
# #we set the variables in the ListWidget # #we set the variables in the ListWidget
# self.column_data.addItems(ncFileVariables) # self.column_data.addItems(ncFileVariables)
#we close the netCDF file #we close the netCDF file
ncFile.close() ncFile.close()
#remove the path from the text space
self.text_set.clear()
def plotNetCDF(self):
"""This function plots the netCDF file"""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment