Skip to content

Commit

Permalink
Draft of sphinx docs for the functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jranalli committed Jul 18, 2024
1 parent 8b0d6dd commit cbbb277
Show file tree
Hide file tree
Showing 16 changed files with 237 additions and 208 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,8 @@ dmypy.json

# IDE Files
.idea*
*.egg
*.egg

# Sphinx Generated files
/docs/sphinx/build/*
/docs/sphinx/source/generated/*
11 changes: 0 additions & 11 deletions docs/sphinx/source/api.rst

This file was deleted.

25 changes: 24 additions & 1 deletion docs/sphinx/source/cmv.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
.. currentmodule:: solartoolbox

Cloud Motion Vector Identification
----------------------------------
The `cmv` module contains tools for identifying the cloud motion vector (CMV) from a distributed network of measurement sensors. Two methods are implemented, that of Jamaly and Kleissl [1] and of Gagne et al. [2].

The tool also contains a function for identifying the optimum subset of CMV vectors from among a long list of CMV pairs. This functions serves as part of the automated CMV identification workflow that serves the :mod:`solartoolbox.field` module.

See examples found in the :ref:`cmv-examples` section. `cmv_demo` highlights identification of the CMV, while `automate_cmv_demo` shows how a group of useful CMVs can be downselected from a long time series of data [3].

[1] M. Jamaly and J. Kleissl, "Robust cloud motion estimation by spatio-temporal correlation analysis of irradiance data," Solar Energy, vol. 159, pp. 306-317, Jan. 2018. https://www.sciencedirect.com/science/article/pii/S0038092X17309556

[2] A. Gagne, N. Ninad, J. Adeyemo, D. Turcotte, and S. Wong, "Directional Solar Variability Analysis," in 2018 IEEE Electrical Power and Energy Conference (EPEC) (2018) pp. 1-6, iSSN: 2381-2842 https://www.researchgate.net/publication/330877949_Directional_Solar_Variability_Analysis

[3] J. Ranalli and W.B. Hobbs, “Automating Methods for Validating PV Plant Equipment Labels,” 52nd IEEE PV Specialists Conference, 2024.

.. automodule:: solartoolbox.cmv
:members: compute_cmv, optimum_subset


.. rubric:: Functions

.. autosummary::
:toctree: generated/

compute_cmv
optimum_subset


2 changes: 1 addition & 1 deletion docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
# html_static_path = ['_static']

# Control the display of class members
autodoc_member_order = 'bysource'
Expand Down
4 changes: 4 additions & 0 deletions docs/sphinx/source/examples.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _cmv-examples:

CMV Examples
------------

Expand All @@ -7,6 +9,8 @@ CMV Examples
demos/cmv_demo
demos/automate_cmv_demo

.. _field-examples:

Field Analysis Examples
-----------------------

Expand Down
23 changes: 22 additions & 1 deletion docs/sphinx/source/field.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
.. currentmodule:: solartoolbox

Plant Field Validation
----------------------

The `field` module contains functions for validating the positions of solar panels in a plant field. It relies on knowledge of the cloud motion vector (see :mod:`solartoolbox.cmv`) and several signal processing routines in :mod:`solartoolbox.signalproc`. Full details of the methodology are available in reference papers [1, 2].

For example usages, see the :ref:`field-examples` page, specifically `field_demo`, `field_demo_detailed` and `field_reassignment_demo`. Examples of the full workflow are available in python files in the `demos` directory, `field_demo_full_process.py` and `field_demo_full_process_multithread.py`.

[1] J. Ranalli and W. Hobbs, “PV Plant Equipment Labels and Layouts can be Validated by Analyzing Cloud Motion in Existing Plant Measurements,” IEEE Journal of Photovoltaics, Vol. 14, No. 3, pp. 538-548, 2024. DOI: https://doi.org/10.1109/JPHOTOV.2024.3366666

[2] J. Ranalli and W.B. Hobbs, “Automating Methods for Validating PV Plant Equipment Labels,” 52nd IEEE PV Specialists Conference, 2024.

.. automodule:: solartoolbox.field
:members: compute_predicted_position, compute_delays, assign_positions, remap_positions, cascade_remap


.. rubric:: Functions

.. autosummary::
:toctree: generated/

compute_predicted_position
compute_delays
assign_positions
remap_positions
cascade_remap
37 changes: 0 additions & 37 deletions docs/sphinx/source/generated/solartoolbox.cmv.rst

This file was deleted.

33 changes: 0 additions & 33 deletions docs/sphinx/source/generated/solartoolbox.field.rst

This file was deleted.

23 changes: 0 additions & 23 deletions docs/sphinx/source/generated/solartoolbox.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/sphinx/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ documentation for details.

cmv
field
api
othermods

.. toctree::
:maxdepth: 2
Expand Down
100 changes: 100 additions & 0 deletions docs/sphinx/source/othermods.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
Other Functions
===============

signalproc module
-----------------
This module contains functions for performing common digital signal processing tasks. Many are utilized by other modules within the package. In the context of the cmv and field modules, these functions are used primarily to calculate relationships between signals, specifically relative delays.

.. automodule:: solartoolbox.signalproc

.. rubric:: Signal Processing Functions

.. autosummary::
:toctree: generated/

averaged_psd
averaged_tf
correlation
tf_delay
xcorr_delay
compute_delays
interp_tf
apply_delay


spatial module
--------------

.. automodule:: solartoolbox.spatial

.. rubric:: Coordinates and Vector Projections

These functions are utilized as parts of the CMV and field modules. The first two are used to transform between latitude and longitude coordinates and a cartesian frame more suitable for use with the CMV and field routines. The remaining functions are used to perform vector operations on the field of points within the cartesian coordinate frame.

.. autosummary::
:toctree: generated/

latlon2utm
utm2latlon
project_vectors
compute_vectors
compute_intersection

.. rubric:: Basic Vector Operations

The following functions are simply implementations of common vector operations that are utilized by other sections of the code. They are only included here for completeness.

.. autosummary::
:toctree: generated/

dot
unit
magnitude
pol2rect
rect2pol
rotate_vector

stats module
------------

.. automodule:: solartoolbox.stats

.. rubric:: Variability Metrics

These functions represent metrics that are used to analyze variability.

.. autosummary::
:toctree: generated/

variability_score
variability_index
darr
calc_quantile

.. rubric:: Basic Statistics

These are just implementations of basic statistical error calculations and are only included as shortcuts for the user.

.. autosummary::
:toctree: generated/

rmse
mse
squared_error
mae
absolute_error
bias_error
mbe

irradiance module
-----------------
This module solely serves as a helper, wrapping the `pvlib` function `pvlib.irradiance.clearsky_index`, which doesn't natively handle some of the data types used by this package.

.. automodule:: solartoolbox.irradiance

.. rubric:: Functions

.. autosummary::
:toctree: generated/

clearsky_index
51 changes: 0 additions & 51 deletions docs/sphinx/source/solartoolbox.rst

This file was deleted.

Loading

0 comments on commit cbbb277

Please sign in to comment.