diff --git a/netCDFVisualizer.ui b/netCDFVisualizer.ui index e9160b8e5488a7fbdbe2f1d03773ef566d1d856c..b130dfe5d37ba64dbeeb76f2d82fcecf2860d1b7 100644 --- a/netCDFVisualizer.ui +++ b/netCDFVisualizer.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>1233</width> - <height>800</height> + <height>790</height> </rect> </property> <property name="windowTitle"> @@ -174,7 +174,7 @@ <x>770</x> <y>110</y> <width>411</width> - <height>631</height> + <height>451</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout"> @@ -225,27 +225,86 @@ </item> </layout> </widget> - <widget class="QWidget" name="verticalLayoutWidget"> + <widget class="QLabel" name="label_2"> <property name="geometry"> <rect> - <x>480</x> - <y>750</y> - <width>160</width> - <height>31</height> + <x>790</x> + <y>630</y> + <width>41</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Entity:</string> + </property> + </widget> + <widget class="QPushButton" name="btn_plot"> + <property name="geometry"> + <rect> + <x>920</x> + <y>710</y> + <width>141</width> + <height>23</height> + </rect> + </property> + <property name="styleSheet"> + <string notr="true">selection-background-color: rgb(83, 194, 200);</string> + </property> + <property name="text"> + <string>create ebv_cube plot</string> + </property> + </widget> + <widget class="QLabel" name="label"> + <property name="geometry"> + <rect> + <x>780</x> + <y>590</y> + <width>401</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Create Plot</string> + </property> + </widget> + <widget class="QLabel" name="label_3"> + <property name="geometry"> + <rect> + <x>790</x> + <y>660</y> + <width>41</width> + <height>20</height> + </rect> + </property> + <property name="text"> + <string>Time:</string> + </property> + </widget> + <widget class="QComboBox" name="cbox_entity"> + <property name="geometry"> + <rect> + <x>830</x> + <y>630</y> + <width>91</width> + <height>22</height> + </rect> + </property> + </widget> + <widget class="QComboBox" name="comboBox_2"> + <property name="geometry"> + <rect> + <x>830</x> + <y>660</y> + <width>181</width> + <height>22</height> </rect> </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QPushButton" name="btn_plot"> - <property name="styleSheet"> - <string notr="true">selection-background-color: rgb(83, 194, 200);</string> - </property> - <property name="text"> - <string>create ebv_cube plot</string> - </property> - </widget> - </item> - </layout> </widget> </widget> <resources/> diff --git a/netCDF_visualizer_funtionality.py b/netCDF_visualizer_funtionality.py index 1c7f2935554a3275bb6f22b7333b7276f5f6144f..a3d36e8effa5149d021bf823c1202c617202a7ed 100644 --- a/netCDF_visualizer_funtionality.py +++ b/netCDF_visualizer_funtionality.py @@ -166,6 +166,10 @@ class maskAndFuntionality (BASE, WIDGET): child3 = QTreeWidgetItem([ncFileVariablesName2[k], longNameVariables2]) child2.addChild(child3) + #get the entyties of the variables of the groups of the groups an set the lon name of the entyties into the QComboBox if the variable is a cube and click on the variable + + + #we get the attributes of the variables of the groups of the groups and show them in the QTextBrowser if the variable is clicked if child3.isSelected(): ncFileVariablesName2Attributes = list(ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].ncattrs()) @@ -173,6 +177,7 @@ class maskAndFuntionality (BASE, WIDGET): ncFileVariablesName2AttributesValue = ncFile.groups[ncFileGroupsName[i]].groups[ncFileGroupsName2[j]].variables[ncFileVariablesName2[k]].getncattr(ncFileVariablesName2Attributes[l]) self.text_info.append(ncFileVariablesName2Attributes[l] + ": " + str(ncFileVariablesName2AttributesValue)) + #we get the variables of the groups ncFileGroupsVariablesName = list(ncFile.groups[ncFileGroupsName[i]].variables.keys()) @@ -183,6 +188,7 @@ class maskAndFuntionality (BASE, WIDGET): longNameVariables = ncFile.groups[ncFileGroupsName[i]].variables[ncFileGroupsVariablesName[j]].long_name child4 = QTreeWidgetItem([ncFileGroupsVariablesName[j],longNameVariables]) child.addChild(child4) + #expand all the data self.tree_data.expandAll() @@ -194,28 +200,20 @@ class maskAndFuntionality (BASE, WIDGET): for i in range(len(ncFileAttributes)): ncFileAttributesValue = ncFile.getncattr(ncFileAttributes[i]) self.text_info.append(ncFileAttributes[i] + ": " + str(ncFileAttributesValue)) - + #we close the netCDF file ncFile.close() + + - + def loadMap(self): + """This function loads the variables of groups of the groups into the panel layer of the QGIS if click on the variable""" + + + def plotEbvCube(self): """This function plots the EBV cube if the user select the EBV cube""" - #we get the selected item from the tree widget - item = self.tree_data.selectedItems() - #we get the name of the selected item - name = item[0].text(0) - #we get the path of the netCDF file - path = self.text_set.text() - #we load the netCDF file - ncFile = nc.Dataset(path, 'r', format='NETCDF4') - #we get the EBV cube - ebvCube = ncFile.variables[name][:] - #we plot the EBV cube - plt.imshow(ebvCube) - plt.show() - #we close the netCDF file - ncFile.close() +