Skip to content
Snippets Groups Projects
Commit 478608ca authored by Clemens Berteld's avatar Clemens Berteld
Browse files

Some cleanups

parent 09557647
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,6 @@ def get_average_of_multiple_years(cursor, years):
avg_strings = avg_strings[:-2]
query = """SELECT station_id, ROUND(({}) / {}, 1), transparent FROM stations WHERE file IS NULL GROUP BY station_id, transparent ORDER BY station_id ASC;""".format(avg_strings, n)
print(query)
cursor.execute(query)
return cursor.fetchall()
......@@ -103,7 +102,6 @@ def filter_neighbours(year, neighbours):
neighbour_counter = 0
for neighbour in neighbours:
if not neighbour[str(year)] == 'NaN':
print('jo hier')
filtered_neighbours.append(neighbour)
neighbour_counter += 1
if neighbour_counter == int(param_interpol["amount_neighbours"]):
......@@ -118,9 +116,7 @@ def calc_idw(neighbours, years):
for year in years:
values = []
distances = []
print(year)
filtered_neighbours = filter_neighbours(year, neighbours)
print(filtered_neighbours)
for neighbour in filtered_neighbours:
distances.append(neighbour['distance'])
for neighbour in filtered_neighbours:
......@@ -133,7 +129,6 @@ def calc_idw(neighbours, years):
except ZeroDivisionError:
# print('No Data (NaN in DB)')
pass
print('lief?')
return weighted_values
......@@ -145,7 +140,6 @@ def get_interpolation_data_for_point(lat, lon, columns, cursor):
year_columns = (str(columns).replace("""SQL('""", "").replace('"', '').replace("')", "")).split(',')
neighbours = get_neighbours(cursor, lat, lon, columns)
avg_data = calc_idw(neighbours, year_columns)
# print(avg_data)
return avg_data
......
......@@ -91,7 +91,6 @@ def get_raster():
"""
if 'ramp' in request.args:
ramp = json.loads(request.args['ramp'])
print(ramp)
if 'years' in request.args:
years = request.args['years'].split('-')
if int(years[1]) < int(years[0]):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment