Skip to content

Commit fe26b6e

Browse files
committed
Add option to subsample network
1 parent 652d5ed commit fe26b6e

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

notebooks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# rm build/sphinx/ doc/python_module/ doc/gen_modules/ -rf
2-
# rm doc/_autosummary/ doc/gen_modules - rf
2+
# rm doc/_autosummary/ doc/gen_modules -rf
33
python setup.py build_sphinx
44
rsync -vrltp doc/python_module notebooks/. --include '*/' --include '*.ipynb' --exclude '*' --prune-empty-dirs

src/py_eddy_tracker/appli/network.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@ def subset_network():
7474
help="Nb of day which must be cover by network, first minimum number of day and last maximum number of day,"
7575
"if value is negative, this bound won't be used",
7676
)
77+
parser.add_argument(
78+
"--remove_dead_end",
79+
nargs=2,
80+
type=int,
81+
help="Remove short dead end, first is for minimal obs number and second for minimal segment time to keep",
82+
)
7783
args = parser.parse_args()
7884
n = NetworkObservations.load_file(args.input)
79-
n = n.longer_than(*args.length)
85+
if args.length is not None:
86+
n = n.longer_than(*args.length)
87+
if args.remove_dead_end is not None:
88+
n = n.remove_dead_end(*args.remove_dead_end)
8089
n.write_file(filename=args.out)

0 commit comments

Comments
 (0)