-
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.
Orientation sphinx documentation (#148)
* Push up dummy files for the two orientation functions. * add example for nrel mesa 1axis tracker * update the routines for tracking and fixed tilt sunny days mask. * updated the tracking routine to output plot * added data files. * fixed pep8 errors in docs. * added to whatsnew file, docstring cleanup * removed duplicate in documentation * recommit bc jobs didn't run * remove redundant data processing for tracking example * update docs before branch switch * Update docs/examples/fixed-nrel.py Co-authored-by: Kevin Anderson <[email protected]> * updated with OEDI system ID * update the name of the serf east file * Update the routine with the csv name * pushed up reduced size file + changed wording per @kanderso-nrel's request * fixed missing index on serf 15-min data file * update the file to remove nan rows Co-authored-by: Perry <[email protected]> Co-authored-by: Kevin Anderson <[email protected]> Co-authored-by: Perry <kperry>
- Loading branch information
1 parent
76a8ccc
commit 5bac346
Showing
5 changed files
with
1,269 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
""" | ||
Flag Sunny Days for a Fixed-Tilt System | ||
======================================= | ||
Flag sunny days for a fixed-tilt PV system. | ||
""" | ||
|
||
# %% | ||
# Identifying and masking sunny days for a fixed-tilt system is important | ||
# when performing future analyses that require filtered sunny day data. | ||
# For this example we will use data from the fixed-tilt NREL SERF East system | ||
# located on the NREL campus in Colorado, USA, and generate a sunny day mask. | ||
# This data set is publicly available via the PVDAQ database in the | ||
# DOE Open Energy Data Initiative (OEDI) | ||
# (https://data.openei.org/submissions/4568), as system ID 50. | ||
# This data is timezone-localized. | ||
|
||
import pvanalytics | ||
from pvanalytics.features import daytime as day | ||
from pvanalytics.features.orientation import fixed_nrel | ||
import matplotlib.pyplot as plt | ||
import pandas as pd | ||
import pathlib | ||
|
||
# %% | ||
# First, read in data from the NREL SERF East fixed-tilt system. This data | ||
# set contains 15-minute interval AC power data. | ||
|
||
pvanalytics_dir = pathlib.Path(pvanalytics.__file__).parent | ||
file = pvanalytics_dir / 'data' / 'serf_east_15min_ac_power.csv' | ||
data = pd.read_csv(file, index_col=0, parse_dates=True) | ||
|
||
|
||
# %% | ||
# Mask day-night periods using the | ||
# :py:func:`pvanalytics.features.daytime.power_or_irradiance` function. | ||
# Then apply :py:func:`pvanalytics.features.orientation.fixed_nrel` | ||
# to the AC power stream and mask the sunny days in the time series. | ||
|
||
daytime_mask = day.power_or_irradiance(data['ac_power']) | ||
|
||
fixed_sunny_days = fixed_nrel(data['ac_power'], | ||
daytime_mask) | ||
|
||
# %% | ||
# Plot the AC power stream with the sunny day mask applied to it. | ||
|
||
data['ac_power'].plot() | ||
data.loc[fixed_sunny_days, 'ac_power'].plot(ls='', marker='.') | ||
plt.legend(labels=["AC Power", "Sunny Day"], | ||
loc="upper left") | ||
plt.xlabel("Date") | ||
plt.ylabel("AC Power (kW)") | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
""" | ||
Flag Sunny Days for a Tracking System | ||
===================================== | ||
Flag sunny days for a single-axis tracking PV system. | ||
""" | ||
|
||
# %% | ||
# Identifying and masking sunny days for a single-axis tracking system is | ||
# important when performing future analyses that require filtered sunny day | ||
# data. For this example we will use data from the single-axis tracking | ||
# NREL Mesa system located on the NREL campus in Colorado, USA, and generate | ||
# a sunny day mask. | ||
# This data set is publicly available via the PVDAQ database in the | ||
# DOE Open Energy Data Initiative (OEDI) | ||
# (https://data.openei.org/submissions/4568), as system ID 50. | ||
# This data is timezone-localized. | ||
|
||
import pvanalytics | ||
from pvanalytics.features import daytime as day | ||
from pvanalytics.features.orientation import tracking_nrel | ||
import matplotlib.pyplot as plt | ||
import pandas as pd | ||
import pathlib | ||
|
||
# %% | ||
# First, read in data from the NREL Mesa 1-axis tracking system. This data | ||
# set contains 15-minute interval AC power data. | ||
|
||
pvanalytics_dir = pathlib.Path(pvanalytics.__file__).parent | ||
file = pvanalytics_dir / 'data' / 'nrel_1axis_tracker_mesa_ac_power.csv' | ||
data = pd.read_csv(file, index_col=0, parse_dates=True) | ||
|
||
# %% | ||
# Mask day-night periods using the | ||
# :py:func:`pvanalytics.features.daytime.power_or_irradiance` function. | ||
# Then apply :py:func:`pvanalytics.features.orientation.tracking_nrel` | ||
# to the AC power stream and mask the sunny days in the time series. | ||
|
||
daytime_mask = day.power_or_irradiance(data['ac_power']) | ||
|
||
tracking_sunny_days = tracking_nrel(data['ac_power'], | ||
daytime_mask) | ||
|
||
# %% | ||
# Plot the AC power stream with the sunny day mask applied to it. | ||
|
||
data['ac_power'].plot() | ||
data.loc[tracking_sunny_days, 'ac_power'].plot(ls='', marker='.') | ||
plt.legend(labels=["AC Power", "Sunny Day"], | ||
loc="upper left") | ||
plt.xlabel("Date") | ||
plt.ylabel("AC Power (kW)") | ||
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
Oops, something went wrong.