Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
brivas
ORCHESTRA-SST
Commits
770b874d
Commit
770b874d
authored
4 years ago
by
Beatriz Recinos
Browse files
Options
Download
Email Patches
Plain Diff
added other plot functions and notebook
parent
88cc733e
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68080 additions
and
0 deletions
+68080
-0
README.md
README.md
+1
-0
notebooks/cci_at_buoy_coord_results.ipynb
notebooks/cci_at_buoy_coord_results.ipynb
+68024
-0
sst_tools/plot_sst.py
sst_tools/plot_sst.py
+55
-0
No files found.
README.md
View file @
770b874d
...
...
@@ -7,6 +7,7 @@ The code reads, organises and plot daily SST data from The ESA-CCI Sea Surface T
Repository structure:
-
`config.ini`
: paths to the data
-
`notebooks`
: jupyter-notebooks to show results
-
`sst_tools`
: tools to read, process and plot the data
-
`scripts`
: python scripts to run the workflow
-
`src`
: SLURM scripts to send the jobs in JASMIN
...
...
This diff is collapsed.
Click to expand it.
notebooks/cci_at_buoy_coord_results.ipynb
0 → 100644
View file @
770b874d
This diff is collapsed.
Click to expand it.
sst_tools/plot_sst.py
View file @
770b874d
import
logging
import
salem
import
pyproj
import
matplotlib.pyplot
as
plt
from
matplotlib
import
colorbar
import
cartopy.crs
as
crs
...
...
@@ -54,3 +56,56 @@ def plot_sst_map(sst_data, ax, vmin=None, vmax=None, cbar=True):
ax
.
add_feature
(
cartopy
.
feature
.
LAND
,
color
=
'black'
)
return
{}
def
plot_sst_on_salem_map
(
ds
,
t
,
lon_xinterval
=
0.5
,
lat_yinterval
=
0.5
):
""" plots re-gridded sst data with Salem
Parameters
----------
ds : xarray of sst data
t: time slice
lon_xinterval: longitude interval for x-axis
lat_yinterval: latitude interval for y-axis
Returns
-------
sm : Salem.Map
"""
sm
=
ds
.
isel
(
time
=
t
).
salem
.
get_map
(
countries
=
True
)
sm
.
set_data
(
ds
.
analysed_sst
.
isel
(
time
=
t
))
sm
.
set_data
(
ds
.
analysed_sst
.
isel
(
time
=
t
))
sm
.
set_lonlat_contours
(
xinterval
=
lon_xinterval
,
yinterval
=
lat_yinterval
)
sm
.
set_cmap
(
'RdBu_r'
)
return
sm
def
plot_stats_on_salem_map
(
ds
,
var
,
t
,
lon_xinterval
=
0.5
,
lat_yinterval
=
0.5
):
""" plots re-gridded data with Salem
Parameters
----------
ds : xarray of re-gridded data
var: string with the variable name to plot
t: time slice
lon_xinterval: longitude interval for x-axis
lat_yinterval: latitude interval for y-axis
Returns
-------
sm : Salem.Map
"""
if
var
==
'buoy_count'
:
cmap
=
'Purples'
elif
var
==
'analysed_sst_std'
:
cmap
=
'Greens'
else
:
cmap
=
'RdBu_r'
sm
=
ds
.
isel
(
time
=
t
).
salem
.
get_map
(
countries
=
True
)
sm
.
set_data
(
ds
[
var
].
isel
(
time
=
t
))
sm
.
set_data
(
ds
[
var
].
isel
(
time
=
t
))
sm
.
set_lonlat_contours
(
xinterval
=
lon_xinterval
,
yinterval
=
lat_yinterval
)
sm
.
set_cmap
(
cmap
)
return
sm
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment