-
Notifications
You must be signed in to change notification settings - Fork 41
Data Inventory
A number of functions are available in the bfastSpatial package to help keep an inventory of data in a raster time series stack. These functions range from basic scene information (getSceneinfo()
) to summary of pixel values per year in the time series (annualSummary()
).
The following functions are included in the Data Inventory module:
getSceneinfo()
countObs()
annualSummary()
getSceneinfo()
allows the user to list the information contained within a scene ID. Currently, only Landsat scene ID's are supported. For example, the scene ID "LE71700552007309ASN00" tells us that the scene is from the Landsat 7 ETM+ sensor ('LE7'), path-row 170-55 ('170055') and was acquired on the 309th day of the year 2007 ('2007309'). Calling getSceneinfo('LE71700552007309ASN00')
will give a data.frame
with one row showing all of this information.
> # show scene info from tura layers
> data(tura)
> names(tura)
> s <- getSceneinfo(names(tura))
> s
> # add a column for years and plot # of scenes per year
> s$year <- as.numeric(substr(s$date, 1, 4))
> hist(s$year, breaks=c(1984:2014))
More examples can be found under ?getSceneinfo
. Many other functions in the bfastSpatial package rely on getSceneinfo
to extract relevant scene information, such as acquisition dates to be passed to bfmSpatial()
or bfmPixel()
.
The number of available observations in a raster time series can be calculated by using countObs()
. This function "drills" through pixels of a time series and counts the number of pixels with a non-NA value. Optionally, any other value can be supplied as a substitute for NA (e.g. the number of non-zero values per pixel can also be queried). Values can also be expressed as a percentage if as.perc
is set to TRUE
.
> data(tura)
> obs <- countObs(tura, as.perc=TRUE)
> plot(obs)
> summary(obs)