diff --git a/cost_function.py b/cost_function.py index 43b41684b76c046410d4f44e17ef16d8ea3a151e..21bc53b7bd11e3cefe2ce02ddc08a9a90c9d55d0 100755 --- a/cost_function.py +++ b/cost_function.py @@ -154,15 +154,12 @@ for n in g.vertices(): last['date_index'], last['eddy_index']) - # grab the centers: - first_pos = handlers[first_SHPC]["readers"]["extremum"]\ - .shape(first_loc).points[0] - last_pos = handlers[last_SHPC]["readers"]["extremum"]\ - .shape(last_loc).points[0] - - # Store positions in the vertex properties: - g.vp.pos_first[n] = first_pos # [deg, deg] - g.vp.pos_last[n] = last_pos # [deg, deg] + # Grab the positions of the extrema and store them in the vertex + # properties: + g.vp.pos_first[n] = handlers[first_SHPC]["readers"]["extremum"]\ + .shape(first_loc).points[0] # [in degrees] + g.vp.pos_last[n] = handlers[last_SHPC]["readers"]["extremum"]\ + .shape(last_loc).points[0] # [in degrees] if (num_of_days > num_of_days_to_avg): # The segment is longer than the number of days over which to average