Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymistral
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Aaron Spring
pymistral
Commits
9229f9a0
Commit
9229f9a0
authored
4 years ago
by
Aaron Spring
Browse files
Options
Downloads
Patches
Plain Diff
draw_lon_lat_labels
parent
f2190506
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ci/pymistral.yml
+1
-1
1 addition, 1 deletion
ci/pymistral.yml
pymistral/plot.py
+11
-12
11 additions, 12 deletions
pymistral/plot.py
with
12 additions
and
13 deletions
ci/pymistral.yml
+
1
−
1
View file @
9229f9a0
...
...
@@ -42,4 +42,4 @@ dependencies:
-
pre-commit
-
pytest-lazy-fixture
-
pytest-tldr
+
git+https://github.com/dask/dask-labextension.git
-
git+https://github.com/dask/dask-labextension.git
This diff is collapsed.
Click to expand it.
pymistral/plot.py
+
11
−
12
View file @
9229f9a0
...
...
@@ -85,17 +85,6 @@ class CartopyMap(object):
),
(
xda
.
ndim
,
xda
.
dims
)
single_plot
=
True
if
xda
.
ndim
==
2
else
False
stereo_maps
=
(
ccrs
.
Stereographic
,
ccrs
.
NorthPolarStereo
,
ccrs
.
SouthPolarStereo
,
)
if
isinstance
(
proj
,
stereo_maps
):
raise
ValueError
(
'
Not implemented, see
'
'
https://github.com/luke-gregor/xarray_tools/accessors.py#L222
'
)
# find whether curv or not
curv
=
False
lon
=
None
...
...
@@ -110,6 +99,10 @@ class CartopyMap(object):
assert
lon
,
(
lon
,
xda
.
coords
)
assert
lat
,
(
lat
,
xda
.
coords
)
if
plot_lon_lat_axis
:
draw_labels
=
True
else
:
draw_labels
=
False
if
proj
!=
ccrs
.
PlateCarree
():
plot_lon_lat_axis
=
False
...
...
@@ -160,6 +153,12 @@ class CartopyMap(object):
if
plot_lon_lat_axis
:
_set_lon_lat_axis
(
axes
,
proj
)
else
:
gl
=
axes
.
gridlines
(
draw_labels
=
draw_labels
)
gl
.
top_labels
=
False
gl
.
right_labels
=
False
gl
.
xlines
=
False
gl
.
ylines
=
False
if
single_plot
:
if
ax
is
None
:
...
...
@@ -179,7 +178,7 @@ def _rm_singul_lon(ds, lon='lon', lat='lat'):
lons
=
ds
[
lon
].
values
fixed_lons
=
lons
.
copy
()
for
i
,
start
in
enumerate
(
np
.
argmax
(
np
.
abs
(
np
.
diff
(
lons
))
>
180
,
axis
=
1
)):
fixed_lons
[
i
,
start
+
1
:]
+=
360
fixed_lons
[
i
,
start
+
1
:]
+=
360
lons_da
=
xr
.
DataArray
(
fixed_lons
,
ds
[
lat
].
coords
)
ds
=
ds
.
assign_coords
({
lon
:
lons_da
})
return
ds
...
...
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