spectralpython/spectral — pull request #4 by ohspite (2014-05-03 00:16:46+00:00)
Title: Update BIL read_bands to read from disk in consecutive chunks.

Hi Thomas,

I noticed that the `read_bands()` loop for BIL files was looping over `self.nrows` one time for each band. This pull request has a version that loops over `self.nrows` just once, loading all bands per frame in one call to `fromfile()`.

This obviously only matters if you bypass the memmap, which I'm doing by setting `img._memmap = None`.

The speed improvement for the file that I'm testing on is about proportional to the number of bands I'm loading.