Spaces:
Runtime error
Runtime error
Commit
•
07ed14c
1
Parent(s):
5efbc8c
Upload precipitation.py
Browse files- stlib/precipitation.py +144 -83
stlib/precipitation.py
CHANGED
@@ -8,11 +8,11 @@ from streamlit_folium import st_folium
|
|
8 |
from branca.element import Figure
|
9 |
|
10 |
|
11 |
-
from precipitation_function import date_split,lat_long_process_precp
|
12 |
from precipitation_function import concat_func, drop_dup_funct,lat_long_type
|
13 |
from precipitation_function import daily_precp_plot,start_end_date_ui,lat_long_ui,year_selection_ui
|
14 |
from precipitation_function import monthly_mean_plot, annual_max_precip_plot,daily_precp_data,cumulative_plot
|
15 |
-
from precipitation_function import annual_max_precip_plot,annual_min_precip_plot,annual_avg_plot,max_precip,min_precip,avg_precip,cumulative
|
16 |
|
17 |
from temperature_functions import convert_df, map_creation, search_func
|
18 |
|
@@ -24,80 +24,50 @@ def run():
|
|
24 |
start = pd.to_datetime('2001/01/01')
|
25 |
end = pd.to_datetime('2019/12/31')
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
#
|
30 |
-
#
|
31 |
-
#
|
32 |
-
#
|
33 |
-
#
|
34 |
-
#
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
#
|
39 |
-
#
|
40 |
-
#
|
41 |
-
#
|
42 |
-
#
|
43 |
-
#
|
44 |
-
# file_path_16 = "precip_data/precip16.zip"
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
precipitation_1_og = pd.read_csv('historicalData/precip1.zip',compression = 'zip')
|
49 |
-
precipitation_2_og = pd.read_csv('historicalData/precip2.zip',compression = 'zip')
|
50 |
-
precipitation_3_og = pd.read_csv('historicalData/precip3.zip',compression = 'zip')
|
51 |
-
precipitation_4_og = pd.read_csv('historicalData/precip4.zip',compression = 'zip')
|
52 |
-
precipitation_5_og = pd.read_csv('historicalData/precip5.zip',compression = 'zip')
|
53 |
-
precipitation_6_og = pd.read_csv('historicalData/precip6.zip',compression = 'zip')
|
54 |
-
precipitation_7_og = pd.read_csv('historicalData/precip7.zip',compression = 'zip')
|
55 |
-
precipitation_8_og = pd.read_csv('historicalData/precip8.zip',compression = 'zip')
|
56 |
-
precipitation_9_og = pd.read_csv('historicalData/precip9.zip',compression = 'zip')
|
57 |
-
precipitation_10_og = pd.read_csv('historicalData/precip10.zip',compression = 'zip')
|
58 |
-
precipitation_11_og = pd.read_csv('historicalData/precip11.zip',compression = 'zip')
|
59 |
-
precipitation_12_og = pd.read_csv('historicalData/precip12.zip',compression = 'zip')
|
60 |
-
precipitation_13_og = pd.read_csv('historicalData/precip13.zip',compression = 'zip')
|
61 |
-
precipitation_14_og = pd.read_csv('historicalData/precip14.zip',compression = 'zip')
|
62 |
-
precipitation_15_og = pd.read_csv('historicalData/precip15.zip',compression = 'zip')
|
63 |
-
precipitation_16_og = pd.read_csv('historicalData/precip16.zip',compression = 'zip')
|
64 |
|
65 |
|
66 |
lat_long_precipitation_1 = precipitation_1_og['lat_long']
|
67 |
lat_long_precipitation_2 = precipitation_2_og['lat_long']
|
68 |
-
lat_long_precipitation_3 = precipitation_3_og['lat_long']
|
69 |
-
lat_long_precipitation_4 = precipitation_4_og['lat_long']
|
70 |
-
lat_long_precipitation_5 = precipitation_5_og['lat_long']
|
71 |
-
lat_long_precipitation_6 = precipitation_6_og['lat_long']
|
72 |
-
lat_long_precipitation_7 = precipitation_7_og['lat_long']
|
73 |
-
lat_long_precipitation_8 = precipitation_8_og['lat_long']
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
lat_long_precipitation_list_4 = concat_func(lat_long_precipitation_13,lat_long_precipitation_14,lat_long_precipitation_15,lat_long_precipitation_16)
|
89 |
-
lat_long_precipitation_list = concat_func(lat_long_precipitation_list_1,lat_long_precipitation_list_2,lat_long_precipitation_list_3,lat_long_precipitation_list_4)
|
90 |
-
|
91 |
-
|
92 |
-
precipitation_conc_1 = concat_func(precipitation_1_og,precipitation_2_og,precipitation_3_og,precipitation_4_og)
|
93 |
-
precipitation_conc_2 = concat_func(precipitation_5_og,precipitation_6_og,precipitation_7_og,precipitation_8_og)
|
94 |
-
precipitation_conc_3 = concat_func(precipitation_9_og,precipitation_10_og,precipitation_11_og,precipitation_12_og)
|
95 |
-
precipitation_conc_4 = concat_func(precipitation_13_og,precipitation_14_og,precipitation_15_og,precipitation_16_og)
|
96 |
-
precipitation = concat_func(precipitation_conc_1,precipitation_conc_2,precipitation_conc_3,precipitation_conc_4)
|
97 |
|
98 |
# precipitation = precipitation.drop([Unnamed:0.2,Unnamed:0.1,Unnamed:0],axis =1)
|
99 |
precipitation.drop(precipitation.filter(regex="Unnamed"),axis=1, inplace=True)
|
100 |
-
# st.write(precipitation.head())
|
101 |
precipitation_temp = precipitation.copy()
|
102 |
precipitation_temp = precipitation_temp.groupby('lat_long')
|
103 |
|
@@ -110,10 +80,23 @@ def run():
|
|
110 |
if data_type == "Cumulative Monthly Precipitation":
|
111 |
col1,col2 = st.columns(2)
|
112 |
with col1:
|
113 |
-
start_year,end_year = year_selection_ui(99,100)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
with col2:
|
115 |
#calling the ui method to create a lat long input UI
|
116 |
-
latitude_input,longitude_input = lat_long_ui(300,400)
|
|
|
|
|
|
|
|
|
117 |
|
118 |
|
119 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
@@ -164,9 +147,22 @@ def run():
|
|
164 |
col1,col2 = st.columns(2)
|
165 |
with col1:
|
166 |
#calling the ui method to create a start end date input UI
|
167 |
-
start,end = start_end_date_ui(start,end,11,22)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
with col2:
|
169 |
-
latitude_input,longitude_input = lat_long_ui(1,2)
|
|
|
|
|
|
|
|
|
170 |
|
171 |
|
172 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
@@ -220,10 +216,23 @@ def run():
|
|
220 |
elif data_type == 'Monthly Average Precipitation':
|
221 |
col1,col2 = st.columns(2)
|
222 |
with col1:
|
223 |
-
start_year,end_year = year_selection_ui(9,10)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
with col2:
|
225 |
#calling the ui method to create a lat long input UI
|
226 |
-
latitude_input,longitude_input = lat_long_ui(3,4)
|
|
|
|
|
|
|
|
|
227 |
|
228 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
229 |
nearest_lat_long = search_func(latitude_input,longitude_input,lat_long_precipitation_list,precipitation)
|
@@ -278,10 +287,23 @@ def run():
|
|
278 |
elif data_type == 'Annual Maximum Precipitation':
|
279 |
col1,col2 = st.columns(2)
|
280 |
with col1:
|
281 |
-
start_year,end_year = year_selection_ui(11,12)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
with col2:
|
283 |
#calling the ui method to create a lat long input UI
|
284 |
-
latitude_input,longitude_input = lat_long_ui(5,6)
|
|
|
|
|
|
|
|
|
285 |
|
286 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
287 |
nearest_lat_long = search_func(latitude_input,longitude_input,lat_long_precipitation_list,precipitation)
|
@@ -328,10 +350,23 @@ def run():
|
|
328 |
elif data_type == 'Annual Minimum Precipitation':
|
329 |
col1,col2 = st.columns(2)
|
330 |
with col1:
|
331 |
-
start_year,end_year = year_selection_ui(13,14)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
with col2:
|
333 |
#calling the ui method to create a lat long input UI
|
334 |
-
latitude_input,longitude_input = lat_long_ui(7,8)
|
|
|
|
|
|
|
|
|
335 |
|
336 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
337 |
nearest_lat_long = search_func(latitude_input,longitude_input,lat_long_precipitation_list,precipitation)
|
@@ -380,10 +415,23 @@ def run():
|
|
380 |
elif data_type == 'Annual Average Precipitation':
|
381 |
col1,col2 = st.columns(2)
|
382 |
with col1:
|
383 |
-
start_year,end_year = year_selection_ui(15,16)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
384 |
with col2:
|
385 |
#calling the ui method to create a lat long input UI
|
386 |
-
latitude_input,longitude_input = lat_long_ui(9,10)
|
|
|
|
|
|
|
|
|
387 |
|
388 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
389 |
nearest_lat_long = search_func(latitude_input,longitude_input,lat_long_precipitation_list,precipitation)
|
@@ -428,10 +476,23 @@ def run():
|
|
428 |
elif data_type == 'Annual Max, Min, & Average Precipitation':
|
429 |
col1,col2 = st.columns(2)
|
430 |
with col1:
|
431 |
-
start_year,end_year = year_selection_ui(17,18)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
432 |
|
433 |
with col2:
|
434 |
-
latitude_input,longitude_input = lat_long_ui(11,12)
|
|
|
|
|
|
|
|
|
435 |
|
436 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
437 |
nearest_lat_long = search_func(latitude_input,longitude_input,lat_long_precipitation_list,precipitation)
|
|
|
8 |
from branca.element import Figure
|
9 |
|
10 |
|
11 |
+
from precipitation_function import date_split,lat_long_process_precp,load_data
|
12 |
from precipitation_function import concat_func, drop_dup_funct,lat_long_type
|
13 |
from precipitation_function import daily_precp_plot,start_end_date_ui,lat_long_ui,year_selection_ui
|
14 |
from precipitation_function import monthly_mean_plot, annual_max_precip_plot,daily_precp_data,cumulative_plot
|
15 |
+
from precipitation_function import annual_max_precip_plot,annual_min_precip_plot,annual_avg_plot,max_precip,min_precip,avg_precip,cumulative,main_concat
|
16 |
|
17 |
from temperature_functions import convert_df, map_creation, search_func
|
18 |
|
|
|
24 |
start = pd.to_datetime('2001/01/01')
|
25 |
end = pd.to_datetime('2019/12/31')
|
26 |
|
27 |
+
p1 = 'historicalData/precip1.zip'
|
28 |
+
p2 = 'historicalData/precip2.zip'
|
29 |
+
# p3 = 'historicalData/precip3.zip'
|
30 |
+
# p4 = 'historicalData/precip4.zip'
|
31 |
+
# p5 = 'historicalData/precip5.zip'
|
32 |
+
# p6 = 'historicalData/precip6.zip'
|
33 |
+
# p7 = 'historicalData/precip7.zip'
|
34 |
+
# p8 = 'historicalData/precip8.zip'
|
35 |
+
|
36 |
+
precipitation_1_og = load_data(p1)
|
37 |
+
precipitation_2_og = load_data(p2)
|
38 |
+
# precipitation_3_og = load_data(p3)
|
39 |
+
# precipitation_4_og = load_data(p4)
|
40 |
+
# precipitation_5_og = load_data(p5)
|
41 |
+
# precipitation_6_og = load_data(p6)
|
42 |
+
# precipitation_7_og = load_data(p7)
|
43 |
+
# precipitation_8_og = load_data(p8)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
|
46 |
lat_long_precipitation_1 = precipitation_1_og['lat_long']
|
47 |
lat_long_precipitation_2 = precipitation_2_og['lat_long']
|
48 |
+
# lat_long_precipitation_3 = precipitation_3_og['lat_long']
|
49 |
+
# lat_long_precipitation_4 = precipitation_4_og['lat_long']
|
50 |
+
# lat_long_precipitation_5 = precipitation_5_og['lat_long']
|
51 |
+
# lat_long_precipitation_6 = precipitation_6_og['lat_long']
|
52 |
+
# lat_long_precipitation_7 = precipitation_7_og['lat_long']
|
53 |
+
# lat_long_precipitation_8 = precipitation_8_og['lat_long']
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
# lat_long_precipitation_list_1 = concat_func(lat_long_precipitation_1,lat_long_precipitation_2,lat_long_precipitation_3,lat_long_precipitation_4)
|
58 |
+
lat_long_precipitation_list = concat_func(lat_long_precipitation_1,lat_long_precipitation_2)
|
59 |
+
# lat_long_precipitation_list_2 = concat_func(lat_long_precipitation_5,lat_long_precipitation_6,lat_long_precipitation_7,lat_long_precipitation_8)
|
60 |
+
# lat_long_precipitation_list = main_concat(lat_long_precipitation_list_1,lat_long_precipitation_list_2)
|
61 |
+
|
62 |
+
|
63 |
+
# precipitation_conc_1 = concat_func(precipitation_1_og,precipitation_2_og,precipitation_3_og,precipitation_4_og)
|
64 |
+
precipitation = concat_func(precipitation_1_og,precipitation_2_og)
|
65 |
+
|
66 |
+
# precipitation_conc_2 = concat_func(precipitation_5_og,precipitation_6_og,precipitation_7_og,precipitation_8_og)
|
67 |
+
# precipitation = main_concat(precipitation_conc_1,precipitation_conc_2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
# precipitation = precipitation.drop([Unnamed:0.2,Unnamed:0.1,Unnamed:0],axis =1)
|
70 |
precipitation.drop(precipitation.filter(regex="Unnamed"),axis=1, inplace=True)
|
|
|
71 |
precipitation_temp = precipitation.copy()
|
72 |
precipitation_temp = precipitation_temp.groupby('lat_long')
|
73 |
|
|
|
80 |
if data_type == "Cumulative Monthly Precipitation":
|
81 |
col1,col2 = st.columns(2)
|
82 |
with col1:
|
83 |
+
# start_year,end_year = year_selection_ui(99,100)
|
84 |
+
st.markdown('**Select the Start Year**')
|
85 |
+
start_year = st.selectbox('',
|
86 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
87 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key = 99)
|
88 |
+
|
89 |
+
st.markdown('**Select the End Year**')
|
90 |
+
end_year = st.selectbox('',
|
91 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
92 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key =100)
|
93 |
with col2:
|
94 |
#calling the ui method to create a lat long input UI
|
95 |
+
# latitude_input,longitude_input = lat_long_ui(300,400)
|
96 |
+
st.markdown('**Enter the latitude**')
|
97 |
+
latitude_input = st.text_input('','12.55',key = 1)
|
98 |
+
st.markdown('**Enter the longitude**')
|
99 |
+
longitude_input = st.text_input('','42.45',key = 2)
|
100 |
|
101 |
|
102 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
|
|
147 |
col1,col2 = st.columns(2)
|
148 |
with col1:
|
149 |
#calling the ui method to create a start end date input UI
|
150 |
+
# start,end = start_end_date_ui(start,end,11,22)
|
151 |
+
st.markdown('**Enter Start Date**')
|
152 |
+
start = st.date_input("",value = start,key = 9000)
|
153 |
+
if start < pd.to_datetime('2001/01/01'):
|
154 |
+
st.write('Start date should not be less than 2001/01/01')
|
155 |
+
|
156 |
+
st.markdown('**Enter End Date**')
|
157 |
+
end = st.date_input("",value = end, key = 900)
|
158 |
+
if end > pd.to_datetime('2019/12/31'):
|
159 |
+
st.write('End date should not be greater than 2019/12/31')
|
160 |
with col2:
|
161 |
+
# latitude_input,longitude_input = lat_long_ui(1,2)
|
162 |
+
st.markdown('**Enter the latitude**')
|
163 |
+
latitude_input = st.text_input('','12.55',key = 132)
|
164 |
+
st.markdown('**Enter the longitude**')
|
165 |
+
longitude_input = st.text_input('','42.45',key = 223)
|
166 |
|
167 |
|
168 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
|
|
216 |
elif data_type == 'Monthly Average Precipitation':
|
217 |
col1,col2 = st.columns(2)
|
218 |
with col1:
|
219 |
+
# start_year,end_year = year_selection_ui(9,10)
|
220 |
+
st.markdown('**Select the Start Year**')
|
221 |
+
start_year = st.selectbox('',
|
222 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
223 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key = 9)
|
224 |
+
|
225 |
+
st.markdown('**Select the End Year**')
|
226 |
+
end_year = st.selectbox('',
|
227 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
228 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key = 10)
|
229 |
with col2:
|
230 |
#calling the ui method to create a lat long input UI
|
231 |
+
# latitude_input,longitude_input = lat_long_ui(3,4)
|
232 |
+
st.markdown('**Enter the latitude**')
|
233 |
+
latitude_input = st.text_input('','12.55',key = 134)
|
234 |
+
st.markdown('**Enter the longitude**')
|
235 |
+
longitude_input = st.text_input('','42.45',key = 256)
|
236 |
|
237 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
238 |
nearest_lat_long = search_func(latitude_input,longitude_input,lat_long_precipitation_list,precipitation)
|
|
|
287 |
elif data_type == 'Annual Maximum Precipitation':
|
288 |
col1,col2 = st.columns(2)
|
289 |
with col1:
|
290 |
+
# start_year,end_year = year_selection_ui(11,12)
|
291 |
+
st.markdown('**Select the Start Year**')
|
292 |
+
start_year = st.selectbox('',
|
293 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
294 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key = 111)
|
295 |
+
|
296 |
+
st.markdown('**Select the End Year**')
|
297 |
+
end_year = st.selectbox('',
|
298 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
299 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key =222)
|
300 |
with col2:
|
301 |
#calling the ui method to create a lat long input UI
|
302 |
+
# latitude_input,longitude_input = lat_long_ui(5,6)
|
303 |
+
st.markdown('**Enter the latitude**')
|
304 |
+
latitude_input = st.text_input('','12.55',key = 145)
|
305 |
+
st.markdown('**Enter the longitude**')
|
306 |
+
longitude_input = st.text_input('','42.45',key = 267)
|
307 |
|
308 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
309 |
nearest_lat_long = search_func(latitude_input,longitude_input,lat_long_precipitation_list,precipitation)
|
|
|
350 |
elif data_type == 'Annual Minimum Precipitation':
|
351 |
col1,col2 = st.columns(2)
|
352 |
with col1:
|
353 |
+
# start_year,end_year = year_selection_ui(13,14)
|
354 |
+
st.markdown('**Select the Start Year**')
|
355 |
+
start_year = st.selectbox('',
|
356 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
357 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key = 13)
|
358 |
+
|
359 |
+
st.markdown('**Select the End Year**')
|
360 |
+
end_year = st.selectbox('',
|
361 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
362 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key = 14)
|
363 |
with col2:
|
364 |
#calling the ui method to create a lat long input UI
|
365 |
+
# latitude_input,longitude_input = lat_long_ui(7,8)
|
366 |
+
st.markdown('**Enter the latitude**')
|
367 |
+
latitude_input = st.text_input('','12.55',key = 109)
|
368 |
+
st.markdown('**Enter the longitude**')
|
369 |
+
longitude_input = st.text_input('','42.45',key = 209)
|
370 |
|
371 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
372 |
nearest_lat_long = search_func(latitude_input,longitude_input,lat_long_precipitation_list,precipitation)
|
|
|
415 |
elif data_type == 'Annual Average Precipitation':
|
416 |
col1,col2 = st.columns(2)
|
417 |
with col1:
|
418 |
+
# start_year,end_year = year_selection_ui(15,16)
|
419 |
+
st.markdown('**Select the Start Year**')
|
420 |
+
start_year = st.selectbox('',
|
421 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
422 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key = 15)
|
423 |
+
|
424 |
+
st.markdown('**Select the End Year**')
|
425 |
+
end_year = st.selectbox('',
|
426 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
427 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key = 26)
|
428 |
with col2:
|
429 |
#calling the ui method to create a lat long input UI
|
430 |
+
# latitude_input,longitude_input = lat_long_ui(9,10)
|
431 |
+
st.markdown('**Enter the latitude**')
|
432 |
+
latitude_input = st.text_input('','12.55',key = 198)
|
433 |
+
st.markdown('**Enter the longitude**')
|
434 |
+
longitude_input = st.text_input('','42.45',key =298)
|
435 |
|
436 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
437 |
nearest_lat_long = search_func(latitude_input,longitude_input,lat_long_precipitation_list,precipitation)
|
|
|
476 |
elif data_type == 'Annual Max, Min, & Average Precipitation':
|
477 |
col1,col2 = st.columns(2)
|
478 |
with col1:
|
479 |
+
# start_year,end_year = year_selection_ui(17,18)
|
480 |
+
st.markdown('**Select the Start Year**')
|
481 |
+
start_year = st.selectbox('',
|
482 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
483 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key = 1111)
|
484 |
+
|
485 |
+
st.markdown('**Select the End Year**')
|
486 |
+
end_year = st.selectbox('',
|
487 |
+
('2001','2002','2003','2004','2005','2006','2007','2008','2009',
|
488 |
+
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'),key = 2222)
|
489 |
|
490 |
with col2:
|
491 |
+
# latitude_input,longitude_input = lat_long_ui(11,12)
|
492 |
+
st.markdown('**Enter the latitude**')
|
493 |
+
latitude_input = st.text_input('','12.55',key = 186)
|
494 |
+
st.markdown('**Enter the longitude**')
|
495 |
+
longitude_input = st.text_input('','42.45',key = 2543)
|
496 |
|
497 |
latitude_input,longitude_input= float(latitude_input),float(longitude_input)
|
498 |
nearest_lat_long = search_func(latitude_input,longitude_input,lat_long_precipitation_list,precipitation)
|