documentation - weather files authored by Bouvry Arnaud's avatar Bouvry Arnaud
- WeatherDataOption : explain cases for 1 (pvgis) and 2 (user data file)
- detail files (contents, format, examples)
......@@ -10,12 +10,14 @@ This tutorial provides a guide to simulate an agrivoltaic system with PASE.
# Modules
The PASE software is coded in object-oriented Python.
The engine running the computations is made of modules, located in the MODULES/ directory.
The engine running the computations is made of modules, located in the pase/ directory.
Those modules are imported at the start of the simulation script.
Those modules are imported at the start of the simulation script.
The `example.py` script is the preferred example for newcomers.
# Inputs
## Parameter files
As a user, you can easily run PASE using the `example.py` script "as is" and only adapting the parameters of the simulation.
These parameters are set in YAML configuration files contained in the INPUTS/ directory's subdirectories.
Each parameter in these files includes detailed information such as:
......@@ -29,6 +31,11 @@ Each parameter in these files includes detailed information such as:
To update a parameter, change only the value following the line labeled **"Value:"**.
This helps ensure consistent formatting and preserves the contextual information about each parameter.
**Important**: note that some parameters are marked as optional.
There are very few of those, and by default all parameters are mandatory.
Even if a parameter may seem unrelated to your specific application, it may affect computations in indirect ways.
Take the time to specify correct parameter values !
The parameters are located in several subdirectories according to their purpose:
- AV_CENTRAL/ : set parameters of the agrivoltaics plant (number of panels, azimuth of the central, etc.)
......@@ -37,12 +44,42 @@ The parameters are located in several subdirectories according to their purpose:
- SCENARIOS/ : define the parameters of the simulation scenario, such as location, latitude and longitude, altitude, simulation options, start and end year of the simulation, etc.
- WEATHER_FILES/ : the simulation can run on data fetched from an online database or on data files located in this subdirectory.
## Daily weather files - precipitation and vapour pressure data
## Weather data
To run simulations, PASE needs these four weather variables :
- global horizontal irradiance [W/m²]
- air temperature [°C]
- daily sum of precipitations [mm/d]
- daily average of atmospheric water vapor pressure [hPa]
In the scenario file, users chose WeatherDataOption 1 or 2 :
1. Fetch weather data from PVGIS
2. User provides all weather data
Those two options are described in detail below.
### 1. Fetch weather data from PVGIS
With this option, hourly weather data (GHI and air temperature) is downloaded through the PVGIS API.
The resulting dataframe has columns :
'DateTime', 'G(h)', 'Gb(n)', 'Gd(h)', 'T2m', 'WS10m'
- DateTime: Timestamp in %Y-%m-%d %H:%M:%S format (e.g. 2020-01-01 00:10:00)
- G(h): global horizontal irradiance [W/m²]
- Gb(n): direct normal irradiance [W/m²]
- Gd(h): diffuse horizontal irradiance [W/m²]
- T2m: temperature at 2 m from the ground [°C]
- WS10m: wind speed at 10 m from the ground [m/s]
When choosing this option, user must still provide the daily precipitation (daily sum, [mm/d])
and atmospheric water vapor pressure (daily average, [hPa]) data in the form of a csv file.
This is detailed in the next section.
#### Daily weather file - precipitation and vapour pressure data
The crop modeling component of PASE requires daily weather data to compute evapotranspiration and related processes.
Two key variables are needed: daily precipitation and water vapor pressure.
### Data Sources
##### Data Sources
You can obtain the necessary data in one of two ways:
......@@ -50,26 +87,78 @@ From Agri4Cast: if your study area is covered, you can download the daily weathe
Manual creation: if no Agri4Cast data is available, you must prepare a custom CSV file containing the required variables (see below).
### File Structure
##### File Structure
The input file must be a **semicolon-separated** CSV with the following columns:
The input file must be a comma- or semicolon-separated CSV with the following columns:
| Column Name | Description | Units | Example |
| ---------------- | ---------------------------------- | ----- | -------- |
| Column name | Description | Units | Example |
|------------------| ---------------------------------- | ----- | -------- |
| `DAY` | Calendar date in `yyyymmdd` format | - | 20210415 |
| `VAPOR_PRESSURE` | Daily mean vapor pressure | hPa | 12.3 |
| `PRECIPITATION` | Daily total precipitation | mm/d | 4.7 |
### Formatting Requirements
Each row in this file provides data for one day.
##### Formatting Requirements
- Use UTF-8 encoding and `;` as the column separator.
- Include a header row exactly matching the column names above.
- Use UTF-8 encoding
- `;` or `,` as the column separator
- Include a header row exactly matching the column names above
- Ensure all dates are valid (mind **leap years***) and continuous if the simulation requires complete coverage.
### Example File
##### Example File
A minimal reference file is provided in the repository under INPUTS/WEATHER_FILES/minimal_PRECIP_VP.csv
### 2. User-provided weather data
With this option, all four weather variables (GHI, air temperature,
precipitation and vapor pressure) must be provided by the user in the form of a csv file.
##### File Structure
The input file must be a comma- or semicolon-separated CSV with the following columns:
| Column name | Description | Unit | Format | Example |
|----------------|----------------------------------------|------|------------------|:----------------:|
| date | Timestamp of measurements | - | dd/mm/yyyy hh:mm | 25/10/2017 15:00 |
| G(h) | Global horizontal irradiance | W/m² | float | 125.2 |
| T2m | Air temperature at 2 m from the ground | °C | float | 12.6 |
| PRECIP | Daily sum of precipitation | mm/d | float | 12 |
| VAPOR_PRESSURE | Atmospheric water vapor pressure | hPa | float | 6.86 |
Each row in this file provides data for a timestep. PASE is designed
to parse the data file and automatically infer the sampling period.
Fully supported sampling periods are 1h, 15 min and 10 min.
Other sampling periods may work for part of the simulations.
GHI and air temperature will be used at the provided timestep, while
precipitation and atmospheric water vapor pressure data will be respectively
summed and averaged on each day to serve as inputs to crop models.
##### Formatting Requirements
- Use UTF-8 encoding
- `;` or `,` as the column separator
- Include a header row exactly matching the column names above
- Ensure all dates are valid (mind **leap years***) and continuous if the simulation requires complete coverage.
##### Example File
A minimal reference file is provided in the repository under INPUTS/WEATHER_FILES/Michamps_2017_WD2.csv (temporarily, this file is available in [branch 160](https://gitlab.uliege.be/deal-public/pase/-/blob/160-feature-adding-legumes-growth/INPUTS/WEATHER_FILES/Michamps_2017_WD2.csv?ref_type=heads)).
### Summary
The following table provides an overview of the information a weather file should contain, based on the value of WeatherDataOption.
| Column name | Description | Unit | WeatherDataOption 1 | WeatherDataOption 2 |
|----------------|--------------------------------------------------|------|:-------------------:|:-------------------:|
| date | Timestamp (format depends on WeatherDataOption) | - | x | x |
| G(h) | Global horizontal irradiance | W/m² | | x |
| T2m | Air temperature at 2 m from the ground | °C | | x |
| PRECIP | Daily sum of precipitation | mm/d | x | x |
| VAPOR_PRESSURE | Atmospheric water vapor pressure | hPa | x | x |
# Running a simulation
Once the parameters are set, the simulation can start.
......
......