Hi,
I am using the GMT/Matlab toolbox. I am trying to plot a map with the earth relief of the Japan region. However, grdimage makes matlab shut down. I have been using the toolbox for a month already and other gmt modules are running fine.
I thought it was a matter of the earth_relif file resolution, so I have tried using earth_relief_01d.grd.
I have also downloaded the file in the current directory, but matlab still crashes.
This is the line that I am using for plotting:
gmt(‘grdimage ./earth_relief_01d.grd -JM15c -R118/125/20/26 -Baf -BWSen -Vd > ./test.ps’)
The output file is saved, but it is just showing the map frame.
These are the info that I get using -Vd
grdimage [DEBUG]: Map distance calculation will be using great circle approximation with authalic auxiliary latitudes and authalic (R_2) radius = 6371007.1809 m, in meter.
grdimage [DEBUG]: Look for file 118/125/20/26 in /Users/sbrizzi/.gmt
grdimage [DEBUG]: Look for file 118/125/20/26 in /Users/sbrizzi/.gmt/cache
grdimage [DEBUG]: Look for file 118/125/20/26 in /Users/sbrizzi/.gmt/server
grdimage [DEBUG]: Got regular w/e/s/n for region (118/125/20/26)
grdimage [DEBUG]: Found readable file ./earth_relief_01d.grd
grdimage [DEBUG]: Replace file ./earth_relief_01d.grd with path ./earth_relief_01d.grd
grdimage [DEBUG]: Replace file ./earth_relief_01d.grd with ./earth_relief_01d.grd
grdimage [DEBUG]: Projected grid is non-orthogonal, nonlinear, or dpi was changed
grdimage [DEBUG]: Found readable file ./earth_relief_01d.grd
grdimage [DEBUG]: ./earth_relief_01d.grd is most likely a grid. Open in GMT as grid
grdimage [INFORMATION]: Read header from file ./earth_relief_01d.grd
grdimage [DEBUG]: Found readable file ./earth_relief_01d.grd
grdimage [DEBUG]: Replace file ./earth_relief_01d.grd with path ./earth_relief_01d.grd
grdimage [DEBUG]: Found readable file ./earth_relief_01d.grd
grdimage [DEBUG]: Replace file ./earth_relief_01d.grd with path ./earth_relief_01d.grd
grdimage [DEBUG]: Found readable file ./earth_relief_01d.grd
grdimage [DEBUG]: Object ID 4 : Registered Grid File ./earth_relief_01d.grd as an Input resource with geometry Surface [n_objects = 1]
grdimage [DEBUG]: gmtapi_begin_io: Input resource access is now enabled [container]
grdimage [DEBUG]: gmtapi_import_grid: Passed ID = 4 and mode = 131073
grdimage [DEBUG]: Found readable file ./earth_relief_01d.grd
grdimage [DEBUG]: Calling nc_open on ./earth_relief_01d.grd, ncid = 65536, err = 0
grdimage [DEBUG]: Calling nc_close on ncid 65536, err = 0
grdimage [DEBUG]: Calling nc_open on ./earth_relief_01d.grd, ncid = 65536, err = 0
grdimage [INFORMATION]: netCDF grid ./earth_relief_01d.grd has no default CPT.
grdimage [DEBUG]: Calling nc_close on ncid 65536, err = 0
grdimage [DEBUG]: Call gmtgrdio_doctor_geo_increments on a geographic grid
grdimage [DEBUG]: Geographic input grid, longitudes span exactly 360
grdimage [DEBUG]: GMT_End_IO: Input resource access is now disabled
grdimage [DEBUG]: Set_Object for family: 1
==> 1 API Objects at end of GMT_Read_Data
--------------------------------------------------------
K.. ID RESOURCE.... FAMILY.... ACTUAL.... DIR... S O M L
--------------------------------------------------------
* 0 4 7f9d3e6a34c0 Grid Grid Input 0 Y N 1
--------------------------------------------------------
grdimage [INFORMATION]: Central meridian not given, default to 121.5
grdimage [DEBUG]: Projected values in meters: -389618 389618 2.25842e+06 2.98036e+06
grdimage [DEBUG]: Auto-frame interval for axis 0 item 0: d = 1 f = 0.25
grdimage [INFORMATION]: Auto-frame interval for x-axis (item 0): a1f0.25
grdimage [DEBUG]: Auto-frame interval for axis 1 item 0: d = 1 f = 0.25
grdimage [INFORMATION]: Auto-frame interval for y-axis (item 0): a1f0.25
grdimage [INFORMATION]: Map scale is 51.9491 km per cm or 1:5.19491e+06.
grdimage [DEBUG]: Running in PS mode classic
grdimage [DEBUG]: Opened PS file ./test.ps
grdimage [DEBUG]: Basemap order: Frame = above Grid = above Tick/Annot = below
grdimage [INFORMATION]: Allocate and read data from file ./earth_relief_01d.grd
grdimage [DEBUG]: gmtapi_begin_io: Input resource access is now enabled [container]
grdimage [DEBUG]: gmtapi_import_grid: Passed ID = 4 and mode = 131074
grdimage [INFORMATION]: Reading grid from file ./earth_relief_01d.grd
grdimage [DEBUG]: Calling nc_open on ./earth_relief_01d.grd, ncid = 65536, err = 0
grdimage [DEBUG]: packed z-range: [-12984,2599]
grdimage [DEBUG]: Calling nc_close on ncid 65536, err = 0
grdimage [DEBUG]: Geographic input grid, longitudes span less than 360
grdimage [DEBUG]: Chosen boundary condition for all edges: extended data
grdimage [INFORMATION]: gmt_grd_BC_set: All boundaries set via extended data.
grdimage [DEBUG]: GMT_End_IO: Input resource access is now disabled
grdimage [DEBUG]: Set_Object for family: 1
==> 1 API Objects at end of GMT_Read_Data
--------------------------------------------------------
K.. ID RESOURCE.... FAMILY.... ACTUAL.... DIR... S O M L
--------------------------------------------------------
* 0 4 7f9d3e6a34c0 Grid Grid Input 2 Y N 1
--------------------------------------------------------
grdimage [DEBUG]: CPT argument (null) understood to be a master table
grdimage [DEBUG]: Look for file google/turbo in /Users/sbrizzi/.gmt
grdimage [DEBUG]: Look for file google/turbo in /Users/sbrizzi/.gmt/cache
grdimage [DEBUG]: Look for file google/turbo in /Users/sbrizzi/.gmt/server
grdimage [DEBUG]: GMT: 0. Will try to find subdir=cpt stem = google/turbo suffix=.cpt
grdimage [DEBUG]: GMT: 1. gmt_getsharepath trying current dir
grdimage [DEBUG]: GMT: 2. gmt_getsharepath trying USERDIR /Users/sbrizzi/.gmt
grdimage [DEBUG]: GMT: 3. gmt_getsharepath trying USERDIR subdir /Users/sbrizzi/.gmt/cpt
grdimage [DEBUG]: GMT: 4. gmt_getsharepath trying SHAREDIR subdir /opt/gmt/share/cpt
grdimage [DEBUG]: Given full path to file /opt/gmt/share/cpt/google/turbo.cpt
grdimage [DEBUG]: Found readable file /opt/gmt/share/cpt/google/turbo.cpt
grdimage [DEBUG]: Object ID 5 : Registered CPT File /opt/gmt/share/cpt/google/turbo.cpt as an Input resource with geometry Volume [n_objects = 2]
grdimage [DEBUG]: gmtapi_begin_io: Input resource access is now enabled [container]
grdimage [DEBUG]: gmtapi_import_palette: Passed ID = 5 and mode = 8
grdimage [INFORMATION]: Reading CPT from File /opt/gmt/share/cpt/google/turbo.cpt
grdimage [DEBUG]: Reading CPT from /opt/gmt/share/cpt/google/turbo.cpt
grdimage [DEBUG]: GMT_End_IO: Input resource access is now disabled
grdimage [DEBUG]: Set_Object for family: 3
==> 2 API Objects at end of GMT_Read_Data
--------------------------------------------------------
K.. ID RESOURCE.... FAMILY.... ACTUAL.... DIR... S O M L
--------------------------------------------------------
* 0 4 7f9d3e6a34c0 Grid Grid Input 2 Y N 1
* 1 5 7f9d3c4ad700 CPT CPT Input 2 Y N 1
--------------------------------------------------------
grdimage [INFORMATION]: Auto-stretching CPT file google/turbo to fit data range -6210 to 1234.5
grdimage [INFORMATION]: Project the input grid
grdimage [DEBUG]: Object ID 6 : Registered Grid Memory Reference 7f9d3e3aa810 as an Input resource with geometry Surface [n_objects = 3]
grdimage [DEBUG]: Successfully duplicated a Grid
==> 3 API Objects at end of GMT_Duplicate_Data
--------------------------------------------------------
K.. ID RESOURCE.... FAMILY.... ACTUAL.... DIR... S O M L
--------------------------------------------------------
* 0 4 7f9d3e6a34c0 Grid Grid Input 2 Y N 1
* 1 5 7f9d3c4ad700 CPT CPT Input 2 Y N 1
* 2 6 7f9d3e3aa810 Grid Grid Input 0 Y N 1
--------------------------------------------------------
grdimage [DEBUG]: gmt_project_init: IN: Inc [0/0] n_columns/n_rows [12/11] dpi = 0 offset = 0
grdimage [DEBUG]: gmt_project_init: OUT: Inc [0/0] n_columns/n_rows [12/11] dpi = 0 offset = 0
grdimage [INFORMATION]: Grid projection from size 12x11 to 12x11
grdimage [DEBUG]: Successfully added data array to previously registered Grid container
==> 3 API Objects at end of GMT_Create_Data
--------------------------------------------------------
K.. ID RESOURCE.... FAMILY.... ACTUAL.... DIR... S O M L
--------------------------------------------------------
* 0 4 7f9d3e6a34c0 Grid Grid Input 2 Y N 1
* 1 5 7f9d3c4ad700 CPT CPT Input 2 Y N 1
* 2 6 7f9d3e3aa810 Grid Grid Input 0 Y N 1
--------------------------------------------------------
grdimage [DEBUG]: gmt_grd_project: In [116/127/18/28] and out [-1.68728908886/7.59280089989/-1.77393691697/7.35498111981]
grdimage [DEBUG]: GMT_Destroy_Data: freed memory for a Grid for object 4
grdimage [DEBUG]: gmtlib_unregister_io: Unregistering object no 4 [n_objects = 2]
grdimage [DEBUG]: gmtlib_unregister_io: Object no 4 has non-NULL resource pointer
==> 2 API Objects at end of GMT_Destroy_Data
I am also attaching the matlab crash report.
Any help on how to fix this would be really appreciated!
EDIT: I forgot to mention that grdimage works perfectly if I run commands from the terminal
matlab_crash_report.txt (991.7 KB)