Spaces:
Sleeping
Sleeping
File size: 1,810 Bytes
b1847cf d2e3861 250c394 d2e3861 f26f5cc b1847cf 250c394 8a7f2a2 b1847cf 089dcef f26f5cc b1847cf dcbc506 b1847cf 86099a3 b1847cf dcbc506 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
import ee
import geemap
import solara
# Initialize the Earth Engine client library
#ee.Initialize()
fireList = ["North Complex", "Dixie", "Cameron Peak", "August Complex"]
four_fires = solara.reactive([fireList[0]])
class Map(geemap.Map):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.add_ee_data()
self.add_plot_gui()
def add_ee_data(self):
# Define the coordinates of the bounding box
bbox_coords = [[-121.616097, 39.426723], [-120.668526, 39.426723], [-120.668526, 40.030845], [-121.616097, 40.030845]]
# Create a bounding box geometry
NorthComplexBB = ee.Geometry.Polygon(bbox_coords)
PREgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date('2020-08-15', '2020-08-16')).mean()
POSTgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date('2020-09-15', '2020-09-16')).mean()
preNBR = PREgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR');
postNBR = POSTgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR');
dNBR = preNBR.subtract(postNBR).select('NBR')
dNBRclipped = dNBR.clip(NorthComplexBB)
dNBRvisParams = {
'min': 0.0,
'max': 0.8,
'palette': ['green', 'yellow','orange','red']}
self.addLayer(dNBR, dNBRvisParams, "GOES dNBR")
@solara.component
def Page():
solara.SelectMultiple("Wildfire Case Study", four_fires, fireList)
solara.Markdown(f"**Selected**: {four_fires.value}")
with solara.Column(style={"min-width": "500px"}):
Map.element(
center=[40, -100],
zoom=5,
height="600px",
)
|