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

output to GMT #11

Open
esyracuse opened this issue Aug 27, 2019 · 1 comment
Open

output to GMT #11

esyracuse opened this issue Aug 27, 2019 · 1 comment

Comments

@esyracuse
Copy link

Most of the figure-making I do is with Generic Mapping Tools, or GMT, which is really frequently used among seismologists. While I think I could manually convert a color palette in an Excel file to the proper format for GMT, I suspect it might be straightforward for the GMT format to be incorporated into your download options. Here is an example of the text from a GMT color palette file for a rainbow-style color map where the Z-data varies from -1 to 1.

cpt file created by: makecpt -Cseis

#COLOR_MODEL = RGB

-1 212 0 0 -0.777 212 0 0
-0.777 255 42 0 -0.555 255 42 0
-0.555 255 128 0 -0.333 255 128 0
-0.333 255 212 0 -0.111 255 212 0
-0.111 255 255 0 0.111 255 255 0
0.111 173 255 15 0.333 173 255 15
0.333 45 248 70 0.555 45 248 70
0.555 0 160 182 0.777 0 160 182
0.777 0 40 230 1 0 40 230
B 0 0 0
F 255 255 255
N 128 128 128

For the lines with 8 columns, here are the columns:

  1. low boundary of the band
  2. R-value for the low end of the band
  3. G-value for the low end of the band
  4. B-value for the low end of the band
  5. high boundary of the band
  6. R-value for the high end of the band
  7. G-value for the high end of the band
  8. B-value for the high end of the band
    Line beginning with “B” - RGB value plotted for data below the low end of the range given (here, Z<-1)
    Line beginning with “F” - RGB value plotted for data above the high end of the range give (here, Z>1)
    Line beginning with “N” - RGB value plotted for data for NaN values

As you can see, the values in columns 2/3/4 and 6/7/8 are the same, so each band is plotted as a single color, but if they differed, the R/G/B values would smoothly interpolate between the low and high ends of the bands. Also, although the bands are the same widths here, they need not be, as long as they are continuous (i.e., the low end of one band is the same as the high end of the previous band).

You can also find additional info at http://gmt.soest.hawaii.edu/doc/latest/makecpt.html and find examples of the default color palette options by Google Image searching “GMT color palette” (for example, http://geophysics.eas.gatech.edu/classes/Intro_GMT/gmt_www/gmt/doc/html/GMT_Docs/node187.html - here, the upper color palette below the “seis” is a plot of the color palette I gave above).

Thanks!

@figs512
Copy link

figs512 commented Dec 22, 2019

Ethan,
I was at AGU last week and many folks were asking about GMT... as well as ACRgis. Would it be possible to put up conversions for these programs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants