Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
Detection eddies
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
IPSL
LMD
DPAO
Detection eddies
Commits
46048161
Commit
46048161
authored
3 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Accept multiple SHPC as command line arguments
parent
3ba95458
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
Inst_eddies/Analysis/plot_eddy_contours.py
+23
-21
23 additions, 21 deletions
Inst_eddies/Analysis/plot_eddy_contours.py
with
23 additions
and
21 deletions
Inst_eddies/Analysis/plot_eddy_contours.py
+
23
−
21
View file @
46048161
...
...
@@ -178,8 +178,8 @@ if __name__ == "__main__":
action
=
"
store_true
"
)
parser
.
add_argument
(
"
--dashed
"
,
action
=
"
store_true
"
,
help
=
"
dashed linestyle, useful for a second snapshot
"
)
parser
.
add_argument
(
"
shpc_dir
"
,
help
=
"
director
y
containing the
"
"
collection of shapefiles
"
)
parser
.
add_argument
(
"
shpc_dir
"
,
help
=
"
director
ies
containing the
"
"
collection
s
of shapefiles
"
,
nargs
=
"
+
"
)
parser
.
add_argument
(
"
--save
"
,
metavar
=
"
format
"
,
help
=
"
Save file to specified format
"
)
args
=
parser
.
parse_args
()
...
...
@@ -225,7 +225,7 @@ if __name__ == "__main__":
ax
.
plot
(
lon_2d
.
reshape
(
-
1
),
lat_2d
.
reshape
(
-
1
),
transform
=
src_crs
,
marker
=
"
+
"
,
color
=
"
gray
"
,
linestyle
=
"
None
"
)
if
args
.
window
is
None
:
plot_grid_bb
(
args
.
shpc_dir
,
ax
)
if
args
.
window
is
None
:
plot_grid_bb
(
args
.
shpc_dir
[
0
]
,
ax
)
if
args
.
velocity
:
with
netCDF4
.
Dataset
(
"
uv.nc
"
)
as
f
:
...
...
@@ -239,28 +239,30 @@ if __name__ == "__main__":
plt
.
quiverkey
(
quiver_return
,
0.9
,
0.9
,
1
,
r
"
1 m s$^{-1}$
"
,
coordinates
=
"
figure
"
)
readers
,
d_init
,
ishape_last
=
util_eddies
.
open_shpc
(
args
.
shpc_dir
)
for
shpc_dir
in
args
.
shpc_dir
:
readers
,
d_init
,
ishape_last
=
util_eddies
.
open_shpc
(
shpc_dir
)
if
ishape_last
is
None
:
print
(
"
We will use all the shapes.
"
)
ishape_last
=
[
len
(
readers
[
"
extremum
"
])
-
1
]
if
len
(
ishape_last
)
==
1
:
if
args
.
date
is
not
None
and
args
.
date
!=
d_init
:
sys
.
exit
(
"
Bad value of option k
"
)
d
=
d_init
else
:
if
args
.
date
is
None
:
print
(
"
No option k, plotting first date:
"
,
d_init
)
if
ishape_last
is
None
:
print
(
f
"
{
shpc_dir
}
: We will use all the shapes.
"
)
ishape_last
=
[
len
(
readers
[
"
extremum
"
])
-
1
]
if
len
(
ishape_last
)
==
1
:
if
args
.
date
is
not
None
and
args
.
date
!=
d_init
:
sys
.
exit
(
f
"
{
shpc_dir
}
: Bad value of option k
"
)
d
=
d_init
else
:
d
=
args
.
date
if
args
.
date
is
None
:
print
(
f
"
{
shpc_dir
}
: No option k, plotting first date:
"
,
d_init
)
d
=
d_init
else
:
d
=
args
.
date
ishape_list
=
select_ishapes
(
d
,
d_init
,
ishape_last
,
readers
[
"
extremum
"
],
args
.
window
)
if
len
(
ishape_list
)
==
0
:
print
(
"
No eddy found
"
)
snapshot
(
ax
,
ishape_list
,
readers
,
dashed
=
args
.
dashed
,
light
=
args
.
light
)
ishape_list
=
select_ishapes
(
d
,
d_init
,
ishape_last
,
readers
[
"
extremum
"
],
args
.
window
)
if
len
(
ishape_list
)
==
0
:
print
(
f
"
{
shpc_dir
}
: No eddy found
"
)
snapshot
(
ax
,
ishape_list
,
readers
,
dashed
=
args
.
dashed
,
light
=
args
.
light
)
ax
.
set_title
(
f
"
d =
{
d
}
"
,
y
=
1.05
)
ax
.
gridlines
(
draw_labels
=
True
)
ax
.
coastlines
()
...
...
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