.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/gallery/system/system-tracking.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_system_system-tracking.py: Detect if a System is Tracking ============================== Identifying if a system is tracking or fixed tilt .. GENERATED FROM PYTHON SOURCE LINES 9-16 It is valuable to identify if a system is fixed tilt or tracking for future analysis. This example shows how to use :py:func:`pvanalytics.system.is_tracking_envelope` to determine if a system is tracking or not by fitting data to a maximum power or irradiance envelope, and fitting this envelope to quadratic and quartic curves. The r^2 output from these fits is used to determine if the system fits a tracking or fixed-tilt profile. .. GENERATED FROM PYTHON SOURCE LINES 16-25 .. code-block:: default import pvanalytics from pvanalytics.system import is_tracking_envelope from pvanalytics.features.clipping import geometric from pvanalytics.features.daytime import power_or_irradiance import pandas as pd import pathlib import matplotlib.pyplot as plt .. GENERATED FROM PYTHON SOURCE LINES 26-32 First, we import an AC power data stream from the SERF East site located at NREL. This data set is publicly available via the PVDAQ database in the DOE Open Energy Data Initiative (OEDI) (https://data.openei.org/submissions/4568), under system ID 50. This data is timezone-localized. This particular data stream is associated with a fixed-tilt system. .. GENERATED FROM PYTHON SOURCE LINES 32-45 .. code-block:: default pvanalytics_dir = pathlib.Path(pvanalytics.__file__).parent ac_power_file = pvanalytics_dir / 'data' / \ 'serf_east_15min_ac_power.csv' data = pd.read_csv(ac_power_file, index_col=0, parse_dates=True) data = data.sort_index() time_series = data['ac_power'] time_series = time_series.asfreq('15T') # Plot the first few days of the time series to visualize it time_series[:pd.to_datetime("2016-07-06 00:00:00-07:00")].plot() plt.show() .. image-sg:: /generated/gallery/system/images/sphx_glr_system-tracking_001.png :alt: system tracking :srcset: /generated/gallery/system/images/sphx_glr_system-tracking_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 46-49 Run the clipping and the daytime filters on the time series. Both of these masks will be used as inputs to the :py:func:`pvanalytics.system.is_tracking_envelope` function. .. GENERATED FROM PYTHON SOURCE LINES 49-56 .. code-block:: default # Generate the daylight mask for the AC power time series daytime_mask = power_or_irradiance(time_series) # Generate the clipping mask for the time series clipping_mask = geometric(time_series) .. GENERATED FROM PYTHON SOURCE LINES 57-60 Now, we use :py:func:`pvanalytics.system.is_tracking_envelope` to identify if the data stream is associated with a tracking or fixed-tilt system. .. GENERATED FROM PYTHON SOURCE LINES 60-66 .. code-block:: default predicted_mounting_config = is_tracking_envelope(time_series, daytime_mask, clipping_mask) print("Estimated mounting configuration: " + predicted_mounting_config.name) .. rst-class:: sphx-glr-script-out .. code-block:: none Estimated mounting configuration: FIXED .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.197 seconds) .. _sphx_glr_download_generated_gallery_system_system-tracking.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: system-tracking.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: system-tracking.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_