Skip to content
Snippets Groups Projects
Commit 61bd0932 authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

update: add update_data to scheduler

parent 9a818d2e
No related branches found
No related tags found
1 merge request!19Clhp map, license agreement
......@@ -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))
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment