0

This question is part challenge/part question, as I have an idea of what I need to do, but am at a loss as to how to do it. I have a ton of data files that are two-band bsq's that contain latitude and longitude data. They are .geo files. I'm trying to read the data in the files. They can be read with MATLAB using the "multibandread"command like this:

data = multibandread(filename, ...
[size(info_cube, 1) size(info_cube, 2) 2], ...
'double', 0, 'bsq', 'ieee-le');

I want to be able to open the files with Octave though (the free, open-source version of MATLAB).

A tech help person for octave said that multibandread looks like just a wrapper for simple C-style binary I/O. He said to look here: https://www.gnu.org/software/octave/doc/interpreter/C_002dStyle-I_002fO-Functions.html

and he said opening a binary file with a certain byte order could be done with this: https://www.gnu.org/software/octave/doc/interpreter/Opening-and-Closing-Files.html#Opening-and-Closing-Files

and reading raw binary data w/ a given precision could be done with this: https://www.gnu.org/software/octave/doc/interpreter/Binary-I_002fO.html#Binary-I_002fO

So, he thinks that the only thing missing is the interleaving (the repetition of certain data structures) that would have to be controlled by some for-loops.

Can anyone help me read the lat-long data from these files without matlab? Thanks in advance!

singmotor
  • 3,930
  • 12
  • 45
  • 79
  • This sounds really easy. So give us an example of the type of file (data) you have and what you want to do with it (keep it simple, I'm not an electrical engineer). – KrisSodroski Jul 11 '13 at 18:56
  • Like I said above, the files have the extension .geo, which are two-band bsq's that have lat and long data. They are in binary and that matlab function can read them. I need to figure out another way to read them and extract the lat-long info from them. Writing a similar function in Octave, like I said above, is what I think will be the easiest way. But if anyone knows of any applications that can do it, that would be great too – singmotor Jul 11 '13 at 19:25
  • Just use python. Its easy, and then you can extract integer data from it. You can then create files with integer data instead of binary, and then you can process it with matlab (or python) if you want. http://stackoverflow.com/questions/1035340/reading-binary-file-in-python – KrisSodroski Jul 11 '13 at 19:27

0 Answers0