Skip to content

Commit

Permalink
Miscellaneous improvements to spectrl2 docstring (#2168)
Browse files Browse the repository at this point in the history
* Update spectrl2.py

Co-Authored-By: Cliff Hansen <[email protected]>

* Update spectrl2.py

* Update spectrl2.py

Co-Authored-By: Kevin Anderson <[email protected]>

* Update spectrl2.py

proposal for a few minor changes

* Update spectrl2.py

Co-Authored-By: Echedey Luis <[email protected]>

---------

Co-authored-by: Cliff Hansen <[email protected]>
Co-authored-by: Kevin Anderson <[email protected]>
Co-authored-by: Echedey Luis <[email protected]>
  • Loading branch information
4 people authored Aug 30, 2024
1 parent e59d2b8 commit 9dfcf45
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions pvlib/spectrum/spectrl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,39 +181,39 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo,
(SPECTRL2).
The Bird Simple Spectral Model [1]_ produces terrestrial spectra between
300 and 4000 nm with a resolution of approximately 10 nm. Direct and
300 nm and 4000 nm with a resolution of approximately 10 nm. Direct and
diffuse spectral irradiance are modeled for horizontal and tilted surfaces
under cloudless skies. SPECTRL2 models radiative transmission, absorption,
and scattering due to atmospheric aerosol, water vapor, and ozone content.
Parameters
----------
apparent_zenith : numeric
Solar zenith angle [degrees]
Solar zenith angle. [degrees]
aoi : numeric
Angle of incidence of the solar vector on the panel [degrees]
Angle of incidence of the solar vector on the panel. [degrees]
surface_tilt : numeric
Panel tilt from horizontal [degrees]
Panel tilt from horizontal. [degrees]
ground_albedo : numeric
Albedo [0-1] of the ground surface. Can be provided as a scalar value
if albedo is not spectrally-dependent, or as a 122xN matrix where
the first dimension spans the wavelength range and the second spans
the number of simulations. [unitless]
surface_pressure : numeric
Surface pressure [Pa]
Surface pressure. [Pa]
relative_airmass : numeric
Relative airmass. The airmass model used in [1]_ is the `'kasten1966'`
model, while a later implementation by NREL uses the
`'kastenyoung1989'` model. [unitless]
precipitable_water : numeric
Atmospheric water vapor content [cm]
Atmospheric water vapor content. [cm]
ozone : numeric
Atmospheric ozone content [atm-cm]
Atmospheric ozone content. [atm-cm]
aerosol_turbidity_500nm : numeric
Aerosol turbidity at 500 nm [unitless]
Aerosol turbidity at 500 nm. [unitless]
dayofyear : numeric, optional
The day of year [1-365]. Must be provided if ``apparent_zenith`` is
not a pandas Series.
The day of year [1-365]. Must be provided if ``apparent_zenith`` is
not a ``pandas.Series``.
scattering_albedo_400nm : numeric, default 0.945
Aerosol single scattering albedo at 400nm. The default value of 0.945
is suggested in [1]_ for a rural aerosol model. [unitless]
Expand All @@ -223,15 +223,15 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo,
wavelength_variation_factor : numeric, default 0.095
Wavelength variation factor [unitless]
aerosol_asymmetry_factor : numeric, default 0.65
Aerosol asymmetry factor (mean cosine of scattering angle) [unitless]
Aerosol asymmetry factor (mean cosine of scattering angle). [unitless]
Returns
-------
spectra : dict
spectra_components : dict
A dict of arrays. With the exception of `wavelength`, which has length
122, each array has shape (122, N) where N is the length of the
input ``apparent_zenith``. All values are spectral irradiance
with units W/m^2/nm except for `wavelength`, which is in nanometers.
with units Wm⁻²nm⁻¹, except for `wavelength`, which is in nanometers.
* wavelength
* dni_extra
Expand Down Expand Up @@ -267,7 +267,7 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo,
References
----------
.. [1] Bird, R, and Riordan, C., 1984, "Simple solar spectral model for
.. [1] Bird, R., and Riordan, C., 1984, "Simple solar spectral model for
direct and diffuse irradiance on horizontal and tilted planes at the
earth's surface for cloudless atmospheres", NREL Technical Report
TR-215-2436 :doi:`10.2172/5986936`.
Expand Down Expand Up @@ -363,7 +363,7 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo,

# calculate spectral irradiance on a tilted surface, Eq 3-18
# Note: clipping cosd(aoi) to >=0 is not in the reference, but is necessary
# to prevent nonsense values when the sun is behind the plane of array.
# to prevent negative values when the sun is behind the plane of array.
# The same constraint is applied in irradiance.haydavies when not
# supplying `projection_ratio`.
aoi_projection_nn = np.maximum(cosd(aoi), 0) # GH 1348
Expand Down

0 comments on commit 9dfcf45

Please sign in to comment.