Spaces:
Sleeping
Sleeping
Delete pages
Browse files- pages/Home.py +0 -41
- pages/burn_mapping.py +0 -113
pages/Home.py
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
import solara
|
2 |
-
|
3 |
-
@solara.component
|
4 |
-
def Page():
|
5 |
-
with solara.Column(align="center"):
|
6 |
-
markdown = """
|
7 |
-
## Burn Map Generator
|
8 |
-
|
9 |
-
### About the project
|
10 |
-
|
11 |
-
**A proof of concept illustrating wildfire burn severity maps with emerging clarity while the fires progress**
|
12 |
-
|
13 |
-
More project description, etc, etc.
|
14 |
-
|
15 |
-
**Case Studies from 2020 and 2021 Western US wildfire seasons **
|
16 |
-
|
17 |
-
- August Complex, CA (2020)
|
18 |
-
- Cameron Peak, CO (2020)
|
19 |
-
- Dixie Fire, CA (2021)
|
20 |
-
- North Complex, CA (2020)
|
21 |
-
|
22 |
-
|
23 |
-
### How to use the app
|
24 |
-
|
25 |
-
1. Instuction #1
|
26 |
-
|
27 |
-
2. Instruction #2
|
28 |
-
|
29 |
-
3.
|
30 |
-
|
31 |
-
### Support
|
32 |
-
|
33 |
-
Initial funding for wildland burn scar mapping came through the NOAA JPSS/RRPG Fire and Smoke Initiative.
|
34 |
-
This supported the initial tests of BRIDGE maps using dNDVI. Subsequent funding supported the development of dNBR mapping and an effort
|
35 |
-
to tie support the near real-time distribution of incident-based fire detection and related satellite imagery products through the Next Generation Fire System (NGFS).
|
36 |
-
Current funding from the NOAA Weather Program Office (WPO) is supporting the refinement of our Google Earth Engine App (GEE)
|
37 |
-
and integration of GEE burn scar output with AWIPS (see example above) for Weather Forecast Offices, Regional Offices, and the Weather Prediction Center.
|
38 |
-
|
39 |
-
"""
|
40 |
-
|
41 |
-
solara.Markdown(markdown)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pages/burn_mapping.py
DELETED
@@ -1,113 +0,0 @@
|
|
1 |
-
import ee
|
2 |
-
import geemap
|
3 |
-
import solara
|
4 |
-
import ipywidgets as widgets
|
5 |
-
|
6 |
-
|
7 |
-
fireList = ["North Complex", "Dixie", "Cameron Peak", "August Complex"]
|
8 |
-
selected_fire = solara.reactive(fireList[0])
|
9 |
-
selected_days = solara.reactive(30)
|
10 |
-
dNBRvisParams = {'min': 0.0,'max': 0.8, 'palette': ['green', 'yellow','orange','red']}
|
11 |
-
|
12 |
-
|
13 |
-
class Map(geemap.Map):
|
14 |
-
def __init__(self, **kwargs):
|
15 |
-
super().__init__(**kwargs)
|
16 |
-
self.add_basemap('OpenStreetMap')
|
17 |
-
self.customize_ee_data(selected_fire.value, selected_days.value)
|
18 |
-
self.add_selector()
|
19 |
-
self.add_intSlider()
|
20 |
-
self.add("layer_manager")
|
21 |
-
self.remove("draw_control")
|
22 |
-
|
23 |
-
|
24 |
-
def customize_ee_data(self, fire, elapDays):
|
25 |
-
elapDayNum = ee.Number(elapDays)
|
26 |
-
elapDay_plusOne = elapDayNum.add(ee.Number(1))
|
27 |
-
|
28 |
-
north_startDate = ee.Date('2020-08-16')
|
29 |
-
dixie_startDate = ee.Date('2021-07-13')
|
30 |
-
cam_startDate = ee.Date('2020-08-13')
|
31 |
-
aug_startDate = ee.Date('2020-08-15')
|
32 |
-
|
33 |
-
north_complex_bb = ee.Geometry.BBox(-121.616097, 39.426723, -120.668526, 40.030845)
|
34 |
-
dixie_bb = ee.Geometry.BBox(-121.680467, 39.759303, -120.065477, 40.873387)
|
35 |
-
cam_peak_bb = ee.Geometry.BBox(-106.014784, 40.377907, -105.116651, 40.822094)
|
36 |
-
aug_complex_bb = ee.Geometry.BBox(-123.668726, 39.337654, -122.355860, 40.498304)
|
37 |
-
|
38 |
-
def calc_nbr(pre_start, pre_stop, post_start, post_stop, bbox):
|
39 |
-
PREgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPC').filter(ee.Filter.date(pre_start, pre_stop))\
|
40 |
-
.filter(ee.Filter.calendarRange(17, 21, 'hour')).mean()
|
41 |
-
POSTgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPC').filter(ee.Filter.date(post_start, post_stop))\
|
42 |
-
.filter(ee.Filter.calendarRange(17, 21, 'hour')).mean()
|
43 |
-
preNBR = PREgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR')
|
44 |
-
postNBR = POSTgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR')
|
45 |
-
dNBR = preNBR.subtract(postNBR).select('NBR')
|
46 |
-
dNBRclipped = dNBR.clip(bbox)
|
47 |
-
return dNBRclipped
|
48 |
-
|
49 |
-
self.clear_specific_layers()
|
50 |
-
|
51 |
-
if fire == "North Complex":
|
52 |
-
north_complex = calc_nbr(north_startDate.advance(-7, 'day'), north_startDate, north_startDate.advance(elapDayNum, 'day'), north_startDate.advance(elapDay_plusOne,'day'), north_complex_bb)
|
53 |
-
self.addLayer(north_complex, dNBRvisParams, 'North Complex GOES NBR', True)
|
54 |
-
self.centerObject(north_complex_bb, 9)
|
55 |
-
elif fire == "Dixie":
|
56 |
-
dixie = calc_nbr(dixie_startDate.advance(-7, 'day'), dixie_startDate, dixie_startDate.advance(elapDayNum, 'day'), dixie_startDate.advance(elapDay_plusOne,'day'), dixie_bb)
|
57 |
-
self.addLayer(dixie, dNBRvisParams, 'Dixie Complex GOES NBR', True)
|
58 |
-
self.centerObject(dixie_bb, 9)
|
59 |
-
elif fire == "Cameron Peak":
|
60 |
-
cam_peak = calc_nbr(cam_startDate.advance(-7, 'day'), cam_startDate, cam_startDate.advance(elapDayNum, 'day'), cam_startDate.advance(elapDay_plusOne,'day'), cam_peak_bb)
|
61 |
-
self.addLayer(cam_peak, dNBRvisParams, 'Cameron Peak GOES NBR', True)
|
62 |
-
self.centerObject(cam_peak_bb, 9)
|
63 |
-
elif fire == "August Complex":
|
64 |
-
aug_complex = calc_nbr(aug_startDate.advance(-7, 'day'), aug_startDate, aug_startDate.advance(elapDayNum, 'day'), aug_startDate.advance(elapDay_plusOne,'day'), aug_complex_bb)
|
65 |
-
self.addLayer(aug_complex, dNBRvisParams, 'August Complex GOES NBR', True)
|
66 |
-
self.centerObject(aug_complex_bb, 9)
|
67 |
-
|
68 |
-
def clear_specific_layers(self):
|
69 |
-
layers_to_keep = ['OpenStreetMap']
|
70 |
-
layers = list(self.layers)
|
71 |
-
for layer in layers:
|
72 |
-
if layer.name not in layers_to_keep:
|
73 |
-
self.remove_layer(layer)
|
74 |
-
|
75 |
-
def add_selector(self):
|
76 |
-
selector = widgets.Dropdown(options=fireList, value="North Complex", description='Wildfire Case Study:')
|
77 |
-
|
78 |
-
def on_selector_change(change):
|
79 |
-
if change['name'] == 'value':
|
80 |
-
selected_fire.value = change['new']
|
81 |
-
self.customize_ee_data(selected_fire.value, selected_days.value)
|
82 |
-
|
83 |
-
selector.observe(on_selector_change, names='value')
|
84 |
-
self.add_widget(selector, position="topleft")
|
85 |
-
|
86 |
-
def add_intSlider(self):
|
87 |
-
slider = widgets.IntSlider(value=selected_days.value,min=1,max=30,step=1,description='Elapsed days:',)
|
88 |
-
|
89 |
-
def on_slider_change(change):
|
90 |
-
if change['name'] == 'value':
|
91 |
-
selected_days.value = change['new']
|
92 |
-
self.customize_ee_data(selected_fire.value, selected_days.value)
|
93 |
-
|
94 |
-
slider.observe(on_slider_change, names='value')
|
95 |
-
self.add_widget(slider, position="topleft")
|
96 |
-
|
97 |
-
|
98 |
-
@solara.component
|
99 |
-
def Page():
|
100 |
-
|
101 |
-
with solara.Column(align="center"):
|
102 |
-
markdown = """
|
103 |
-
## Burn Map Generator Case Studies """
|
104 |
-
solara.Markdown(markdown)
|
105 |
-
|
106 |
-
# Isolation is required to prevent the map from overlapping navigation (when screen width < 960px)
|
107 |
-
with solara.Column(style={"isolation": "isolate"}):
|
108 |
-
map_widget = Map.element(
|
109 |
-
center=[39, -120.5],
|
110 |
-
zoom=8,
|
111 |
-
height="600px",
|
112 |
-
toolbar_ctrl=False
|
113 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|