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

Give default value True to argument renumber

parent 9f165e00
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ import shapefile ...@@ -10,7 +10,7 @@ import shapefile
from os import path from os import path
import numpy as np import numpy as np
def filter(input_dir, output_dir, renumber, accept_func): def filter(input_dir, output_dir, accept_func, renumber = True):
with shapefile.Reader(path.join(input_dir, "extremum")) as extremum, \ with shapefile.Reader(path.join(input_dir, "extremum")) as extremum, \
shapefile.Reader(path.join(input_dir, "outermost_contour")) \ shapefile.Reader(path.join(input_dir, "outermost_contour")) \
as outermost_cont, \ as outermost_cont, \
...@@ -79,5 +79,5 @@ if __name__ == "__main__": ...@@ -79,5 +79,5 @@ if __name__ == "__main__":
help = "do not reset indices of eddies", help = "do not reset indices of eddies",
action = "store_true") action = "store_true")
args = parser.parse_args() args = parser.parse_args()
filter(args.input_dir, args.output_dir, not args.keep_indices, filter(args.input_dir, args.output_dir, accept.accept,
accept.accept) not args.keep_indices)
...@@ -15,8 +15,7 @@ my_dir = path.join(sys.argv[1], "Slice_0/Anticyclones") ...@@ -15,8 +15,7 @@ my_dir = path.join(sys.argv[1], "Slice_0/Anticyclones")
for n in range(3): for n in range(3):
date_1 = 20454 + n * 5 date_1 = 20454 + n * 5
accept = functools.partial(in_date_range, date_1 = date_1) accept = functools.partial(in_date_range, date_1 = date_1)
filter.filter(my_dir, f"SHPC/Slice_{n}/Anticyclones", filter.filter(my_dir, f"SHPC/Slice_{n}/Anticyclones", accept_func= accept)
renumber = True, accept_func= accept)
with open("SHPC/n_slices.txt", "w") as f: f.write("3\n") with open("SHPC/n_slices.txt", "w") as f: f.write("3\n")
fname = path.join(sys.argv[1], "grid_nml.txt") fname = path.join(sys.argv[1], "grid_nml.txt")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment