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

Use class SHPC in function `comp_ishape`

parent 53bbb4a7
No related branches found
No related tags found
No related merge requests found
......@@ -84,20 +84,17 @@ class SHPC_class:
return self._n_shapes[i_slice][orientation]
def comp_ishape(handler, date, eddy_index):
"""Compute the location in the shapefiles. handler should be a
dictionary returned by open_shpc.
def comp_ishape(date, eddy_index, SHPC, i_slice, orientation):
"""Compute the location in the shapefiles."""
"""
assert date >= SHPC.d_init[i_slice]
assert date >= handler["d_init"]
if date == handler["d_init"]:
if date == SHPC.d_init[i_slice]:
ishape = eddy_index - 1
else:
# date > handler["d_init"]
ishape = handler["ishape_last"][date - handler["d_init"] - 1] \
+ eddy_index
# date > SHPC.d_init[i_slice]
ishape = SHPC.get_ishape_last(i_slice, orientation)\
[date - SHPC.d_init[i_slice] - 1] + eddy_index
return ishape
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment