GeoEPIC Single Site Tutorial
This tutorial provides step-by-step guidance on setting up and running a single site simulation in GeoEPIC.
-
Set Up Environment: This initial step involves configuring your local machine and installing the necessary
geoEpic
components. For detailed instructions on downloading and running the setup script (epic_setup.bat
), please refer to the Installation Page. Completing this step ensures your system is ready to usegeoEpic
functionalities. -
Prepare Input Files: This step involves gathering or creating the four essential input files required by the EPIC model: Site File (.SIT), Soil File (.SOL), Weather File (.DLY), and Operation Schedule File (.OPC). These files contain the specific environmental data and management practices for your simulation site.
- For detailed guidance on creating/downloading the Site (.SIT) file, refer to the Site File Section in the getting started menu. Example using
geoEpic
: - For detailed guidance on creating/downloading the Soil (.SOL) file, refer to the Soil File Section in the getting started menu. Example using
geoEpic
: - For detailed guidance on creating/downloading the Weather (.DLY) file, refer to the Weather File Section in the getting started menu. Example using
geoEpic
: - For detailed guidance on creating the Operation Schedule (.OPC) file, including using the
generate_opc
command, refer to the Operation Schedule File Section in the getting started menu. Example command: Successfully preparing these files provides the model with all necessary inputs for the specific site simulation.
- For detailed guidance on creating/downloading the Site (.SIT) file, refer to the Site File Section in the getting started menu. Example using
-
Run Simulation: Once the input files are ready, this step involves configuring the simulation parameters (like start date, duration, desired outputs) and executing the EPIC model for your site. For detailed instructions on using the
Site
andEPICModel
classes, setting parameters, and calling themodel.run(site)
method, please refer to the Running Simulations Guide. This step performs the core simulation process based on the prepared inputs. -
Process Outputs: After the simulation completes, this step involves reading, analyzing, and visualizing the results generated by the EPIC model. The output files contain valuable information about crop yields, soil conditions, water balance, and other environmental metrics.
-
Reading Output Files: EPIC generates various output files. Key ones include ACY (Annual Crop Yield) and DGN (Daily General). Use
Example output:geoEpic.io
classes to read them: -
Visualizing Results: Create plots to understand trends. Example: Plotting annual yields:
Example: Plotting daily Leaf Area Index (LAI):import matplotlib.pyplot as plt plt.figure(figsize=(10, 6)) plt.bar(yields['YR'], yields['YLDG'], color='green') plt.title('Annual Corn Yield (2015-2019)') plt.xlabel('Year') plt.ylabel('Yield (t/ha)') plt.grid(axis='y', linestyle='--', alpha=0.7) plt.xticks(yields['YR']) plt.tight_layout() plt.show()
# Access daily LAI data lai = DGN(site.outputs['DGN']).get_var('LAI') plt.figure(figsize=(12, 6)) plt.plot(lai['Date'], lai['LAI'], color='darkgreen', linewidth=2) plt.title('Leaf Area Index (LAI) Over Time') plt.xlabel('Date') plt.ylabel('LAI') plt.grid(True, alpha=0.3) plt.tight_layout() plt.show()
-
Advanced Analysis: Combine different output variables for deeper insights. Example: Merging precipitation and soil water:
-
Exporting Results: Save your processed data for reports or further use:
This final step allows you to interpret the simulation outcomes and draw conclusions about the site's behavior under the simulated conditions.# Export annual yields to CSV yields.to_csv('corn_yields_2015_2019.csv', index=False) # Export daily data to Excel with pd.ExcelWriter('simulation_results.xlsx') as writer: yields.to_excel(writer, sheet_name='Annual_Yields', index=False) lai.to_excel(writer, sheet_name='Daily_LAI', index=False) # merged_data.to_excel(writer, sheet_name='Daily_Weather_Soil', index=False)
-