diff --git a/cost_function.py b/cost_function.py index 4fc4ff2a20cd5a47e8481702f8d628d7e0793184..9fe443a655d8682d3b7e1e6088bbb78b9f7faa8e 100755 --- a/cost_function.py +++ b/cost_function.py @@ -125,7 +125,7 @@ handlers = [util_eddies.open_shpc(shpc_dir) for shpc_dir in args.SHPC_dir] array_d_init = [handler["d_init"] for handler in handlers] # (create the list once and for all) -num_of_days_to_avg = 7 # number of days to average +n_days_avg = 7 # number of days to average print("Iterating on vertices...") for n in g.vertices(): @@ -153,19 +153,19 @@ for n in g.vertices(): g.vp.pos_last[n] = handlers[i_SHPC]["readers"]["extremum"]\ .shape(ishape).points[0] # [in degrees] - if (num_of_days > num_of_days_to_avg): + if (num_of_days > n_days_avg): # The segment is longer than the number of days over which # to average # First 7 days calculation g.vp.first_av_rad[n], g.vp.first_av_ros[n] \ - = calculate_radii_rossby(segment[:num_of_days_to_avg], - e_overestim, handlers, array_d_init) + = calculate_radii_rossby(segment[:n_days_avg], e_overestim, + handlers, array_d_init) # Last 7 days calculation: g.vp.last_av_rad[n], g.vp.last_av_ros[n] \ - = calculate_radii_rossby(segment[- num_of_days_to_avg:], - e_overestim, handlers, array_d_init) + = calculate_radii_rossby(segment[- n_days_avg:], e_overestim, + handlers, array_d_init) else: # The number of eddies in a segment is lower than the number # of days over which to average. The values will be the same