makecpt issue

Added by Deep 7 months ago

Hello,
I was using makecpt to plot color charts from the GMT tutorial. I am sure I am making some mistake. I have cleared all .cpt files from the folder where I am running my code. I am attaching my code, my output files and the error I get. Any help would be greatly appreciated.

Code: Please see attached file: t14.gmt

Output: Please see attached files: disc.cpt, my-cont.cpt, t14.ps. It seems nothing gets created in the my-cont.cpt.

Error message:
pragnyadipta@pragnyadipta-VirtualBox:~/Documents/GMT/Code$ chmod +x t14.gmt
pragnyadipta@pragnyadipta-VirtualBox:~/Documents/GMT/Code$ ./t14.gmt
/bin/rm: cannot remove 'tmp.ps': No such file or directory
makecpt: Syntax error: No input files expected unless -E is used
psscale: Error: Cannot open color palette table /usr/share/gmt/cpt/mycont.cpt
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
psscale: Error: Cannot open color palette table /usr/share/gmt/cpt/mycont.cpt
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
psconvert: t14.ps: GMT PS format detected but file is not finalized. Maybe a -K in excess? t14.pdf could be messed up.
GPL Ghostscript 9.18 (2015-10-05)
Copyright (C) 2015 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusSanL-Reg font from /usr/share/ghostscript/9.18/Resource/Font/NimbusSanL-Reg... 4258180 2800962 7320552 5950321 1 done.
GS>quit

disc.cpt - Cpt file with content in it (265 Bytes)

t14.gmt - Code (1.12 KB)

t14.ps - Output (28.6 KB)


Replies (4)

RE: makecpt issue - Added by Federico 7 months ago

I am not sure, but I think that there is a problem with the CPT file name.

You use (according to t14.gmt):

gmt makecpt Crainbow -T-20/60/10 -Z > my-cont.cpt

Try use:

gmt makecpt Crainbow -T-20/60/10 -Z > mycont.cpt

RE: makecpt issue - Added by Deep 7 months ago

Hi Federico,

I made the change you suggested.

Here is what I get when I run the code.

/bin/rm: cannot remove 'tmp.ps': No such file or directory
makecpt: Syntax error: No input files expected unless -E is used
psscale: Error: CPT file mycont.cpt has no z-slices!
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
psscale: Error: CPT file mycont.cpt has no z-slices!
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
[Session gmt (0)]: Error returned from GMT API: GMT_CPT_READ_ERROR (8)
psconvert: t14.ps: GMT PS format detected but file is not finalized. Maybe a -K in excess? t14.pdf could be messed up.
GPL Ghostscript 9.18 (2015-10-05)
Copyright (C) 2015 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusSanL-Reg font from /usr/share/ghostscript/9.18/Resource/Font/NimbusSanL-Reg... 4258180 2800962 7320552 5950321 1 done.

t14.gmt - Code (1.12 KB)

RE: makecpt issue - Added by Federico 7 months ago

Use (with a "-" before the C):

gmt makecpt -Crainbow -T-20/60/10 -Z > mycont.cpt

t14.ps - Figure Output (232 KB)

RE: makecpt issue - Added by Deep 7 months ago

Thank you Federico. That worked.
I will be more vigilant from now on.
Thanks,

Deep

(1-4/4)