-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/pvlib/pvanalytics into snow
- Loading branch information
Showing
70 changed files
with
25,314 additions
and
1,925 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
## Description | ||
|
||
*Thank you for your contribution! Please provide a brief description of the problem and the proposed solution or new feature (if not already fully described in a linked issue)* | ||
|
||
## Checklist | ||
|
||
The following items must be addressed before the code can be merged. | ||
Please don't hesitate to ask for help if you are unsure of how to accomplish any of the items. | ||
*You are free to remove any checklist items that do not apply or add additional items that are | ||
not on this list* | ||
<!-- Thank you for your contribution! Please don't hesitate to ask for help if you are unsure of how to accomplish any of the items. | ||
You are free to strikethrough any checklist items that do not apply or to add additional items that are not on this list. --> | ||
|
||
- [ ] Closes #xxx | ||
- [ ] Added new API functions to `docs/api.rst` | ||
- [ ] Clearly documented all new API functions with [PEP257](https://www.python.org/dev/peps/pep-0257/) and [numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html) compliant docstrings | ||
- [ ] Added tests to cover all new or modified code. | ||
- [ ] Clearly documented all new API functions with [PEP257](https://www.python.org/dev/peps/pep-0257/) and [numpydoc](https://numpydoc.readthedocs.io/en/latest/format.html) compliant docstrings. | ||
- [ ] Added new API functions to `docs/api.rst`. | ||
- [ ] Non-API functions clearly documented with docstrings or comments as necessary. | ||
- [ ] Adds description and name entries in the appropriate "what's new" file | ||
in [`docs/whatsnew`](https://github.com/pvlib/pvanalytics/tree/master/docs/whatsnew) | ||
in [`docs/whatsnew`](https://github.com/pvlib/pvanalytics/tree/main/docs/whatsnew) | ||
for all changes. Includes link to the GitHub Issue with `` :issue:`num` `` | ||
or this Pull Request with `` :pull:`num` ``. Includes contributor name | ||
and/or GitHub username (link with `` :ghuser:`user` ``). | ||
- [ ] Non-API functions clearly documented with docstrings or comments as necessary | ||
- [ ] Added tests to cover all new or modified code | ||
- [ ] Pull request is nearly complete and ready for detailed review | ||
- [ ] Pull request is nearly complete and ready for detailed review. | ||
- [ ] Maintainer: Appropriate GitHub Labels and Milestone are assigned to the Pull Request and linked Issue. | ||
|
||
<!-- Please provide a brief description of the problem and the proposed solution or new feature (if not already fully described in a linked issue): --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
name: Upload to PyPi | ||
on: | ||
release: | ||
types: [published] | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
deploy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
version: 2 | ||
|
||
build: | ||
os: "ubuntu-22.04" | ||
tools: | ||
python: "3.7" | ||
|
||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
formats: all | ||
|
||
python: | ||
version: 3.7 | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- doc | ||
- optional | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
docs/examples/irradiance-quality/component-sum-irradiance.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
""" | ||
Component Sum Equations for Irradiance Data | ||
=========================================== | ||
Estimate GHI, DHI, and DNI using the component sum equations, with | ||
nighttime corrections. | ||
""" | ||
|
||
# %% | ||
# Estimating GHI, DHI, and DNI using the component sum equations is useful | ||
# if the associated field is missing, or as a comparison to an existing | ||
# physical data stream. | ||
|
||
import pvanalytics | ||
from pvanalytics.quality.irradiance import calculate_component_sum_series | ||
import pvlib | ||
import matplotlib.pyplot as plt | ||
import pandas as pd | ||
import pathlib | ||
|
||
# %% | ||
# First, read in data from the RMIS NREL system. This data set contains | ||
# 5-minute right-aligned data. It includes POA, GHI, | ||
# DNI, DHI, and GNI measurements. | ||
|
||
pvanalytics_dir = pathlib.Path(pvanalytics.__file__).parent | ||
rmis_file = pvanalytics_dir / 'data' / 'irradiance_RMIS_NREL.csv' | ||
data = pd.read_csv(rmis_file, index_col=0, parse_dates=True) | ||
|
||
# %% | ||
# Now generate solar zenith estimates for the location, | ||
# based on the data's time zone and site latitude-longitude | ||
# coordinates. This is done using the | ||
# :py:func:`pvlib.solarposition.get_solarposition` function. | ||
latitude = 39.742 | ||
longitude = -105.18 | ||
time_zone = "Etc/GMT+7" | ||
data = data.tz_localize(time_zone) | ||
solar_position = pvlib.solarposition.get_solarposition(data.index, | ||
latitude, | ||
longitude) | ||
|
||
|
||
# %% | ||
# Get the clearsky DNI values associated with the current location, using | ||
# the :py:func:`pvlib.solarposition.get_solarposition` function. These clearsky | ||
# values are used to calculate DNI data. | ||
site = pvlib.location.Location(latitude, longitude, tz=time_zone) | ||
clearsky = site.get_clearsky(data.index) | ||
|
||
# %% | ||
# Use :py:func:`pvanalytics.quality.irradiance.calcuate_ghi_component` | ||
# to estimate GHI measurements using DHI and DNI measurements | ||
|
||
component_sum_ghi = calculate_component_sum_series( | ||
solar_zenith=solar_position['zenith'], | ||
dhi=data['irradiance_dhi__7983'], | ||
dni=data['irradiance_dni__7982'], | ||
zenith_limit=90, | ||
fill_night_value='equation') | ||
|
||
# %% | ||
# Plot the 'irradiance_ghi__7981' data stream against the estimated component | ||
# sum GHI, for comparison | ||
data['irradiance_ghi__7981'].plot() | ||
component_sum_ghi.plot() | ||
plt.legend(labels=["RMIS GHI", "Component Sum GHI"], | ||
loc="upper left") | ||
plt.xlabel("Date") | ||
plt.ylabel("GHI (W/m^2)") | ||
plt.tight_layout() | ||
plt.show() | ||
|
||
# %% | ||
# Use :py:func:`pvanalytics.quality.irradiance.calcuate_dhi_component` | ||
# to estimate DHI measurements using GHI and DNI measurements | ||
|
||
component_sum_dhi = calculate_component_sum_series( | ||
solar_zenith=solar_position['zenith'], | ||
dni=data['irradiance_dni__7982'], | ||
ghi=data['irradiance_ghi__7981'], | ||
zenith_limit=90, | ||
fill_night_value='equation') | ||
|
||
# %% | ||
# Plot the 'irradiance_dhi__7983' data stream against the estimated component | ||
# sum GHI, for comparison | ||
data['irradiance_dhi__7983'].plot() | ||
component_sum_dhi.plot() | ||
plt.legend(labels=["RMIS DHI", "Component Sum DHI"], | ||
loc="upper left") | ||
plt.xlabel("Date") | ||
plt.ylabel("GHI (W/m^2)") | ||
plt.tight_layout() | ||
plt.show() | ||
|
||
# %% | ||
# Use :py:func:`pvanalytics.quality.irradiance.calcuate_dni_component` | ||
# to estimate DNI measurements using GHI and DHI measurements | ||
|
||
component_sum_dni = calculate_component_sum_series( | ||
solar_zenith=solar_position['zenith'], | ||
dhi=data['irradiance_dhi__7983'], | ||
ghi=data['irradiance_ghi__7981'], | ||
dni_clear=clearsky['dni'], | ||
zenith_limit=90, | ||
fill_night_value='equation') | ||
|
||
# %% | ||
# Plot the 'irradiance_dni__7982' data stream against the estimated component | ||
# sum GHI, for comparison | ||
data['irradiance_dni__7982'].plot() | ||
component_sum_dni.plot() | ||
plt.legend(labels=["RMIS DNI", "Component Sum DNI"], | ||
loc="upper left") | ||
plt.xlabel("Date") | ||
plt.ylabel("DNI (W/m^2)") | ||
plt.tight_layout() | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PVFleets QA Examples | ||
-------------------- | ||
|
||
These examples highlight the QA processes for temperature, power and irradiance data streams that are used in the NREL | ||
PV Fleet Performance Data Initiative (https://www.nrel.gov/pv/fleet-performance-data-initiative.html). |
Oops, something went wrong.