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.

Source Distribution

envi2numpy-1.4.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

envi2numpy-1.4-cp36-cp36m-manylinux1_x86_64.whl (282.3 kB view details)

Uploaded CPython 3.6m

File details

Details for the file envi2numpy-1.4.tar.gz.

File metadata

  • Download URL: envi2numpy-1.4.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for envi2numpy-1.4.tar.gz
Algorithm Hash digest
SHA256 debeeaf05ca9548d416a27aea4e5778429aa36cde29385db7d4c0a69f298a72c
MD5 2c96a5ec68ad76f4b947893aa95d124b
BLAKE2b-256 511119f86c509e40b04bd7c6ba34b7e9b9ae7731f2a825b9a6815943e4ad854d

See more details on using hashes here.

File details

Details for the file envi2numpy-1.4-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: envi2numpy-1.4-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 282.3 kB
  • Tags: CPython 3.6m
  • Uploaded using 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

File hashes

Hashes for envi2numpy-1.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 21bdaea59f085d48be8dc93350b6f7fa46e43e6bdb78b242c354a0d0eff7f58b
MD5 0a6a8edefab543afc443663759e0eaeb
BLAKE2b-256 647e452590b26e612d8599e6d141e2f7d8492e8ff97a96b4739ba0958634f1fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page