Spaces:
Sleeping
Sleeping
Commit ·
77a04d8
1
Parent(s): 731c0dd
remove magic numbers
Browse files
app.py
CHANGED
|
@@ -74,9 +74,12 @@ def server(input, output, session):
|
|
| 74 |
else:
|
| 75 |
split = False
|
| 76 |
|
|
|
|
|
|
|
|
|
|
| 77 |
try:
|
| 78 |
fig = show_two_plots(gdf_trees, f'simulated_temp_{value_trees}%', 'LST',
|
| 79 |
-
|
| 80 |
"Original temperature",'Temperature (°C)',split=split)
|
| 81 |
return fig
|
| 82 |
except Exception as e:
|
|
@@ -89,9 +92,13 @@ def server(input, output, session):
|
|
| 89 |
def temp_change():
|
| 90 |
gdf_trees = get_gdf_trees()
|
| 91 |
value_trees = input.tree_pct()
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
return fig
|
| 96 |
|
| 97 |
@output
|
|
|
|
| 74 |
else:
|
| 75 |
split = False
|
| 76 |
|
| 77 |
+
min_temp = 15
|
| 78 |
+
max_temp = 35
|
| 79 |
+
|
| 80 |
try:
|
| 81 |
fig = show_two_plots(gdf_trees, f'simulated_temp_{value_trees}%', 'LST',
|
| 82 |
+
min_temp, max_temp, 'coolwarm',f"Temperature after treatment (+{value_trees}% Trees)",
|
| 83 |
"Original temperature",'Temperature (°C)',split=split)
|
| 84 |
return fig
|
| 85 |
except Exception as e:
|
|
|
|
| 92 |
def temp_change():
|
| 93 |
gdf_trees = get_gdf_trees()
|
| 94 |
value_trees = input.tree_pct()
|
| 95 |
+
|
| 96 |
+
most_temp_change = -2
|
| 97 |
+
no_temp_change = 0
|
| 98 |
+
|
| 99 |
+
fig = show_one_plot(gdf_trees, f'treatment_effect_{value_trees}%', most_temp_change, no_temp_change,
|
| 100 |
+
'PuBu_r', f"Decrease of temperature from treatment (+{value_trees}% Trees)",
|
| 101 |
+
"Temperature decrease (°C)")
|
| 102 |
return fig
|
| 103 |
|
| 104 |
@output
|