-
Notifications
You must be signed in to change notification settings - Fork 234
Complete documentation of grdimage #620
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
Changes from 13 commits
b47ab35
4c352c0
b7029c5
14ba332
740c980
4584c32
4c1fcb2
d2b6997
42e2b28
8817749
581968a
a0771e6
8ad8d7c
3b14a0e
ccf6c1d
924e5a8
6f0c34a
6b6e63a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -318,24 +318,59 @@ def grdcontour(self, grid, **kwargs): | |||||||||||||
|
|
||||||||||||||
| @fmt_docstring | ||||||||||||||
| @use_alias( | ||||||||||||||
| R="region", | ||||||||||||||
| J="projection", | ||||||||||||||
| W="pen", | ||||||||||||||
| A="img_out", | ||||||||||||||
| B="frame", | ||||||||||||||
| I="shading", | ||||||||||||||
| C="cmap", | ||||||||||||||
| D="img_in", | ||||||||||||||
| E="dpi", | ||||||||||||||
| G="bit_color", | ||||||||||||||
| I="shading", | ||||||||||||||
| J="projection", | ||||||||||||||
| M="monochrome", | ||||||||||||||
| N="no_clip", | ||||||||||||||
| Q="nan_transparent", | ||||||||||||||
| R="region", | ||||||||||||||
| U="timestamp", | ||||||||||||||
| V="verbose", | ||||||||||||||
| X="xshift", | ||||||||||||||
| Y="yshift", | ||||||||||||||
| n="interpolation", | ||||||||||||||
| p="perspective", | ||||||||||||||
| t="transparency", | ||||||||||||||
| x="cores", | ||||||||||||||
| ) | ||||||||||||||
| @kwargs_to_strings(R="sequence", p="sequence") | ||||||||||||||
| def grdimage(self, grid, **kwargs): | ||||||||||||||
| """ | ||||||||||||||
| Project grids or images and plot them on maps. | ||||||||||||||
|
|
||||||||||||||
| Takes a grid file name or an xarray.DataArray object as input. | ||||||||||||||
| Project and plot grids or images. | ||||||||||||||
|
|
||||||||||||||
| Reads a 2-D grid file and produces a gray-shaded (or colored) map by | ||||||||||||||
| building a rectangular image and assigning pixels a gray-shade (or | ||||||||||||||
| color) based on the z-value and the CPT file. Optionally, illumination | ||||||||||||||
| may be added by providing a file with intensities in the (-1,+1) range | ||||||||||||||
| or instructions to derive intensities from the input data grid. Values | ||||||||||||||
| outside this range will be clipped. Such intensity files can be created | ||||||||||||||
| from the grid using `grdgradient` and, optionally, modified by | ||||||||||||||
| `grdmath` or `grdhisteq`. A third alternative is available when GMT is | ||||||||||||||
| build with GDAL support. Pass **image** which can be an image file | ||||||||||||||
| (geo-referenced or not). In this case the image can optionally be | ||||||||||||||
|
||||||||||||||
| `grdmath` or `grdhisteq`. A third alternative is available when GMT is | |
| build with GDAL support. Pass **image** which can be an image file | |
| (geo-referenced or not). In this case the image can optionally be | |
| `grdmath` or `grdhisteq`. A third alternative is available when GMT is | |
| build with GDAL support. Pass **image** which can be an image file | |
| (geo-referenced or not). In this case the image can optionally be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that this could be worded better, currently it's just copied from upstream GMT at https://github.com/GenericMappingTools/gmt/blob/8c0b548e52938f91bfb15f47f27d023488003ef8/doc/rst/source/grdimage_common.rst_#L14-L16. Maybe we should take out the grdgradient, grdmath and grdhisteq parts since they're not wrapped in PyGMT yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid we may forget to add them back when the wrappers are available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe keep them for now, better to over-document than not. Doubt we'll see grdmath anytime soon (who uses Reverse Polish notation?!!), but grdgradient would definitely come, and grdhisteq will be a nice one for stretching colormaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree.
Uh oh!
There was an error while loading. Please reload this page.