Skip to content
Merged
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
37 changes: 36 additions & 1 deletion pygmt/src/sphdistance.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@

@fmt_docstring
@use_alias(
C="single_form",
D="duplicate",
E="quantity",
G="outgrid",
I="spacing",
L="unit",
N="nodetable",
Q="voronoi",
R="region",
V="verbose",
)
Expand All @@ -41,7 +47,36 @@ def sphdistance(table, **kwargs):
{I}
{R}
{V}

single_form : bool
For large data sets you can save some memory (at the expense of more
processing) by only storing one form of location coordinates
(geographic or Cartesian 3-D vectors) at any given time, translating
from one form to the other when necessary [Default keeps both arrays
in memory]. Not applicable with `voronoi`.
duplicate : bool
Used to skip duplicate points since the algorithm cannot handle them.
[Default assumes there are no duplicates].
quantity : str
Specify the quantity that should be assigned to the grid nodes. By
default we compute distances to the nearest data point [**d**].
Use **n** to assign the ID numbers of the Voronoi polygons that each
grid node is inside, or use **z** for a natural nearest-neighbor grid
where we assign all nodes inside the polygon the z-value of the center
node. Optionally, append the resampling interval along Voronoi arcs in
spherical degrees.
unit : str
Specify the unit used for distance calculations. Choose among **d**
(spherical degree), **e** (m), **f** (feet), **k** (km), **M**
(mile), **n** (nautical mile) or **u** survey foot.
nodetable : str
Read the information pertaining to each Voronoi
polygon (the unique node lon, lat and polygon area) from a separate
file [Default acquires this information from the ASCII segment
headers of the output file]. Required if binary input via `voronoi`
is used.
voronoi : str
Append the name of a file with pre-calculated Voronoi polygons
[Default performs the Voronoi construction on input data].
Comment on lines +86 to +93
Copy link
Member

Choose a reason for hiding this comment

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

Especially one sphtriangulate is wrapped, we will need to open a separate issue to discuss how to pass these data to sphdistance from memory rather than relying on writing/reading files.

Returns
-------
ret: xarray.DataArray or None
Expand Down