Skip to main content

Package used for reading and converting hyperspectral ENVI captures to numpy

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for envi2numpy, version 1.3
Filename, size File type Python version Upload date Hashes
Filename, size envi2numpy-1.3-cp36-cp36m-manylinux1_x86_64.whl (281.5 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size envi2numpy-1.3.tar.gz (14.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page