@@ -187,41 +185,35 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -187,41 +185,35 @@ class maskAndFuntionality (BASE, WIDGET):
ncFile.close()
ncFile.close()
defshowInfo(self):
defshowInfo(self):
"""this function is to show the attributes of the groups if the group is clicked and the groups of the groups if the group of the group is clicked and the attributes of the variables if the variable is clicked"""
"""this function shows first the name of the file and the global attributes and then if a varible is clicked delete the info and add the attributes of the selected variable"""
#we get the item that is clicked
#we get the path from the text space
item=self.tree_data.currentItem()
path=self.text_set.text()
#we get the name of the item that is clicked
#we load the netCDF file
itemName=item.text(0)
ncFile=nc.Dataset(path,'r',format='NETCDF4')
#we get the name of the file
#we get the name of the netCDF file to show it in the GUI
fileName=self.text_file.text()
ncFileName=os.path.basename(path)
#we open the netCDF file
#We get the title of the netCDF file
ncFile=Dataset(fileName,"r",format="NETCDF4")
ncFileTitle=ncFile.title
#we get the name of the file without the extension
#we get the global attributes of the netCDF file
ncFileName=os.path.splitext(fileName)[0]
ncFileGlobalAttributes=list(ncFile.ncattrs())
#we set first the name of the file in the QTextBrowser
self.text_info.append('File name: '+ncFileName)
#we get the attributes of the groups if the group is clicked
#we show the name of the file and the global attributes in the QtextBrowser