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

Rename to `get_slice` and `i_slice`

Rename `get_SHPC` to `get_slice` and `i_SHPC` to `i_slice`.
parent 488473e0
No related branches found
No related tags found
No related merge requests found
...@@ -55,10 +55,10 @@ def calculate_radii_rossby(properties): ...@@ -55,10 +55,10 @@ def calculate_radii_rossby(properties):
if n_valid_Rossby != 0: avg_Rossby /= n_valid_Rossby if n_valid_Rossby != 0: avg_Rossby /= n_valid_Rossby
return avg_rad, avg_Rossby return avg_rad, avg_Rossby
def get_SHPC(array_d_ini, date_index): def get_slice(array_d_ini, date_index):
i_SHPC = bisect.bisect(array_d_init, date_index) - 1 i_slice = bisect.bisect(array_d_init, date_index) - 1
assert i_SHPC >= 0 assert i_slice >= 0
return i_SHPC return i_slice
def node_to_prop(node_list, e_overestim, array_d_init, handlers): def node_to_prop(node_list, e_overestim, array_d_init, handlers):
"""node_list is a list of node identification numbers for """node_list is a list of node identification numbers for
...@@ -73,16 +73,16 @@ def node_to_prop(node_list, e_overestim, array_d_init, handlers): ...@@ -73,16 +73,16 @@ def node_to_prop(node_list, e_overestim, array_d_init, handlers):
for n in node_list: for n in node_list:
date_index, eddy_index = report_graph.node_to_date_eddy(n, e_overestim) date_index, eddy_index = report_graph.node_to_date_eddy(n, e_overestim)
i_SHPC = get_SHPC(array_d_init, date_index) i_slice = get_slice(array_d_init, date_index)
ishape = util_eddies.comp_ishape(handlers[i_SHPC], date_index, ishape = util_eddies.comp_ishape(handlers[i_slice], date_index,
eddy_index) eddy_index)
shapeRec = handlers[i_SHPC]["readers"]["extremum"].shapeRecord(ishape) shapeRec = handlers[i_slice]["readers"]["extremum"].shapeRecord(ishape)
prop = {"pos": shapeRec.shape.points[0], "speed": shapeRec.record.speed} prop = {"pos": shapeRec.shape.points[0], "speed": shapeRec.record.speed}
prop["radius"] = handlers[i_SHPC]["readers"]["max_speed_contour"]\ prop["radius"] = handlers[i_slice]["readers"]["max_speed_contour"]\
.record(ishape).r_eq_area .record(ishape).r_eq_area
if prop["radius"] < 0: if prop["radius"] < 0:
prop["radius"] = handlers[i_SHPC]["readers"]["outermost_contour"]\ prop["radius"] = handlers[i_slice]["readers"]["outermost_contour"]\
.record(ishape).r_eq_area .record(ishape).r_eq_area
properties.append(prop) properties.append(prop)
......
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