Skip to main content

envi2numpy - Converting ENVI shots to numpy

Python module for converting hyperspectral ENVI captures to numpy arrays. It can also do white/dark balancing.

To install:

python3 ./setup.py build
python3 ./setup.py install

This module can also be installed using pip

pip3 install envi2numpy

Example

Suppose the following files:

  • DARKREF_EXAMPLE_2020-01-01-10-10-10.hdr
  • DARKREF_EXAMPLE_2020-01-01-10-10-10.log
  • DARKREF_EXAMPLE_2020-01-01-10-10-10.raw
  • EXAMPLE_2020-01-01-10-10-10.hdr
  • EXAMPLE_2020-01-01-10-10-10.log
  • EXAMPLE_2020-01-01-10-10-10.raw
  • WHITEREF_EXAMPLE_2020-01-01-10-10-10.hdr
  • WHITEREF_EXAMPLE_2020-01-01-10-10-10.log
  • WHITEREF_EXAMPLE_2020-01-01-10-10-10.raw
import envi2numpy

# Settings
do_normalize = False # Normalize pixel values between 0.0 and 1.0
do_log_derive = False # Take the logarithmic derivative between the bands

# Parse meta info
hdr_dict = envi2numpy.readHDRfile(cube_hdr_path="EXAMPLE_2020-01-01-10-10-10.hdr")
width = hdr_dict['width']
num_bands = hdr_dict['bands']

numpy_array = envi2numpy.convert(cube_path="EXAMPLE_2020-01-01-10-10-10.raw",
                                  dark_ref_path="DARKREF_EXAMPLE_2020-01-01-10-10-10.raw",
                                  white_ref_path="WHITEREF_EXAMPLE_2020-01-01-10-10-10.raw",
                                  width=width,
                                  num_bands=num_bands,
                                  normalize=do_normalize,
                                  log_derive=do_log_derive

Metadata

Release files for envi2numpy 1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for envi2numpy 1.4
File Size Uploaded
envi2numpy-1.4.tar.gz 14.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for envi2numpy 1.4
File Interpreter ABI Platform
envi2numpy-1.4-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details

Total release size: 296.8 kB

Release files / envi2numpy-1.4.tar.gz

Download URL envi2numpy-1.4.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
debeeaf05ca9548d416a27aea4e5778429aa36cde29385db7d4c0a69f298a72c
BLAKE2b-256 checksum
How to use checksums
511119f86c509e40b04bd7c6ba34b7e9b9ae7731f2a825b9a6815943e4ad854d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9

Release files / envi2numpy-1.4-cp36-cp36m-manylinux1_x86_64.whl

Download URL envi2numpy-1.4-cp36-cp36m-manylinux1_x86_64.whl
Size 282.3 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
21bdaea59f085d48be8dc93350b6f7fa46e43e6bdb78b242c354a0d0eff7f58b
BLAKE2b-256 checksum
How to use checksums
647e452590b26e612d8599e6d141e2f7d8492e8ff97a96b4739ba0958634f1fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

1.4 This release

2 release files

1.3

2 release files

1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page