Skip to content
Merged
Changes from all 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
21 changes: 21 additions & 0 deletions pygmt/src/dimfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
)
from pygmt.io import load_dataarray

__doctest_skip__ = ["dimfilter"]


@fmt_docstring
@use_alias(
Expand Down Expand Up @@ -124,6 +126,25 @@ def dimfilter(grid, **kwargs):
- :class:`xarray.DataArray` if ``outgrid`` is not set
- None if ``outgrid`` is set (grid output will be stored in file set by
``outgrid``)

Example
-------
>>> import pygmt
>>> # Load a grid of Earth relief data
>>> grid = pygmt.datasets.load_earth_relief()
>>> # Create a filtered grid from an input grid.
>>> filtered_grid = pygmt.dimfilter(
... grid=grid,
... # Set filter type to "median" and the diameter width to 600 km
... filter="m600",
... # Set grid in degrees, width in km
... distance=4,
... # Create 6 sectors and return the lowest values in the sector
... sectors="l6",
... # Set the region longitude range from 55W to 51W, and the
... # latitude range from 24S to 19S
... region=[-55, -51, -24, -19],
... )
"""
if not all(arg in kwargs for arg in ["D", "F", "N"]) and "Q" not in kwargs:
raise GMTInvalidInput(
Expand Down