.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/gallery/orientation/fixed-nrel.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_generated_gallery_orientation_fixed-nrel.py: Flag Sunny Days for a Fixed-Tilt System ======================================= Flag sunny days for a fixed-tilt PV system. .. GENERATED FROM PYTHON SOURCE LINES 9-17 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. .. GENERATED FROM PYTHON SOURCE LINES 17-25 .. code-block:: default 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 .. GENERATED FROM PYTHON SOURCE LINES 26-28 First, read in data from the NREL SERF East fixed-tilt system. This data set contains 15-minute interval AC power data. .. GENERATED FROM PYTHON SOURCE LINES 28-34 .. code-block:: default 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) .. GENERATED FROM PYTHON SOURCE LINES 35-39 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. .. GENERATED FROM PYTHON SOURCE LINES 39-45 .. code-block:: default daytime_mask = day.power_or_irradiance(data['ac_power']) fixed_sunny_days = fixed_nrel(data['ac_power'], daytime_mask) .. GENERATED FROM PYTHON SOURCE LINES 46-47 Plot the AC power stream with the sunny day mask applied to it. .. GENERATED FROM PYTHON SOURCE LINES 47-56 .. code-block:: default 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() .. image-sg:: /generated/gallery/orientation/images/sphx_glr_fixed-nrel_001.png :alt: fixed nrel :srcset: /generated/gallery/orientation/images/sphx_glr_fixed-nrel_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.369 seconds) .. _sphx_glr_download_generated_gallery_orientation_fixed-nrel.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: fixed-nrel.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: fixed-nrel.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_