Description of the desired feature
Metadata (data about data) is important, and there are specific kinds of metadata used by GMT when it decides how to plot a grid, such as:
Instead of explicitly wrapping gmt info or gmt grdinfo as in #147, why not allow the user to just access it via grid.gmt.someattribute? This would make use of xarray accessors and call grdinfo under the hood to retrieve those metadata properties.
Pros:
Cons:
- We would be designing yet another standard, as per https://xkcd.com/927/
- Would involve some development effort
- Might not be as discoverable as simply using
grid.attrs["someattribute"] or pygmt.grdinfo(grid), but that's just a documentation thing.
In reality, this gmt accessor can do more than just hold metadata. We could extend it to do grid.gmt.plot and more. But let's start with having it hold the metadata we want, and then build on top of it from there.
References:
Other xarray accessor examples:
Are you willing to help implement and maintain this feature? Yes
Description of the desired feature
Metadata (data about data) is important, and there are specific kinds of metadata used by GMT when it decides how to plot a grid, such as:
Instead of explicitly wrapping
gmt infoorgmt grdinfoas in #147, why not allow the user to just access it viagrid.gmt.someattribute? This would make use of xarray accessors and callgrdinfounder the hood to retrieve those metadata properties.Pros:
fig.basemap()et al. use it automaticallycrsand whatnot.Cons:
grid.attrs["someattribute"]orpygmt.grdinfo(grid), but that's just a documentation thing.In reality, this
gmtaccessor can do more than just hold metadata. We could extend it to dogrid.gmt.plotand more. But let's start with having it hold the metadata we want, and then build on top of it from there.References:
Other xarray accessor examples:
Are you willing to help implement and maintain this feature? Yes