Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jajberni opened this issue Aug 4, 2015 · 3 comments
Open

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

jajberni opened this issue Aug 4, 2015 · 3 comments

Comments

@jajberni
Copy link

jajberni commented Aug 4, 2015

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
Copy link
Member

tboggs commented Aug 5, 2015

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.

tboggs added a commit that referenced this issue Oct 14, 2015
ENVI image files with frame offsets are not supported. If an image with frame
offsets were opened, image data would be read incorrectly so an exception is
now thrown instead (this addresses issue #35).

- io/envi.py:
  - (EnviFeatureNotSupported): New class
  - (_has_frame_offset): New function to determine if image has frame offsets.
  - (check_compatibility): New function to raise exception when an unsupported
    feature is indicated in an ENVI header.
  - (open): Check compatibility before opening image.
- spectral.py (open): Check compatibility before opening image.
- tests/envi.py: Added tests for ENVI feature compatibilty
@donm
Copy link
Contributor

donm commented Mar 28, 2016

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
Copy link
Member

tboggs commented Mar 28, 2016

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants