diff --git a/cost_function.py b/cost_function.py index fd8d85791b2e8e58856edf9764fad5c90e984aa6..29f8a37b9b234b05ce50b3d5842fd20c4c594a93 100755 --- a/cost_function.py +++ b/cost_function.py @@ -45,17 +45,17 @@ def calculate_radii_rossby(list_eddies, e_overestim, handlers, array_d_init): for n in list_eddies: date_index, eddy_index = report_graph.node_to_date_eddy(n, e_overestim) i_SHPC = get_SHPC(array_d_init, date_index) - location = util_eddies.comp_ishape(handlers[i_SHPC], date_index, - eddy_index) + ishape = util_eddies.comp_ishape(handlers[i_SHPC], date_index, + eddy_index) # now that we have the location in the shapefiles, we need to # get the radius and the rossby number - shapeRec = handlers[i_SHPC]["readers"]["extremum"].shapeRecord(location) + shapeRec = handlers[i_SHPC]["readers"]["extremum"].shapeRecord(ishape) lat_in_deg = shapeRec.shape.points[0][1] # in degrees f = 2 * Omega * math.sin(math.radians(lat_in_deg)) # in s-1 V_max = shapeRec.record[4] # in m/s R_Vmax = handlers[i_SHPC]["readers"]["max_speed_contour"]\ - .record(location)['r_eq_area'] * 1000 # in m + .record(ishape)['r_eq_area'] * 1000 # in m if (V_max < 100): rossby += V_max / (f * R_Vmax)