-
Notifications
You must be signed in to change notification settings - Fork 147
Closed
Labels
Description
Although it appears to be undocumented, ENVI treats keys in header files as case insensitive. Some data creators are assuming the behavior and their .hdr files look like this
ENVI
SAMPLES = 160
LINES = 640
...
instead of this
ENVI
samples = 160
lines = 640
...
This causes problems for mandatory keywords, checked in spectral/io/envi.py around line 737
# Verify minimal set of parameters have been provided
if 'lines' not in metadata:
raise Exception('Number of image rows is not defined.')
...
What do you think is the best way of dealing with this? Some possibilities:
- Apply
.lower()to all keywords in ENVI headers. (easy: envi.py line 115) - Apply
.lower()only to mandatory keywords in ENVI headers (lines, samples, bands, etc.) (personally not a fan of this option). - Optional
case_insensitivekeyword argument. Probably has to be added toread_envi_header(),open()andgen_params()in envi.py, and possibly toopen_image()in spectral.py.
Or maybe something better that I'm not thinking of. Let me know what you think and if you'd like me to submit a pull request.