binary data tables - gmtinfo and gmtconvert

Added by Jason about 3 years ago

Hi,

I'm having some trouble processing some binary data tables. I'm completely new to working directly with binary tables and files in general. My understanding is that the attached binary table file contains a single column of binary floats (single precision?), has a 896-byte header, and should have 4941 records. Using these parameters, the output from gmtinfo looks as expected:
$ gmt gmtinfo agrid_charl_l.2013.ssc -bi1f -h896
agrid_charl_l.2013.ssc: N = 4941 <0/3.95378665417e-005>

If I try to strip the header with gmtconvert, leaving it as a binary table in the same format, the output appears to be missing some records:
$ gmt gmtconvert agrid_charl_l.2013.ssc -bi1f -hi896 -bo1f > agrid_charl_l.2013.ssc.nh_gmt
$ gmt gmtinfo agrid_charl_l.2013.ssc.nh_gmt -bi1f
agrid_charl_l.2013.ssc.nh_gmt: N = 4269 <0/3.95378665417e-005>

If use xxd to strip the header (is there a better tool look inside/dump binary files?), it seems like the output has the correct number of records:
$ xxd -s +896 -p agrid_charl_l.2013.ssc | xxd -r -p > agrid_charl_l.2013.ssc.nh_xxd
$ gmt gmtinfo agrid_charl_l.2013.ssc.nh_xxd -bi1f
agrid_charl_l.2013.ssc.nh_xxd: N = 4941 <0/3.95378665417e-005>

Am I missing something with gmtconvert? Or, quite possibly, are my expectations off because I'm missing something basic about the binary data tables?

I'm running v5.1.2, Windows binaries via Cygwin.

Thank you,

Jason


Replies (3)

RE: binary data tables - gmtinfo and gmtconvert - Added by Paul about 3 years ago

I can reproduce your problem so it is a bug. Will have a look now.

RE: binary data tables - gmtinfo and gmtconvert - Added by Paul about 3 years ago

Added as issue #760 and fixed in r14789. Thanks for pointing this out.

RE: binary data tables - gmtinfo and gmtconvert - Added by Paul about 3 years ago

Should have said that if you don't update via svn then a temporary workaround would be to strip off the header with another tool such as dd or xxd.

(1-3/3)