From 06f2e290a07a5856ecb9103e0e69cca418d9c93c Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Fri, 5 Jan 2024 14:34:46 +0100 Subject: process_route: Added explaination comment. --- scripts/process_route.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/process_route.py b/scripts/process_route.py index 643d7dd..e2034fe 100644 --- a/scripts/process_route.py +++ b/scripts/process_route.py @@ -44,6 +44,13 @@ def calculate_timestamp(data, current_index): prev_timestamp = calculate_timestamp(data, current_index - 1) return prev_timestamp + data[current_index-1]['distance'] / data[current_index]['speed'] +# Function process_route +# Parameters: +# input_filename: Input file name +# output_filename: Output file name +# Returns: None +# This function calculates the bearings and timestamps for a route file in JSON-format +# with given latitude, longitude and speed parameters. def process_route(input_filename, output_filename): with open(input_filename, 'r') as infile: data = json.load(infile) -- cgit v1.2.1