-
Notifications
You must be signed in to change notification settings - Fork 361
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
Retain information about default colormaps for remote files #6167
Comments
One relatively simple implementation would be to add an attribute to the output netCDF file that holds the default CPT, if one is available. It could then be read and placed in the hidden GRID_HEADER structure and used to inform the default CPT choice if none is set via -C. This makes these assumptions:
I think (1) is reasonable, only very specific needs require a non-netCDF intermediate grid. As for (2), need feedback from @GenericMappingTools/pygmt-admin if this helpful, and perhaps @joa-quim could have similar needs in GMT.jl. |
Currently, PyGMT loads the variable attributes for netCDF grids but not the global attributes and uses grdinfo to access other attributes (registration, grid type). |
The SST L3 grids from the OceanColor color come with a cpt in global attribute called |
So the grid's z' attributes are read, so if I add palette it would be available to PyGMT then. |
Since this would only be used when GMT grdcuts a subset off one of our remote grids and writes a netCDF grid, I think just adding CPT = "@earth_age.cpt" or similar is all we need to do. |
This addresses #6167 when we cut a subset from, sa, earth_relief_10m and then no longer know what the CPT should be.
* Save any default CPT in hidden grid header This addresses #6167 when we cut a subset from, sa, earth_relief_10m and then no longer know what the CPT should be. * use allocated string cpt instead * Init remote_id to -1 * polish * Fix save CPT and highpass * Update gmt_support.c * Add small tests * formatting * Remove boundary annotations * Save the current CPT from grdcut if modern mode
OK to close, @meghanrjones ? |
Yes |
Description of the desired feature
It would be helpful if GMT had a way to retain information about the default colormaps for remote files during processing. For example, if the following code produced two images using the
geo
colormap. This feature would be helpful for PyGMT, where the remote data files are often read into memory before being passed to GMT, resulting in the loss of the default cpt information (xref GenericMappingTools/pygmt#499).ex1:
ex2:
Are you willing to help implement and maintain this feature? Yes
The text was updated successfully, but these errors were encountered: