Hi,
I'm trying to import binary Surfer (6.x) files and I've got a problem with the import through r.in.bin
The grid values in the binary file are byte reversed, signed, 32 bit floats following IEEE-754. If I import the data section of the file (ignoring the header) using:
r.in.bin -sbf bytes=4 input=file output=test ....
the file imports without problem and r.info for the resulting map shows the expected min and max for the file (from cellmisc/test/r_range). r.report however shows '*' for all cells. The range of values is from approximately -5 to 90, although the 'no data' value is a very large float (1.7014100091878280e+38).
Any suggestions as to what is going wrong?
Thanks,
David
David Orme wrote:
I'm trying to import binary Surfer (6.x) files and I've got a problem
with the import through r.in.bin
The grid values in the binary file are byte reversed, signed, 32 bit
floats following IEEE-754. If I import the data section of the file
(ignoring the header) using:
r.in.bin -sbf bytes=4 input=file output=test ....
the file imports without problem and r.info for the resulting map shows
the expected min and max for the file (from cellmisc/test/r_range).
r.report however shows '*' for all cells. The range of values is from
approximately -5 to 90, although the 'no data' value is a very large
float (1.7014100091878280e+38).
r.in.bin has the "anull=" option to specify the value which is used
for nulls. However, I don't know how reliable this is for floats, as:
a) the check is done using ==, so any rounding error will cause
problems.
b) if the value is considered to be NaN (as is the case for GRASS'
internal null value), NaN isn't equal to itself, so the test will
always fail.
--
Glynn Clements <glynn.clements@virgin.net>