emolch / gmtpy Goto Github PK
View Code? Open in Web Editor NEWGmtPy - A Python interface to GMT
Home Page: http://emolch.github.com/gmtpy
License: Other
GmtPy - A Python interface to GMT
Home Page: http://emolch.github.com/gmtpy
License: Other
Hi,
I can get to gmt=GMT() happily when using GMT version 4.5.5 , but it fails for GMT version 5.1.1 with the following :
Traceback (most recent call last):
File "test1.py", line 29, in
gmt = GMT()
File "/sp/prj/tvz95/mypython2/lib/python2.7/site-packages/gmtpy.py", line 2850, in init
self.installation = get_gmt_installation(version)
File "/sp/prj/tvz95/mypython2/lib/python2.7/site-packages/gmtpy.py", line 1161, in get_gmt_installation
setup_gmt_installations()
File "/sp/prj/tvz95/mypython2/lib/python2.7/site-packages/gmtpy.py", line 1045, in setup_gmt_installations
gmtversion, gmthome, gmtbin = check_detect_gmt_installation()
File "/sp/prj/tvz95/mypython2/lib/python2.7/site-packages/gmtpy.py", line 976, in check_detect_gmt_installation
return detect_gmt_installation()
File "/sp/prj/tvz95/mypython2/lib/python2.7/site-packages/gmtpy.py", line 963, in detect_gmt_installation
gmtversion = get_gmt_version(pjoin(gmtbin, 'gmtdefaults'), gmthome)
File "/sp/prj/tvz95/mypython2/lib/python2.7/site-packages/gmtpy.py", line 946, in get_gmt_version
gmtdefaultsbinary)
Exception: Can't extract version number from output of /opt/local/gmt/GMT5.1.1/bin/gmtdefaults
any suggestions ?
Perhaps the top of "gmtdefaults" under GMT 5.1.1 is different to previous earlier GMT v4 ??
A command-line ">gmtdefaults" (using v5.1.1) results in :
I tried to plot some maps with gmt.grdimage, here is my command:
gmt.grdimage(C='cpt', J='m125/35/1:35000000', R='103/153/10/50', B=15, V=True, P=True, in_filename = '/Volumes/work/data/abc.nc')
while it throws an error: "grdimage: Your grid y's or latitudes appear to be outside the map region and will be skipped."
This command works well in bash. I don't quite understand, is the command wrong?
Thanks :-)
When I try to use gmtpy with grdreformat, a -K option is add and according to the official documentation of GMT 5.1 this option does not exist. Is it a bad use from me of your module?
Here's my code:
gmt = GMT()
gmt.surface(T=0.25, G="toto.nc", I="0.25m", C=0.1, R="55/56/-21.5/-20.75", in_columns=(xx, yy, zz), out_discard=True)
gmt.grdreformat("toto.nc", "toto.tiff", V="d")
best regards,
Simon
This is the traceback:
vic@onyx:/mnt/vic/Documents/Coding/GitHub/python-gmtpy$ python examples/example5.py
gmt: Warning: Parameter TIME_LANGUAGE is deprecated. Use GMT_LANGUAGE instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter PAGE_COLOR is deprecated. Use PS_PAGE_COLOR instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter TIME_LANGUAGE is deprecated. Use GMT_LANGUAGE instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter PAGE_COLOR is deprecated. Use PS_PAGE_COLOR instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter TIME_LANGUAGE is deprecated. Use GMT_LANGUAGE instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter PAGE_COLOR is deprecated. Use PS_PAGE_COLOR instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter TIME_LANGUAGE is deprecated. Use GMT_LANGUAGE instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter PAGE_COLOR is deprecated. Use PS_PAGE_COLOR instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter TIME_LANGUAGE is deprecated. Use GMT_LANGUAGE instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter PAGE_COLOR is deprecated. Use PS_PAGE_COLOR instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter TIME_LANGUAGE is deprecated. Use GMT_LANGUAGE instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter PAGE_COLOR is deprecated. Use PS_PAGE_COLOR instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter TIME_LANGUAGE is deprecated. Use GMT_LANGUAGE instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter PAGE_COLOR is deprecated. Use PS_PAGE_COLOR instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter TIME_LANGUAGE is deprecated. Use GMT_LANGUAGE instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter PAGE_COLOR is deprecated. Use PS_PAGE_COLOR instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter TIME_LANGUAGE is deprecated. Use GMT_LANGUAGE instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter PAGE_COLOR is deprecated. Use PS_PAGE_COLOR instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter TIME_LANGUAGE is deprecated. Use GMT_LANGUAGE instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter PAGE_COLOR is deprecated. Use PS_PAGE_COLOR instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter TIME_LANGUAGE is deprecated. Use GMT_LANGUAGE instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
gmt: Warning: Parameter PAGE_COLOR is deprecated. Use PS_PAGE_COLOR instead.
Please see http://gmt.soest.hawaii.edu/doc/5.4.5/GMT_Docs.html#new-features-in-gmt-5 for more information.
Traceback (most recent call last):
File "examples/example5.py", line 95, in <module>
gmtpy.nice_palette( gmt, palette_widget, guru, cptfile )
File "/mnt/vic/Documents/Coding/GitHub/python-gmtpy/gmtpy.py", line 4204, in nice_palette
label_font = gmt.label_font()
File "/mnt/vic/Documents/Coding/GitHub/python-gmtpy/gmtpy.py", line 3248, in label_font
return font_tab_rev(self.gmt_config['FONT_LABEL'].split(',')[1])
TypeError: 'dict' object is not callable
Apart from the deprecation warnings which are caused by not having a specific defaults string for this GMT version, the error of this issue appears because font_tab_rev
is defined in the library as a dict
object but later the library tries to access an item of this dict
using parentheses instead of brackets.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.