Hourly to Daily
Authors/Creators
- 1. Instituto Politécnico de Setúbal
Description
This script is called Hourly to Daily, and it converts climate data from hourly to daily time resolution.
It is written in R language.
It also allows the calculation of daily variables during certain periods of the day, such as air temperature and wind speed during daylight, and soil temperature during twilight.
It only works for years containing 365 days.
Input files for this script to run are
(1) input_climate.csv, which has the hourly climate data of your selected climate station, and is created by you, the user.
This is a csv file with the following columns
Year Month Day Hour Ta_hourly V_hourly Ts_hourly P_hourly RH_hourly
where
Ta_hourly is air temperature (ºC) at each hour
V_hourly is wind velocity (m/s) at each hour
Ts_hourly is soil temperature (ºC) at each hour
P_hourly is precipitation (mm) at each hour
RH_hourly is air relative humidity (%) at each hour
and
(2) daylight_twilight.csv, which contains the hours and minutes for the daylight and twilight in the selected climate station, and is created by you, the user.
This is a csv file with the following columns
Month Day Hd_0 Hd_0_min Hd_f Hd_f_min Ht_0 Ht_0_min Ht_f Ht_f_min
where
Hd_0 is the hour of beginning of daylight
Hd_0_min is minutes of beginning of daylight
Hd_f is the hour of ending of daylight
Hd_f_min is minutes of ending of daylight
Ht_0 is the hour of beginning of twilight
Ht_0_min is minutes of beginning of twilight
Ht_f is the hour of ending of twilight
Ht_f_min is minutes of ending of twilight
Hours of daylight and twilight can be found for each specific location in the web. We suggest www.cavu.info/sunset.html
As example, we provide a input_climate.csv and a daylight_twilight.csv files. These files are relative to the Mirandela climate station, Portugal.
This script exports a .pre file in the appropriate form to be used as an input weather file to ALMaSS, and also a similar .csv file.
This script was developed by Maria Catarina Paz, Sónia A.P. Santos, and Raquel Barreira, at Instituto Politécnico de Setúbal, Portugal.
Funding:
This work was funded by Fundação para a Ciência e a Tecnologia through project PTDC/ASP-PLA/30003/2017
- OLIVESIM - Managing ecosystem services in olive groves using advanced landscape agent-based models.
R.B. acknowledges support from the National Funding from FCT - Fundação para a Ciência e a Tecnologia,
under the project UIDB/04561/2020.
Acknowledgements:
The authors are grateful to Instituto Português do Mar e da Atmosfera for the hourly climate data measured at the Mirandela climate station.
Files
Hourly_to_Daily.zip
Additional details
Funding
- Fundação para a Ciência e Tecnologia
- PTDC/ASP-PLA/30003/2017 - Managing ecosystem services in olive groves using advanced landscape agent-based models PTDC/ASP-PLA/30003/2017
- Fundação para a Ciência e Tecnologia
- UIDB/04561/2020 - Center for Mathematics, Fundamental Applications and Operations Research UIDB/04561/2020
References
- R Core Team. (2020). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna. https://www.R-project.org/