Spaces:
Sleeping
Sleeping
Update pages/05_GOES_NBR.py
Browse files- pages/05_GOES_NBR.py +25 -26
pages/05_GOES_NBR.py
CHANGED
@@ -13,6 +13,31 @@ class Map(geemap.Map):
|
|
13 |
def __init__(self, **kwargs):
|
14 |
super().__init__(**kwargs)
|
15 |
self.add_ee_data()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
'''
|
17 |
selector = widgets.Dropdown(options=fireList, value="North Complex", description='Wildfire Case Study:')
|
18 |
mapFire_button = widgets.Button(description="Map the burn scar")
|
@@ -35,32 +60,6 @@ class Map(geemap.Map):
|
|
35 |
elif selector.value == "August Complex":
|
36 |
self.find_layer('August Complex GOES NBR').visible = True
|
37 |
'''
|
38 |
-
|
39 |
-
def add_ee_data(self):
|
40 |
-
|
41 |
-
def calc_nbr(pre_start, pre_stop, post_start, post_stop, bbox):
|
42 |
-
PREgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date(pre_start, pre_stop)).mean()
|
43 |
-
POSTgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date(post_start, post_stop)).mean()
|
44 |
-
preNBR = PREgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR')
|
45 |
-
postNBR = POSTgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR')
|
46 |
-
dNBR = preNBR.subtract(postNBR).select('NBR')
|
47 |
-
dNBRclipped = dNBR.clip(bbox)
|
48 |
-
return dNBRclipped
|
49 |
-
|
50 |
-
north_complex_bb = ee.Geometry.BBox(-121.616097, 39.426723, -120.668526, 40.030845)
|
51 |
-
dixie_bb = ee.Geometry.BBox(-121.680467, 39.759303, -120.065477, 40.873387)
|
52 |
-
cam_peak_bb = ee.Geometry.BBox(-106.014784, 40.377907, -105.116651, 40.822094)
|
53 |
-
aug_complex_bb = ee.Geometry.BBox(-123.668726, 39.337654, -122.355860, 40.498304)
|
54 |
-
|
55 |
-
north_complex = self.calc_nbr('2020-08-15', '2020-08-16', '2020-09-15', '2020-09-16', north_complex_bb)
|
56 |
-
dixie = self.calc_nbr('2021-07-12', '2021-07-13', '2021-09-15', '2021-09-16', dixie_bb)
|
57 |
-
cam_peak = self.calc_nbr('2020-08-12', '2020-08-13', '2020-09-12', '2020-09-13', cam_peak_bb)
|
58 |
-
aug_complex = self.calc_nbr('2020-08-15', '2020-08-16', '2020-11-10', '2020-11-11', aug_complex_bb)
|
59 |
-
|
60 |
-
self.addLayer(north_complex, dNBRvisParams, 'North Complex GOES NBR', True)
|
61 |
-
self.addLayer(dixie, dNBRvisParams, 'Dixie Complex GOES NBR', False)
|
62 |
-
self.addLayer(cam_peak, dNBRvisParams, 'Cameron Peak GOES NBR', False)
|
63 |
-
self.addLayer(aug_complex, dNBRvisParams, 'August Complex GOES NBR', False)
|
64 |
|
65 |
|
66 |
@solara.component
|
|
|
13 |
def __init__(self, **kwargs):
|
14 |
super().__init__(**kwargs)
|
15 |
self.add_ee_data()
|
16 |
+
|
17 |
+
def add_ee_data(self):
|
18 |
+
def calc_nbr(pre_start, pre_stop, post_start, post_stop, bbox):
|
19 |
+
PREgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date(pre_start, pre_stop)).mean()
|
20 |
+
POSTgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date(post_start, post_stop)).mean()
|
21 |
+
preNBR = PREgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR')
|
22 |
+
postNBR = POSTgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR')
|
23 |
+
dNBR = preNBR.subtract(postNBR).select('NBR')
|
24 |
+
dNBRclipped = dNBR.clip(bbox)
|
25 |
+
return dNBRclipped
|
26 |
+
|
27 |
+
north_complex_bb = ee.Geometry.BBox(-121.616097, 39.426723, -120.668526, 40.030845)
|
28 |
+
dixie_bb = ee.Geometry.BBox(-121.680467, 39.759303, -120.065477, 40.873387)
|
29 |
+
cam_peak_bb = ee.Geometry.BBox(-106.014784, 40.377907, -105.116651, 40.822094)
|
30 |
+
aug_complex_bb = ee.Geometry.BBox(-123.668726, 39.337654, -122.355860, 40.498304)
|
31 |
+
|
32 |
+
north_complex = self.calc_nbr('2020-08-15', '2020-08-16', '2020-09-15', '2020-09-16', north_complex_bb)
|
33 |
+
dixie = self.calc_nbr('2021-07-12', '2021-07-13', '2021-09-15', '2021-09-16', dixie_bb)
|
34 |
+
cam_peak = self.calc_nbr('2020-08-12', '2020-08-13', '2020-09-12', '2020-09-13', cam_peak_bb)
|
35 |
+
aug_complex = self.calc_nbr('2020-08-15', '2020-08-16', '2020-11-10', '2020-11-11', aug_complex_bb)
|
36 |
+
|
37 |
+
self.addLayer(north_complex, dNBRvisParams, 'North Complex GOES NBR', True)
|
38 |
+
self.addLayer(dixie, dNBRvisParams, 'Dixie Complex GOES NBR', False)
|
39 |
+
self.addLayer(cam_peak, dNBRvisParams, 'Cameron Peak GOES NBR', False)
|
40 |
+
self.addLayer(aug_complex, dNBRvisParams, 'August Complex GOES NBR', False)
|
41 |
'''
|
42 |
selector = widgets.Dropdown(options=fireList, value="North Complex", description='Wildfire Case Study:')
|
43 |
mapFire_button = widgets.Button(description="Map the burn scar")
|
|
|
60 |
elif selector.value == "August Complex":
|
61 |
self.find_layer('August Complex GOES NBR').visible = True
|
62 |
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
|
65 |
@solara.component
|