Skip to content

Commit

Permalink
removed extra backslashes
Browse files Browse the repository at this point in the history
  • Loading branch information
j-emberton committed Oct 23, 2024
1 parent 282150f commit c13f81f
Showing 1 changed file with 40 additions and 40 deletions.
80 changes: 40 additions & 40 deletions pyrealm/core/solar.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def calc_distance_factor(nu: NDArray, k_e: float) -> NDArray:
r"""Calculates distance factor.
This function calculates the distance factor :math:`dr` using the method of \
This function calculates the distance factor :math:`dr` using the method of
:cite:t:`berger:1993a`.
.. math::
Expand Down Expand Up @@ -44,7 +44,7 @@ def calc_declination_angle_delta(
) -> NDArray:
r"""Calculates declination angle delta.
This function calculates the solar declination angle delta using the method of \
This function calculates the solar declination angle delta using the method of
:cite:t:`Woolf:1968`.
.. math::
Expand All @@ -71,8 +71,8 @@ def calc_lat_delta_intermediates(
) -> tuple[NDArray, NDArray]:
r"""Calculates intermediate values for use in solar radiation calcs.
This function calculates :math:`ru` and :math:`rv` which are dimensionless \
intermediate values calculated from the solar declination angle delta and the \
This function calculates :math:`ru` and :math:`rv` which are dimensionless
intermediate values calculated from the solar declination angle delta and the
observation latitude.
.. math::
Expand Down Expand Up @@ -100,7 +100,7 @@ def calc_lat_delta_intermediates(
def calc_sunset_hour_angle(delta: NDArray, latitude: NDArray, k_pir: float) -> NDArray:
r"""Calculates sunset hour angle.
This function calculates the sunset hour angle :math:`hs` using eq3.22 \
This function calculates the sunset hour angle :math:`hs` using eq3.22
:cite:t:`stine_geyer:2001`.
.. math::
Expand All @@ -127,8 +127,8 @@ def _calc_sunset_hour_angle_from_ru_rv(
) -> NDArray:
"""Calculate sunset hour angle from intermediates.
This function calculates the sunset hour angle using Eq3.22, \
:cite:t:'stine_geyer:2001'.
This function calculates the sunset hour angle using Eq3.22,
:cite:t:'stine_geyer:2001'.
Args:
ru: dimensionless parameter
Expand All @@ -147,7 +147,7 @@ def calc_daily_solar_radiation(
) -> NDArray:
r"""Calculate daily extraterrestrial solar radiation (J/m^2).
This function calculates the daily extraterrestrial solar radition :math:`J/m^2` \
This function calculates the daily extraterrestrial solar radition :math:`J/m^2`
using Eq. 1.10.3 :cite:t:`Duffie:2013a`.
.. math::
Expand Down Expand Up @@ -178,7 +178,7 @@ def _calc_daily_solar_radiation(
) -> NDArray:
"""Calculate daily extraterrestrial solar radiation (J/m^2).
This function calculates the daily extraterrestrial solar radition (J/m^2) using \
This function calculates the daily extraterrestrial solar radition (J/m^2) using
Eq. 1.10.3, :cite:t:`Duffie:2013a`.
Args:
Expand Down Expand Up @@ -208,7 +208,7 @@ def _calc_daily_solar_radiation(
def calc_transmissivity(sf: NDArray, elv: NDArray, k_c: float, k_d: float) -> NDArray:
r"""Calculate atmospheric transmissivity, :math:`tau`.
This function calculates atmospheric transmissivity using the method of Eq.11, \
This function calculates atmospheric transmissivity using the method of Eq.11,
:cite:t:`Linacre:1968a` and Eq 2, :cite:t:`allen:1996a`.
.. math::
Expand All @@ -235,7 +235,7 @@ def calc_ppfd_from_tau_ra_d(
) -> NDArray:
r"""Calculate photosynthetic photon flux density, :math:`PPFD`,(mol/m^2).
This function calculates the :math:`PPFD` in :math:`mol/m^2` from secondary \
This function calculates the :math:`PPFD` in :math:`mol/m^2` from secondary
calculated variables, and constants.
.. math::
Expand Down Expand Up @@ -269,7 +269,7 @@ def calc_ppfd(
) -> NDArray:
r"""Calculates Photosynthetic Photon Flux Density, :math:`PPFD`, (:math:`mol/m^2`).
This function calculates :math:`PPFD` (:math:`mol/m^2`) from the observation \
This function calculates :math:`PPFD` (:math:`mol/m^2`) from the observation
location and time using the following calculations:
- :func:`calc_heliocentric_longitudes`
Expand Down Expand Up @@ -345,7 +345,7 @@ def calc_net_longwave_radiation(
) -> NDArray:
r"""Calculates net longwave radiation, :math:`rnl`, :math:`W/m^2`.
This function calculates net longwave radiation in :math:`W/m^2` using the methods \
This function calculates net longwave radiation in :math:`W/m^2` using the methods
of Eq. 11, :cite:t:`colinprentice:1993a`, Eq. 5 and 6 :cite:t:`Linacre:1968a` .
.. math::
Expand Down Expand Up @@ -399,7 +399,7 @@ def calc_net_rad_crossover_hour_angle(
) -> NDArray:
r"""Calculates the net radiation crossover hour angle, :math:`hn` degrees.
This function calculates the net radiation crossover hour angle :math:`hn` in \
This function calculates the net radiation crossover hour angle :math:`hn` in
degrees.
.. math::
Expand Down Expand Up @@ -608,8 +608,8 @@ def calc_heliocentric_longitudes(
) -> tuple[NDArray, NDArray]:
"""Calculate heliocentric longitude and anomaly.
This function calculates the heliocentric true anomaly (``nu``, degrees) and true \
longitude (``lambda_``, degrees), given the Julian day in the year and the \
This function calculates the heliocentric true anomaly (``nu``, degrees) and true
longitude (``lambda_``, degrees), given the Julian day in the year and the
number of days in the year, following :cite:t:`berger:1978a`.
Args:
Expand Down Expand Up @@ -672,11 +672,11 @@ def calc_heliocentric_longitudes(
def calc_solar_elevation(site_obs_data: LocationDateTime) -> NDArray:
r"""Calculate the solar elevation angle for a specific location and times.
This function calculates the solar elevation angle, which is the angle between the \
sun and the observer's local horizon, using the methods outlined in \
This function calculates the solar elevation angle, which is the angle between the
sun and the observer's local horizon, using the methods outlined in
:cite:t:`depury:1997a`.
NB: This implementation does not correct for the effect of local observation \
NB: This implementation does not correct for the effect of local observation
altitude on perceived solar elevation.
This approach uses the following calculations:
Expand All @@ -689,12 +689,12 @@ def calc_solar_elevation(site_obs_data: LocationDateTime) -> NDArray:
- :func:`elevation_from_lat_dec_hn`
Args:
site_obs_data: A :class:`~pyrealm.core.calendar.LocationDateTime` instance \
containing the location and time-specific information for the observation \
site_obs_data: A :class:`~pyrealm.core.calendar.LocationDateTime` instance
containing the location and time-specific information for the observation
site.
Returns:
An array of solar elevation angles in radians, representing the angular height \
An array of solar elevation angles in radians, representing the angular height
of the sun above the horizon at the specified location and time.
Example:
Expand Down Expand Up @@ -736,12 +736,12 @@ def elevation_from_lat_dec_hn(
) -> NDArray:
r"""Calculate the elevation angle of the sun above the horizon.
The elevation angle (or solar altitude angle) is the angle between the horizon and \
the sun, which indicates how high the sun is in the sky at a given time. This \
function calculates the elevation angle based on the observer's latitude, the \
The elevation angle (or solar altitude angle) is the angle between the horizon and
the sun, which indicates how high the sun is in the sky at a given time. This
function calculates the elevation angle based on the observer's latitude, the
solar declination, and the hour angle.
The calculation is based on the following trigonometric relationship based on Eqn \
The calculation is based on the following trigonometric relationship based on Eqn
A13, :cite:t:`depury:1997a`:
.. math::
Expand Down Expand Up @@ -784,7 +784,7 @@ def elevation_from_lat_dec_hn(
def solar_declination(td: NDArray) -> NDArray:
r"""Calculates solar declination angle.
Use method described in eqn A14 of :cite:t:`depury:1997a` to calculate solar \
Use method described in eqn A14 of :cite:t:`depury:1997a` to calculate solar
declination angle, from day of the year.
.. math::
Expand All @@ -807,10 +807,10 @@ def solar_declination(td: NDArray) -> NDArray:
def local_hour_angle(t: NDArray, t0: NDArray) -> NDArray:
r"""Calculate the local hour angle :math:`h` for a given time and solar noon.
The local hour angle is a measure of time, expressed in angular terms, that \
indicates the position of the sun relative to solar noon. This function \
calculates the local hour angle by determining the difference between the \
current time (``t``) and the solar noon time (:math:`t_{0}`), and then \
The local hour angle is a measure of time, expressed in angular terms, that
indicates the position of the sun relative to solar noon. This function
calculates the local hour angle by determining the difference between the
current time (``t``) and the solar noon time (:math:`t_{0}`), and then
converting this difference into an angle.
Equation implemented from A15 :cite:t:`depury:1997a`.
Expand All @@ -823,8 +823,8 @@ def local_hour_angle(t: NDArray, t0: NDArray) -> NDArray:
t0: Array of solar noon time values in hours (as a floating-point number).
Returns:
The local hour angle in radians (as a floating-point number array), which \
represents the angular distance of the sun from the local meridian at the \
The local hour angle in radians (as a floating-point number array), which
represents the angular distance of the sun from the local meridian at the
given time.
"""
Expand All @@ -837,10 +837,10 @@ def local_hour_angle(t: NDArray, t0: NDArray) -> NDArray:
def solar_noon(L_e: float, L_s: float, E_t: NDArray) -> NDArray:
r"""Calculate the solar noon time for a given location.
The solar noon is the time of day when the sun is at its highest point in the sky \
for a given location. This function calculates the solar noon by adjusting the \
standard noon time (12:00 PM) based on the difference between the local \
longitude (:math:`L_{e}`) and the local standard meridian (:math:`L_{s}`) and \
The solar noon is the time of day when the sun is at its highest point in the sky
for a given location. This function calculates the solar noon by adjusting the
standard noon time (12:00 PM) based on the difference between the local
longitude (:math:`L_{e}`) and the local standard meridian (:math:`L_{s}`) and
the equation of time (:math:`E_{t}`). Based on EqA16, :cite:t:`depury:1997a`.
.. math:: t_{0} = 12 + \frac{4 \cdot -(L_{e} - L_{s}) - E_{t}}{60}
Expand All @@ -866,7 +866,7 @@ def solar_noon(L_e: float, L_s: float, E_t: NDArray) -> NDArray:
def equation_of_time(day_angle: NDArray) -> NDArray:
r"""Calculates equation of time in minutes.
Based on eqn 1.4.1 :cite:t:`iqbal:1983a` rather than eqn A17 \
Based on eqn 1.4.1 :cite:t:`iqbal:1983a` rather than eqn A17
:cite:t:`depury:1997a` due to incorrect reported implementation in the latter.
.. math::
Expand Down Expand Up @@ -901,8 +901,8 @@ def equation_of_time(day_angle: NDArray) -> NDArray:
def day_angle(t_d: NDArray) -> NDArray:
r"""Calculates solar day angle (gamma), radians.
The day angle (``gamma``) for a given day of the year ``N``, (where N=1 for \
January 1st and N=365 for December 31st) can be calculated using the following \
The day angle (``gamma``) for a given day of the year ``N``, (where N=1 for
January 1st and N=365 for December 31st) can be calculated using the following
formula:
Based on Eqn A18, :cite:t:`depury:1997a`.
Expand Down

0 comments on commit c13f81f

Please sign in to comment.