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
53cd4094
Commit
53cd4094
authored
2 years ago
by
Lionel GUEZ
Browse files
Options
Downloads
Patches
Plain Diff
Add option `--node` to `eddy_dump.py`
parent
1aec1712
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
+14
-5
14 additions, 5 deletions
Inst_eddies/Analysis/eddy_dump.py
with
14 additions
and
5 deletions
Inst_eddies/Analysis/eddy_dump.py
+
14
−
5
View file @
53cd4094
#!/usr/bin/env python3
"""
Dumps to standard output all information on a particular eddy,
specified by date and eddy_index, or by shape index.
specified by date and eddy_index, or by
node index, or by
shape index.
"""
...
...
@@ -12,10 +12,14 @@ import pprint
import
sys
sys
.
path
.
append
(
path
.
join
(
sys
.
path
[
0
],
"
../../Common
"
))
import
util_eddies
import
report_graph
import
json
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
directory
"
,
help
=
"
containing the three shapefiles
"
)
parser
.
add_argument
(
"
-i
"
,
"
--ishape
"
,
type
=
int
)
group
=
parser
.
add_mutually_exclusive_group
()
group
.
add_argument
(
"
-i
"
,
"
--ishape
"
,
type
=
int
)
group
.
add_argument
(
"
-n
"
,
"
--node
"
,
type
=
int
)
args
=
parser
.
parse_args
()
handler
=
util_eddies
.
open_shpc
(
args
.
directory
)
...
...
@@ -23,9 +27,14 @@ handler = util_eddies.open_shpc(args.directory)
if
args
.
ishape
:
ishape
=
args
.
ishape
else
:
reply
=
input
(
"
date, eddy_index = ?
"
).
split
(
"
,
"
)
date
=
int
(
reply
[
0
])
eddy_index
=
int
(
reply
[
1
])
if
args
.
node
:
with
open
(
"
node_id_param.json
"
)
as
f
:
node_id_param
=
json
.
load
(
f
)
date
,
eddy_index
=
report_graph
\
.
node_to_date_eddy
(
args
.
node
,
node_id_param
[
"
e_overestim
"
])
else
:
reply
=
input
(
"
date, eddy_index = ?
"
).
split
(
"
,
"
)
date
=
int
(
reply
[
0
])
eddy_index
=
int
(
reply
[
1
])
# Find ishape:
if
handler
[
"
ishape_last
"
]
is
None
:
...
...
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