danielle-losos commited on
Commit
250c394
·
verified ·
1 Parent(s): d2e3861

Moved Bbox creation into function

Browse files
Files changed (1) hide show
  1. pages/05_GOES_NBR.py +7 -6
pages/05_GOES_NBR.py CHANGED
@@ -3,16 +3,11 @@ import geemap
3
  import solara
4
 
5
  # Initialize the Earth Engine client library
6
- ee.Initialize()
7
 
8
  fireList = ["North Complex", "Dixie", "Cameron Peak", "August Complex"]
9
  four_fires = solara.reactive([fireList[0]])
10
 
11
- # Define the coordinates of the bounding box
12
- bbox_coords = [[-121.616097, 39.426723], [-120.668526, 39.426723], [-120.668526, 40.030845], [-121.616097, 40.030845]]
13
-
14
- # Create a bounding box geometry
15
- NorthComplexBB = ee.Geometry.Polygon(bbox_coords)
16
 
17
  class Map(geemap.Map):
18
  def __init__(self, **kwargs):
@@ -21,6 +16,12 @@ class Map(geemap.Map):
21
  self.add_plot_gui()
22
 
23
  def add_ee_data(self):
 
 
 
 
 
 
24
  PREgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date('2020-08-15', '2020-08-16')).mean()
25
  POSTgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date('2020-09-15', '2020-09-16')).mean()
26
  preNBR = PREgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR');
 
3
  import solara
4
 
5
  # Initialize the Earth Engine client library
6
+ #ee.Initialize()
7
 
8
  fireList = ["North Complex", "Dixie", "Cameron Peak", "August Complex"]
9
  four_fires = solara.reactive([fireList[0]])
10
 
 
 
 
 
 
11
 
12
  class Map(geemap.Map):
13
  def __init__(self, **kwargs):
 
16
  self.add_plot_gui()
17
 
18
  def add_ee_data(self):
19
+ # Define the coordinates of the bounding box
20
+ bbox_coords = [[-121.616097, 39.426723], [-120.668526, 39.426723], [-120.668526, 40.030845], [-121.616097, 40.030845]]
21
+
22
+ # Create a bounding box geometry
23
+ NorthComplexBB = ee.Geometry.Polygon(bbox_coords)
24
+
25
  PREgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date('2020-08-15', '2020-08-16')).mean()
26
  POSTgoesCMI = ee.ImageCollection('NOAA/GOES/17/MCMIPF').filter(ee.Filter.date('2020-09-15', '2020-09-16')).mean()
27
  preNBR = PREgoesCMI.select(['CMI_C03','CMI_C06']).normalizedDifference(['CMI_C03', 'CMI_C06']).toFloat().rename('NBR');