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

Take handler as argument of function `comp_ishape`

Instead of several values of the handler dictionary. Clearer and more concise.
parent 423f3fcc
No related branches found
No related tags found
No related merge requests found
......@@ -3,13 +3,13 @@ import math
from os import path
import numpy as np
def comp_ishape(d_init, ishape_last, days_1950, eddy_index):
k = days_1950 - d_init
def comp_ishape(handler, days_1950, eddy_index):
k = days_1950 - handler["d_init"]
if k == 0:
ishape = eddy_index - 1
else:
ishape = ishape_last[k - 1] + eddy_index
ishape = handler["ishape_last"][k - 1] + eddy_index
return ishape
......
......@@ -33,8 +33,7 @@ if handler["ishape_last"] is None:
else:
sys.exit("Eddy with this date and index not found")
else:
ishape = util_eddies.comp_ishape(handler["d_init"], handler["ishape_last"],
days_1950, eddy_index)
ishape = util_eddies.comp_ishape(handler, days_1950, eddy_index)
for layer in ["extremum", "outermost_contour", "max_speed_contour"]:
shapeRec = handler["readers"][layer].shapeRecord(ishape)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment