More informative metadata when loading earth_relief grids#494
More informative metadata when loading earth_relief grids#494
Conversation
|
Having second thoughts about this PR, data provenance is a pain...
See also pydata/xarray#1614. |
|
Do users care about the |
It's used at https://github.com/GenericMappingTools/pygmt/pull/476/files#diff-18246882665270482cba82d6b754c43cR1280 for the auto-detect cartesian/geographic type functionality (though we'll probably drop that). I've got the code to work on option 3 already, just need to write some tests first. |
We still need |
|
As I mentioned before, in GMT 6.1.0 |
The to_array method doesn't keep the encoding dictionary, so we're refactoring the code. Updated test to check that these metadata are indeed kept. Also partially revert some of 5e0644e.
Yes, it would be great if |
FYI, the feature is implemented in GenericMappingTools/gmt#3551 and will be available in GMT 6.1.0 |
|
Superseded by #500 which is a nicer way to get get grid registration and coordinate information. We're still missing lots of metadata, but it might be possible in the future to add the metadata into the GMT xarray accessor (e.g. have |
Description of proposed changes
Return a richer set of attributes when running
pygmt.datasets.load_earth_relief(), to include all the NetCDF header info metadata such as a proper title, description (including the DOI) and GMT command history used to produce the grid. In particular, thenode_offsetattribute will be useful for #476. This PR will also be useful for #489.Before (using
xr.open_dataarray(fname)):After (using
xr.open_dataset(fname).to_array(name="elevation").squeeze(drop=True)):Fixes #
Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.