Description Usage Arguments Details Value Author(s) Examples
Generate a table (data.frame) of basic scene information for Landsat5/7/8 data given input scene IDs or filenames. This function can be used to extract this information for single scenes or for an entire collection of scenes (supplied as a character vector). In both cases, a single data frame is returned displaying the sceneID, sensor, path, row, and acquisition date. This data.frame can optionally be written to .csv file for future reference.
1 | getSceneinfo(sourcefile, filename = "")
|
sourcefile |
character vector containing names of scenes to be analyzed. The scene names must adhere to the Landsat convention. Original filenames (with the .tar.gz extension) are allowed |
filename |
optional output filename. If supplied, a .csv is written containing extracted scene information |
It is important to supply the input character vector without changing the names of the scenes, since the getSceneinfo function looks at certain positions in the input character for the necessary information. The input vector may be comprised of original .tar.gz filenames as downloaded from (e.g.) GloVis, which allows for a quick check of scene information in batch mode directly after downloading the data.
a data.frame with columns representing sensor, path, row, and acquisition date for given scenes.
Ben DeVries
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Extract scene information from a known sceneID
sceneID <- "LC80330322013077LGN00"
info <- getSceneinfo(sceneID)
print(info)
# Extract scene information from a scene filename
sceneID <- "LC80330322013077LGN00.tar.gz"
info <- getSceneinfo(sceneID)
print(info)
# Extract scene information from an entire folder containing subfolders with raw data
folders <- c("LE71700551999255AGS00","LE71700551999271EDC00",
"LE71700552000114SGS00","LE71700552000194EDC00","LE71700552000258SGS00",
"LE71700552001036SGS00","LE71700552001180SGS00","LE71700552001228SGS00",
"LE71700552001276SGS00", "LT51700552001060RSA00")
info <- getSceneinfo(folders)
print(info)
# Plot the number of scenes acquired per year
years <- as.numeric(substr(info$date, 1, 4))
plot(table(years), ylab="# of scenes")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.