Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap grdinfo aliases #799

Merged
merged 49 commits into from
Feb 7, 2021
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
27f5d20
Add cyl_transverse_mercator.py
willschlitzer Dec 11, 2020
d64983f
Add cyl_universal_transverse_mercator.py
willschlitzer Dec 11, 2020
6ba8185
Changing land color to red in cyl_mercator.py to match GMT docs examp…
willschlitzer Dec 11, 2020
76850ee
Merge branch 'master' into cylindrical-projections
willschlitzer Dec 13, 2020
48431db
Merge branch 'master' of https://github.com/GenericMappingTools/pygmt
willschlitzer Jan 12, 2021
01052d2
Merge branch 'master' of https://github.com/GenericMappingTools/pygmt
willschlitzer Jan 18, 2021
c710988
Merge remote-tracking branch 'origin/master'
willschlitzer Jan 21, 2021
b94e0a2
Merge branch 'master' of https://github.com/GenericMappingTools/pygmt
willschlitzer Jan 21, 2021
1466bb9
Add region alias to grdinfo
willschlitzer Jan 21, 2021
158ef5d
Add grid argument name to existing tests
willschlitzer Jan 21, 2021
a90ca99
Add tab, geographic, and zdata aliases
willschlitzer Jan 21, 2021
cac7aff
Add tab doc string
willschlitzer Jan 21, 2021
73e0af7
Add tab doc string
willschlitzer Jan 21, 2021
e6e8da0
Make grdinfo doc string an r-string
willschlitzer Jan 21, 2021
7640edc
Merge branch 'master' into grdinfo-alias
willschlitzer Jan 21, 2021
0e28700
Update doc string formatting
willschlitzer Jan 21, 2021
b4b74f4
Update doc string for geographic argument
willschlitzer Jan 21, 2021
9e85b30
Update zdata doc string
willschlitzer Jan 21, 2021
083b655
Updating grdinfo C alias
willschlitzer Jan 21, 2021
87146de
Add/change grdinfo aliases
willschlitzer Jan 21, 2021
1d5d0ed
Add minxmax_pos to doc string
willschlitzer Jan 21, 2021
720b5f3
Fix typo
willschlitzer Jan 21, 2021
13829e3
Add tiles doc string
willschlitzer Jan 21, 2021
dccc4b8
Fix typo
willschlitzer Jan 21, 2021
43372a0
Correct doc string for per_column rename
willschlitzer Jan 21, 2021
61ce2b6
Add doc string for spacing
willschlitzer Jan 21, 2021
51c1c85
Add nearest_multiple to grdinfo doc string
willschlitzer Jan 21, 2021
89ef66b
Add test for region argument
willschlitzer Jan 21, 2021
71ae773
Style fix
willschlitzer Jan 21, 2021
568f516
Fix argument names in per_column docstring
willschlitzer Jan 22, 2021
5a7df5d
Fix formatting typo
willschlitzer Jan 22, 2021
fbe8098
Merge branch 'master' into grdinfo-alias
seisman Jan 26, 2021
bfd027d
Apply suggestions from code review
willschlitzer Feb 5, 2021
2d2ca46
Merge branch 'master' into grdinfo-alias
willschlitzer Feb 5, 2021
c47d45a
Change tests in test_grdinfo.py to use long form aliases
willschlitzer Feb 5, 2021
ecce723
Apply suggestions from code review
willschlitzer Feb 5, 2021
2a94c6c
Update pygmt/modules.py
willschlitzer Feb 5, 2021
12ea457
Merge branch 'master' into grdinfo-alias
seisman Feb 5, 2021
72ef404
[format-command] fixes
actions-bot Feb 5, 2021
00a5961
Merge branch 'master' into grdinfo-alias
willschlitzer Feb 6, 2021
140f8e2
Replace short aliases with long form aliases; fix line length issues
willschlitzer Feb 6, 2021
584d3e2
Move grdinfo function to grdinfo.py
willschlitzer Feb 6, 2021
3b1001f
Remove unused imports
willschlitzer Feb 6, 2021
0d31d52
Update pygmt/src/grdinfo.py
willschlitzer Feb 6, 2021
fe66e7e
Remove unused imports; reorder aliases
willschlitzer Feb 6, 2021
994e7da
Update pygmt/src/grdinfo.py
weiji14 Feb 6, 2021
a368307
Merge branch 'master' into grdinfo-alias
willschlitzer Feb 7, 2021
f48dac2
Merge branch 'master' into grdinfo-alias
willschlitzer Feb 7, 2021
5c03c7a
[format-command] fixes
actions-bot Feb 7, 2021
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
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Dongdong Tian <[email protected]>
willschlitzer and seisman authored Feb 5, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit bfd027d9340cbe8221ed71f45d30b6f6294b3faa
36 changes: 18 additions & 18 deletions pygmt/modules.py
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
R="region",
V="verbose",
)
@kwargs_to_strings(R="sequence")
@kwargs_to_strings(R="sequence", D="sequence", I="sequence")
def grdinfo(grid, **kwargs):
r"""
Get information about a grid.
@@ -46,41 +46,41 @@ def grdinfo(grid, **kwargs):
per_column : str or bool
**n**\ |**t**
willschlitzer marked this conversation as resolved.
Show resolved Hide resolved
Formats the report using tab-separated fields on a single line. The
output is name w e s n z0 z1 dx dy nx ny[ x0 y0 x1 y1 ] [ med scale ]
[mean std rms] [n_nan] registration gtype. The data in brackets are
output is name *w e s n z0 z1 dx dy nx ny* [ *x0 y0 x1 y1* ] [ *med scale* ]
[ *mean std rms* ] [ *n_nan* ] *registration gtype*. The data in brackets are
outputted depending on the ``force_scan`` and ``minmax_pos`` arguments.
Use **t** to place file name at the end of the output record or,
**n** or ``True`` to only output numerical columns. The registration is
either 0 (gridline) or 1 (pixel), while gtype is either 0 (Cartesian)
or 1 (geographic). The default value is ``False``. This cannot be
called if ``geographic`` is also set.
tiles : str
*xoff*\ [/*yoff*\ ][**+i**\ ]
Divide a single grids domain (or the ``region`` domain, if no grid
tiles : str or list
*xoff*\ [/*yoff*][**+i**]
willschlitzer marked this conversation as resolved.
Show resolved Hide resolved
Divide a single grid's domain (or the ``region`` domain, if no grid
given) into tiles of size dx times dy (set via ``spacing``). You can
specify overlap between tiles by appending *xoff*\ [/*yoff*\ ]. If the
specify overlap between tiles by appending *xoff*\ [/*yoff*]. If the
single grid is given you may use the modifier **+i** to ignore tiles
that have no data within each tile subregion. Default output is text
region strings. Use ``per_column`` to instead report four columns with
xmin xmax ymin ymax per tile, or use ``per_column=t`` to also have the
xmin xmax ymin ymax per tile, or use ``per_column="t"`` to also have the
region string appended as trailing text.
geographic : bool
Report grid domain and x/y-increments in world mapping format
The default value is ``False``. This cannot be called if
``per_column`` is also set.
spacing : str
*dx*\ [/*dy*\ ]|\ **b**\ |**i**\ |**r**\ ]
spacing : str or list
*dx*\ [/*dy*]\|\ **b**\|\ **i**\|\ **r**
willschlitzer marked this conversation as resolved.
Show resolved Hide resolved
Report the min/max of the region to the nearest multiple of dx and dy,
and output this in the form w/e/s/n (unless ``per_column`` is set). To
report the actual grid region, append **r**. For a grid produced by
the img supplement (a Cartesian Mercator grid), the exact geographic
region is given with **i** (if not found then we return the actual
grid region instead). If no argument is given then we report the grid
increment in the form *xinc*\ [/*yinc*\ ]. If **b** is given we write
each grids bounding box polygon instead. Finally, if ``tiles`` is in
effect then dx and dy are the dimensions of the desired tiles.
increment in the form *xinc*\ [/*yinc*]. If **b** is given we write
each grid's bounding box polygon instead. Finally, if ``tiles`` is in
effect then *dx* and *dy* are the dimensions of the desired tiles.
force_scan : int or str
**0**\ |**1**\ |**2**\ |**p**\ |**a**
**0**\|\ **1**\|\ **2**\|\ **p**\|\ **a**
willschlitzer marked this conversation as resolved.
Show resolved Hide resolved
**0**\ : Report range of z after actually scanning the data, not just
reporting what the header says.
**1**\ : Report median and L1 scale of z (L1 scale = 1.4826 * Median
@@ -93,16 +93,16 @@ def grdinfo(grid, **kwargs):
Include the x/y values at the location of the minimum and maximum
z-values.
nearest_multiple : str
[*dz*\ ][**+a**\ [*alpha*\ ]][**+s**\ ]
Determine min and max z-value. If dz is provided then we first round
these values off to multiples of dz. To exclude the two tails of the
[*dz*]\ [**+a**\ [*alpha*]]\ [**+s**]
willschlitzer marked this conversation as resolved.
Show resolved Hide resolved
Determine min and max z-value. If *dz* is provided then we first round
these values off to multiples of *dz*. To exclude the two tails of the
distribution when determining the min and max you can add **+a** to
set the *alpha* value (in percent): We then sort the grid, exclude the
data in the 0.5*\ *alpha* and 100 - 0.5*\ *alpha* tails, and revise
the min and max. To force a symmetrical range about zero, using
minus/plus the max absolute value of the two extremes, append **+s**\ .
We report the result via the text string *zmin/zmax* or *zmin/zmax/dz*
(if dz was given) as expected by makecpt.
(if *dz* was given) as expected by :meth:`pygmt.makecpt`.
{V}

Returns