Skip to main content

Irradiance uncertainty package

Project description

irr_uncertainty

This repo enables to generate irradiance (horizontal and plane-of-array) 95%-intervals anywhere in Europe with latitude and longitude between [35°,60°] and [-20°,40°] respectively, excluding atypical locations such as high-altitude snowy locations.

The intervals are generated with the basis of satellite (CAMS) data.

Package

This repo can be used as a package by running the following commands.

pip install irr_uncertainty

Example

The following lines generate Monte Carlo simulations to obtain the 95% interval for one orientation.

import pandas as pd

from irr_uncertainty.data.irr_data import cams_data_pvlib
from irr_uncertainty.data.solar_data import solarpos
from irr_uncertainty.models.uncertainty_model import irrh_scenarios, transpo_scenarios

start = pd.to_datetime("20220812").tz_localize("UTC")
end = pd.to_datetime("20220816").tz_localize("UTC")
n_scenarios = 1000

# Grenoble, FRANCE
lat = 45.16
long = 5.72
alt = 212

# Installation plan
tilt = 25
azimuth = 180

# Fetch CAMS data and get hourly solar position (with same convention)
sat_data = cams_data_pvlib(lat, long, alt, start, end)
solar_position = solarpos(sat_data.index, lat, long, alt).shift(-1)  

# Compute Monte Carlo simulations for horizontal plans
ghi_scns, dhi_scns, bhi_scns = irrh_scenarios(lat, long, alt, solar_position, sat_data["ghi"],
                                              n_scenarios=n_scenarios)
											  

# Generate Monte Carlo simulations for tilted plans
poa_scns_s, _, _, _ = \
    transpo_scenarios(tilt, azimuth, lat, long, alt, solar_position, ghi_scns, dhi_scns, n_scenarios=n_scenarios)

# Compute 95% interval bounds
q_95 = poa_scns_s.quantile([0.025, 0.975], axis=1).T

Then, typical intervals can be computed with the quantiles as in the Figure below.

Illustration quantiles

Mandatory credentials

A secret file "secret.ini" should be placed in the "data/" folder with the credentials for:

  • Soda-pro: for the CAMS data - to generate 95% interval for any location.
  • BSRN with a email request - to access BSRN station data and recreate the methodology Figures.

Command files

Two command files ease the creation of virtual environment and the execution of jupyter notebooks:

  • create_env.cmd: Create a virtual environment and installed all the required packages
  • notebook_start.cmd: Create a kernel to link with the virtual environment in order to use within the notebook and open the jupyter notebook

Setup

Python 3.9 python docs

Contact

Created by @Alex - feel free to contact me for any concerns and happy to receive feedbacks !

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

irr_uncertainty-1.4.tar.gz (47.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

irr_uncertainty-1.4-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

Details for the file irr_uncertainty-1.4.tar.gz.

File metadata

  • Download URL: irr_uncertainty-1.4.tar.gz
  • Upload date:
  • Size: 47.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for irr_uncertainty-1.4.tar.gz
Algorithm Hash digest
SHA256 5835de4487a13d3c626a4be03ed1df6cf0601a39a7f1f0005bd2f3badfdf8cd0
MD5 8f269ab98e6312f70948f26c63818d82
BLAKE2b-256 30095455f02e60b9de8be33cd8b816187e9d13d99dd6f11852e75a5fea77c157

See more details on using hashes here.

File details

Details for the file irr_uncertainty-1.4-py3-none-any.whl.

File metadata

  • Download URL: irr_uncertainty-1.4-py3-none-any.whl
  • Upload date:
  • Size: 51.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for irr_uncertainty-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3a026ac3234d0ca485e0ad051fa0498f0237f2cf7fd5accd899a69d8ac9c49fc
MD5 69701efa38b5e13cd4d0ce13d8d21d81
BLAKE2b-256 9233f9a253c47c5caaa671d633810612bc96365d78fe70d61e972e77957ef73b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page