Skip to content

Commit

Permalink
Merge pull request #2971 from dopplershift/doc-fixes
Browse files Browse the repository at this point in the history
A few doc fixes
  • Loading branch information
dcamron authored Mar 30, 2023
2 parents 21581da + 0ffb097 commit dfe8db6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/gridding/Point_Interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def station_test_data(variable_names, proj_from=None, proj_to=None):
# ----------------------
# search_radius = 100 km
#
# grid resolution = 25 km
# grid resolution = 75 km
#
# min_neighbors = 1
gx, gy, img = interpolate_to_grid(x, y, temp, interp_type='cressman', minimum_neighbors=1,
Expand Down
21 changes: 16 additions & 5 deletions src/metpy/calc/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,16 @@ def precipitable_water(pressure, dewpoint, *, bottom=None, top=None):
def mean_pressure_weighted(pressure, *args, height=None, bottom=None, depth=None):
r"""Calculate pressure-weighted mean of an arbitrary variable through a layer.
Layer top and bottom specified in height or pressure.
Layer bottom and depth specified in height or pressure.
.. math:: MPW = \frac{\int_{p_s}^{p_b} A p dp}{\int_{p_s}^{p_b} p dp}
where:
* :math:`MPW` is the pressure-weighted mean of a variable.
* :math:`p_b` is the bottom pressure level.
* :math:`p_s` is the top pressure level.
* :math:`A` is the variable whose pressure-weighted mean is being calculated.
Parameters
----------
Expand All @@ -120,7 +129,7 @@ def mean_pressure_weighted(pressure, *args, height=None, bottom=None, depth=None
assumed to be the surface.
depth: `pint.Quantity`, optional
Depth of the layer in meters or hPa.
Depth of the layer in meters or hPa. Defaults to 100 hPa.
Returns
-------
Expand Down Expand Up @@ -169,12 +178,14 @@ def weighted_continuous_average(pressure, *args, height=None, bottom=None, depth
Layer top and bottom specified in height or pressure.
Formula based on that from [Holton2004]_ pg. 76 and the NCL function _wgt_vertical_n_
Formula based on that from [Holton2004]_ pg. 76 and the NCL function ``wgt_vertical_n``
.. math:: WCA = \frac{\int_{p_s}^{p_b} A dp}{\int_{p_s}^{p_b} dp}
.. math:: WCA = \frac{\int_{p_s}^{p} A dp}{\int_{p_s}^{p} dp},
where:
* :math:`WCA` is the weighted continuous average of a variable.
* :math:`p` is the bottom pressure level.
* :math:`p_b` is the bottom pressure level.
* :math:`p_s` is the top pressure level.
* :math:`A` is the variable whose weighted continuous average is being calculated.
Expand Down

0 comments on commit dfe8db6

Please sign in to comment.