# A Python Framework for Crop Yield Estimation Using Sentinel-2 Satellite Data
## 2 Materials and Methods
### Methods
#### 2.5.4 Web Application Development  
The web application was implemented using the Python programming language (version 3.11.1) along with Python libraries (geemap, folium, fastkml, shapely, jsonlib, os-sys, pandas, numpy, plotly, Python-IO, tempfile, zipfile, ogeo) in combination with Google Earth Engine. To further enhance user interaction and accessibility, the Streamlit framework (version 1.24.0) was exploited. The graphical user interface (GUI) was designed to be user-friendly and accessible to users with limited expertise in remote sensing. The interface adopts a two-panel layout: the left panel allows users to select and configure task parameters, while the right panel displays the results of these tasks in an interactive map format, complemented by relevant informational notifications, Figure 4. This design emphasizes usability and fosters efficient intuitive interaction with the application.  
Table 7 provides a summary of the parameterization of the available tasks as presented in the left panel of the graphical user interface (GUI).  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Index** & **Formula** & \\ \hline NDVI & \(\frac{NIR-RED}{NIR-RED}\) & (1) \\ GNDVI & \(2.5\frac{NIR-Green}{NIR-Green}\) & (2) \\ EVI & \(\frac{NIR-RED}{NIR-RED}\) & (3) \\ LAI & \(3.618*EVI-0.118\) & (4) \\  & _Vegegation RE2(B6)_ & \\ RE-PAP & \(\frac{NIR~{}(B8)}{RED(B4)}*\) & (5) \\ \hline \hline \end{tabular}
\end{table}
Table 6: Sentinel-2 vegetation indices under investigation.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Configure Task Parameters** & **Type** \\ \hline \multicolumn{2}{c}{Search available Sentinel 2 imagery} \\ \hline Start date/end date & Date picker \\ Cloud cover & Slider—optional \\ Shadow Threshold & Check box—optional \\ Apply cloud mask & Upload txt file with desired dates for \\ Dates upload & acquisition—optional \\ Upload Region of Interest (ROI) & Upload GeoJSON or KML file \\ \hline \multicolumn{2}{c}{Calculate vegetation index} \\ \hline Select the available images & List box \\ Select index to calculate & Drop—down list \\ Display image & Button—optional \\ Generate histogram & Button—optional \\ Export images & Button—optional \\ \hline \multicolumn{2}{c}{Index statistics per parcel} \\ \hline Upload parcels & Upload GeoJSON or KML file \\ Calculate mean index value for each parcel & Button \\ Download values to CSV & Button—optional \\ Plot results & Button—optional \\ \hline \multicolumn{2}{c}{Dates subset for AUC calculation} \\ \hline Subset start date/end date & Drop—down list/optional \\ Plot subset results & Button—optional \\ \hline \multicolumn{2}{c}{Yield prediction} \\ \hline Yield prediction & Button \\ Download yield prediction results to CSV & Button—optional \\ Update parcel information (on the app) & Button—optional \\ Download updated parcels to GeoJSON or KML & Button—optional \\ \hline \multicolumn{2}{c}{Shadow/Cloud mask check} \\ \hline Show shadow mask layer & Check box—optional \\ Plot histogram (Original/Masked) & Button—optional \\ Download metadata to TXT & Button—optional \\ \hline \hline \end{tabular}
\end{table}
Table 7: Configuration and parameterization of tasks within the application.  
Figure 4: User interface of the app.  
Appendix A presents a comprehensive summary of the application components, including the corresponding Streamlit functions, in the form of Streamlit pseudo-code.