Skip to main content

Package for downloading timeseries data and convert to generated power

Project description

pipeline coverage Code style: black

Timeseries Methods for Wind Power

This is a Python package to download timeseries data from the NORA3 or ERA5 reanalysis, and to convert to power time series for wind farms.

Documentation

Documentation is provided in GitLab Pages.

Quick-start

  • Install as a Python package in your preferred way, for example using poetry.
  • Copy and adjust the example code below.

Installation

Using conda to manage the environment, the package can be installed as follows.

conda create --name myenv python=3.10 
conda activate myenv 
conda install -c conda-forge poetry 
git clone https://gitlab.sintef.no/harald.svendsen/wind_power_timeseries.git 
cd wind_power_timeseries 
poetry install

ERA5 API Key

For use of the "ERA5" data source, the user needs to register and obtain a CDS API key.

Example

import pandas as pd
import pathlib
import wind_power_timeseries as tm

# Specify windfarms
windfarms = pd.DataFrame([
    {"id":"windfarm_1", "lat":55, "lon": 9, "orientation":None, "shape":None, "turbine_height": 150},
    {"id":"windfarm_2", "lat":60, "lon": 7, "orientation":None, "shape":None, "turbine_height": 150},
]).set_index("id")

# Download wind speed data from NORA3 and save to CSV file in specified folder
time_start = "2022-05-01"
time_end = "2022-05-05"
data_path = pathlib.Path("downloaded_nora3")
data_path.mkdir(parents=True,exist_ok=True)

# Download from server and save to files
wind_data = tm.download.retrieve_nora3(
    windfarms,time_start,time_end,use_cache=True,data_path=data_path)

# Specify function for wind speed to wind power conversion, using a pre-defined function:
my_power_function = tm.compute.func_ninja_compute_power
my_args = {"turbine_power_curve": tm.compute.get_power_curve(name="VestasV80")}

# Compute wind farm power from wind speed data
windpower = tm.compute.compute_power(windfarms,wind_data,
        power_function=my_power_function,power_function_args=my_args)

# Save to file
windpower.to_csv("windpower.csv")

This creates a windpower dataframe

                     windfarm_1  windfarm_2
time
2022-05-01 00:00:00    0.053922    0.105866
2022-05-01 01:00:00    0.065940    0.037178
2022-05-01 02:00:00    0.107095    0.009000
2022-05-01 03:00:00    0.056030    0.006256
2022-05-01 04:00:00    0.041206    0.003573
...

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

wind_power_timeseries-0.6.1.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

wind_power_timeseries-0.6.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file wind_power_timeseries-0.6.1.tar.gz.

File metadata

  • Download URL: wind_power_timeseries-0.6.1.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.11 Linux/4.18.0-553.85.1.el8_10.x86_64

File hashes

Hashes for wind_power_timeseries-0.6.1.tar.gz
Algorithm Hash digest
SHA256 2b80038dba0d79588343c360c2e0bda95a14df3521844240deb3885446e468fc
MD5 4df2fdc0d5da55f9e971c27a66a90dfb
BLAKE2b-256 c4f735321615497479d3bdfd861f23bf1e4b11a242eccb3838348b4811eaada7

See more details on using hashes here.

File details

Details for the file wind_power_timeseries-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: wind_power_timeseries-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.13.11 Linux/4.18.0-553.85.1.el8_10.x86_64

File hashes

Hashes for wind_power_timeseries-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4278e39523da25ef6907356e0b8653a49aeec29b7f15d7a49b60e0f6f4bd4d21
MD5 a7d3f61ebb46e93f19975ad83a379c74
BLAKE2b-256 ac759e40238989bf147bcaa3857e213373bf3c29ff03a689e13e8a5fbcabcc00

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