Skip to main content

Some (relatively) lightweight short-term energy forecasting tools for solar, wind, and load.

Project description

hEFTy

Some (relatively) lightweight short-term energy forecasting tools for solar, wind, and load.

This repository currently includes solar and wind tools, but may expand one day to include electric load. Forecasts can be created using the NOAA GFS, NOAA GEFS, NOAA HRRR, and ECMWF IFS and AIFS (open data versions) models. The ECMWF CAMS version of IFS is also included, but only via hefty.solar.get_solar_forecast(), and it requires cdsapi to be installed and the user needs an API key (see https://ads.atmosphere.copernicus.eu/how-to-api).

For solar, look at the notebook solar_example.ipynb for some examples, and more_solar_examples.ipynb for more examples. Both of these convert the resource forecasts to power.

There are also solar ensemble forecasts demonstrated in ensemble_example.ipynb.

For wind, look at the notebook wind_example.ipynb. The wind tools are not as developed at the solar tools.

The custom.py module is intended to help with getting forecasts of "custom" weather parameters, not necessarily specific to wind or solar, which migh be useful for load forecasting.

Quick examples

Here's a quick example of getting a solar resource data forecast:

from hefty.solar import get_solar_forecast

latitude = 33.5
longitude = -86.8
init_date = '2024-06-05 6:00' # datetime the forecast model was initialized
resource_data = get_solar_forecast(
    latitude,
    longitude,
    init_date,
    run_length=18, # 18 hours are included in the forecast
    lead_time_to_start=3, # forecast starts 3 hours out from the init_date
    model='hrrr', # use NOAA HRRR
)
resource_data[
    ['ghi','dni','dhi','temp_air','wind_speed']
              ].plot(drawstyle='steps-mid')

with this output:

Here's a wind resource forecast:

from hefty.wind import get_wind_forecast

latitude = 33.5
longitude = -86.8
init_date = '2024-06-05 6:00' # datetime the forecast model was initialized
resource_data = get_wind_forecast(
    latitude,
    longitude,
    init_date,
    run_length=18, # 18 hours are included in the forecast
    lead_time_to_start=3, # forecast starts 3 hours out from the init_date
    model='gfs', # use NOAA GFS
)
resource_data[
    ['wind_speed_10m', 'wind_speed_80m',
    'wind_speed_100m', 'temp_air_2m', 
    'pressure_0m']
    ].plot(secondary_y=['pressure_0m'], drawstyle='steps-mid')

with this output (note that pressure is on the secondary y-axis):

Installation

A virtual environment is strongly recommended. You can install from PyPi with:

pip install hefty

To run the example Jupyter notebooks, you also need jupyter:

pip install jupyter

If you want to use ECMWF CAMS, you also need cdsapi:

pip install cdsapi

References

This project uses several Python packages, including pvlib, an open-source solar PV modeling package [1, 2], and Herbie [3, 4], a package for accessing weather forecast data from NOAA. pv_model.py (with the model_pv_power() function used here) comes from [5] which leverages some functions from [6].

[1] Anderson, K., Hansen, C., Holmgren, W., Jensen, A., Mikofski, M., and Driesse, A. “pvlib python: 2023 project update.” Journal of Open Source Software, 8(92), 5994, (2023). DOI: 10.21105/joss.05994.

[2] https://github.com/pvlib/pvlib-python

[3] Blaylock, B. K. (2025). Herbie: Retrieve Numerical Weather Prediction Model Data (Version 2025.3.1) [Computer software]. https://doi.org/10.5281/zenodo.4567540

[4] https://github.com/blaylockbk/Herbie

[5] https://github.com/williamhobbs/pv-system-model

[6] Hobbs, W., Anderson, K., Mikofski, M., and Ghiz, M. "An approach to modeling linear and non-linear self-shading losses with pvlib." 2024 PV Performance Modeling Collaborative (PVPMC). https://github.com/williamhobbs/2024_pvpmc_self_shade

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

hefty-0.0.7.tar.gz (28.8 kB view details)

Uploaded Source

Built Distribution

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

hefty-0.0.7-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file hefty-0.0.7.tar.gz.

File metadata

  • Download URL: hefty-0.0.7.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for hefty-0.0.7.tar.gz
Algorithm Hash digest
SHA256 bc13c576b2c05cbfb1a91c00eb4160bc4011277b3872a6b4e06f3f73e5c138b6
MD5 0b3d6dad6b850286283f1b7cdbfd973c
BLAKE2b-256 c4ffd6c200ac04a44b1841f0c8848fefa5dc15e3133b72845abe7effdecfff35

See more details on using hashes here.

File details

Details for the file hefty-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: hefty-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 30.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for hefty-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 848fed00e96adb282bd389938e0c7714104f75c3d6801a143f69828449a43ffb
MD5 e67a5f6399f65e9a9057dea652f2c6b5
BLAKE2b-256 4e3e69991725750744a8342c2a5885dfcc24e7aadf8c6aabd986544e318af29d

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