Question

The package rimage is abandoned, but I was hoping to build from the old source specifically to be able to read Aviris image data files. So first off, if anyone knows of an R package over at github or somewhere with this capability, that'll meet my needs.

The problem I'm running into in trying to build rimage (via cygwin, with Rtools installed on my machine) appears to be that the modern versions of fftw library don't match the versions called out in the configure and related files in the rimage source. The errors I get after calling ./configure are

checking fftw.h usability... no
checking fftw.h presence... no
checking for fftw.h... no
configure: error: Sorry, can't find fftw header

I have installed the latest fftw3 libraries pretty much anywhere (Rtools library directory, cygwin lib directory) that seemed sensible, but if there's a specific place they should have been placed, please let me know that as well. thanks for all help

Was it helpful?

Solution

If you need to import AVIRIS ENVI files, have a look at hyperSpec::read.ENVI. It does not (yet?) provide specific support for the .spec files nor for any georeferencing (as I mainly work with micro-spectroscopy), but adding the wavelength information is reasonably easy by hand:

require ("hyperSpec")

cuprite <- read.ENVI (      file = "data/cuprite/f970619t01p02_r02_sc01.a.rfl",
                      headerfile = "data/cuprite/f970619t01p02_r02_sc01.a.hdr")
spec <- read.table (        file = "data/cuprite/f970619t01p02_r02.a.spc")

colnames (spec) <- c ("wl", "refl", "V3", "V4", "i")
spec <- spec [order (spec$i),]
wl (cuprite) <- spec$wl
labels (cuprite, ".wavelength") <- expression (lamba / nm)

plotmap (cuprite [,, 827], col.regions = alois.palette ()) # slow

hyperSpec works with the data cube unfolded into a data matrix with accompanying $x and $y information. While this is flexible, you'll probably want to set up an indexing matrix to quickly retrieve images. Or you can reshape the matrix cuprite$spc to get the hypercube in an array.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top