spectralpython / spectral

Python module for hyperspectral image processing
MIT License
573 stars 139 forks source link

Add support for Major/Minor Frame Offsets in ENVI header #35

Open jajberni opened 9 years ago

jajberni commented 9 years ago

It would be great to support these optional header fields according to ENVI documentation:

http://www.exelisvis.com/docs/EnterOptionalHeaderInformation.html#Set3

It's not going to be easy with the current memmap implementation.

tboggs commented 9 years ago

I agree it would be rather difficult using the memmap interface. I suppose another option is to disable the memmap interface and use the SpyFile interface whenever a nonzero value is encountered for either the "major frame offsets" or "minor frame offsets" header parameters, though that would still be a significant amount of work.

I'll consider options for supporting this. If you have any insight into how often and in what situations these parameters are used, it might help for prioritizing the implementation of this change.

In the mean time, it probable makes sense to raise an exception when a nonzero value is encountered for these parameters to prevent reading corrupted data values.

donm commented 8 years ago

Which fields were you referring to, @jajberni? It looks like that page has changed since your post and the #Set3 in the URL no longer refers to anything.

tboggs commented 8 years ago

@ohspite, that is odd. The keywords were there earlier, hence the change I made to protect against headers with nonzero offsets. I notice the parameters referenced here (search the page for "frame offsets") as being in the ENVI help documentation but not actually used. Also, a quick web search gives multiple other pages describing how to handle/set the parameters.

If anyone has any insight into the past/present/future support of these parameters in ENVI, please add a comment here. In the mean time, we'll continue to raise an exception for nonzero offsets since we don't support that feature.