We are happy to introduce satellite
, an R package designed to facilitate satellite remote sensing analysis in a structured and user-friendly manner.
The main purpose of satellite
is to provide standard classes and methods to stream-line remote sensing analysis workflow in R. It provides its own satellite-class
along with standard methods for basic image transformations such as atmospheric and topgraphic corrections, among others.
The package is desinged with both flexibility and user-friendliness in mind. Think of it as the sp-package
for remote sensing analysis. It provides core functionality and can be easily extended via packages to suit your own analysis needs. Furthermore, the fact that image bands are stored as Raster*
objects means, that all functionality currently available for these classes will also work nicely with satellite
.
In the following, we would like to highlight some of the functionality provided by satellite
.
To start a remote sensing alaysis workflow with satellite
you simply use its workhorse function satellite()
and point it to a folder where your satellite data is stored.
library(satellite) path <- system.file("extdata", package = "satellite") files <- list.files(path, pattern = glob2rx("LC08*.TIF"), full.names = TRUE) # Landsat 8 example data files sat <- satellite(files)
This will create an object of class satellite
with three slots:
RasterLayers
of all available bandsFor supported satellite platforms all of this is done automatically. At the moment of this writing, supported platforms are Landsat generations 4 to 8. It is, however, very easy to expand this support to other platforms by providing suitable look-up-tables (LUT). Even if no suitable LUT is available, satellite
will still import slots @layers
and @log
.
As mentioned above, @layers
contains a list of RasterLayers
of all available bands. The reason for storing the individual bands as RasterLayers
rather than a RasterStack
is that most satellite platforms provide at least one layer of different spatial resolution that the rest.
str(sat@layers, 1)
It is, however, easy to create a RasterStack
from selected layers as stack-method
is defined for class satellite
. By default this will take all layers with the same resolution as the first and stack them. A suitable warning is provided so that the user is informed which layers were not included in the RasterStack
. Furthermore, one can simply provide a vector of layer IDs (either layer names or numbers) to be stacked.
## default (all that are similar to layer 1; panchromatic 15-m band 8 is skipped here) sat_stack <- stack(sat) sat_stack ## or by layer names stack(sat, layer = c("B001n", "B002n", "B003n")) ## or by layer indices stack(sat, layer = 2:6)
The @meta
slot provides meta information for each of the layers of the satellite
object. Here's a non-exhaustive list of the most important entries:
In addition to these, several calibration coefficients (such as the sun zenith and azimuth angles , sun elevation, earth-sun distance etc.), information on spatial resolution and projection as well as information about file names and paths is also stored.
For the Landsat 8 example data shipped with the package the meta data looks like this:
str(sat@meta)
Everytime the user performs some calculation on some or all of the layers, this meta information will be updated accordingly. Here's an example:
## add digital elevation model to existing 'Satellite' object dem <- raster(system.file("extdata/DEM.TIF", package = "satellite")) sat <- addSatDataLayer(sat, data = dem, info = NULL, bcde = "DEM", in_bcde = "DEM") ## perform topographic correction sat_tc <- calcTopoCorr(sat) tail(sat_tc@meta[, 1:6])
As you can see, all bands have been topographically corrected and the meta data for the resulting layers is automatically appended to the original data frame. Note for example how $DATE
is set to the date that layers were calculated.
Note, that in order to avoid too long console output, we only show the first and last six columns and rows, respectively, of the meta data here.
Similar to the meta data, log data is also updated every time an analyis is carried out on the object. The default entries (i.e. the ones created on intial import) are as follows:
sat@log
And here's how this is modified after the topographic correction:
str(sat_tc@log[1:2])
Note how, in addition to the info about the initial import, we now have additional logs entries for each band that was topographically corrected clearly showing which call was dispatched, when and on which layer. Even though we only show the first additional log entry here, entries are created for all processed layers. This ensures that we can easily trace what has been done so far and serves as a reference for the current state of processing.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.