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 ...@@ -3,13 +3,13 @@ import math
from os import path from os import path
import numpy as np import numpy as np
def comp_ishape(d_init, ishape_last, days_1950, eddy_index): def comp_ishape(handler, days_1950, eddy_index):
k = days_1950 - d_init k = days_1950 - handler["d_init"]
if k == 0: if k == 0:
ishape = eddy_index - 1 ishape = eddy_index - 1
else: else:
ishape = ishape_last[k - 1] + eddy_index ishape = handler["ishape_last"][k - 1] + eddy_index
return ishape return ishape
......
...@@ -33,8 +33,7 @@ if handler["ishape_last"] is None: ...@@ -33,8 +33,7 @@ if handler["ishape_last"] is None:
else: else:
sys.exit("Eddy with this date and index not found") sys.exit("Eddy with this date and index not found")
else: else:
ishape = util_eddies.comp_ishape(handler["d_init"], handler["ishape_last"], ishape = util_eddies.comp_ishape(handler, days_1950, eddy_index)
days_1950, eddy_index)
for layer in ["extremum", "outermost_contour", "max_speed_contour"]: for layer in ["extremum", "outermost_contour", "max_speed_contour"]:
shapeRec = handler["readers"][layer].shapeRecord(ishape) shapeRec = handler["readers"][layer].shapeRecord(ishape)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment