Spaces:
Sleeping
Sleeping
Update pages/05_GOES_NBR.py
Browse files- pages/05_GOES_NBR.py +25 -25
pages/05_GOES_NBR.py
CHANGED
@@ -35,36 +35,36 @@ class Map(geemap.Map):
|
|
35 |
elif selector.value == "August Complex":
|
36 |
self.find_layer('August Complex GOES NBR').visible = True
|
37 |
'''
|
38 |
-
north_complex_bb = ee.Geometry.BBox(-121.616097, 39.426723, -120.668526, 40.030845)
|
39 |
-
dixie_bb = ee.Geometry.BBox(-121.680467, 39.759303, -120.065477, 40.873387)
|
40 |
-
cam_peak_bb = ee.Geometry.BBox(-106.014784, 40.377907, -105.116651, 40.822094)
|
41 |
-
aug_complex_bb = ee.Geometry.BBox(-123.668726, 39.337654, -122.355860, 40.498304)
|
42 |
-
|
43 |
-
def calc_nbr(pre_start, pre_stop, post_start, post_stop, bbox):
|
44 |
-
PREgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date(pre_start, pre_stop)).mean()
|
45 |
-
POSTgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date(post_start, post_stop)).mean()
|
46 |
-
preNBR = PREgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR')
|
47 |
-
postNBR = POSTgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR')
|
48 |
-
dNBR = preNBR.subtract(postNBR).select('NBR')
|
49 |
-
dNBRclipped = dNBR.clip(bbox)
|
50 |
-
return dNBRclipped
|
51 |
-
|
52 |
-
def add_ee_data(self):
|
53 |
-
|
54 |
north_complex_bb = ee.Geometry.BBox(-121.616097, 39.426723, -120.668526, 40.030845)
|
55 |
dixie_bb = ee.Geometry.BBox(-121.680467, 39.759303, -120.065477, 40.873387)
|
56 |
cam_peak_bb = ee.Geometry.BBox(-106.014784, 40.377907, -105.116651, 40.822094)
|
57 |
aug_complex_bb = ee.Geometry.BBox(-123.668726, 39.337654, -122.355860, 40.498304)
|
58 |
-
|
59 |
-
north_complex = self.calc_nbr('2020-08-15', '2020-08-16', '2020-09-15', '2020-09-16', north_complex_bb)
|
60 |
-
dixie = self.calc_nbr('2021-07-12', '2021-07-13', '2021-09-15', '2021-09-16', dixie_bb)
|
61 |
-
cam_peak = self.calc_nbr('2020-08-12', '2020-08-13', '2020-09-12', '2020-09-13', cam_peak_bb)
|
62 |
-
aug_complex = self.calc_nbr('2020-08-15', '2020-08-16', '2020-11-10', '2020-11-11', aug_complex_bb)
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
'''
|
70 |
def calc_nbr(pre_start, pre_stop, post_start, post_stop, bbox):
|
|
|
35 |
elif selector.value == "August Complex":
|
36 |
self.find_layer('August Complex GOES NBR').visible = True
|
37 |
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
north_complex_bb = ee.Geometry.BBox(-121.616097, 39.426723, -120.668526, 40.030845)
|
39 |
dixie_bb = ee.Geometry.BBox(-121.680467, 39.759303, -120.065477, 40.873387)
|
40 |
cam_peak_bb = ee.Geometry.BBox(-106.014784, 40.377907, -105.116651, 40.822094)
|
41 |
aug_complex_bb = ee.Geometry.BBox(-123.668726, 39.337654, -122.355860, 40.498304)
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
+
def calc_nbr(pre_start, pre_stop, post_start, post_stop, bbox):
|
44 |
+
PREgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date(pre_start, pre_stop)).mean()
|
45 |
+
POSTgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date(post_start, post_stop)).mean()
|
46 |
+
preNBR = PREgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR')
|
47 |
+
postNBR = POSTgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR')
|
48 |
+
dNBR = preNBR.subtract(postNBR).select('NBR')
|
49 |
+
dNBRclipped = dNBR.clip(bbox)
|
50 |
+
return dNBRclipped
|
51 |
+
|
52 |
+
def add_ee_data(self):
|
53 |
+
|
54 |
+
north_complex_bb = ee.Geometry.BBox(-121.616097, 39.426723, -120.668526, 40.030845)
|
55 |
+
dixie_bb = ee.Geometry.BBox(-121.680467, 39.759303, -120.065477, 40.873387)
|
56 |
+
cam_peak_bb = ee.Geometry.BBox(-106.014784, 40.377907, -105.116651, 40.822094)
|
57 |
+
aug_complex_bb = ee.Geometry.BBox(-123.668726, 39.337654, -122.355860, 40.498304)
|
58 |
+
|
59 |
+
north_complex = self.calc_nbr('2020-08-15', '2020-08-16', '2020-09-15', '2020-09-16', north_complex_bb)
|
60 |
+
dixie = self.calc_nbr('2021-07-12', '2021-07-13', '2021-09-15', '2021-09-16', dixie_bb)
|
61 |
+
cam_peak = self.calc_nbr('2020-08-12', '2020-08-13', '2020-09-12', '2020-09-13', cam_peak_bb)
|
62 |
+
aug_complex = self.calc_nbr('2020-08-15', '2020-08-16', '2020-11-10', '2020-11-11', aug_complex_bb)
|
63 |
+
|
64 |
+
self.addLayer(north_complex, dNBRvisParams, 'North Complex GOES NBR', True)
|
65 |
+
self.addLayer(dixie, dNBRvisParams, 'Dixie Complex GOES NBR', False)
|
66 |
+
self.addLayer(cam_peak, dNBRvisParams, 'Cameron Peak GOES NBR', False)
|
67 |
+
self.addLayer(aug_complex, dNBRvisParams, 'August Complex GOES NBR', False)
|
68 |
|
69 |
'''
|
70 |
def calc_nbr(pre_start, pre_stop, post_start, post_stop, bbox):
|