@@ -39,37 +39,41 @@ This tutorial aims at describing the processing workflow and giving the associat
...
@@ -39,37 +39,41 @@ This tutorial aims at describing the processing workflow and giving the associat
# Processing parameters
# Processing parameters
## Input / Output files
## Input / Output files
The input images are expected to be in ENVI HDR format, BIL interleaved. To check if the flormat is good use fucntion `check_data`.
The input images are expected to be in ENVI HDR format, BIL interleaved.
If not they should be converted with function `raster2BIL`.
The functions `perform_radiometric_filtering` and `perform_PCA` start with a procedure checkin if the image format is as expected. if not, the functions will retrun a message explaining the problem and will stop the process.
A mask can also be set to work on a selected part of the input image. The mask is expected to be a raster in the same format as the image (ENVI HDR), with values 0 = masked or 1 = selected. If no mask is to be used set `Input.Mask.File = FALSE`.
If the format is not ENVI format BIL interleaved, the function `raster2BIL` allows conversion into proper format and returns updated `Input_Image_File`
The output directory defined with `Output.Dir` will contain all the results. For each image processed, a subdirectory will be automatically created after its name.
Spectral bands should be defined if the image is multi or hyperspectral image.
A mask can also be set to work on a selected part of the input image. The mask is expected to be a raster in the same format as the image (ENVI HDR), with values 0 = masked or 1 = selected. Only one band is required. If no mask is to be used set `Input_Mask_File = FALSE`.
The output directory defined with `Output_Dir` will contain all the results. For each image processed, a subdirectory will be automatically created after its name.
The algorithm estimates \alpha and \beta diversity within a window, that is also the output spatial resolution. It is defined in number of pixels of the input image with parameter `window_size`, e.g. `window_size = 10` meaning a window of 10x10 pixels. It will be the spatial resolution of the ouput rasters.
The algorithm estimates \alpha and \beta diversity within a window, that is also the output spatial resolution. It is defined in number of pixels of the input image with parameter `window_size`, e.g. `window_size = 10` meaning a window of 10x10 pixels. It will be the spatial resolution of the ouput rasters.
As a rule of thumb, spatial units between 0.25 and 4 ha usually match with ground data.
As a rule of thumb, spatial units between 0.25 and 4 ha usually match with ground data.
A window_size too small results in low number of pixels per spatial unit, hence limited range of variation of diversity in the image.
if `window_size` is too small, it will result in low number of pixels per spatial unit, hence limited range of variation of diversity in the image.
In this example, the spatial resolution of the input raster. Setting `window_size = 10` will result in diversity maps of spatial resolution 100x100m.
In this example, the spatial resolution of the input raster is 10m. Setting `window_size = 10` will result in diversity maps of spatial resolution 100m x 100m.
```{r Spatial resolution}
```{r Spatial resolution}
window_size = 10
window_size = 10
...
@@ -87,10 +91,10 @@ The use of computing ressources can be controled with the following parameters:
...
@@ -87,10 +91,10 @@ The use of computing ressources can be controled with the following parameters:
* `nbCPU` controls the parallelisation of the processing: how many CPUs will be asssigned for multithreading,
* `nbCPU` controls the parallelisation of the processing: how many CPUs will be asssigned for multithreading,
* `MaxRAM` controls the size in GB of the input image chunks processed by each thread (this does not correspond to the max amount of RAM allocated),
* `MaxRAM` controls the size in GB of the input image chunks processed by each thread (this does not correspond to the max amount of RAM allocated),
* `nbclusters` controls the number of clusters defined by k-means clustering for each repetition. Images showing moderate diversity (temperate forests) may need lower number of clusters (20), whereas highly diverse tropical forest require more (50). The larger the value the longer the computation time.
* `nbclusters` controls the number of clusters defined by k-means clustering for each repetition. Images showing moderate diversity (temperate forests) may need lower number of clusters (20), whereas highly diverse tropical forest require more (50). The larger the value the longer the computation time. Users are invited to experiment with different numbers of clusters in order to identify the snsitivity of divrsity patterns to this parameter.
```{r Computing options}
```{r Computing options}
nbCPU = 4
nbCPU = 2
MaxRAM = 0.5
MaxRAM = 0.5
nbclusters = 50
nbclusters = 50
```
```
...
@@ -99,13 +103,13 @@ nbclusters = 50
...
@@ -99,13 +103,13 @@ nbclusters = 50
## Mask non vegetated / shaded / cloudy pixels
## Mask non vegetated / shaded / cloudy pixels
```{r Mask non vegetated / shaded / cloudy pixels}
```{r Mask non vegetated / shaded / cloudy pixels}
@@ -121,7 +125,7 @@ This PCA raster file can be displayed using QGIS or any GIS / image processing s
...
@@ -121,7 +125,7 @@ This PCA raster file can be displayed using QGIS or any GIS / image processing s
This PCA band selection left to user judgement, who then writes the band to be kept in a `.txt` file located in the same directory as the PCA raster file. The file is automatically created and ready to edit with function `select_PCA_components`. Each selected band should be identified per line in this file.
This PCA band selection left to user judgement, who then writes the band to be kept in a `.txt` file located in the same directory as the PCA raster file. The file is automatically created and ready to edit with function `select_PCA_components`. Each selected band should be identified per line in this file.
The main goal of PC selection is to discard PCs showing no relevant information corresponding to vegetation, or including artifacts possibly explained by sensor properties. It is somehow a subjective process, and we are currently working on automatic selection of these components.
The main goal of PC selection is to discard PCs showing no relevant information corresponding to vegetation, or including artifacts possibly explained by sensor properties. It is somehow a subjective process, and we are currently working on automatic selection of these components.
For this example, PCA bands 1, 2, 4, 5, 6 and 8 can be kept if writing the following lines in file `selected_components.txt` opened for edition (do not forget carriage return after last value):
For this example, PCA bands 1, 2, 4, 5, 6 and 8 can be kept if writing the following lines in file `Selected_Components.txt` opened for edition (do not forget carriage return after last value):
```
```
1
1
2
2
...
@@ -136,22 +140,35 @@ Here is the code to perform PCA and select PCA bands:
...
@@ -136,22 +140,35 @@ Here is the code to perform PCA and select PCA bands:
The first step towards \alpha and \beta diversity mapping corresponds to the computation of a `SpectralSpecies` map, which identifies the centroid a the cluster ('spectral species') assigned to each pixel in the image, after k-means clustering is performed
The first step towards \alpha and \beta diversity mapping corresponds to the computation of a `SpectralSpecies` map, which identifies the cluster ('spectral species') assigned to each pixel in the image, after k-means clustering is performed.
@@ -39,37 +39,41 @@ This tutorial aims at describing the processing workflow and giving the associat
...
@@ -39,37 +39,41 @@ This tutorial aims at describing the processing workflow and giving the associat
# Processing parameters
# Processing parameters
## Input / Output files
## Input / Output files
The input images are expected to be in ENVI HDR format, BIL interleaved. To check if the flormat is good use fucntion `check_data`.
The input images are expected to be in ENVI HDR format, BIL interleaved.
If not they should be converted with function `raster2BIL`.
The functions `perform_radiometric_filtering` and `perform_PCA` start with a procedure checkin if the image format is as expected. if not, the functions will retrun a message explaining the problem and will stop the process.
A mask can also be set to work on a selected part of the input image. The mask is expected to be a raster in the same format as the image (ENVI HDR), with values 0 = masked or 1 = selected. If no mask is to be used set `Input.Mask.File = FALSE`.
If the format is not ENVI format BIL interleaved, the function `raster2BIL` allows conversion into proper format and returns updated `Input_Image_File`
The output directory defined with `Output.Dir` will contain all the results. For each image processed, a subdirectory will be automatically created after its name.
Spectral bands should be defined if the image is multi or hyperspectral image.
A mask can also be set to work on a selected part of the input image. The mask is expected to be a raster in the same format as the image (ENVI HDR), with values 0 = masked or 1 = selected. Only one band is required. If no mask is to be used set `Input_Mask_File = FALSE`.
The output directory defined with `Output_Dir` will contain all the results. For each image processed, a subdirectory will be automatically created after its name.
The algorithm estimates \alpha and \beta diversity within a window, that is also the output spatial resolution. It is defined in number of pixels of the input image with parameter `window_size`, e.g. `window_size = 10` meaning a window of 10x10 pixels. It will be the spatial resolution of the ouput rasters.
The algorithm estimates \alpha and \beta diversity within a window, that is also the output spatial resolution. It is defined in number of pixels of the input image with parameter `window_size`, e.g. `window_size = 10` meaning a window of 10x10 pixels. It will be the spatial resolution of the ouput rasters.
As a rule of thumb, spatial units between 0.25 and 4 ha usually match with ground data.
As a rule of thumb, spatial units between 0.25 and 4 ha usually match with ground data.
A window_size too small results in low number of pixels per spatial unit, hence limited range of variation of diversity in the image.
if `window_size` is too small, it will result in low number of pixels per spatial unit, hence limited range of variation of diversity in the image.
In this example, the spatial resolution of the input raster. Setting `window_size = 10` will result in diversity maps of spatial resolution 100x100m.
In this example, the spatial resolution of the input raster is 10m. Setting `window_size = 10` will result in diversity maps of spatial resolution 100m x 100m.
```{r Spatial resolution}
```{r Spatial resolution}
window_size = 10
window_size = 10
...
@@ -87,7 +91,7 @@ The use of computing ressources can be controled with the following parameters:
...
@@ -87,7 +91,7 @@ The use of computing ressources can be controled with the following parameters:
* `nbCPU` controls the parallelisation of the processing: how many CPUs will be asssigned for multithreading,
* `nbCPU` controls the parallelisation of the processing: how many CPUs will be asssigned for multithreading,
* `MaxRAM` controls the size in GB of the input image chunks processed by each thread (this does not correspond to the max amount of RAM allocated),
* `MaxRAM` controls the size in GB of the input image chunks processed by each thread (this does not correspond to the max amount of RAM allocated),
* `nbclusters` controls the number of clusters defined by k-means clustering for each repetition. Images showing moderate diversity (temperate forests) may need lower number of clusters (20), whereas highly diverse tropical forest require more (50). The larger the value the longer the computation time.
* `nbclusters` controls the number of clusters defined by k-means clustering for each repetition. Images showing moderate diversity (temperate forests) may need lower number of clusters (20), whereas highly diverse tropical forest require more (50). The larger the value the longer the computation time. Users are invited to experiment with different numbers of clusters in order to identify the snsitivity of divrsity patterns to this parameter.
```{r Computing options}
```{r Computing options}
nbCPU = 2
nbCPU = 2
...
@@ -99,13 +103,13 @@ nbclusters = 50
...
@@ -99,13 +103,13 @@ nbclusters = 50
## Mask non vegetated / shaded / cloudy pixels
## Mask non vegetated / shaded / cloudy pixels
```{r Mask non vegetated / shaded / cloudy pixels}
```{r Mask non vegetated / shaded / cloudy pixels}
@@ -121,7 +125,7 @@ This PCA raster file can be displayed using QGIS or any GIS / image processing s
...
@@ -121,7 +125,7 @@ This PCA raster file can be displayed using QGIS or any GIS / image processing s
This PCA band selection left to user judgement, who then writes the band to be kept in a `.txt` file located in the same directory as the PCA raster file. The file is automatically created and ready to edit with function `select_PCA_components`. Each selected band should be identified per line in this file.
This PCA band selection left to user judgement, who then writes the band to be kept in a `.txt` file located in the same directory as the PCA raster file. The file is automatically created and ready to edit with function `select_PCA_components`. Each selected band should be identified per line in this file.
The main goal of PC selection is to discard PCs showing no relevant information corresponding to vegetation, or including artifacts possibly explained by sensor properties. It is somehow a subjective process, and we are currently working on automatic selection of these components.
The main goal of PC selection is to discard PCs showing no relevant information corresponding to vegetation, or including artifacts possibly explained by sensor properties. It is somehow a subjective process, and we are currently working on automatic selection of these components.
For this example, PCA bands 1, 2, 4, 5, 6 and 8 can be kept if writing the following lines in file `selected_components.txt` opened for edition (do not forget carriage return after last value):
For this example, PCA bands 1, 2, 4, 5, 6 and 8 can be kept if writing the following lines in file `Selected_Components.txt` opened for edition (do not forget carriage return after last value):
```
```
1
1
2
2
...
@@ -136,22 +140,35 @@ Here is the code to perform PCA and select PCA bands:
...
@@ -136,22 +140,35 @@ Here is the code to perform PCA and select PCA bands:
The first step towards \alpha and \beta diversity mapping corresponds to the computation of a `SpectralSpecies` map, which identifies the centroid a the cluster ('spectral species') assigned to each pixel in the image, after k-means clustering is performed
The first step towards \alpha and \beta diversity mapping corresponds to the computation of a `SpectralSpecies` map, which identifies the cluster ('spectral species') assigned to each pixel in the image, after k-means clustering is performed.