Skip to content

Commit 30a3110

Browse files
committed
Give access at several options for EddyId
1 parent 4c55842 commit 30a3110

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/py_eddy_tracker/appli/grid.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,8 @@ def eddy_id(args=None):
8787
parser.add_argument("--height_unit", default=None, help="Force height unit")
8888
parser.add_argument("--speed_unit", default=None, help="Force speed unit")
8989
parser.add_argument("--unregular", action="store_true", help="if grid is unregular")
90-
parser.add_argument(
91-
"--sampling",
92-
default=50,
93-
type=int,
94-
help="Array size used to build contour, first and last point will be the same",
95-
)
90+
help = "Array size used to build contour, first and last point will be the same"
91+
parser.add_argument("--sampling", default=50, type=int, help=help)
9692
parser.add_argument(
9793
"--sampling_method",
9894
default="visvalingam",
@@ -103,14 +99,20 @@ def eddy_id(args=None):
10399
help = "Output will be wrote in zarr"
104100
parser.add_argument("--zarr", action="store_true", help=help)
105101
help = "Indexs to select grid : --indexs time=2, will select third step along time dimensions"
102+
parser.add_argument("--indexs", nargs="*", help=help, action=DictAction)
103+
help = "Number of pixel of grid detection which could be in an eddies, you must specify MIN and MAX."
106104
parser.add_argument(
107-
"--indexs",
108-
nargs="*",
109-
help=help,
110-
action=DictAction,
105+
"--pixel_limit", nargs="+", default=(5, 2000), type=int, help=help
111106
)
107+
help = "Minimal number of amplitude in number of step"
108+
parser.add_argument("--nb_step_min", default=2, type=int, help=help)
112109
args = parser.parse_args(args) if args else parser.parse_args()
113110

111+
if len(args.pixel_limit) != 2:
112+
raise Exception(
113+
"You must define two value minimal number of pixel and maximal number of pixel"
114+
)
115+
114116
cut_wavelength = args.cut_wavelength
115117
nb_cw = len(cut_wavelength)
116118
if nb_cw > 2 or nb_cw == 0:
@@ -123,10 +125,11 @@ def eddy_id(args=None):
123125
kwargs = dict(
124126
step=args.isoline_step,
125127
shape_error=args.fit_errmax,
126-
pixel_limit=(5, 2000),
128+
pixel_limit=args.pixel_limit,
127129
force_height_unit=args.height_unit,
128130
force_speed_unit=args.speed_unit,
129131
nb_step_to_be_mle=0,
132+
nb_step_min=args.nb_step_min,
130133
)
131134

132135
a, c = identification(

0 commit comments

Comments
 (0)