Skip to main content

PV Forecast simulation

Project description

pv60hz

CircleCI codecov Documentation Status Python: 3.6 Code style: black License: BSD 3-Clause

The pv60hz library is an solar forecast simulation powered by the 60hz company. This library provides easy download to the Global Forecast System, a numerical forecasting model provided by the National Oceanic and Atmospheric Administration, and preprocessing steps required for solar power generation estimation. This library uses the open source pvlib-python to simulate the predicted solar power generation.

Intro

As interest in climate change and environmental issues is growing around the world, renewable energy power plants are continuously increasing.

However, as renewable energy increases, it becomes increasingly difficult to operate the power grid. Renewable energy power plants are an intermittent resource whose power generation varies depending on the weather, making it difficult to balance the supply and demand for electricity. In addition, relatively small power plants are characterized by decentralization, making them difficult to manage with traditional methods.

Therefore, if you can accurately predict the amount of renewable energy generation across the country, you can balance supply and demand by adjusting the utilization rate of flexible resources such as fossil fuels. In addition, this generation forecasting technology can be used for grid operation, monitoring and maintenance of solar and wind power plants.

Getting started

This library recommends a virtual environment using conda.

$ conda create -y -n venv python==3.6.10
$ conda activate venv

And install the cfgrib library.

conda install -c conda-forge cfgrib

Installation

$ pip install pv60hz

QuickStart

>>> from pv60hz.preprocessor.preprocess import GFSPreprocessor
>>> from pv60hz.loader.gfs import GFSLoader
>>> from pv60hz.simulator.simulate import PVWattsV5
>>> import pytz
>>> import datetime
>>>
>>> kst = pytz.timezone("Asia/Seoul")
>>> start_dt = kst.localize(datetime.datetime(2021, 9, 2, 0, 0)) # Change datetime to recent datetime
>>> end_dt = kst.localize(datetime.datetime(2021, 9, 3, 0, 0)) # Change datetime to recent datetime
>>> lat, lon, alt = 37.123, 126.598, 0
>>> capacity = 300  # kw
>>> azimuth = 180
>>> tilt = 25
>>>
>>>
>>> loader = GFSLoader()
>>> loader.collect_data(start_dt, end_dt)
Latest GFS Simulation Datetime: 2021-09-01 06:00:00+00:00
Download Global Forecast System Data
====================================
100%|█████████████████████████████████████████████████████████████████████████| 10/10 [00:18<00:00
>>>
>>>
>>> data = loader(lat, lon, start_dt, end_dt)
Read Global Forecast System Grib file
====================================
100%|█████████████████████████████████████████████████████████████████████████| 10/10 [00:18<00:00
>>>
>>> preproc_model = GFSPreprocessor(decomp_model="disc", clearsky_interpolate=True)
>>> weather_preproc = preproc_model(lat, lon, altitude=alt, weather=data, keep_solar_geometry=False)
>>>

>>> simulator = PVWattsV5(lat, lon, alt, capacity=capacity, surface_azimuth=azimuth, surface_tilt=tilt)
>>> simulator(weather_preproc, start_dt, end_dt, kst)
                           predict_yield
dt                                      
2021-09-02 00:00:00+09:00       0.000000
2021-09-02 01:00:00+09:00       0.000000
2021-09-02 02:00:00+09:00       0.000000
2021-09-02 03:00:00+09:00       0.000000
2021-09-02 04:00:00+09:00       0.000000
2021-09-02 05:00:00+09:00       0.000000
2021-09-02 06:00:00+09:00       0.000000
2021-09-02 07:00:00+09:00       0.000000
2021-09-02 08:00:00+09:00       0.837611
2021-09-02 09:00:00+09:00       4.288974
2021-09-02 10:00:00+09:00      17.897454
2021-09-02 11:00:00+09:00      43.032267
2021-09-02 12:00:00+09:00      72.636298
2021-09-02 13:00:00+09:00      97.711072
2021-09-02 14:00:00+09:00     112.442749
2021-09-02 15:00:00+09:00     117.264219
2021-09-02 16:00:00+09:00     114.608081
2021-09-02 17:00:00+09:00      94.638939
2021-09-02 18:00:00+09:00      49.883874
2021-09-02 19:00:00+09:00      11.370596
2021-09-02 20:00:00+09:00       0.000000
2021-09-02 21:00:00+09:00       0.000000
2021-09-02 22:00:00+09:00       0.000000
2021-09-02 23:00:00+09:00       0.000000
2021-09-03 00:00:00+09:00       0.000000

Documentation

Full documentation can be found at here

Related to

License

BSD-3-Clause

Citing

William F. Holmgren, Clifford W. Hansen, and Mark A. Mikofski. "pvlib python: a python package for modeling solar energy systems." Journal of Open Source Software, 3(29), 884, (2018). https://doi.org/10.21105/joss.00884

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

pv60hz-0.0.4.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

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

pv60hz-0.0.4-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file pv60hz-0.0.4.tar.gz.

File metadata

  • Download URL: pv60hz-0.0.4.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.6.10

File hashes

Hashes for pv60hz-0.0.4.tar.gz
Algorithm Hash digest
SHA256 cb6425056f82d9e12cef97d8b5bf2f7eacd8c29295fb901d2b6c221c8266b75f
MD5 2adf9050023620bc5021f953d600d0aa
BLAKE2b-256 d89c8246a96ab76870aa3f4c5a41cb91c6d3050fa0276f7b8fd4130b65f9570f

See more details on using hashes here.

File details

Details for the file pv60hz-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pv60hz-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.6.10

File hashes

Hashes for pv60hz-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c4c0a82061ed0c42f7c6e107890cc064c25f2c0f442ea6a99b2b84893298a92e
MD5 c332650f133eb2e8308ea6889a58b70d
BLAKE2b-256 e290fef527a05113bdfd383d44f0800bdac6864e8e6a37deb3688705fdbef36a

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