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
Admin message
Authenticating with a password
with git over http
works again
. More information
here
.
Show more breadcrumbs
IPSL
LMD
DPAO
Detection eddies
Commits
abc2f7a5
Commit
abc2f7a5
authored
3 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Add option ishape
parent
e574100d
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/eddy_dump.py
+20
-14
20 additions, 14 deletions
Inst_eddies/Analysis/eddy_dump.py
with
20 additions
and
14 deletions
Inst_eddies/Analysis/eddy_dump.py
+
20
−
14
View file @
abc2f7a5
...
...
@@ -15,25 +15,31 @@ import util_eddies
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
directory
"
,
help
=
"
containing the three shapefiles
"
)
parser
.
add_argument
(
"
-i
"
,
"
--ishape
"
,
type
=
int
)
args
=
parser
.
parse_args
()
reply
=
input
(
"
days_1950, eddy_index = ?
"
).
split
(
"
,
"
)
days_1950
=
int
(
reply
[
0
])
eddy_index
=
int
(
reply
[
1
])
handler
=
util_eddies
.
open_shpc
(
args
.
directory
)
# Find ishape:
if
handler
[
"
ishape_last
"
]
is
None
:
print
(
"
ishape_last not found. Iterating through shapes...
"
)
for
ishape
,
rec
in
enumerate
(
handler
[
"
readers
"
][
"
extremum
"
].
iterRecords
()):
if
rec
[
"
days_1950
"
]
==
days_1950
and
rec
[
"
eddy_index
"
]
==
eddy_index
:
break
else
:
sys
.
exit
(
"
Eddy with this date and index not found
"
)
if
args
.
ishape
:
ishape
=
args
.
ishape
else
:
ishape
=
util_eddies
.
comp_ishape
(
handler
,
days_1950
,
eddy_index
)
reply
=
input
(
"
days_1950, eddy_index = ?
"
).
split
(
"
,
"
)
days_1950
=
int
(
reply
[
0
])
eddy_index
=
int
(
reply
[
1
])
# Find ishape:
if
handler
[
"
ishape_last
"
]
is
None
:
print
(
"
ishape_last not found. Iterating through shapes...
"
)
for
ishape
,
rec
\
in
enumerate
(
handler
[
"
readers
"
][
"
extremum
"
].
iterRecords
()):
if
rec
[
"
days_1950
"
]
==
days_1950
\
and
rec
[
"
eddy_index
"
]
==
eddy_index
:
break
else
:
sys
.
exit
(
"
Eddy with this date and index not found
"
)
else
:
ishape
=
util_eddies
.
comp_ishape
(
handler
,
days_1950
,
eddy_index
)
for
layer
in
[
"
extremum
"
,
"
outermost_contour
"
,
"
max_speed_contour
"
,
"
centroid
"
]:
if
layer
in
handler
[
"
readers
"
]:
...
...
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