Skip to content

Commit

Permalink
docstring fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
  • Loading branch information
Zeitsperre committed Jan 24, 2025
1 parent e44aa0b commit e590702
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/xclim/ensembles/_robustness.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def robustness_fractions( # noqa: C901
And members showing absolutely no change are ``1 - nf - pf``.
Available statistical tests are :
Available statistical tests are:
{tests_doc}
Expand Down
30 changes: 15 additions & 15 deletions src/xclim/indices/_agro.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,25 +201,25 @@ def huglin_index(
.. math::
k = f(lat) = \begin{cases}
1, & \text{if } |lat| <= 40 \\
1 + ((abs(lat) - 40) / 10) * 0.06, & \text{if } 40 < |lat| <= 50 \\
NaN, & \text{if } |lat| > 50 \\
1, & \text{if } | lat | <= 40 \\
1 + ((abs(lat) - 40) / 10) * 0.06, & \text{if } 40 < | lat | <= 50 \\
NaN, & \text{if } | lat | > 50 \\
\end{cases}
For compatibility with ICCLIM, `end_date` should be set to `11-01`, `method` should be set to `icclim`. The
day-length multiplication factor, :math:`k`, is calculated as follows:
For compatibility with ICCLIM, `end_date` should be set to `11-01`, `method` should be set to `icclim`.
The day-length multiplication factor, :math:`k`, is calculated as follows:
.. math::
k = f(lat) = \begin{cases}
1.0, & \text{if } |lat| <= 40 \\
1.02, & \text{if } 40 < |lat| <= 42 \\
1.03, & \text{if } 42 < |lat| <= 44 \\
1.04, & \text{if } 44 < |lat| <= 46 \\
1.05, & \text{if } 46 < |lat| <= 48 \\
1.06, & \text{if } 48 < |lat| <= 50 \\
NaN, & \text{if } |lat| > 50 \\
\end{cases}
1.0, & \text{if } | lat | <= 40 \\
1.02, & \text{if } 40 < | lat | <= 42 \\
1.03, & \text{if } 42 < | lat | <= 44 \\
1.04, & \text{if } 44 < | lat | <= 46 \\
1.05, & \text{if } 46 < | lat | <= 48 \\
1.06, & \text{if } 48 < | lat | <= 50 \\
NaN, & \text{if } | lat | > 50 \\
\end{cases}
A more robust day-length calculation based on latitude, calendar, day-of-year, and obliquity is available with
`method="jones"`. See: :py:func:`xclim.indices.generic.day_lengths` or :cite:t:`hall_spatial_2010` for more
Expand Down Expand Up @@ -389,7 +389,7 @@ def biologically_effective_degree_days(
.. math::
k = f(lat) = 1 + \left(\frac{\left| lat \right|}{50} * 0.06, \text{if }40 < |lat| <50, \text{else } 0\right)
k = f(lat) = 1 + \left(\frac{\left| lat \right|}{50} * 0.06, \text{if }40 < ``|lat|`` <50, \text{else } 0\right)
A second version of the BEDD (`method="icclim"`) does not consider :math:`TR_{adj}` and :math:`k` and employs a
different end date (30 September) :cite:p:`project_team_eca&d_algorithm_2013`.
Expand Down Expand Up @@ -785,7 +785,7 @@ def latitude_temperature_index(
.. math::
LTI = max(TN_{j}: j = 1..12)(lat_f - |lat|)
LTI = max(TN_{j}: j = 1..12)(lat_f - | lat | )
References
----------
Expand Down
34 changes: 20 additions & 14 deletions src/xclim/indices/_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,24 +1397,30 @@ def potential_evapotranspiration(
-----
Available methods are:
- "baierrobertson65" or "BR65", based on :cite:t:`baier_estimation_1965`.
Requires tasmin and tasmax, daily [D] freq.
- "hargreaves85" or "HG85", based on :cite:t:`george_h_hargreaves_reference_1985`.
Requires tasmin and tasmax, daily [D] freq. (optional: tas can be given in addition of tasmin and tasmax).
- "mcguinnessbordne05" or "MB05", based on :cite:t:`tanguy_historical_2018`.
Requires tas, daily [D] freq, with latitudes 'lat'.
- "thornthwaite48" or "TW48", based on :cite:t:`thornthwaite_approach_1948`.
Requires tasmin and tasmax, monthly [MS] or daily [D] freq.
(optional: tas can be given instead of tasmin and tasmax).
- "allen98" or "FAO_PM98", based on :cite:t:`allen_crop_1998`. Modification of Penman-Monteith method.
Requires tasmin and tasmax, relative humidity, radiation flux and wind speed (10 m wind will be converted to 2 m).
- "droogersallen02" or "DA02", based on :cite:t:`droogers2002`.
Requires tasmin, tasmax and precipitation, monthly [MS] or daily [D] freq. (optional: tas can be given in addition of tasmin and tasmax).
- "baierrobertson65" or "BR65", based on :cite:t:`baier_estimation_1965`.
Requires tasmin and tasmax, daily [D] freq.
- "hargreaves85" or "HG85", based on :cite:t:`george_h_hargreaves_reference_1985`.
Requires tasmin and tasmax, daily [D] freq. (optional: tas can be given in addition of tasmin and tasmax).
- "mcguinnessbordne05" or "MB05", based on :cite:t:`tanguy_historical_2018`.
Requires tas, daily [D] freq, with latitudes 'lat'.
- "thornthwaite48" or "TW48", based on :cite:t:`thornthwaite_approach_1948`.
Requires tasmin and tasmax, monthly [MS] or daily [D] freq.
(optional: tas can be given instead of tasmin and tasmax).
- "allen98" or "FAO_PM98", based on :cite:t:`allen_crop_1998`. Modification of Penman-Monteith method.
Requires tasmin and tasmax, relative humidity, radiation flux and wind speed (10 m wind will be converted to 2 m).
- "droogersallen02" or "DA02", based on :cite:t:`droogers2002`.
Requires tasmin, tasmax and precipitation, monthly [MS] or daily [D] freq. (optional: tas can be given in addition of tasmin and tasmax).
The McGuinness-Bordne :cite:p:`mcguinness_comparison_1972` equation is:
.. math::
PET[mm day^{-1}] = a * \frac{S_0}{\lambda}T_a + b *\frsc{S_0}{\lambda}
PET[mm day^{-1}] = a * \frac{S_0}{\lambda}T_a + b * \frac{S_0}{\lambda}
where :math:`a` and :math:`b` are empirical parameters; :math:`S_0` is the extraterrestrial radiation [MJ m-2 day-1],
assuming a solar constant of 1367 W m-2; :math:`\\lambda` is the latent heat of vaporisation [MJ kg-1]
Expand Down

0 comments on commit e590702

Please sign in to comment.