diff --git a/server/map_handler/update_measurements.py b/server/map_handler/update_measurements.py index 3468a04f6f38fbb14502ba3b7ff101b8077204db..ebafbc104e2f7b745135482db7e4d08e13e9a6a4 100644 --- a/server/map_handler/update_measurements.py +++ b/server/map_handler/update_measurements.py @@ -68,6 +68,11 @@ def update_measurements(lake_name: str) -> (int, str): center_lng = round(sub_division['CenLongitude'], 4) avg_thickness = sub_division['AvgThickness'] + # Read from json file + # lakName_sub_div.json + # Add center coord txt file + # Call update function once daily + # Retrieve ice statistics for current subdivision ice_stats = get_raw_dates(ice_prognosis_raw_data(sub_div_id=subdiv_id, x=center_lat, y=center_lng)) diff --git a/server/scheduler.py b/server/scheduler.py index 6c50b0948dc7ddfafc19d0a05b68806b36774c7f..91d98279a9e3617411ce631f493cf0f377d23896 100644 --- a/server/scheduler.py +++ b/server/scheduler.py @@ -2,13 +2,21 @@ import json import time import schedule -from map_handler.update_measurements import update_measurements_handler from server.consts import LAKE_RELATIONS_PATH +from ModelFromNVE.icemodellingscripts.getIceThicknessLakes import update_data +from map_handler.update_measurements import update_measurements_handler def update_all_measurements(lake_names: list): """Loops through all lake names and calls get_measurements() on each lake""" for lake in lake_names: + # NB dates are hard coded to january for demonstration. For deployment, simply remove the date parameters. + from_date = "2024-01-10" + to_date = "2024-01-20" + + update_data(from_date, to_date, lake_name=lake_names, + sub_divs_folder = LAKE_RELATIONS_PATH + lake_names + '_centers.txt', update_all_bboxes=True) + update_measurements_handler(None, lake)