reading binary data written in C

S

Sheldon

Hi,

I have a script that I want to use to read some binary lon and lat data
that was written with a C program. My script looks like this:

lat = open(lat_file,'rb').read()
lat = Numeric.fromstring(lat)
print len(lat)
print lat[0]

Results:
1476225
-995001790

Or using the Float typecode:
Results:
1476225
-1419.82055664
**************************

Now the length of the string is good, a 1215*1215 array in vector form.
But the lat data is wrong.
I have tried different type codes but nothing gives me a lat that is
within [+90,-90] degrees.
Does anyone know what is going on here?

Thanks,
Sheldon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top