Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pyicon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Fraser William Goldsworth
pyicon
Commits
763d0400
Commit
763d0400
authored
2 months ago
by
Nils Brüggemann
Committed by
Fraser William Goldsworth
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
pyic_view: Cleaning up comments.
parent
1ae1bac8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/pyic_view.py
+1
-38
1 addition, 38 deletions
scripts/pyic_view.py
with
1 addition
and
38 deletions
scripts/pyic_view.py
+
1
−
38
View file @
763d0400
...
...
@@ -31,9 +31,6 @@ def generate_axes(asp, generate_figure=True):
axw0
=
axh0
*
figh
/
figw
/
asp0
ax
=
fig
.
add_subplot
(
position
=
(
x0
,
y0
,
axw0
,
axh0
))
#asp = ax.get_position().height*fig.get_figheight() / ( ax.get_position().width*fig.get_figwidth() )
#print(asp)
# colorbar
daxcax
=
0.02
caxw
=
0.04
...
...
@@ -150,23 +147,9 @@ class view(object):
# Create figure and axis
self
.
fig
,
self
.
ax
,
self
.
cax
=
generate_axes
(
asp
=
0.5
)
#asp = 0.5
#proj = ccrs.PlateCarree()
#proj = None
#print(f'Font size: {self.font_size}')
#plt.rcParams.update({'font.size': self.font_size})
#P = pyic.Plot(1, 1,
# fig_size_fac=self.fig_size_fac,
# asp=asp, projection=proj, axlab_kw=None,
#)
#self.ax, self.cax = P.next()
#self.fig = plt.gcf()
#self.pos_ax = self.ax.get_position()
print
(
'
------
'
)
print
(
self
.
fig
.
get_size_inches
())
print
(
self
.
ax
.
get_position
())
self
.
pos_cax
=
self
.
cax
.
get_position
()
#self.make_new_axis()
# TK canvas
self
.
canvas
=
FigureCanvasTkAgg
(
self
.
fig
,
master
=
root
)
...
...
@@ -306,13 +289,6 @@ class view(object):
parallel
=
True
,
)
# #run = 'nib2704'
# #path_data = f'/work/mh0033/m300602/proj_vmix/icon/icon_27_enbal/feature_momentum_diagnostics_MID_POINT_DUAL_EDGE/build/gcc/experiments/{run}/'
# run = 'nib2703'
# path_data = f'/Users/nbruegge/work/icon_playground/icon_r2b4_new_test_data/'
# flist = glob.glob(f'{path_data}/{run}_P1M_3d_*.nc')
# flist.sort()
# #flist = flist[1:3]
self
.
ds
=
xr
.
open_mfdataset
(
self
.
flist
,
**
mfdset_kwargs
,
...
...
@@ -347,8 +323,7 @@ class view(object):
self
.
X
,
self
.
Y
=
self
.
Lon
,
self
.
Lat
else
:
self
.
X
,
self
.
Y
=
self
.
transformer
.
transform
(
self
.
Lon
,
self
.
Lat
,
direction
=
'
FORWARD
'
)
#valid = np.isfinite(self.X) & np.isfinite(self.Y)
#self.dai[valid==False] = np.nan
# make plot
valid
=
np
.
isfinite
(
self
.
X
)
&
np
.
isfinite
(
self
.
Y
)
self
.
hm
=
pyic
.
shade
(
...
...
@@ -364,7 +339,6 @@ class view(object):
else
:
self
.
ax
.
set_xlim
(
self
.
X
.
min
(),
self
.
X
.
max
())
self
.
ax
.
set_ylim
(
self
.
Y
.
min
(),
self
.
Y
.
max
())
#pyic.plot_settings(self.ax, xlim=self.lon_reg, ylim=self.lat_reg)
self
.
ax
.
set_facecolor
(
'
0.7
'
)
self
.
update_cmap
()
# set titles
...
...
@@ -406,22 +380,11 @@ class view(object):
asp
=
(
self
.
lat_reg
[
1
]
-
self
.
lat_reg
[
0
])
/
(
self
.
lon_reg
[
1
]
-
self
.
lon_reg
[
0
])
self
.
fig
,
self
.
ax
,
self
.
cax
=
generate_axes
(
asp
,
generate_figure
=
False
)
##proj = ccrs.PlateCarree()
#proj = None
self
.
ax
=
self
.
fig
.
add_subplot
(
position
=
self
.
pos_ax
,
projection
=
proj
)
self
.
ax
.
set_position
(
self
.
pos_ax
)
print
(
'
------
'
)
print
(
self
.
fig
.
get_size_inches
())
print
(
self
.
ax
.
get_position
())
self
.
cax
=
self
.
fig
.
add_subplot
(
position
=
self
.
pos_cax
)
self
.
cax
.
set_position
(
self
.
pos_cax
)
self
.
cax
.
set_xticks
([])
self
.
cax
.
yaxis
.
tick_right
()
self
.
cax
.
yaxis
.
set_label_position
(
"
right
"
)
self
.
plot_data
()
self
.
canvas
.
draw
()
...
...
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