Package: quartz-solar-forecast
Quartz Solar ForecastThe aim of the project is to build an open source PV forecast that is free and easy to use.
The forecast provides the expected generation inkwfor 0 to 48 hours for a single PV site.Open Climate Fix also provides a commercial PV forecast, please get in touch atquartz.support@openclimatefix.orgThe current model uses GFS or ICON NWPs to predict the solar generation at a sitefromquartz_solar_forecast.forecastimportrun_forecastfromquartz_solar_forecast.pydantic_modelsimportPVSite# make a pv site objectsite=PVSite(latitude=51.75,longitude=-1.25,capacity_kwp=1.25)# run model, uses ICON NWP data by defaultpredictions_df=run_forecast(site=site,ts='2023-11-01')Which gives the following predictionInstallationThe source code is currently hosted on GitHub at:https://github.com/openclimatefix/Open-Source-Quartz-Solar-ForecastBinary installers for the latest released version are available at the Python Package Index (PyPI)pipinstallquartz-solar-forecastYou might need to install the following packages firstcondainstall-cconda-forgepyresampleThis can solve thebug: ___kmpc_for_static_fini.ModelThe model is a gradient boosted tree model and uses 9 NWP variables.
It is trained on 25,000 PV sites with over 5 years of PV history, which is availablehere.
The training of this model is handled inpv-site-predictionTODO - we need to benchmark this forecast.The 9 NWP variables, from Open-Meteo documentation, are mentioned above with their appropariate units.Visibility (km), or vis: Distance at which objects can be clearly seen. Can affect the amount of sunlight reaching solar panels.Wind Speed at 10 meters (km/h), or si10 : Wind speed measured at a height of 10 meters above ground level. Important for understanding weather conditions and potential impacts on solar panels.Temperature at 2 meters (°C), or t : Air temperature measure at 2 meters above the ground. Can affect the efficiency of PV systems.Precipiration (mm), or prate : Precipitation (rain, snow, sleet, etc.). Helps to predict cloud cover and potentiel reductions in solar irradiance.Shortwave Radiation (W/m²), or dswrf: Solar radiation in the shortwave spectrum reaching the Earth's surface. Measure of the potential solar energy available for PV systems.Direct Radiation (W/m²)or dlwrf: Longwave (infrared) radiation emitted by the Earth back into the atmosphere.confirm it is correctCloud Cover low (%), or lcc: Percentage of the sky covered by clouds at low altitudes. Impacts the amount of solar radiation reachign the ground, and similarly the PV system.Cloud Cover mid (%), or mcc : Percentage of the sky covered by clouds at mid altitudes.Cloud Cover high (%), or lcc : Percentage of the sky covered by clouds at high altitudeWe also use the following featurespoa_global: The plane of array irradiance, which is the amount of solar radiation that strikes a solar panel.poa_global_now_is_zero: A boolean variable that is true if the poa_global is zero at the current time. This is used to help the model learn that the PV generation is zero at night.capacity (kw): The capacity of the PV system in kw.The model also has a feature to check if these variables are NaNs or not.The model also uses the following variables, which are currently all set to nanrecent_power: The mean power over the last 30 minutesh_mean: The mean of the recent pv data over the last 7 daysh_median: The median of the recent pv data over the last 7 daysh_max: The max of the recent pv data over the last 7 daysKnown restrictionsThe model is trained onUK MetOfficeNWPs, but when running inference we useGFSdata fromOpen-meteo. The differences between GFS and UK MetOffice could led to some odd behaviours.It looks like the GFS data on Open-Meteo is only available for free for the last 3 months.EvaluationTo evaluate the model we use theUK PVdataset and theICON NWPdataset.
All the data is publicly available and the evaluation script can be run with the following commandpythonscripts/run_evaluation.pyThe test dataset we used is defined inquartz_solar_forecast/dataset/testset.csv.
This contains 50 PV sites, which 50 unique timestamps. The data is from 2021.The results of the evaluation are as follows
The MAE is 0.1906 kw across all horizons.HorizonsMAE [kw]MAE [%]00.202 +- 0.036.210.211 +- 0.036.420.216 +- 0.036.53 - 40.211 +- 0.026.35 - 80.191 +- 0.0169 - 160.161 +- 0.01517 - 240.173 +- 0.015.324 - 480.201 +- 0.016.1If we exclude nighttime, then the average MAE [%] from 0 to 36 forecast hours is 13.0%.Notes:The MAE in % is the MAE divided by the capacity of the PV site. We acknowledge there are a number of different ways to do this.It is slightly surprising that the 0-hour forecast horizon and the 24-48 hour horizon have a similar MAE.
This may be because the model is trained expecting live PV data, but currently in this project we provide no live PV data.AbbreviationsNWP: Numerical Weather PredictionsGFS: Global Forecast SystemPV: PhotovoltaicMAE: Mean Absolute ErrorICON: ICOsahedral NonhydrostaticKW: KilowattContributionWe welcome other models.Contributors ✨Thanks goes to these wonderful people (emoji key):Peter Dudfield💻Megawattz🤔📢EdFage📖💻Chloe Pilon Vaillancourt📖rachel tipton📢armenbod🖋💻Shreyas Udaya📖Aryan Bhosale📖Francesco💻This project follows theall-contributorsspecification. Contributions of any kind welcome!