Skip to content
Snippets Groups Projects
Commit 53cd4094 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Add option `--node` to `eddy_dump.py`

parent 1aec1712
No related branches found
No related tags found
No related merge requests found
#!/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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment