Questions tagged [spectral-python]

For questions about Spectral Python (SPy) - the open source Python module for hyperspectral image processing. When using this tag also include the more generic [python] tag where possible.

The user guide for Spectral Python is located at http://spectralpython.net

Source code is managed at https://github.com/spectralpython/spectral

28 questions
6
votes
0 answers

Image Warping with a Polynomial Transformation

Outline I'm trying to warp an image (of a spectral peak in a time series, but this is not important) by generating a polynomial based on some 'centroid' data that is associated with the image (the peak at each time step) and augmenting the…
AlexP
  • 351
  • 2
  • 14
4
votes
2 answers

How to display hyperspectral image with SPy by python script not ipython?

when I use the script the window flashes and then disappears, so I just want to know how to make it stay for a long time? Thanks very much! you can get this python package form from spectral import * img = open_image('92AV3C.lan') view =…
Semie J
  • 41
  • 2
4
votes
2 answers

reading .img envi file with spectral python

I am trying to open an envi .img file and there is a .hdr file having same name. In the .img file there are two images which I can read using following code. from spectral import * img =…
M. M. Farhad
  • 39
  • 1
  • 7
4
votes
1 answer

How to use spectral python to handle multispectral raster files?

I'm interested in using Spectral Python (SPy) to visualize and classify multiband raster GeoTIFF (not hyperspectral data). Currently it appaers that only .lan, .gis File Formats are readable. I've tried to convert files to .lan with gdal_translate…
Wraf
  • 747
  • 2
  • 10
  • 24
2
votes
2 answers

How to iteratively load read_pixel and write to envi file; python3

I want to load hyperspectral data per pixel into an array and write this pixel out again using Python 3.5. I want to calculate something with the spectral information of this Pixel. I have tried two different ways and both don't work the way I…
AnneR
  • 31
  • 5
1
vote
0 answers

Function of a backslash in a line of code, not escaping character from string

I am teaching myself all kinds of things at once, which is probably problematic, but I am doing it by simultaneously trying to understand the source code in a library whilst using the same library. In the Spectral Python library there is this…
russj
  • 25
  • 1
  • 6
1
vote
0 answers

Baseline removal for multiple columns

I have a data frame with 300 rows and 666 columns. Each row is basically a spectrum. How to apply a Baseline removal package or any other method for an entire dataset? Any suggestion related to the question would be great and appreciated. Thanks in…
1
vote
1 answer

How to read wavelength information from envi file in spectral python libraray?

I am working on hyperspectral imagery which is in envi format. I have successfully read it using spectral python library. Now , I want to get each band (wavelength center). Kindly suggest method for this task.
KHIZER
  • 21
  • 4
1
vote
1 answer

How to merge raster files directly to ENVI or LAN

I am trying to stitch several hyperspectral tiles together using gdal. The raw files are in ENVI .bin/.hdr format. I have used gdal to build a virtual raster for each scene, and then used gdal_merge to create the new combined file. I am using the…
Josh Henry
  • 29
  • 2
1
vote
1 answer

Errors with matplotlib, what am I missing?

I've been experimenting with SPy (Spectral Python), using PyCharm on a Mac. I've been running into error after error, but as it stands, its this error I'm completely stumped on: Program…
NGXII
  • 407
  • 2
  • 9
  • 18
0
votes
1 answer

How can I generate RGB image from hyperspectral data?

I have a hypercube with dimensions (512, 640, 92), which has 92 bands. How can I trasform this Hypercube to RGB image? Is there any tool or python code available that I can use it? The spectral range is [980-1680].
S.EB
  • 1,966
  • 4
  • 29
  • 54
0
votes
1 answer

How to plot the NIR spectral signal from the hypercube data in python?

I have the following data available from the hyperspectral imaging: cube_envi32.dat cube_envi32.hdr roi_masks.bmp How can I plot the reflectance vs wavelength plot? Is there any sample python code that I can use?
S.EB
  • 1,966
  • 4
  • 29
  • 54
0
votes
1 answer

How to extract the spectra range within a roi mask?

I am learning hyperspectral data analysis, so my question may sound simple. I am reading a hypercube by using the following command: import spectral.io.envi as envi hc = envi.open('cube_envi32.hdr','cube_envi32.dat') 'hc' has the following…
S.EB
  • 1,966
  • 4
  • 29
  • 54
0
votes
0 answers

SPy error: "Axes don't match array" when calling .open_memmap()

I have some .bsq files with corresponding header files (.hdr). I want to open and edit them in Python, using the spectral (SPy) module. Since I need to edit the files from within a Python Toolbox in ArcMap (that is, a single Python script which uses…
Manuel Popp
  • 1,003
  • 1
  • 10
  • 33
0
votes
2 answers

Replacing values in a numpy array by averaging adjacent values

I have a 3D numpy array dark = np.array(dark_ref.load()) dark.shape (100, 384, 249) I have a list of indices for the second and third dimension l, r, b = np.where(dark > 9000) len(r) 1799 len(b) 1799 and I have written this function to replace the…
russj
  • 25
  • 1
  • 6
1
2