GenericMappingTools / gmt-for-geodesy

Material for the annual GMT for EarthScope short course
35 stars 16 forks source link

Failure to use grdimage to plot earth_day image #26

Closed gacarlson closed 2 years ago

gacarlson commented 2 years ago

Hello all- I am having trouble making grdimage work for me. I attempted to execute the following one-liner:

$ gmt grdimage @earth_day_30m -Rg -JW-65/15c -B -png map -Vd

and received the following debug message:

gmt.exe [DEBUG]: GMT_Create_Session: Terminal width = 116 gmt.exe [DEBUG]: Obtained the ppid from parent: 21892
gmt.exe [DEBUG]: Enter: gmtinit_new_GMT_ctrl gmt.exe [DEBUG]: GMT->session.SHAREDIR = c:/programs/gmt6/share gmt.exe [DEBUG]: GMT->session.HOMEDIR = C:/Users/13173 gmt.exe [DEBUG]: GMT->session.USERDIR = C:/Users/13173/.gmt [created] gmt.exe [DEBUG]: GMT->session.CACHEDIR = C:/Users/13173/.gmt/cache [created] gmt.exe [DEBUG]: GMT: 0. Will try to find subdir=postscriptlight stem = PSL_custom_fonts suffix=.txt gmt.exe [DEBUG]: GMT: 1. gmt_getsharepath trying current dir gmt.exe [DEBUG]: GMT: 2. gmt_getsharepath trying USERDIR C:/Users/13173/.gmt gmt.exe [DEBUG]: GMT: 3. gmt_getsharepath trying USERDIR subdir C:/Users/13173/.gmt/postscriptlight gmt.exe [DEBUG]: GMT: 4. gmt_getsharepath trying SHAREDIR subdir c:/programs/gmt6/share/postscriptlight gmt.exe [DEBUG]: GMT: 5. gmt_getsharepath trying SHAREDIR c:/programs/gmt6/share gmt.exe [DEBUG]: GMT: 6. gmt_getsharepath failed gmt.exe [DEBUG]: Map distance calculation will be Cartesian gmt.exe [DEBUG]: Exit: gmtinit_new_GMT_ctrl gmt.exe [DEBUG]: Enter: New_PSL_Ctrl gmt.exe [DEBUG]: Exit: New_PSL_Ctrl gmt.exe [DEBUG]: Enter: gmt_manage_workflow gmt.exe [DEBUG]: Exit : gmt_manage_workflow gmt.exe [DEBUG]: Enter: PSL_beginsession gmt.exe [DEBUG]: Exit : PSL_beginsession gmt.exe [DEBUG]: Enter: PSL_setdefaults gmt.exe [DEBUG]: Exit : PSL_setdefaults gmt.exe [DEBUG]: Enter: gmtlib_io_init gmt.exe [DEBUG]: Exit : gmtlib_io_init gmt.exe [DEBUG]: Enter: gmt_hash_init gmt.exe [DEBUG]: Exit: gmt_hash_init gmt.exe [DEBUG]: Enter: gmt_hash_init gmt.exe [DEBUG]: Exit: gmt_hash_init gmt.exe [DEBUG]: Enter: gmt_reload_settings gmt.exe [DEBUG]: The PROJ_GEODESIC set to Vincenty gmt.exe [DEBUG]: Look for file C:/Users/13173/gmt.conf gmt.exe [DEBUG]: Look for file C:/Users/13173/.gmt/gmt.conf gmt.exe [DEBUG]: Look for file C:/Users/13173/.gmt/server/gmt.conf gmt.exe [DEBUG]: Look for file C:/Users/13173/.gmt/cache/gmt.conf gmt.exe [DEBUG]: Could not find file gmt.conf gmt.exe [DEBUG]: Exit: gmt_reload_settings gmt.exe [DEBUG]: Enter: gmtlib_plot_C_format gmt.exe [DEBUG]: Exit: gmtlib_plot_C_format gmt.exe [DEBUG]: Enter: gmtinit_get_history gmt.exe [DEBUG]: Enter: gmt_hash_init gmt.exe [DEBUG]: Exit: gmt_hash_init gmt.exe [DEBUG]: Failed to release lock (Error <158>: The segment is already unlocked. ) gmt.exe [DEBUG]: Exit: gmtinit_get_history gmt.exe [DEBUG]: GMT_Create_Session initialized GMT structure gmt.exe [DEBUG]: Loading core GMT shared library: gmt_w32.dll gmt.exe [DEBUG]: Shared Library # 0 (core). Path = gmt_w32.dll gmt.exe [DEBUG]: Loading GMT plugins from: C:/programs/gmt6/bin/gmt_plugins gmt.exe [DEBUG]: Shared Library # 1 (supplements). Path = C:/programs/gmt6/bin/gmt_plugins/supplements_w32.dll
gmt.exe [DEBUG]: Local file C:/Users/13173/.gmt/server/gmt_data_server.txt found gmt.exe [DEBUG]: File C:/Users/13173/.gmt/server/gmt_data_server.txt less than 24 hours old, refresh is premature.
gmt.exe [DEBUG]: Load contents from C:/Users/13173/.gmt/server/gmt_data_server.txt gmt.exe [DEBUG]: Local file C:/Users/13173/.gmt/server/gmt_hash_server.txt found gmt.exe [DEBUG]: File C:/Users/13173/.gmt/server/gmt_hash_server.txt less than 24 hours old, refresh is premature.
gmt.exe [DEBUG]: Input remote grid modified to have registration: @earth_day_30m_p gmt.exe [DEBUG]: Revised options: map png begin [INFORMATION]: Creating a workflow directory C:/Users/13173/.gmt/sessions/gmt_session.21892 begin [DEBUG]: The PROJ_GEODESIC set to Vincenty begin [DEBUG]: Look for file C:/Users/13173/gmt.conf begin [DEBUG]: Look for file C:/Users/13173/.gmt/gmt.conf begin [DEBUG]: Look for file C:/Users/13173/.gmt/server/gmt.conf begin [DEBUG]: Look for file C:/Users/13173/.gmt/cache/gmt.conf begin [DEBUG]: Could not find file gmt.conf begin [DEBUG]: Set session name to be map png begin [DEBUG]: Begin Workflow. Session ID = 21892. Directory C:/Users/13173/.gmt/sessions/gmt_session.21892 created. begin [DEBUG]: GMT now running in modern mode [Session ID = 21892] gmt.exe [DEBUG]: Map distance calculation will be using great circle approximation with authalic auxiliary latitudes and authalic (R_2) radius = 6371007.1809 m, in meter. gmt.exe [DEBUG]: Use PS filename C:/Users/13173/.gmt/sessions/gmt_session.21892/gmt_0.ps- gmt.exe [DEBUG]: gmtinit_get_current_panel: No current panel selected so not in subplot mode gmt.exe [DEBUG]: Revised options: @earth_day_30m_p -Rg -JW-65/15c -B -Vd grdimage [DEBUG]: History: Process -Rg grdimage [DEBUG]: History: Process -JW-65/15c 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]: 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]: Remote file (null) exists locally as C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif grdimage [DEBUG]: Replace file @earth_day_30m_p.tif with C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif grdimage [DEBUG]: Projected grid is non-orthogonal, nonlinear, or dpi was changed grdimage [DEBUG]: Found readable file C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif grdimage [DEBUG]: C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif considered a valid image instead of grid. Open via GDAL grdimage [DEBUG]: Reset MAP_ANNOT_OBLIQUE to anywhere grdimage [INFORMATION]: Central meridian set with -J (295) implies -R115/475/-90/90 grdimage [DEBUG]: Projected values in meters: -1.80199e+07 1.80199e+07 -9.00996e+06 9.00996e+06 grdimage [DEBUG]: Computed automatic parameters using dimension scaling: 0.908088 grdimage [DEBUG]: Auto-frame interval for axis 0 item 0: d = 60 f = 15 grdimage [INFORMATION]: Auto-frame interval for x-axis (item 0): a60f15 grdimage [DEBUG]: Auto-frame interval for axis 1 item 0: d = 60 f = 15 grdimage [INFORMATION]: Auto-frame interval for y-axis (item 0): a60f15 grdimage [INFORMATION]: Map scale is 2402.66 km per cm or 1:2.40266e+08. grdimage [INFORMATION]: gmt_map_setup perimeter search region: 0/360/-90/90. grdimage [INFORMATION]: Allocate memory and read image file C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif grdimage [DEBUG]: Given full path to file C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif grdimage [DEBUG]: Given full path to file C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif grdimage [DEBUG]: Found readable file C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif grdimage [DEBUG]: Object ID 0 : Registered Image File C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif 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_image: Passed ID = 0 and mode = 135168 grdimage [DEBUG]: Found readable file C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif grdimage (gmt_gdalread.c:914(gmt_gdalread)): FYI: gmt_M_free given a NULL pointer - ignored 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]: Geographic input grid, longitudes span exactly 360 grdimage [INFORMATION]: Reading image from file C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif
grdimage [DEBUG]: Found readable file C:/Users/13173/.gmt/server/earth/earth_day/earth_day_30m_p.tif

PaulWessel commented 2 years ago

The only thing that looks out of the ordinary is this error:

gmt.exe [DEBUG]: Failed to release lock (Error <158>: The segment is already unlocked.

I have not seen that before. But as you said the TIF file downloaded safely and is there, but looks like grdimage simply quit at the end there since no more messages. Pinging @joa-quim as our Windows guy to see if he has any thoughts of what could go wrong with your system (since it works for others it is related to something on your system).

joa-quim commented 2 years ago

Hmm, if I delete the one I already had I also see that message but it works at the end

grdimage [INFORMATION]: Downloading file http://oceania.generic-mapping-tools.org/server/earth/earth_day/earth_day_30m_p.tif ...
grdimage [DEBUG]: Failed to release lock (Error <158>: The segment is already unlocked.
)
grdimage [DEBUG]: Delete C:\TEMP/earth_day_30m_p.tif.download
grdimage [DEBUG]: Replace file @earth_day_30m_p.tif with c:/j/.gmt/server/earth/earth_day/earth_day_30m_p.tif
grdimage [DEBUG]: Projected grid is non-orthogonal, nonlinear, or dpi was changed

But I notice that you are using the GMT 32 bits. Any reason for that? The 32 bits version is much less tested and we will drop it one of these days.

PaulWessel commented 2 years ago

I am sure the lock/unlock probably works differently under Windows than Unix. Not tested by me. Please install the 64-bit version (and if that works let's eliminate the 32...)

Esteban82 commented 2 years ago

Is it possible to see how many people download gmt-6.4.0-win32.exe?

gacarlson commented 2 years ago

That was definitely the issue. It works now with the 64-bit version

PaulWessel commented 2 years ago

Great, probably something to do with 32-bit vs 64-bit system functions.

gacarlson commented 2 years ago

And thank you all for the help solving this!

Esteban82 commented 2 years ago

I think that this can be close (altough the issue wasn't solve).