jbferet / biodivMapR

biodivMapR: an R package for α- and β-diversity mapping using remotely-sensed images
https://jbferet.github.io/biodivMapR/index.html
GNU General Public License v3.0
47 stars 13 forks source link

raster import #3

Closed downey205 closed 4 years ago

downey205 commented 4 years ago

I am trying to import a 5-band raster and run the demo code on it. It works through the call to perform_PCA() call, and just hangs there. perform_radiometric_filtering() seems to work correctly. I am attaching a debugging version of the code and a small cropped area from my raster. I am using convert2bil() and add the correct wavelength info for the sensor (Micasense RedEdge) and I have tried multiple different versions of raster grids, etc., but none of it seems to make a difference. Here I am providing a GeoTiff. Thanks in advance.


> print("PERFORM DIMENSIONALITY REDUCTION")
> PCA_Output <- perform_PCA(Input_Image_File = Input_Image_File, Input_Mask_File = Input_Mask_File,
>                           Output_Dir = Output_Dir, TypePCA = TypePCA, FilterPCA=FilterPCA,
>                           nbCPU = nbCPU, MaxRAM = MaxRAM, Continuum_Removal = Continuum_Removal)
> # *********************************************************
> #   IF MULTI / HYPERSPECTRAL DATA: 
> #   Please make sure the wavelengths are in nanometers or micrometers
> # if not, stop processing and convert wavelengths in nanometers
> # or micrometers in HDR file
> # *********************************************************
> #   Exclude spectral domains corresponding to water vapor absorption
> # The following spectral domains (min and max spectral band in nanometers) will be discarded
> # [,1] [,2]
> # Excluded_WL    0  400
> # 895 1005
> # 1180 1480
> # 1780 2040
> # Please define the input variable Excluded_WL when calling perform_PCA
> # if you want to modify these spectral domains
> # [1] "Extract pixels from the images to perform PCA on a subset"

code hangs here. I have let it run overnight and it never completes go_debug.zip

UPDATE: I updated to R 4.0.2 and it seemed to run past the PCA. But the rasters it producing are sparse so there are still problems.

jbferet commented 4 years ago

The issues reported here were analyzed and we could identify what went wrong.
Based on our exchange ith downey205, here are a few information that are still required on user side (some may be managed by biodivMapR in future versions):