YashMK89 commited on
Commit
c16c7db
·
verified ·
1 Parent(s): fcba768

update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -60,11 +60,11 @@ st.header("Sentinel Dataset Selector")
60
  # Step 1: Select main dataset category
61
  main_selection = st.selectbox("Select Sentinel Dataset Category", list(data.keys()))
62
 
63
- # # Step 2: Display sub-options based on main selection
64
- # sub_selection = None
65
- # if main_selection:
66
- # sub_options = data[main_selection]["sub_options"]
67
- # sub_selection = st.selectbox("Select Specific Dataset ID", list(sub_options.keys()))
68
 
69
  # # Step 3: Display band selection based on sub-selection with max 3 selections
70
  # selected_bands = []
@@ -99,7 +99,7 @@ if index_choice == 'Custom Formula':
99
  # Step 6: Calculate and Display Results based on selected index or formula
100
  if sub_selection and st.button("Calculate Index"):
101
  # Use the selected dataset from the main and sub-selection as an ImageCollection
102
- collection = ee.ImageCollection(sub_selection).filterDate('2020-01-01', '2020-12-31')
103
  image = collection.first() # Using the first image in the collection as an example
104
 
105
  result_image = None
 
60
  # Step 1: Select main dataset category
61
  main_selection = st.selectbox("Select Sentinel Dataset Category", list(data.keys()))
62
 
63
+ # Step 2: Display sub-options based on main selection
64
+ sub_selection = None
65
+ if main_selection:
66
+ sub_options = data[main_selection]["sub_options"]
67
+ sub_selection = st.selectbox("Select Specific Dataset ID", list(sub_options.keys()))
68
 
69
  # # Step 3: Display band selection based on sub-selection with max 3 selections
70
  # selected_bands = []
 
99
  # Step 6: Calculate and Display Results based on selected index or formula
100
  if sub_selection and st.button("Calculate Index"):
101
  # Use the selected dataset from the main and sub-selection as an ImageCollection
102
+ collection = ee.ImageCollection(sub_selection).filterDate('2020-01-01', '2020-1-31')
103
  image = collection.first() # Using the first image in the collection as an example
104
 
105
  result_image = None