Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/sphinx/source/whatsnew/v0.12.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. _whatsnew_01201:


v0.12.1 (XXXX, 2025)
------------------------

Breaking Changes
~~~~~~~~~~~~~~~~


Bug fixes
~~~~~~~~~


Enhancements
~~~~~~~~~~~~


Documentation
~~~~~~~~~~~~~
* Add a supporting reference to :py:func:`pvlib.atmosphere.get_relative_airmass` (:issue:`2390`, :pull:`2424`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Add a supporting reference to :py:func:`pvlib.atmosphere.get_relative_airmass` (:issue:`2390`, :pull:`2424`)
* Add a supporting bibliographic reference to model ``gueymard1993`` in
:py:func:`pvlib.atmosphere.get_relative_airmass` (:issue:`2390`, :pull:`2424`)

Clarification for users out of context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought just "reference" was okay without "bibliographic". Adding the model ``gueymard1993`` in seems reasonable though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I sometimes think of code references, but given this piece of description is in the Docs section, you are completely right.


Testing
~~~~~~~


Maintenance
~~~~~~~~~~~


Contributors
~~~~~~~~~~~~
* Cliff Hansen (:ghuser:`cwhanse`)
32 changes: 16 additions & 16 deletions pvlib/atmosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,13 @@ def get_relative_airmass(zenith, model='kastenyoung1989'):

* 'simple' - secant(apparent zenith angle) -
Note that this gives -Inf at zenith=90
* 'kasten1966' - See reference [1] -
requires apparent sun zenith
* 'youngirvine1967' - See reference [2] -
requires true sun zenith
* 'kastenyoung1989' (default) - See reference [3] -
requires apparent sun zenith
* 'gueymard1993' - See reference [4] -
requires apparent sun zenith
* 'young1994' - See reference [5] -
requires true sun zenith
* 'pickering2002' - See reference [6] -
requires apparent sun zenith
* 'gueymard2003' - See references [7] and [8] -
requires apparent sun zenith
* 'kasten1966' - See [1]_ - requires apparent sun zenith
* 'youngirvine1967' - See [2]_ - requires true sun zenith
* 'kastenyoung1989' (default) - See [3]_ - requires apparent sun zenith
* 'gueymard1993' - See [4]_, [9]_ - requires apparent sun zenith
* 'young1994' - See [5]_ - requires true sun zenith
* 'pickering2002' - See [6]_ - requires apparent sun zenith
* 'gueymard2003' - See [7]_, [8]_ - requires apparent sun zenith
Copy link
Member

@RDaxini RDaxini Mar 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking, but should we adjust the order? [9] -> [5] and so on. I missed this earlier, just noticed it now.
(reference list would need to change accordingly)

Suggested change
* 'kasten1966' - See [1]_ - requires apparent sun zenith
* 'youngirvine1967' - See [2]_ - requires true sun zenith
* 'kastenyoung1989' (default) - See [3]_ - requires apparent sun zenith
* 'gueymard1993' - See [4]_, [9]_ - requires apparent sun zenith
* 'young1994' - See [5]_ - requires true sun zenith
* 'pickering2002' - See [6]_ - requires apparent sun zenith
* 'gueymard2003' - See [7]_, [8]_ - requires apparent sun zenith
* 'kasten1966' - See [1]_ - requires apparent sun zenith
* 'youngirvine1967' - See [2]_ - requires true sun zenith
* 'kastenyoung1989' (default) - See [3]_ - requires apparent sun zenith
* 'gueymard1993' - See [4]_, [5]_ - requires apparent sun zenith
* 'young1994' - See [6]_ - requires true sun zenith
* 'pickering2002' - See [7]_ - requires apparent sun zenith
* 'gueymard2003' - See [8]_, [9]_ - requires apparent sun zenith


Returns
-------
Expand All @@ -174,6 +167,8 @@ def get_relative_airmass(zenith, model='kastenyoung1989'):
other models use true (not refraction-adjusted) zenith angle. Apparent
zenith angles should be calculated at sea level.

Comparison among several models is reported in [10]_.

References
----------
.. [1] Fritz Kasten. "A New Table and Approximation Formula for the
Expand Down Expand Up @@ -206,9 +201,14 @@ def get_relative_airmass(zenith, model='kastenyoung1989'):
Mapping. Green Energy and Technology. Springer, Cham.
:doi:`10.1007/978-3-319-97484-2_5`

.. [9] Matthew J. Reno, Clifford W. Hansen and Joshua S. Stein, "Global
.. [9] C. Gueymard, "Development and performance assessment of a clear
sky spectral radiation model,” in Proc. of the 22nd ASES Conference,
Solar ’93, 1993, pp. 433–438.

.. [10] Matthew J. Reno, Clifford W. Hansen and Joshua S. Stein, "Global
Horizontal Irradiance Clear Sky Models: Implementation and Analysis"
Sandia Report, (2012).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Sandia Report, (2012).
Sandia Report, (2012).
:doi:`10.2172/1039404`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't add DOIs for the other references but here they are:
1: 11681/5671
2: 10.1086/110366
3: 10.1364/AO.28.004735
4: 10.1016/0038-092X(93)90074-X


'''

# set zenith values greater than 90 to nans
Expand Down Expand Up @@ -236,7 +236,7 @@ def get_relative_airmass(zenith, model='kastenyoung1989'):
(np.cos(zenith_rad) ** 3 +
0.149864*(np.cos(zenith_rad) ** 2) +
0.0102963*(np.cos(zenith_rad)) + 0.000303978))
elif 'gueymard1993' == model:
elif 'gueymard1993' == model: # [4], Eq. 22 and [9], Eq. 3b
am = (1.0 / (np.cos(zenith_rad) +
0.00176759*(z)*((94.37515 - z) ** - 1.21563)))
elif 'gueymard2003' == model:
Expand Down