Zeel commited on
Commit
201944c
·
1 Parent(s): e7b5fc1
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -122,12 +122,12 @@ def add_indices(image, nir_band, red_band, blue_band):
122
 
123
  def process_date(daterange, satellite, veg_indices):
124
  start_date, end_date = daterange
 
125
  try:
126
  attrs = satellites[satellite]
127
  collection = attrs["collection"]
128
  collection = collection.filterBounds(buffer_ee_geometry)
129
  daterange_str = daterange_dates_to_str(start_date, end_date)
130
- write_info(f"Processing {satellite} - {daterange_str}")
131
  collection = collection.filterDate(start_date, end_date)
132
 
133
  bucket = {}
@@ -157,8 +157,12 @@ def process_date(daterange, satellite, veg_indices):
157
  cloud_mask_probability = None
158
  bucket["Cloud (0 to 1)"] = cloud_mask_probability
159
  result_df.loc[daterange_str, list(bucket.keys())] = list(bucket.values())
 
 
160
  except Exception as e:
161
  print(e)
 
 
162
 
163
  def write_info(info):
164
  st.write(f"<span style='color:#006400;'>{info}</span>", unsafe_allow_html=True)
 
122
 
123
  def process_date(daterange, satellite, veg_indices):
124
  start_date, end_date = daterange
125
+ prefix = f"Processing {satellite} - {daterange_str}"
126
  try:
127
  attrs = satellites[satellite]
128
  collection = attrs["collection"]
129
  collection = collection.filterBounds(buffer_ee_geometry)
130
  daterange_str = daterange_dates_to_str(start_date, end_date)
 
131
  collection = collection.filterDate(start_date, end_date)
132
 
133
  bucket = {}
 
157
  cloud_mask_probability = None
158
  bucket["Cloud (0 to 1)"] = cloud_mask_probability
159
  result_df.loc[daterange_str, list(bucket.keys())] = list(bucket.values())
160
+ suffix = f" - Completed"
161
+ write_info(f"{prefix}{suffix}")
162
  except Exception as e:
163
  print(e)
164
+ suffix = f" - Imagery not available"
165
+ write_info(f"{prefix}{suffix}")
166
 
167
  def write_info(info):
168
  st.write(f"<span style='color:#006400;'>{info}</span>", unsafe_allow_html=True)