Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Temperaturverteilung
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
s39174
Temperaturverteilung
Commits
478608ca
Commit
478608ca
authored
3 years ago
by
Clemens Berteld
Browse files
Options
Downloads
Patches
Plain Diff
Some cleanups
parent
09557647
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/GetAverageData.py
+0
-6
0 additions, 6 deletions
api/GetAverageData.py
api/api.py
+0
-1
0 additions, 1 deletion
api/api.py
with
0 additions
and
7 deletions
api/GetAverageData.py
+
0
−
6
View file @
478608ca
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
api/api.py
+
0
−
1
View file @
478608ca
...
...
@@ -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
]):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment