Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Oceano2python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
US191
Oceano2python
Commits
54e75bf5
Commit
54e75bf5
authored
5 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
update during Seamount02 cruise. Define parameters first at the beginning script
parent
29fd98a8
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
plots/plot_scatter_tsg_using_basemap_SSPS.py
+20
-10
20 additions, 10 deletions
plots/plot_scatter_tsg_using_basemap_SSPS.py
plots/plot_scatter_tsg_using_basemap_SSTP.py
+20
-10
20 additions, 10 deletions
plots/plot_scatter_tsg_using_basemap_SSTP.py
with
40 additions
and
20 deletions
plots/plot_scatter_tsg_using_basemap_SSPS.py
+
20
−
10
View file @
54e75bf5
...
...
@@ -8,9 +8,19 @@ import csv
from
mpl_toolkits.basemap
import
Basemap
file
=
'
OS_PIRATA-FR29_TSG.nc
'
ncpath
=
'
.
'
path
=
'
png
'
file
=
'
OS_SEAMOUNT02_TSG.nc
'
ncpath
=
'
../netcdf/
'
path
=
''
latmin
=
-
25.
latmax
=
-
20.
lat_ticks
=
1
lonmin
=
165.
lonmax
=
170.
lon_ticks
=
1
# resolution to use. Can be c (crude), l (low), i (intermediate), h (high), f (full) or None
resolution
=
'
i
'
minvalue
=
34
maxvalue
=
36
ncfile
=
os
.
path
.
join
(
ncpath
,
file
)
nc
=
Dataset
(
ncfile
,
mode
=
'
r
'
)
...
...
@@ -22,22 +32,22 @@ LATITUDE = nc.variables['LATITUDE']
LONGITUDE
=
nc
.
variables
[
'
LONGITUDE
'
]
CM
=
nc
.
cycle_mesure
plt
.
title
(
'
{}
-
{}
'
.
format
(
CM
,
SSPS
.
long_name
))
plt
.
title
(
'
{}
\n
{} (
{}
)
'
.
format
(
CM
,
SSPS
.
name
,
SSPS
.
long_name
))
plt
.
ylabel
(
'
{}
'
.
format
(
LATITUDE
.
standard_name
),
labelpad
=
30
)
plt
.
xlabel
(
'
{}
'
.
format
(
LONGITUDE
.
standard_name
),
labelpad
=
20
)
# setup mercator map projection.
m
=
Basemap
(
llcrnrlon
=-
30.
,
llcrnrlat
=-
12.
,
urcrnrlon
=
15.
,
urcrnrlat
=
19.
,
\
m
=
Basemap
(
llcrnrlon
=
lonmin
,
llcrnrlat
=
latmin
,
urcrnrlon
=
lonmax
,
urcrnrlat
=
latmax
,
\
rsphere
=
(
6378137.00
,
6356752.3142
),
\
resolution
=
'
l
'
,
projection
=
'
merc
'
,
\
lat_0
=
40
.
,
lon_0
=-
20
.
,
lat_ts
=
2
0.
)
resolution
=
resolution
,
projection
=
'
merc
'
)
#
lat_0=
-22
.,lon_0=-
168
.,lat_ts=0.)
m
.
drawcoastlines
()
m
.
fillcontinents
()
# draw parallels
m
.
drawparallels
(
np
.
arange
(
-
90
,
90
,
6
),
labels
=
[
1
,
1
,
0
,
1
])
m
.
drawparallels
(
np
.
arange
(
-
90
,
90
,
lat_ticks
),
labels
=
[
1
,
1
,
0
,
1
])
# draw meridians
m
.
drawmeridians
(
np
.
arange
(
-
180
,
180
,
8
),
labels
=
[
1
,
1
,
0
,
1
])
m
.
drawmeridians
(
np
.
arange
(
-
180
,
180
,
lon_ticks
),
labels
=
[
1
,
1
,
0
,
1
])
x
,
y
=
m
(
LONGITUDE
[:],
LATITUDE
[:])
plt
.
scatter
(
x
,
y
,
c
=
SSPS
[:],
s
=
30
,
cmap
=
'
jet
'
,
vmin
=
32
,
vmax
=
37
)
plt
.
scatter
(
x
,
y
,
c
=
SSPS
[:],
s
=
30
,
cmap
=
'
jet
'
,
vmin
=
minvalue
,
vmax
=
maxvalue
)
plt
.
colorbar
(
orientation
=
'
vertical
'
,
shrink
=
0.8
,
aspect
=
20
,
fraction
=
0.05
,
pad
=
0.12
)
figname
=
'
{}_TSG_COLCOR_SCATTER_{}.png
'
.
format
(
CM
,
SSPS
.
standard_name
)
dest
=
os
.
path
.
join
(
path
,
figname
)
...
...
This diff is collapsed.
Click to expand it.
plots/plot_scatter_tsg_using_basemap_SSTP.py
+
20
−
10
View file @
54e75bf5
...
...
@@ -8,9 +8,19 @@ import csv
from
mpl_toolkits.basemap
import
Basemap
file
=
'
OS_PIRATA-FR29_TSG.nc
'
ncpath
=
'
.
'
path
=
'
png
'
file
=
'
OS_SEAMOUNT02_TSG.nc
'
ncpath
=
'
../netcdf/
'
path
=
''
latmin
=
-
25.
latmax
=
-
20.
lat_ticks
=
1
lonmin
=
165.
lonmax
=
170.
lon_ticks
=
1
# resolution to use. Can be c (crude), l (low), i (intermediate), h (high), f (full) or None
resolution
=
'
i
'
minvalue
=
22
maxvalue
=
25
ncfile
=
os
.
path
.
join
(
ncpath
,
file
)
nc
=
Dataset
(
ncfile
,
mode
=
'
r
'
)
...
...
@@ -22,22 +32,22 @@ LATITUDE = nc.variables['LATITUDE']
LONGITUDE
=
nc
.
variables
[
'
LONGITUDE
'
]
CM
=
nc
.
cycle_mesure
plt
.
title
(
'
{}
-
{}
'
.
format
(
CM
,
SSTP
.
long_name
))
plt
.
title
(
'
{}
\n
{} (
{}
)
'
.
format
(
CM
,
SSTP
.
name
,
SSTP
.
long_name
))
plt
.
ylabel
(
'
{}
'
.
format
(
LATITUDE
.
standard_name
),
labelpad
=
30
)
plt
.
xlabel
(
'
{}
'
.
format
(
LONGITUDE
.
standard_name
),
labelpad
=
20
)
# setup mercator map projection.
m
=
Basemap
(
llcrnrlon
=-
30.
,
llcrnrlat
=-
12.
,
urcrnrlon
=
15.
,
urcrnrlat
=
19.
,
\
m
=
Basemap
(
llcrnrlon
=
lonmin
,
llcrnrlat
=
latmin
,
urcrnrlon
=
lonmax
,
urcrnrlat
=
latmax
,
\
rsphere
=
(
6378137.00
,
6356752.3142
),
\
resolution
=
'
l
'
,
projection
=
'
merc
'
,
\
lat_0
=
40.
,
lon_0
=-
20.
,
lat_ts
=
20.
)
resolution
=
resolution
,
projection
=
'
merc
'
)
#
lat_0=40.,lon_0=-20.,lat_ts=20.)
m
.
drawcoastlines
()
m
.
fillcontinents
()
# draw parallels
m
.
drawparallels
(
np
.
arange
(
-
90
,
90
,
6
),
labels
=
[
1
,
1
,
0
,
1
])
m
.
drawparallels
(
np
.
arange
(
-
90
,
90
,
lat_ticks
),
labels
=
[
1
,
1
,
0
,
1
])
# draw meridians
m
.
drawmeridians
(
np
.
arange
(
-
180
,
180
,
8
),
labels
=
[
1
,
1
,
0
,
1
])
m
.
drawmeridians
(
np
.
arange
(
-
180
,
180
,
lon_ticks
),
labels
=
[
1
,
1
,
0
,
1
])
x
,
y
=
m
(
LONGITUDE
[:],
LATITUDE
[:])
plt
.
scatter
(
x
,
y
,
c
=
SSTP
[:],
s
=
30
,
cmap
=
'
jet
'
,
vmin
=
21
,
vmax
=
32
)
plt
.
scatter
(
x
,
y
,
c
=
SSTP
[:],
s
=
30
,
cmap
=
'
jet
'
,
vmin
=
minvalue
,
vmax
=
maxvalue
)
plt
.
colorbar
(
orientation
=
'
vertical
'
,
shrink
=
0.8
,
aspect
=
20
,
fraction
=
0.05
,
pad
=
0.12
)
figname
=
'
{}_TSG_COLCOR_SCATTER_{}.png
'
.
format
(
CM
,
SSTP
.
standard_name
)
dest
=
os
.
path
.
join
(
path
,
figname
)
...
...
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