Hello,
I (seemingly) cannot get gmt to read the gmt.conf file. I feel like there must be another file somewhere overriding it, but I can’t find one. At the moment, I have gmt.conf in my current working directory. I have also tried it in my home directory and in the .gmt directory in my home directory (making sure gmt.conf is not in multiple of those places at once.)
I am running GMT 6.4 on Mac OS Sonoma (14.1.2). I installed GMT6 using MacPorts.
I’m running the tutorial 3 as a script, slightly modified (-R) so as to have the axis display fractions of a degree:
#!/bin/sh
gmt begin -Vd GMT_tut_3
gmt coast -R270/271/0/1 -JM6i -Bxya0.3g0.3 -Gchocolate -V
gmt end show
I generate a fresh gmt.conf file in the current working directory thus:
gmt defaults > gmt.conf
The default FORMAT_GEO_MAP is ddd:mm:ss, and gmt outputs the axis format correctly in ddd:mm:ss format.
When I change the FORMAT_GEO_MAP to +D in gmt.conf in the current working directory (and I save it!), the plot does not change; the axis is still output in ddd:mm:ss format. Furthermore, if I add this line to my script:
gmt get FORMAT_GEO_MAP
it does shows that FORMAT_GEO_MAP is still set to ddd:mm:ss.
Thus I think it is not reading the gmt.conf file. Why would this be? How can I fix it so that it reads the conf file?
The output of the -Vd is:
(base) ~/Documents/gmtTestLocal$ ./GMT_tut_3.sh
gmt [DEBUG]: GMT_Create_Session: Terminal width = 178
gmt [DEBUG]: Obtained the ppid from parent: 6164
gmt [DEBUG]: Enter: gmtinit_new_GMT_ctrl
gmt [DEBUG]: GMT->session.SHAREDIR = /opt/local/lib/gmt6/share/gmt
gmt [DEBUG]: GMT->session.HOMEDIR = /Users/gwen
gmt [DEBUG]: GMT->session.USERDIR = /Users/gwen/.gmt [created]
gmt [DEBUG]: GMT->session.CACHEDIR = /Users/gwen/.gmt/cache [created]
gmt [DEBUG]: GMT: 0. Will try to find subdir=postscriptlight stem = PSL_custom_fonts suffix=.txt
gmt [DEBUG]: GMT: 1. gmt_getsharepath trying current dir
gmt [DEBUG]: GMT: 2. gmt_getsharepath trying USERDIR /Users/gwen/.gmt
gmt [DEBUG]: GMT: 3. gmt_getsharepath trying USERDIR subdir /Users/gwen/.gmt/postscriptlight
gmt [DEBUG]: GMT: 4. gmt_getsharepath trying SHAREDIR subdir /opt/local/lib/gmt6/share/gmt/postscriptlight
gmt [DEBUG]: GMT: 5. gmt_getsharepath trying SHAREDIR /opt/local/lib/gmt6/share/gmt
gmt [DEBUG]: GMT: 6. gmt_getsharepath failed
gmt [DEBUG]: Map distance calculation will be Cartesian
gmt [DEBUG]: Exit: gmtinit_new_GMT_ctrl
gmt [DEBUG]: Enter: New_PSL_Ctrl
gmt [DEBUG]: Exit: New_PSL_Ctrl
gmt [DEBUG]: Enter: gmt_manage_workflow
gmt [DEBUG]: Exit : gmt_manage_workflow
gmt [DEBUG]: Enter: PSL_beginsession
gmt [DEBUG]: Exit : PSL_beginsession
gmt [DEBUG]: Enter: PSL_setdefaults
gmt [DEBUG]: Exit : PSL_setdefaults
gmt [DEBUG]: Enter: gmtlib_io_init
gmt [DEBUG]: Exit : gmtlib_io_init
gmt [DEBUG]: Enter: gmt_hash_init
gmt [DEBUG]: Exit: gmt_hash_init
gmt [DEBUG]: Enter: gmt_hash_init
gmt [DEBUG]: Exit: gmt_hash_init
gmt [DEBUG]: Enter: gmt_reload_settings
gmt [DEBUG]: The PROJ_GEODESIC set to Vincenty
gmt [DEBUG]: Found file gmt.conf
gmt [DEBUG]: Reading GMT Default parameters from file: gmt.conf
gmt [DEBUG]: The PROJ_GEODESIC set to Vincenty
gmt [DEBUG]: gmtinit_parse_map_annot_oblique: Converted separate,lon_horizontal,lat_horizontal,tick_extend to 14
gmt [DEBUG]: The PROJ_GEODESIC set to Vincenty
gmt [DEBUG]: Exit: gmt_reload_settings
gmt [DEBUG]: Enter: gmtlib_plot_C_format
gmt [DEBUG]: Exit: gmtlib_plot_C_format
gmt [DEBUG]: Enter: gmtinit_get_history
gmt [DEBUG]: GMT_Create_Session initialized GMT structure
gmt [DEBUG]: Loading core GMT shared library: libgmt.dylib
gmt [DEBUG]: Shared Library # 0 (core). Path = libgmt.dylib
gmt [DEBUG]: Loading GMT plugins from: /opt/local/lib/gmt6/lib/gmt/plugins
gmt [DEBUG]: Shared Library # 1 (supplements). Path = /opt/local/lib/gmt6/lib/gmt/plugins/supplements.so
gmt [DEBUG]: Revised options: -Vd GMT_tut_3
begin [INFORMATION]: Creating a workflow directory /Users/gwen/.gmt/sessions/gmt_session.6164
begin [DEBUG]: The PROJ_GEODESIC set to Vincenty
begin [DEBUG]: Found file gmt.conf
begin [DEBUG]: Reading GMT Default parameters from file: gmt.conf
begin [DEBUG]: The PROJ_GEODESIC set to Vincenty
begin [DEBUG]: gmtinit_parse_map_annot_oblique: Converted separate,lon_horizontal,lat_horizontal,tick_extend to 14
begin [DEBUG]: The PROJ_GEODESIC set to Vincenty
begin [DEBUG]: Set session name to be GMT_tut_3
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_GSHHS_c.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_GSHHS_c.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_river_c.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_river_c.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_border_c.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_border_c.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_GSHHS_l.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_GSHHS_l.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_river_l.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_river_l.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_border_l.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_border_l.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_GSHHS_i.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_GSHHS_i.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_river_i.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_river_i.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_border_i.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_border_i.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_GSHHS_h.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_GSHHS_h.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_river_h.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_river_h.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_border_h.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_border_h.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_GSHHS_f.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_GSHHS_f.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_river_f.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_river_f.nc
begin [DEBUG]: 1. GSHHG: GSHHGDIR set, trying /opt/local/share/gmt/gshhg/binned_border_f.nc
begin [DEBUG]: 1. GSHHG: OK, could access /opt/local/share/gmt/gshhg/binned_border_f.nc
begin [DEBUG]: gmtinit_print_map_annot_oblique: Converted 14 to separate,lon_horizontal,lat_horizontal,tick_extend
begin [DEBUG]: Begin Workflow. Session ID = 6164. Directory /Users/gwen/.gmt/sessions/gmt_session.6164 created.
begin [DEBUG]: GMT now running in modern mode [Session ID = 6164]
gmt [DEBUG]: Entering GMT_Destroy_Session
gmt [WARNING]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6.
coast [INFORMATION]: Central meridian not given, default to 270.5
coast [INFORMATION]: Map scale is 7.30443 km per cm or 1:730443.
coast [INFORMATION]: -D option: Selected resolution -Df
coast [INFORMATION]: Selected ice front line as Antarctica coastline
coast [INFORMATION]: GSHHG version 2.3.7
coast [INFORMATION]: Derived from World Vector Shoreline, CIA WDB-II, and Atlas of the Cryosphere
coast [INFORMATION]: Processed by Paul Wessel and Walter H. F. Smith, 1994-2017
coast [INFORMATION]: Save current gridline information to gmt.history
gmt [WARNING]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6.
ddd:mm:ss
gmt [WARNING]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6.
(base) ~/Documents/gmtTestLocal$
I have found that putting the line
gmt set FORMAT_GEO_MAP +D
within the script will get me the output I want, and the line
gmt get FORMAT_GEO_MAP
in the script will then output +D as I want it to. But I can’t get it to work by setting it in gmt.conf. I’d appreciate any ideas you might have to help me solve this.
Thanks!