<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 5-Jul-09, at 9:29 PM, Hamish wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>Michael Perdue wrote:<br><blockquote type="cite">I don't think you can use r.in.bin<br></blockquote><blockquote type="cite">because there is no option to specify the number of bands<br></blockquote><blockquote type="cite">and how those bands are interleaved. In the past I've used<br></blockquote><blockquote type="cite">Multispec and Matlab to read the data but you might be able<br></blockquote><blockquote type="cite">to manipulate GDAL to read it.<br></blockquote><br>if you have a small m-file to load it and save in a format<br>ready for GRASS's r.in.mat it could be useful to post. Users<br>without Matlab could always use GNU Octave to do the job.<br><br>also I suspect Python can do binary reads in a clean way, which<br>may help if the expected format was known.<br></div></blockquote></div><br><div>Unfortunately, my computer and all my backup drives were stolen in a home invasion about 6 months ago so if I had made a m-file, it's gone. However, it's fairly straight forward in matlab/octave.</div><div>I just did;</div><div><br></div><div><div><font class="Apple-style-span" face="Courier">fid = fopen ('f960705t01p02_r05_sc01.c.img','r');</font></div><div><font class="Apple-style-span" face="Courier">AVIRIS = int16(fread(fid, 'int16', 'ieee-be'));</font></div><div><font class="Apple-style-span" face="Courier">fclose(fid)</font></div><div><font class="Apple-style-span" face="Courier">AVIRIS2 = reshape (AVIRIS, 224,614,512);</font></div><div><font class="Apple-style-span" face="Courier">AVIRIS3 = permute (AVIRIS2,[3 2 1]);</font></div><div><br></div><div>This created the correct output on my system. Of course this assumes that the original file has 224 bands, 614 columns and 512 lines. That should be true for all except the last tile in every flight line which will be less that 512 lines. I'd put more effort into&nbsp;writing&nbsp;an m-file for these files but I don't think it's of a lot of value unless you also read in the *.nav files and geometrically correct the files at the same time. As I've mentioned, the distortions due to aircraft dynamics can be rather extreme. Unfortunately, that is a lot less trivial. Attached is an example from one of the sample datasets.</div><div><br></div><div>Cheers,</div><div><br></div><div>Mike</div><div><br></div><div><img height="596" width="782" apple-width="yes" apple-height="yes" src="cid:BD0F782C-9B60-4F83-9718-26C741BB528F@cg.shawcable.net"></div><div><br></div><div><br></div></div></body></html>