Skip to content

Commit 91a50de

Browse files
committed
extract ids from network
1 parent 7d237ab commit 91a50de

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/py_eddy_tracker/appli/network.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ def subset_network():
114114
help="Remove short dead end, first is for minimal obs number and second for minimal segment time to keep",
115115
)
116116
parser.add_argument(
117-
"--remove_trash", action="store_true", help="Remove trash (network id == 0)",
117+
"--remove_trash",
118+
action="store_true",
119+
help="Remove trash (network id == 0)",
118120
)
119121
parser.add_argument(
120122
"-p",
@@ -124,8 +126,18 @@ def subset_network():
124126
help="Start day and end day, if it's a negative value we will add to day min and add to day max,"
125127
"if 0 it is not used",
126128
)
129+
parser.add_argument(
130+
"-i",
131+
"--ids",
132+
nargs='*',
133+
type=int,
134+
help="network ids to extract",
135+
)
136+
127137
args = parser.parse_args()
128138
n = NetworkObservations.load_file(args.input, raw_data=True)
139+
if args.ids:
140+
n = n.networks(args.ids)
129141
if args.length is not None:
130142
n = n.longer_than(*args.length)
131143
if args.remove_dead_end is not None:

0 commit comments

Comments
 (0)