jordancaraballo commited on
Commit
6621390
·
1 Parent(s): dcfa6c5

Adding bidirectional and port access

Browse files
pages/1_⚡_Alaska_Lightning.py CHANGED
@@ -41,12 +41,8 @@ def format_filename(filename):
41
  return f'{Path(filename).stem}'.split('_')[1]
42
 
43
  # define layers dict
44
- options_2024 = [
45
- 'https://data.kitware.com/api/v1/file/626854a14acac99f42126a74/download'
46
- ]#sorted(glob(os.path.join(dataset_path_2024, '*/*.tif')))
47
- options_2016 = [
48
- 'https://data.kitware.com/api/v1/file/626854a14acac99f42126a74/download'
49
- ]#sorted(glob(os.path.join(dataset_path_2016, '*/*.tif')))
50
 
51
  #st.title(f"Lightning Forecast: {format_filename(options_2024[0])} to {format_filename(options_2024[-1])}")
52
  st.title(f"Lightning Forecast")
@@ -57,9 +53,9 @@ col1, col2 = st.columns([4, 1])
57
  index = 0 #options.index("OpenTopoMap")
58
 
59
  with col2:
60
- current_forecast_date = st.selectbox("Current Forecast Window:", options_2024, index)#, format_func=format_filename)
61
- previous_forecast_date = st.selectbox("Previous Forecast Window:", options_2024, index)#, format_func=format_filename)
62
- legacy_forecast_date = st.selectbox("Legacy Examples:", options_2016, index)#, format_func=format_filename)
63
 
64
  m = leafmap.Map(
65
  locate_control=True, latlon_control=True,
@@ -88,7 +84,8 @@ with col1:
88
  vmax=100,
89
  colormap='jet',
90
  layer_name=Path(current_forecast_date).stem,
91
- client_port=8501
 
92
  )
93
 
94
  # folium does not support this
 
41
  return f'{Path(filename).stem}'.split('_')[1]
42
 
43
  # define layers dict
44
+ options_2024 = sorted(glob(os.path.join(dataset_path_2024, '*/*.tif')))
45
+ options_2016 = sorted(glob(os.path.join(dataset_path_2016, '*/*.tif')))
 
 
 
 
46
 
47
  #st.title(f"Lightning Forecast: {format_filename(options_2024[0])} to {format_filename(options_2024[-1])}")
48
  st.title(f"Lightning Forecast")
 
53
  index = 0 #options.index("OpenTopoMap")
54
 
55
  with col2:
56
+ current_forecast_date = st.selectbox("Current Forecast Window:", options_2024, index, format_func=format_filename)
57
+ previous_forecast_date = st.selectbox("Previous Forecast Window:", options_2024, index, format_func=format_filename)
58
+ legacy_forecast_date = st.selectbox("Legacy Examples:", options_2016, index, format_func=format_filename)
59
 
60
  m = leafmap.Map(
61
  locate_control=True, latlon_control=True,
 
84
  vmax=100,
85
  colormap='jet',
86
  layer_name=Path(current_forecast_date).stem,
87
+ client_port=8501,
88
+ port=8080
89
  )
90
 
91
  # folium does not support this
pages/2_🌍_Alaska_WRF.py CHANGED
@@ -9,9 +9,9 @@ from localtileserver import TileClient, get_leaflet_tile_layer, examples, get_fo
9
  from ipyleaflet import Map
10
 
11
  # First, create a tile server from local raster file
12
- client = examples.get_san_francisco(client_port=8501, debug=True, port=8080)
13
  print(client)
14
- print(client.server.port)
15
 
16
  # Create ipyleaflet tile layer from that server
17
  #t = get_leaflet_tile_layer(client)
 
9
  from ipyleaflet import Map
10
 
11
  # First, create a tile server from local raster file
12
+ client = examples.get_san_francisco(client_port=8501, debug=True, port=8080, )
13
  print(client)
14
+ print("FROM WRF", client.server.port)
15
 
16
  # Create ipyleaflet tile layer from that server
17
  #t = get_leaflet_tile_layer(client)