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

Polish

parent af9e5776
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,6 @@ def calculate_radii_rossby(list_eddies, e_overestim, handlers, array_d_init):
avg_rad = 0 # in m
avg_Rossby = 0
n_valid_Rossby = 0
n_eddies = len(list_eddies)
for n in list_eddies:
date_index, eddy_index = report_graph.node_to_date_eddy(n, e_overestim)
......@@ -60,7 +59,7 @@ def calculate_radii_rossby(list_eddies, e_overestim, handlers, array_d_init):
avg_rad += R_Vmax # in m
avg_rad /= n_eddies
avg_rad /= len(list_eddies)
if n_valid_Rossby != 0:
avg_Rossby /= n_valid_Rossby
......@@ -70,9 +69,9 @@ def calculate_radii_rossby(list_eddies, e_overestim, handlers, array_d_init):
return {"avg_rad": avg_rad, "avg_Rossby": avg_Rossby}
def get_SHPC(array_d_ini, date_index):
i_SHPC = bisect.bisect(array_d_init, date_index)
assert i_SHPC >= 1
return i_SHPC - 1
i_SHPC = bisect.bisect(array_d_init, date_index) - 1
assert i_SHPC >= 0
return i_SHPC
t0 = time.perf_counter()
timings = open("timings.txt", "w")
......
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