-
Notifications
You must be signed in to change notification settings - Fork 76
/
sits_merge.Rd
81 lines (69 loc) · 2.83 KB
/
sits_merge.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sits_merge.R
\name{sits_merge}
\alias{sits_merge}
\alias{sits_merge.sits}
\alias{sits_merge.raster_cube}
\alias{sits_merge.default}
\title{Merge two data sets (time series or cubes)}
\usage{
sits_merge(data1, data2, ...)
\method{sits_merge}{sits}(data1, data2, ..., suffix = c(".1", ".2"))
\method{sits_merge}{raster_cube}(data1, data2, ..., tolerance = NULL, output_dir = NULL)
\method{sits_merge}{default}(data1, data2, ...)
}
\arguments{
\item{data1}{Time series (tibble of class "sits")
or data cube (tibble of class "raster_cube") .}
\item{data2}{Time series (tibble of class "sits")
or data cube (tibble of class "raster_cube") .}
\item{...}{Additional parameters}
\item{suffix}{If there are duplicate bands in data1 and data2
these suffixes will be added
(character vector).}
\item{tolerance}{A period tolerance to merge both cubes.
ISO8601-compliant time period for regular data cubes,
with number and unit, where "D", "M" and "Y" stand
for days, month and year; e.g., "P16D" for 16 days.
The temporal tolerance parameter should be less than
the time interval between two images of both cubes.}
\item{output_dir}{Valid directory for storing merged images.}
}
\value{
merged data sets (tibble of class "sits" or
tibble of class "raster_cube")
}
\description{
To merge two series, we consider that they contain different
attributes but refer to the same data cube, and spatiotemporal location.
This function is useful to merge different bands of the same locations.
For example, one may want to put the raw and smoothed bands
for the same set of locations in the same tibble.
To merge data cubes, they should share the same sensor, resolution,
bounding box, timeline, and have different bands.
When the user requests a sits_merge operation for two regular cubes with
the same number of time intervals but with timelines that are not equal
the system issues a warning and asks the user to provide a \code{tolerance}
parameter which will be used in the merging operation.
The temporal tolerance parameter should be less than the time interval
between two images of both cubes.
In this case the second cube will have its timeline and the image
file names changed to match the timeline of the first cube.
The images of the second cube will be written in \code{output_dir}
directory.
}
\examples{
if (sits_run_examples()) {
# Retrieve a time series with values of NDVI
point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI")
# Filter the point using the Whittaker smoother
point_whit <- sits_filter(point_ndvi, sits_whittaker(lambda = 3.0))
# Merge time series
point_ndvi <- sits_merge(point_ndvi, point_whit, suffix = c("", ".WHIT"))
# Plot the two points to see the smoothing effect
plot(point_ndvi)
}
}
\author{
Gilberto Camara, \email{[email protected]}
}