Skip to content

[draft] pvlib prototype - #98

Open
willhonaker wants to merge 41 commits into
masterfrom
pvlib-prototype
Open

[draft] pvlib prototype#98
willhonaker wants to merge 41 commits into
masterfrom
pvlib-prototype

Conversation

@willhonaker

@willhonaker willhonaker commented Nov 28, 2024

Copy link
Copy Markdown
Collaborator

Add pvlib wrapper for pv generation via pvlib library.

Adds pvlib module - integrates pvlib.modelchain.ModelChain() with geodata cutouts, enabling pv simulations across time, x, and y indices of a cutout. Also adds ModelChainConfig class to streamline the configuration of ModelChain instances.

Also updates era5 module to also download dewpoint_temperature (d2m) for use in calculation of relative humidity and precipitable water (required input for some pvlib models).

Main functions/classes:

pvlib_model()

  • Extracts necessary weather variables from a geodata cutout.
  • Generates simulations using pvlib.modelchain.ModelChain().
  • Returns an xarray.Dataset containing AC pv output across cutout coordinates.

ModelChainConfig

  • Class for defining ModelChain configs, allowing for reuse of modeling parameters across different PV systems and cutouts.

Helper functions:

  • _prepare_pvlib_ds(): Processes and format input weather data for use with pvlib models.
  • _calculate_pvlib_solarposition(): Computes solar position data using pvlib.solarposition.get_solarposition().
  • _calculate_ghi(): Computes global horizontal irradiance (GHI) from direct and diffuse components.
  • _calculate_relative_humidity(): Estimates relative humidity from air temperature and dewpoint. Calculated using dewpoint_temperature from era5 module. Calculated using August-Roche-Magnus equation
  • _calculate_precipitable_water(): Calculates precipitable water using pvlib.atmosphere.gueymard94_pw().

References:

@willhonaker willhonaker added do not merge stil requires review/test/change draft Draft - not ready for merge labels Nov 28, 2024
@willhonaker willhonaker added enhancement New feature or request ready for review/merge and removed do not merge stil requires review/test/change draft Draft - not ready for merge labels Feb 5, 2025
@willhonaker
willhonaker marked this pull request as ready for review February 5, 2025 17:05
Comment thread .github/workflows/pr_test.yml Outdated
Comment thread .github/workflows/dev_test.yml Outdated
Comment thread src/geodata/pvlib.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants