Skip to content

Commit 70cfc0f

Browse files
unknownunknown
authored andcommitted
still finalizing v 1.0.0
1 parent 7dfde04 commit 70cfc0f

18 files changed

+60
-43
lines changed

.Rprofile

Lines changed: 0 additions & 1 deletion
This file was deleted.

R/MSScvm.r

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
#' Create a cloud and cloud shadow mask for Landsat MSS imagery
1+
#' Landsat MSS cloud and cloud shadow masking
22
#'
3-
#' Create a cloud and cloud shadow mask for Landsat MSS imagery
3+
#' Creates a cloud and cloud shadow mask for Landsat MSS imagery.
44
#' @param imgDir directory name (character). Full path to a MSS image directory produced by the \code{\link{MSSunpack}} function.
55
#' @param demFile filename (character). Full path to image-corresponding DEM file.
6-
#' @param classify logical. If TRUE clouds, cloud shadows, and clear pixels have unique values. If FALSE obscured pixels are value 0 and clear are 1.
7-
#' @details bla
8-
#' @return A binary raster with the same dimensions as the MSS image where pixels with value 1 represent clear pixel and 0 as obsured by either cloud or cloud shadow
6+
#' @param classify logical. If TRUE clouds, cloud shadows, and clear pixels have unique values (0 = clear, 1 = cloud shadow, 2 = cloud).
7+
#' If FALSE obscured pixles = 0 and clear = 1.
8+
#' @details It is important that the input DEM file, specified by the 'demFile' parameter, be the same projection and pixel resolution as the
9+
#' input image. It must also be >= in spatial extent, relative to the image. The program will check for these attributes and throw an error message if
10+
#' there is a violation. There are two helper functions to prepare a suitable DEM. Use the \code{\link{reprojectDEM}} function to ensure proper projection
11+
#' and pixel resolution of an exisiting DEM, and the \code{\link{mosaicDEMs}} function to create a mosaic from several DEMs to ensure proper extent, projection,
12+
#' and pixel resolution.
13+
#' @return A GeoTIFF raster image file with the same dimensions as the MSS image. The file will be placed in the
14+
#' 'imgDir' directory with the name equal to the image ID followed by '_msscvm'.
915
#' @examples
1016
#' \dontrun{
1117
#'

R/MSSdn2rad.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' Convert MSS DN values to TOA radiance
22
#'
3-
#' Convert MSS DN values to TOA radiance
3+
#' Convert MSS DN values to TOA radiance.
44
#' @param imgFile filename (character). Full path to *dn.tif image file produced by the \code{\link{MSSunpack}} function.
55
#' @details The equation used to convert DN to TOA radiance can be found \href{http://landsat.usgs.gov/how_is_radiance_calculated.php}{here}.
66
#' @return A 4-band Landsat MSS GeoTIFF raster image file in units of top-of-atmosphere (TOA) radiance. The file will be placed in

R/MSSdn2refl.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#' Convert DN values to TOA reflectance
1+
#' Convert MSS DN values to TOA reflectance
22
#'
3-
#' Convert DN values to TOA reflectance
3+
#' Convert MSS DN values to TOA reflectance.
44
#' @param imgFile filename (character). Full path to *dn.tif image file produced by the \code{\link{MSSunpack}} function.
55
#' @details DN values are first converted to top-of-atmosphere (TOA) radiance using the equation found \href{http://landsat.usgs.gov/how_is_radiance_calculated.php}{here}.
66
#' Then TOA radiance is converted to TOA reflectance using the equation found \href{http://landsathandbook.gsfc.nasa.gov/data_prod/prog_sect11_3.html}{here}.

R/MSSunpack.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
#' This mitigates a problem caused by bad columns on the east and west edge of images when mosaicing adjacent images together.
1212
#' @return A 4-band Landsat MSS GeoTIFF raster image file in DN units. If optional 'toaRad' and/or 'toaRefl'
1313
#' parameters are set to TRUE, then similar TOA radiance and reflectance image files will created. The files will be places in
14-
#' directory in the same location as the 'imgFile' with the name equal to the image ID. The files contain the image ID with
15-
#' descriptors 'dn' (digital number), 'toa_radiance' (TOA radiance), and 'toa_reflectance' (TOA reflectance).
14+
#' the same location as the 'imgFile' with the name equal to the image ID plus an appended descriptor. Descriptors
15+
#' include 'dn' (digital number), 'toa_radiance' (TOA radiance), and 'toa_reflectance' (TOA reflectance).
1616
#' @seealso \code{\link{MSSdn2rad}}, \code{\link{MSSdn2refl}}
1717
#' @examples
1818
#' \dontrun{

R/eudist.r

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#' Earth-Sun distance by day-of-year
22
#'
3-
#' Retrieve the Earth-Sun distance by day-of-year
4-
#' @param doy integer. image day-of-year
3+
#' Retrieve the Earth-Sun distance by day-of-year. It is helper function used
4+
#' by the \code{\link{MSSdn2refl}} and \code{\link{MSScvm}} functions when calculating TOA reflectance.
5+
#' @param doy integer. image day-of-year.
56
#' @details The function returns the Earth-sun distance for a specific day-of-year as defined
67
#' \href{http://landsathandbook.gsfc.nasa.gov/data_prod/prog_sect11_3.html}{here}.
78
#' @examples dist = eudist(215)

R/getMetadata.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Retrieve Landsat image metadata
22
#'
33
#' Uses the image file name to find the corresponding *MTL.txt image metadata file provided with LPSG Landsat images
4-
#' and returns a dataframe with image information
4+
#' and returns a data.frame with image information.
55
#' @param imgFile filename (character). Full path to a Landast LPGS MSS file that includes the
66
#' original image ID as the first block of characters.
77
#' @return data.frame with image information.

R/mosaicDEMs.r

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#' Create a DEM mosaic from a direcory of DEM's
22
#'
3-
#' A helper function to create the large-extent DEM file required by the 'MSScvm' function.
3+
#' A helper function to create the large-extent DEM file required by the \code{\link{MSScvm}} function.
44
#' @param dir directory name (character). Full path to a directory containing digital elevation model (DEM) files to be mosaiced.
5-
#' @param projRef filename (character). Full path to an image file produced by the \code{\link{MSSunpack}} function.
6-
#' @param srcNodata numeric. What is the background value of the DEM files in the directory. If there is no background value, use NA (default)
7-
#' @param dstNodata numeric. Specify the value to represent background pixels in the mosaic DEM. -32768 is the default
5+
#' @param projRef filename (character). Full path to an image file produced by the \code{\link{MSSunpack}} function to be used as the projection reference.
6+
#' @param srcNodata numeric. Specify the background value of the DEM files in the directory. If there is no background value, use NA (default) .
7+
#' @param dstNodata numeric. Specify the value to represent background pixels in the mosaic DEM. -32768 is the default.
88
#' @details The provided directory path should only contain decompressed digital elevation files from the same source (SRTM, NED, GTOPO, etc).
99
#' The function will search the directory and include all files found in the mosaic. It is important that each file have the same background value
1010
#' and that it is correctly assigned to the 'srcNodata' parameter, if not, intersection between DEMs could have unexpected results.

R/reprojectDEM.r

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#' Reproject a DEM file
22
#'
33
#' Reproject a DEM file to match the projection and pixel resolution of an image file. A helper function to make a DEM
4-
#' conform to the properties of an image file prior to using it as an input to the 'MSScvm' masking function
4+
#' conform to the properties of an image file prior to using it as an input to the \code{\link{MSScvm}} masking function.
55
#' @param demFile filename (character). Full path to DEM file.
66
#' @param projRef filename (character). Full path to an image file produced by the \code{\link{MSSunpack}} function.
7-
#' @param srcNodata numeric. Specify the background value in the input DEM. If there is no background value, use NA (default)
8-
#' @param dstNodata numeric. Specify the value to represent background pixels in the reprojected DEM. -32768 is the default
7+
#' @param srcNodata numeric. Specify the background value in the input DEM. If there is no background value, use NA (default).
8+
#' @param dstNodata numeric. Specify the value to represent background pixels in the reprojected DEM. -32768 is the default.
99
#' @details The DEM file will be adjusted to match the projection and pixel resolution of the 'proRef' image.
10-
#' @return A GeoTIFF raster file with '_reprojected.tif' replacing the last 4 characters of the input DEM filename
10+
#' @return A GeoTIFF raster file with '_reprojected.tif' replacing the last 4 characters of the input DEM filename.
1111
#' @seealso \code{\link{mosaicDEMs}}
1212
#' @examples \dontrun{
1313
#'

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# MSScvm
22
[![Travis-CI Build Status](https://travis-ci.org/jdbcode/MSScvm.svg?branch=master)](https://travis-ci.org/jdbcode/MSScvm)
3+
4+
An automated cloud and cloud shadow masking system for Landsat MSS imagery. It provides a means of more easily incorporating MSS imagery in large-area and time series analysis by providing an efficient way to prevent cloud and cloud shadow pixels from contaminating mosaics, composites, and time series.
5+
6+
http://www.msscvm.jdbcode.com/

0 commit comments

Comments
 (0)