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
ae853d4d
Commit
ae853d4d
authored
2 years ago
by
Emmanuel Oceguera Conchas
Browse files
Options
Downloads
Patches
Plain Diff
the variables lon, lat, etc... in the QTreeWidget has been deleted
parent
5b5f2ca4
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
+23
-34
23 additions, 34 deletions
netCDF_visualizer_funtionality.py
with
23 additions
and
34 deletions
netCDF_visualizer_funtionality.py
+
23
−
34
View file @
ae853d4d
...
@@ -82,6 +82,7 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -82,6 +82,7 @@ class maskAndFuntionality (BASE, WIDGET):
self
.
btn_remove
.
clicked
.
connect
(
self
.
removePath
)
self
.
btn_remove
.
clicked
.
connect
(
self
.
removePath
)
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.tree_data.itemClicked.connect(self.onItemClicked)
"""
Here is the place for set stzlesheet
"""
"""
Here is the place for set stzlesheet
"""
#self.btn_plot.setStyleSheet("backgrou")
#self.btn_plot.setStyleSheet("backgrou")
...
@@ -104,14 +105,19 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -104,14 +105,19 @@ class maskAndFuntionality (BASE, WIDGET):
self
.
text_set
.
clear
()
self
.
text_set
.
clear
()
#we remove the information from the table widget
#we remove the information from the table widget
self
.
tree_data
.
clear
()
self
.
tree_data
.
clear
()
#we remove the information from the listWidget
#we remove the information from the QtextBrowser
#self.column_data.clear()
self
.
text_info
.
clear
()
def
removeSelection
(
self
):
def
removeSelection
(
self
):
"""
this function remove the selection in the tree widget
"""
"""
this function remove the selection in the tree widget
"""
#we remmove the selectec TopLevelItems from the tree widget
#we remmove the selectec TopLevelItems from the tree widget
for
item
in
self
.
tree_data
.
selectedItems
():
for
item
in
self
.
tree_data
.
selectedItems
():
self
.
tree_data
.
takeTopLevelItem
(
self
.
tree_data
.
indexOfTopLevelItem
(
item
))
self
.
tree_data
.
takeTopLevelItem
(
self
.
tree_data
.
indexOfTopLevelItem
(
item
))
else
:
self
.
text_info
.
clear
()
def
loadNetCDF
(
self
):
def
loadNetCDF
(
self
):
...
@@ -139,14 +145,11 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -139,14 +145,11 @@ class maskAndFuntionality (BASE, WIDGET):
#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 get the variables of the file and show then as well as the long name in the tree
for
i
in
range
(
len
(
ncFileVariablesName
)):
child
=
QTreeWidgetItem
([
ncFileVariablesName
[
i
],
ncFile
.
variables
[
ncFileVariablesName
[
i
]].
long_name
])
top_level
.
addChild
(
child
)
#we show the groups of the file in the QTreeWidgetite
#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
],
ncFileGroupsName
[
i
]])
longNameGroups
=
ncFile
.
groups
[
ncFileGroupsName
[
i
]].
standard_name
child
=
QTreeWidgetItem
([
ncFileGroupsName
[
i
],
longNameGroups
])
top_level
.
addChild
(
child
)
top_level
.
addChild
(
child
)
#we get the groups of the groups
#we get the groups of the groups
...
@@ -154,15 +157,17 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -154,15 +157,17 @@ class maskAndFuntionality (BASE, WIDGET):
#we show the groups of the groups in the QTreeWidgetite
#we show the groups of the groups in the QTreeWidgetite
for
j
in
range
(
len
(
ncFileGroupsName2
)):
for
j
in
range
(
len
(
ncFileGroupsName2
)):
child2
=
QTreeWidgetItem
([
ncFileGroupsName2
[
j
],
ncFileGroupsName2
[
j
]])
longNameGroups2
=
ncFile
.
groups
[
ncFileGroupsName
[
i
]].
groups
[
ncFileGroupsName2
[
j
]].
long_name
child2
=
QTreeWidgetItem
([
ncFileGroupsName2
[
j
],
longNameGroups2
])
child
.
addChild
(
child2
)
child
.
addChild
(
child2
)
#we get the variables of the groups of the groups
#we get the variables of the groups of the groups
ncFileVariablesName2
=
list
(
ncFile
.
groups
[
ncFileGroupsName
[
i
]].
groups
[
ncFileGroupsName2
[
j
]].
variables
.
keys
())
ncFileVariablesName2
=
list
(
ncFile
.
groups
[
ncFileGroupsName
[
i
]].
groups
[
ncFileGroupsName2
[
j
]].
variables
.
keys
())
#we show the variables of the groups of the groups in the QTreeWidgetite an set the lon name of the variables
#we show the variables of the groups of the groups in the QTreeWidgetite an set the lon name of the variables
for
k
in
range
(
len
(
ncFileVariablesName2
)):
for
k
in
range
(
len
(
ncFileVariablesName2
)):
child3
=
QTreeWidgetItem
([
ncFileVariablesName2
[
k
]])
longNameVariables2
=
ncFile
.
groups
[
ncFileGroupsName
[
i
]].
groups
[
ncFileGroupsName2
[
j
]].
variables
[
ncFileVariablesName2
[
k
]].
long_name
child3
=
QTreeWidgetItem
([
ncFileVariablesName2
[
k
],
longNameVariables2
])
child2
.
addChild
(
child3
)
child2
.
addChild
(
child3
)
...
@@ -175,37 +180,21 @@ class maskAndFuntionality (BASE, WIDGET):
...
@@ -175,37 +180,21 @@ class maskAndFuntionality (BASE, WIDGET):
longNameVariables
=
ncFile
.
groups
[
ncFileGroupsName
[
i
]].
variables
[
ncFileGroupsVariablesName
[
j
]].
long_name
longNameVariables
=
ncFile
.
groups
[
ncFileGroupsName
[
i
]].
variables
[
ncFileGroupsVariablesName
[
j
]].
long_name
child4
=
QTreeWidgetItem
([
ncFileGroupsVariablesName
[
j
],
longNameVariables
])
child4
=
QTreeWidgetItem
([
ncFileGroupsVariablesName
[
j
],
longNameVariables
])
child
.
addChild
(
child4
)
child
.
addChild
(
child4
)
"""
here we are gonna show all information into the GUI
"""
#set all information about the file into the text browser
self
.
textBrowser
.
setText
(
"
File name:
"
+
ncFileName
+
"
\r
"
File
type
:
"
+ ncFile.file_format +
"
\
r
"
File title:
"
+
ncFileTitle
+
"
\r
)
#expand all the data
self
.
tree_data
.
expandAll
()
"""
here we are gonna show all information into the GUI
"""
#set all information about the file into the text browser
self
.
text_info
.
setText
(
"
File name:
"
+
ncFileName
)
# #we set the dimensions in the ListWidget
# self.column_data.addItems(ncFileDimensions)
# #we set the variables in the ListWidget
# 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
#remove the path from the text space
whe the file is loaded
self
.
text_set
.
clear
()
self
.
text_set
.
clear
()
def
plotNetCDF(self
):
#
def
onItemClicked(self, item, col
):
"""
This function plot
s
the
netCDF file
"""
#
"""This function plot the
ebv
"""
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