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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
no67wuwu
EBVCubeVisualizerPlugin
Commits
f2e4829e
Commit
f2e4829e
authored
2 years ago
by
Emmanuel Heriberto Oceguera Conchas
Browse files
Options
Downloads
Patches
Plain Diff
updated
parent
638729e2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
netCDF_visualizer_funtionality.py
+36
-11
36 additions, 11 deletions
netCDF_visualizer_funtionality.py
with
36 additions
and
11 deletions
netCDF_visualizer_funtionality.py
+
36
−
11
View file @
f2e4829e
...
@@ -79,7 +79,9 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -79,7 +79,9 @@ class maskAndFuntionality (BASE, WIDGET):
self
.
btn_load
.
clicked
.
connect
(
self
.
loadNetCDF
)
self
.
btn_load
.
clicked
.
connect
(
self
.
loadNetCDF
)
self
.
btn_remove_sel
.
clicked
.
connect
(
self
.
removeSelection
)
self
.
btn_remove_sel
.
clicked
.
connect
(
self
.
removeSelection
)
self
.
btn_plot
.
clicked
.
connect
(
self
.
plotEbvCube
)
self
.
btn_plot
.
clicked
.
connect
(
self
.
plotEbvCube
)
self
.
#here we set the clicked signal for the tree widget
self
.
tree_data
.
itemClicked
.
connect
(
self
.
showInfo
)
"""
Here is the place for set stzlesheet
"""
"""
Here is the place for set stzlesheet
"""
#self.btn_plot.setStyleSheet("backgrou")
#self.btn_plot.setStyleSheet("backgrou")
...
@@ -206,21 +208,44 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -206,21 +208,44 @@ class maskAndFuntionality (BASE, WIDGET):
self
.
text_info
.
append
(
ncFileName
)
#we show the name of the file
self
.
text_info
.
append
(
ncFileName
)
#we show the name of the file
self
.
text_info
.
append
(
ncFileAttributes
[
i
]
+
"
:
"
+
str
(
ncFileAttributesValue
))
#we show the attributes of the file
self
.
text_info
.
append
(
ncFileAttributes
[
i
]
+
"
:
"
+
str
(
ncFileAttributesValue
))
#we show the attributes of the file
#we close the netCDF file
#we close the netCDF file
ncFile
.
close
()
ncFile
.
close
()
def
showInfo
(
self
):
#we get the path of the netCDF file
path
=
self
.
tree_data
.
currentItem
().
text
(
0
)
#we open the netCDF file
ncFile
=
nc
.
Dataset
(
path
,
'
r
'
,
format
=
'
NETCDF4
'
)
#we get the name of the netCDF file to show it in the GUI
ncFileName
=
os
.
path
.
basename
(
path
)
#We get the title of the netCDF file
ncFileTitle
=
ncFile
.
title
#convert file name and file title into a QTreeWidgetItem
top_level
=
QTreeWidgetItem
([
ncFileName
,
ncFileTitle
])
#we get the variables of the netCDf file
ncFileVariablesName
=
list
(
ncFile
.
variables
.
keys
())
#we get the groups of the file
ncFileGroupsName
=
list
(
ncFile
.
groups
.
keys
())
#we get the attributes of the variables and show them in the QTextBrowser if the variable is clicked
for
i
in
range
(
len
(
ncFileVariablesName
)):
ncFileVariablesNameAttributes
=
list
(
ncFile
.
variables
[
ncFileVariablesName
[
i
]].
ncattrs
())
for
j
in
range
(
len
(
ncFileVariablesNameAttributes
)):
ncFileVariablesNameAttributesValue
=
ncFile
.
variables
[
ncFileVariablesName
[
i
]].
getncattr
(
ncFileVariablesNameAttributes
[
j
])
self
.
text_info
.
append
(
ncFileVariablesNameAttributes
[
j
]
+
"
:
"
+
str
(
ncFileVariablesNameAttributesValue
))
#get the entyties of the variables and set the lon name of the entyties into the QComboBox if the variable is a cube and click on the variable
for
i
in
range
(
len
(
ncFileVariablesName
)):
if
len
(
ncFile
.
variables
[
ncFileVariablesName
[
i
]].
dimensions
)
==
3
:
ncFileVariablesNameEntities
=
list
(
ncFile
.
variables
[
ncFileVariablesName
[
i
]].
dimensions
)
for
j
in
range
(
len
(
ncFileVariablesNameEntities
)):
ncFileVariablesNameEntitiesValue
=
ncFile
.
variables
[
ncFileVariablesName
[
i
]].
getncattr
(
ncFileVariablesNameEntities
[
j
])
self
.
combo_entity
.
addItem
(
ncFileVariablesNameEntities
[
j
])
self
.
combo_entity
.
setItemText
(
j
,
ncFileVariablesNameEntitiesValue
)
#we close the netCDF file
ncFile
.
close
()
def
loadCubeLayer
(
self
):
def
loadCubeLayer
(
self
):
...
...
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