Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EBVCubeVisualizerPlugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
no67wuwu
EBVCubeVisualizerPlugin
Commits
20cffd67
Commit
20cffd67
authored
Oct 11, 2022
by
Emmanuel Heriberto Oceguera Conchas
Browse files
Options
Downloads
Patches
Plain Diff
modul netCDF4 does not work
parent
f0e01648
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
netCDFVisualizer.ui
+2
-2
2 additions, 2 deletions
netCDFVisualizer.ui
netCDF_visualizer.py
+11
-9
11 additions, 9 deletions
netCDF_visualizer.py
netCDF_visualizer_funtionality.py
+19
-2
19 additions, 2 deletions
netCDF_visualizer_funtionality.py
with
32 additions
and
13 deletions
netCDFVisualizer.ui
+
2
−
2
View file @
20cffd67
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
<rect>
<rect>
<x>
0
</x>
<x>
0
</x>
<y>
0
</y>
<y>
0
</y>
<width>
771
</width>
<width>
389
</width>
<height>
835
</height>
<height>
518
</height>
</rect>
</rect>
</property>
</property>
<property
name=
"windowTitle"
>
<property
name=
"windowTitle"
>
...
...
This diff is collapsed.
Click to expand it.
netCDF_visualizer.py
+
11
−
9
View file @
20cffd67
...
@@ -135,22 +135,24 @@ class netCDFVisualizer:
...
@@ -135,22 +135,24 @@ class netCDFVisualizer:
#when we click the plugin in QGIS the plugin will be loaded
#when we click the plugin in QGIS the plugin will be loaded
def
initGui
(
self
):
def
initGui
(
self
):
"""
Create the menu entries and toolbar icons inside the QGIS GUI.
"""
"""
Create the menu entries and toolbar icons inside the QGIS GUI.
"""
icon_path
=
'
:/plugins/netCDFVisualizer/
icon
.png
'
icon_path
=
'
:/plugins/netCDFVisualizer/
adventure
.png
'
self
.
add_action
(
self
.
add_action
(
icon_path
,
icon_path
,
text
=
self
.
tr
(
u
'
netCDFVisualizer
'
),
text
=
self
.
tr
(
u
'
netCDFVisualizer
'
),
callback
=
self
.
callMask
,
callback
=
self
.
callMask
,
parent
=
self
.
iface
.
mainWindow
())
parent
=
self
.
iface
.
mainWindow
())
#when we close the plugin in QGIS the plugin will be unloaded
#when we close the plugin in QGIS the plugin will be unloaded
def
unload
(
self
):
def
unload
(
self
):
#we remove the menu item
"""
Removes the plugin menu item and icon from QGIS GUI.
"""
self
.
iface
.
removePluginMenu
(
'
netCDFVisualizer
'
,
self
.
pluginButton
)
for
action
in
self
.
actions
:
#we remove the menu item
self
.
iface
.
removePluginMenu
(
self
.
iface
.
removeToolBarIcon
(
self
.
pluginButton
)
self
.
tr
(
u
'
&netCDFVisualizer
'
),
action
)
self
.
iface
.
removeToolBarIcon
(
action
)
else
:
self
.
toolbar
.
removeAction
(
action
)
#we create a function to call the mask
#we create a function to call the mask
def
callMask
(
self
):
def
callMask
(
self
):
...
...
This diff is collapsed.
Click to expand it.
netCDF_visualizer_funtionality.py
+
19
−
2
View file @
20cffd67
...
@@ -34,7 +34,8 @@ import os
...
@@ -34,7 +34,8 @@ import os
#to import general tools from QGIS we need the qgis.core module
#to import general tools from QGIS we need the qgis.core module
from
qgis.core
import
*
from
qgis.core
import
*
#for loading the netCDF files we need the netCDF4 module
#for loading the netCDF files we need the netCDF4 module
import
netCDF4
as
nc
from
netCDF4
import
Dataset
#we create the path to the ui file
#we create the path to the ui file
#Path to the Ordner where the ui file is
#Path to the Ordner where the ui file is
ncvPath
=
os
.
path
.
dirname
(
__file__
)
#the comand dirname gives the path to the directory where the file is
ncvPath
=
os
.
path
.
dirname
(
__file__
)
#the comand dirname gives the path to the directory where the file is
...
@@ -58,6 +59,8 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -58,6 +59,8 @@ class maskAndFuntionality (BASE, WIDGET):
"""
Here is the place for the Clicked Signal
"""
"""
Here is the place for the Clicked Signal
"""
self
.
btn_closePlugin
.
clicked
.
connect
(
self
.
closePlugin
)
self
.
btn_closePlugin
.
clicked
.
connect
(
self
.
closePlugin
)
self
.
btn_inputFile
.
clicked
.
connect
(
self
.
importData
)
self
.
btn_inputFile
.
clicked
.
connect
(
self
.
importData
)
self
.
btn_remove
.
clicked
.
connect
(
self
.
removePath
)
self
.
btn_load
.
clicked
.
connect
(
self
.
loadNetCDF
)
def
closePlugin
(
self
):
def
closePlugin
(
self
):
...
@@ -77,6 +80,20 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -77,6 +80,20 @@ class maskAndFuntionality (BASE, WIDGET):
#we remove the path from the text space
#we remove the path from the text space
self
.
text_set
.
clear
()
self
.
text_set
.
clear
()
def
loadNetCDF
(
self
):
"""
This function loads the netCDF file
"""
#we get the path from the text space
path
=
self
.
text_set
.
text
()
#we load the netCDF file
self
.
nc
=
Dataset
(
path
,
'
r
'
,
format
=
'
NETCDF4
'
)
#we get the name of the variables
self
.
variables
=
self
.
nc
.
variables
.
keys
()
#we set the name of the variables in the combo box
self
.
txt_tab_dataSet
.
addItems
(
self
.
variables
)
#we get the name of the dimensions
self
.
dimensions
=
self
.
nc
.
dimensions
.
keys
()
#we set the name of the dimensions in the combo box
self
.
txt_tab_dataSet
.
addItems
(
self
.
dimensions
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment