diff --git a/DESCRIPTION b/DESCRIPTION index e3c6f6d..3812edb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rGEDI Type: Package Title:NASA's Global Ecosystem Dynamics Investigation (GEDI) Data Visualization and Processing -Version: 0.0.7 +Version: 0.1.0 Authors@R: c( person("Carlos Alberto", "Silva", email = "carlos_engflorestal@outlook.com", role = c("aut", "cre", "cph")), person("Caio", "Hamamura", email = "caiohamamura@gmail.com", role = c("aut", "cph")), diff --git a/NAMESPACE b/NAMESPACE index f1cfbf4..4aef452 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -# Generated by roxygen2: do not edit by hand +# Generated by roxygen2: do not edit by hand export(clipLevel1B) export(clipLevel1BGeo) diff --git a/R/gedifinder.R b/R/gedifinder.R index c9cda60..e0a01c5 100644 --- a/R/gedifinder.R +++ b/R/gedifinder.R @@ -3,11 +3,11 @@ #'@description This function finds the path to GEDI data within a boundary box coordinates provided #' #'@param product GEDI data level; Options: "GEDI01_B", "GEDI02_A" or "GEDI02_B" -#'@param version Character. The version of the GEDI product files to be returned. #'@param ul_lat Numeric. Upper left (ul) corner coordinates, in lat (decimal degrees) for the bounding box of the area of interest. #'@param ul_lon Numeric. Upper left (ul) corner coordinates, in lon (decimal degrees) for the bounding box of the area of interest. #'@param lr_lat Numeric. Lower right (ul) corner coordinates, in lat (decimal degrees) for the bounding box of the area of interest. #'@param lr_lon Numeric. Lower right (ul) corner coordinates, in lon (decimal degrees) for the bounding box of the area of interest. +#'@param version Character. The version of the GEDI product files to be returned. Default "001". #' #'@return Return a vector object pointing out the path saving the downloaded GEDI data within #'the boundary box coordinates provided @@ -27,11 +27,11 @@ #'lr_lon<- -96.0 #' #'# Extracting the path to GEDI data for the specified boundary box coordinates -#'gedi02b_list<-gedifinder(product="GEDI02_B",version="001",ul_lat, ul_lon, lr_lat, lr_lon) +#'gedi02b_list<-gedifinder(product="GEDI02_B",ul_lat, ul_lon, lr_lat, lr_lon,version="001") #'} #'@import jsonlite curl #'@export -gedifinder<-function(product,version="001", ul_lat, ul_lon, lr_lat, lr_lon){ +gedifinder<-function(product, ul_lat, ul_lon, lr_lat, lr_lon,version="001"){ response = curl::curl(sprintf( "https://lpdaacsvc.cr.usgs.gov/services/gedifinder?%s=%s&%s=%s&%s=%f,%f,%f,%f&output=json", "version",version, diff --git a/README.md b/README.md index d14aa43..596c33c 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,9 @@ ul_lon<- -13.76913 lr_lon<- -13.67646 # Get path to GEDI data -gLevel1B<-gedifinder(product="GEDI01_B",version="001",ul_lat, ul_lon, lr_lat, lr_lon) -gLevel2A<-gedifinder(product="GEDI02_A",version="001",ul_lat, ul_lon, lr_lat, lr_lon) -gLevel2B<-gedifinder(product="GEDI02_B",version="001",ul_lat, ul_lon, lr_lat, lr_lon) +gLevel1B<-gedifinder(product="GEDI01_B",ul_lat, ul_lon, lr_lat, lr_lon,version="001") +gLevel2A<-gedifinder(product="GEDI02_A",ul_lat, ul_lon, lr_lat, lr_lon,version="001") +gLevel2B<-gedifinder(product="GEDI02_B",ul_lat, ul_lon, lr_lat, lr_lon,version="001") ``` ## Downloading GEDI data ```r diff --git a/man/clipLevel1B.Rd b/man/clipLevel1B.Rd index 7975460..c659f9e 100644 --- a/man/clipLevel1B.Rd +++ b/man/clipLevel1B.Rd @@ -21,7 +21,7 @@ An S4 object of class "gedi.level1b".} \item{output}{Optional character path where to save the new hdf5file. The default stores a temporary file only.} } \value{ -Returns a list of S4 objects of class "gedi.level1b". +Returns a list of S4 objects of class "gedi.level1b" containing clipped GEDI Level1B data. } \description{ This function clips GEDI Level1B data (geolocated waveforms) within a given bounding coordinates diff --git a/man/clipLevel1BGeometry.Rd b/man/clipLevel1BGeometry.Rd index 77fe390..4fb3113 100644 --- a/man/clipLevel1BGeometry.Rd +++ b/man/clipLevel1BGeometry.Rd @@ -4,7 +4,8 @@ \alias{clipLevel1BGeometry} \title{Clip GEDI Level1B data by geometry} \usage{ -clipLevel1BGeometry(level1b, polygon_spdf, output = "", split_by = NULL) +clipLevel1BGeometry(level1b, polygon_spdf, output = "", + split_by = NULL) } \arguments{ \item{level1b}{A GEDI Level1B object (output of \code{\link[rGEDI:readLevel1B]{readLevel1B}} function). @@ -18,7 +19,7 @@ which can be loaded as an ESRI shapefile using \code{\link[raster:shapefile]{ras \item{split_by}{Polygon id. If defined, GEDI data will be clipped by each polygon using the attribute specified by \code{split_by} from the attribute table.} } \value{ -Returns a list of S4 object of class "gedi.level1b". +Returns a list of S4 object of class "gedi.level1b" containing clipped GEDI Level1B data. } \description{ This function clips GEDI Level1B (geolocated waveforms) data within a given bounding geometry diff --git a/man/clipLevel2A.Rd b/man/clipLevel2A.Rd index 0bcabf9..da61395 100644 --- a/man/clipLevel2A.Rd +++ b/man/clipLevel2A.Rd @@ -21,7 +21,7 @@ An S4 object of class "gedi.level2a".} \item{output}{Optional character path where to save the new hdf5file. The default stores a temporary file only.} } \value{ -Returns a list of S4 objects of class "gedi.level2a". +Returns a list of S4 objects of class "gedi.level2a" containing clipped GEDI Level2A data. } \description{ This function clips GEDI Level2A data within a given bounding coordinates diff --git a/man/clipLevel2AGeometry.Rd b/man/clipLevel2AGeometry.Rd index dbb9b93..ea63bab 100644 --- a/man/clipLevel2AGeometry.Rd +++ b/man/clipLevel2AGeometry.Rd @@ -18,7 +18,7 @@ which can be loaded as an ESRI shapefile using \code{\link[raster:shapefile]{ras \item{split_by}{Polygon id. If defined, GEDI data will be clipped by each polygon using the attribute specified by \code{split_by} from the attribute table.} } \value{ -Returns a list of S4 object of class "gedi.level2a". +Returns a list of S4 object of class "gedi.level2a" containing clipped GEDI Level2A data. } \description{ This function clips GEDI Level2A data within a given geometry diff --git a/man/clipLevel2B.Rd b/man/clipLevel2B.Rd index d18cc6f..3590f63 100644 --- a/man/clipLevel2B.Rd +++ b/man/clipLevel2B.Rd @@ -21,7 +21,7 @@ An S4 object of class "gedi.level2b".} \item{output}{Optional character path where to save the new hdf5 file. The default stores a temporary file only.} } \value{ -Returns a list of S4 object of class "gedi.level2b". +Returns a list of S4 object of class "gedi.level2b" containing clipped GEDI Level2B data. } \description{ This function extracts GEDI Level1B data a within given bounding coordinates diff --git a/man/clipLevel2BGeometry.Rd b/man/clipLevel2BGeometry.Rd index 4b5f552..6602945 100644 --- a/man/clipLevel2BGeometry.Rd +++ b/man/clipLevel2BGeometry.Rd @@ -4,7 +4,8 @@ \alias{clipLevel2BGeometry} \title{Clip GEDI Level2B data by geometry} \usage{ -clipLevel2BGeometry(level2b, polygon_spdf, output = "", split_by = NULL) +clipLevel2BGeometry(level2b, polygon_spdf, output = "", + split_by = NULL) } \arguments{ \item{level2b}{A GEDI Level2B object (output of \code{\link[rGEDI:readLevel2B]{readLevel2B}} function). @@ -18,7 +19,7 @@ which can be loaded as an ESRI shapefile using \code{\link[raster:shapefile]{ras \item{split_by}{Polygon id. If defined, GEDI data will be clipped by each polygon using the attribute specified by \code{split_by} from the attribute table.} } \value{ -Returns a list of S4 objects of class "gedi.level2b". +Returns a list of S4 objects of class "gedi.level2b" containing clipped GEDI Level2B data. } \description{ This function extracts GEDI Level1B data within a given geometry diff --git a/man/close.Rd b/man/close.Rd index 826fbd9..40768b5 100644 --- a/man/close.Rd +++ b/man/close.Rd @@ -1,5 +1,6 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/class.gedi.R +\docType{methods} \name{close} \alias{close} \alias{close,gedi.level1b-method} diff --git a/man/gedi.fullwaveform-class.Rd b/man/gedi.fullwaveform-class.Rd index c33587d..813194d 100644 --- a/man/gedi.fullwaveform-class.Rd +++ b/man/gedi.fullwaveform-class.Rd @@ -1,17 +1,17 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/class.gedi.R -\docType{class} -\name{gedi.fullwaveform-class} -\alias{gedi.fullwaveform-class} -\alias{gedi.fullwaveform} -\title{Class for GEDI level1B Full Waveform} -\description{ -Class for GEDI level1B Full Waveform -} -\section{Slots}{ - -\describe{ -\item{\code{dt}}{Object of class data.table from \emph{data.table} package containing -the extracted GEDI full-waveform elevation and amplitude.} -}} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/class.gedi.R +\docType{class} +\name{gedi.fullwaveform-class} +\alias{gedi.fullwaveform-class} +\alias{gedi.fullwaveform} +\title{Class for GEDI level1B Full Waveform} +\description{ +Class for GEDI level1B Full Waveform +} +\section{Slots}{ + +\describe{ +\item{\code{dt}}{Object of class data.table from \emph{data.table} package containing +the extracted GEDI full-waveform elevation and amplitude.} +}} diff --git a/man/gediDownload.Rd b/man/gediDownload.Rd index f950bb9..0121583 100644 --- a/man/gediDownload.Rd +++ b/man/gediDownload.Rd @@ -4,7 +4,8 @@ \alias{gediDownload} \title{Download GEDI data} \usage{ -gediDownload(filepath, outdir = NULL, overwrite = FALSE, buffer_size = 512) +gediDownload(filepath, outdir = NULL, overwrite = FALSE, + buffer_size = 512) } \arguments{ \item{filepath}{Vector object; path to the GEDI data} diff --git a/man/gediWFMetrics.Rd b/man/gediWFMetrics.Rd index cf66022..a92b4fd 100644 --- a/man/gediWFMetrics.Rd +++ b/man/gediWFMetrics.Rd @@ -4,74 +4,24 @@ \alias{gediWFMetrics} \title{GEDI full waveform data processing} \usage{ -gediWFMetrics( - input, - outRoot, - writeFit = FALSE, - writeGauss = FALSE, - bounds = NULL, - ground = FALSE, - useInt = FALSE, - useFrac = FALSE, - rhRes = 5, - laiRes = 10, - laiH = 30, - noRHgauss = FALSE, - gTol = 0, - fhdHistRes = 0.001, - forcePsigma = FALSE, - bayesGround = FALSE, - dontTrustGround = FALSE, - noRoundCoord = FALSE, - noCanopy = FALSE, - dcBias = 0, - nSig = 0, - hNoise = 0, - linkNoise = NULL, - linkFsig = NULL, - linkPsig = NULL, - trueSig = NULL, - bitRate = NULL, - maxDN = NULL, - renoise = FALSE, - newPsig = -1, - oldPsig = 0.764331, - addDrift = NULL, - missGround = FALSE, - minGap = NULL, - photonCount = FALSE, - pcl = FALSE, - nPhotons = 2.1, - photonWind = 200, - noiseMult = 0.1, - rhoVrhoG = 1, - nPhotC = 2.1, - nPhotG = -1, - photHDF = FALSE, - meanN = 0, - thresh = 1e-14, - varNoise = FALSE, - varScale = NULL, - statsLen = NULL, - noiseTrack = FALSE, - sWidth = NULL, - psWidth = 0, - msWidth = NULL, - preMatchF = FALSE, - postMatchF = FALSE, - pFile = NULL, - gWidth = 1.2, - minGsig = 0.764331, - minWidth = 0, - medNoise = FALSE, - varDrift = NULL, - driftFac = NULL, - rhoG = 0.4, - rhoC = 0.57, - pSigma = NULL, - gold = FALSE, - deconTol = NULL -) +gediWFMetrics(input, outRoot, writeFit = FALSE, writeGauss = FALSE, + bounds = NULL, ground = FALSE, useInt = FALSE, useFrac = FALSE, + rhRes = 5, laiRes = 10, laiH = 30, noRHgauss = FALSE, gTol = 0, + fhdHistRes = 0.001, forcePsigma = FALSE, bayesGround = FALSE, + dontTrustGround = FALSE, noRoundCoord = FALSE, noCanopy = FALSE, + dcBias = 0, nSig = 0, hNoise = 0, linkNoise = NULL, + linkFsig = NULL, linkPsig = NULL, trueSig = NULL, bitRate = NULL, + maxDN = NULL, renoise = FALSE, newPsig = -1, oldPsig = 0.764331, + addDrift = NULL, missGround = FALSE, minGap = NULL, + photonCount = FALSE, pcl = FALSE, nPhotons = 2.1, + photonWind = 200, noiseMult = 0.1, rhoVrhoG = 1, nPhotC = 2.1, + nPhotG = -1, photHDF = FALSE, meanN = 0, thresh = 1e-14, + varNoise = FALSE, varScale = NULL, statsLen = NULL, + noiseTrack = FALSE, sWidth = NULL, psWidth = 0, msWidth = NULL, + preMatchF = FALSE, postMatchF = FALSE, pFile = NULL, + gWidth = 1.2, minGsig = 0.764331, minWidth = 0, medNoise = FALSE, + varDrift = NULL, driftFac = NULL, rhoG = 0.4, rhoC = 0.57, + pSigma = NULL, gold = FALSE, deconTol = NULL) } \arguments{ \item{input}{\code{\link[rGEDI:gedi.level1bSim-class]{gedi.level1bSim}} (may be a list of objects). Simulated waveform input object(s).} diff --git a/man/gediWFSimulator.Rd b/man/gediWFSimulator.Rd index 00314f3..ec5faa5 100644 --- a/man/gediWFSimulator.Rd +++ b/man/gediWFSimulator.Rd @@ -4,39 +4,16 @@ \alias{gediWFSimulator} \title{GEDI full waveform data simulation} \usage{ -gediWFSimulator( - input, - output, - waveID = NULL, - coords = NULL, - listCoord = NULL, - gridBound = NULL, - gridStep = 30, - pSigma = -1, - pFWHM = 15, - readPulse = NULL, - fSigma = 5.5, - wavefront = NULL, - res = 0.15, - topHat = FALSE, - sideLobe = FALSE, - lobeAng = 0, - checkCover = FALSE, - maxScanAng = 1e+06, - decimate = 1, - pBuff = as.integer(2e+08), - maxBins = as.integer(1024), - countOnly = FALSE, - pulseAfter = FALSE, - pulseBefore = TRUE, - noNorm = FALSE, - noOctree = FALSE, - octLevels = as.integer(0), - nOctPix = as.integer(40), - keepOld = FALSE, - useShadow = FALSE, - polyGround = FALSE -) +gediWFSimulator(input, output, waveID = NULL, coords = NULL, + listCoord = NULL, gridBound = NULL, gridStep = 30, pSigma = -1, + pFWHM = 15, readPulse = NULL, fSigma = 5.5, wavefront = NULL, + res = 0.15, topHat = FALSE, sideLobe = FALSE, lobeAng = 0, + checkCover = FALSE, maxScanAng = 1e+06, decimate = 1, + pBuff = as.integer(2e+08), maxBins = as.integer(1024), + countOnly = FALSE, pulseAfter = FALSE, pulseBefore = TRUE, + noNorm = FALSE, noOctree = FALSE, octLevels = as.integer(0), + nOctPix = as.integer(40), keepOld = FALSE, useShadow = FALSE, + polyGround = FALSE) } \arguments{ \item{input}{character vector. lasfile input filename} @@ -110,7 +87,8 @@ Using full waveform input data (not tested)} #'} } \value{ -Returns an S4 object of class \code{\link[hdf5r:H5File-class]{hdf5r::H5File}} in the \emph{hdf5r} package. +Returns an S4 object of class \code{\link[hdf5r:H5File-class]{hdf5r::H5File}} form the \emph{hdf5r} package +containing the simulated GEDI full-waveform. } \description{ Simulate GEDI full waveform data from Airborne Laser Scanning (ALS) 3D point cloud diff --git a/man/gedifinder.Rd b/man/gedifinder.Rd index 68c78c3..e0a3d93 100644 --- a/man/gedifinder.Rd +++ b/man/gedifinder.Rd @@ -4,10 +4,10 @@ \alias{gedifinder} \title{GEDI finder} \usage{ -gedifinder(level, ul_lat, ul_lon, lr_lat, lr_lon) +gedifinder(product, ul_lat, ul_lon, lr_lat, lr_lon, version = "001") } \arguments{ -\item{level}{GEDI data level; Options: "GEDI01_B", "GEDI02_A" or "GEDI02_B"} +\item{product}{GEDI data level; Options: "GEDI01_B", "GEDI02_A" or "GEDI02_B"} \item{ul_lat}{Numeric. Upper left (ul) corner coordinates, in lat (decimal degrees) for the bounding box of the area of interest.} @@ -16,6 +16,8 @@ gedifinder(level, ul_lat, ul_lon, lr_lat, lr_lon) \item{lr_lat}{Numeric. Lower right (ul) corner coordinates, in lat (decimal degrees) for the bounding box of the area of interest.} \item{lr_lon}{Numeric. Lower right (ul) corner coordinates, in lon (decimal degrees) for the bounding box of the area of interest.} + +\item{version}{Character. The version of the GEDI product files to be returned. Default "001".} } \value{ Return a vector object pointing out the path saving the downloaded GEDI data within @@ -23,8 +25,6 @@ the boundary box coordinates provided } \description{ This function finds the path to GEDI data within a boundary box coordinates provided - -#'@usage gedifinder(level="GEDI02_B",xmin,xmax,ymin,ymax) } \examples{ \donttest{ @@ -38,7 +38,7 @@ lr_lat<- 40.0 lr_lon<- -96.0 # Extracting the path to GEDI data for the specified boundary box coordinates -gedi02b_list<-gedifinder(level="GEDI02_B",ul_lat, ul_lon, lr_lat, lr_lon) +gedi02b_list<-gedifinder(product="GEDI02_B",ul_lat, ul_lon, lr_lat, lr_lon,version="001") } } \seealso{ diff --git a/man/plot.Rd b/man/plot.Rd index 783abdc..35791f4 100644 --- a/man/plot.Rd +++ b/man/plot.Rd @@ -1,5 +1,6 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/class.gedi.R +\docType{methods} \name{plot} \alias{plot} \alias{plot,gedi.fullwaveform,missing-method} @@ -8,9 +9,11 @@ \usage{ plot(x, y, ...) -\S4method{plot}{gedi.fullwaveform,missing}(x, relative = FALSE, polygon = FALSE, ...) +\S4method{plot}{gedi.fullwaveform,missing}(x, relative = FALSE, + polygon = FALSE, ...) -\S4method{plot}{gedi.level1bSim,missing}(x, relative = FALSE, polygon = FALSE, method = "RXWAVEINT", ...) +\S4method{plot}{gedi.level1bSim,missing}(x, relative = FALSE, + polygon = FALSE, method = "RXWAVEINT", ...) } \arguments{ \item{x}{An object of class "gedi.fullwaveform". (output of \code{\link[rGEDI:getLevel1BWF]{getLevel1BWF}} function)} diff --git a/man/readLevel1B.Rd b/man/readLevel1B.Rd index 19beeeb..71fd574 100644 --- a/man/readLevel1B.Rd +++ b/man/readLevel1B.Rd @@ -10,7 +10,7 @@ readLevel1B(level1Bpath) \item{level1Bpath}{File path pointing to GEDI level1B data. Data in HDF5 Hierarchical Data Format (.h5).} } \value{ -Returns an S4 object of class "gedi.level1b". +Returns an S4 object of class "gedi.level1b" containing GEDI level1B data. } \description{ This function reads GEDI level1B products: geolocated Waveforms diff --git a/man/readLevel2A.Rd b/man/readLevel2A.Rd index cc7c2c5..322397c 100644 --- a/man/readLevel2A.Rd +++ b/man/readLevel2A.Rd @@ -10,7 +10,7 @@ readLevel2A(level2Apath) \item{level2Apath}{File path pointing to GEDI level2A data. Data in HDF5 Hierarchical Data Format (.h5).} } \value{ -Returns an S4 object of class "gedi.level1a". +Returns an S4 object of class "gedi.level2a" containing GEDI level2A data. } \description{ This function reads GEDI level2A products: ground elevation, canopy top height, and relative heights (RH). diff --git a/man/readLevel2B.Rd b/man/readLevel2B.Rd index a74e716..7a988ba 100644 --- a/man/readLevel2B.Rd +++ b/man/readLevel2B.Rd @@ -10,7 +10,7 @@ readLevel2B(level2Bpath) \item{level2Bpath}{File path pointing to GEDI level2B data. Data in HDF5 Hierarchical Data Format (.h5).} } \value{ -Returns an S4 object of class "gedi.level1b". +Returns an S4 object of class "gedi.level2b" containing GEDI level2B data. } \description{ This function reads GEDI level2B products: canopy cover, Plant Area Index (PAI), Plant Area Volume Density (PAVD), and Foliage Height Diversity (FHD). diff --git a/vignettes/tutorial.Rmd b/vignettes/tutorial.Rmd index 95cc2a5..a0fb1d0 100644 --- a/vignettes/tutorial.Rmd +++ b/vignettes/tutorial.Rmd @@ -81,9 +81,9 @@ ul_lon<- -13.76913 lr_lon<- -13.67646 # Get path to GEDI data -gLevel1B<-gedifinder(product="GEDI01_B",version="001",ul_lat, ul_lon, lr_lat, lr_lon) -gLevel2A<-gedifinder(product="GEDI02_A",version="001",ul_lat, ul_lon, lr_lat, lr_lon) -gLevel2B<-gedifinder(product="GEDI02_B",version="001",ul_lat, ul_lon, lr_lat, lr_lon) +gLevel1B<-gedifinder(product="GEDI01_B",ul_lat, ul_lon, lr_lat, lr_lon,version="001") +gLevel2A<-gedifinder(product="GEDI02_A",ul_lat, ul_lon, lr_lat, lr_lon,version="001") +gLevel2B<-gedifinder(product="GEDI02_B",ul_lat, ul_lon, lr_lat, lr_lon,version="001") # Set output dir for downloading the files outdir=getwd()