https://github.com/carlos-alberto-silva/rlvis

rLVIS: An R Package for Reading, Processing and Visualizing Land, Vegetation, and Ice Sensor (LVIS) Level1b and Level2 data

https://github.com/carlos-alberto-silva/rlvis

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: ieee.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.2%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

rLVIS: An R Package for Reading, Processing and Visualizing Land, Vegetation, and Ice Sensor (LVIS) Level1b and Level2 data

Basic Info
  • Host: GitHub
  • Owner: carlos-alberto-silva
  • Language: C++
  • Default Branch: master
  • Homepage:
  • Size: 89.4 MB
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 7 years ago · Last pushed over 5 years ago
Metadata Files
Readme

README.md


Github Github Rdoc licence R_Forge Downloads

rLVIS: An R Package for NASA's Land, Vegetation, and Ice Sensor (LVIS) data processing and visualization.

Authors: Carlos Alberto Silva, Caio Hamamura and Carine Klauberg

The rLVIS package provides functions for i) importing, ii) visualizing, iii) clipping, iv) gridding LVIS data.

Getting Started

Installation

```r

The development version:

library(devtools) devtools::install_github("carlos-alberto-silva/rLVIS")

The CRAN version:

install.packages("rLVIS") r

Import labraries

library(rLIVS) library(raster) library(rgdal) library(rasterVis) library(rgl) ```

Import LVIS data

```r

LVIS level1b file path

level1bfilepathzip <- system.file("extdata", "LVISMondahlevel1b.zip", package="rLVIS") unzip(level1bfilepathzip, exdir = tempdir()) level1bfilepath <- file.path(tempdir(), "LVISMondah_level1b.h5")

Reading LVIS level1b

level1b<-readLevel1b(level1bpath=level1b_filepath) level1b

' LVIS level 2 file path

level2filepathzip <- system.file("extdata", "LVISMondahlevel2.zip", package="rLVIS") unzip(level2filepathzip, exdir = tempdir()) level2filepath <- file.path(tempdir(), "LVISMondah_level2.txt")

' Reading LVIS level 2 file

level2spdf<-readLevel2(level2path=level2filepath,spdf=TRUE,glatlon=TRUE)

' Reading Polygons

polygonsfilepath <- system.file("extdata", "LVISMondahpolygons.shp", package="rLVIS") plots<-readOGR(polygonsfilepath) proj4string(plots) <- CRS("+proj=longlat +datum=WGS84") ```

' Plot LVIS Level2 data

```r par(mfrow=c(1,2)) plotLevel2(level2spdf=level2spdf, color = "RH100", colorPalette = c("blue","green","yellow","red"),axes=TRUE, xlab="Lat", ylab="Lon") plot(plots[3,], add=TRUE, border="black", lwd=2)

plotLevel2(level2spdf=level2spdf, color = "RH100", colorPalette = c("blue","green","yellow","red"), axes=TRUE, xlim=extent(plots[3,])[1:2],ylim=extent(plots[3,])[3:4],xlab="Lat", ylab="Lon") ```

'Clipping LVIS Level2 data

```r level2spdfsub<-clipLevel2(level2spdf=level2spdf,polygon_spdf=plots)

' Plot clipped LVIS Level2 data

par(mfrow=c(1,2)) plotLevel2(level2spdf=level2spdf, color = "RH100", colorPalette = c("blue","green","yellow","red"),axes=TRUE, xlab="Lat", ylab="Lon") plot(plots, border="black", lwd=2, axes=T) plotLevel2(level2spdf=level2spdf_sub, color = "RH100", colorPalette = c("blue","green","yellow","red"), add=T) grid() ```

'Plotting LVIS waveforms

r plotWaveform(level1b=level1b,level2=level2_spdf, shotnum=10964985,plot2=TRUE,xlab="Relative amplitude (%)", ylab="Height (m)")

' Canopy and ground metrics within field plots

```r

' Define your own function

mySetOfMetrics = function(x) { metrics = list( min =min(x), # Min of z max = max(x), # Max of z mean = mean(x), # Mean of z sd = sd(x)# Sd of z ) return(metrics) }

'Computing single LVIS metrics

RH100mean<-L2Stats(level2spdf=level2spdf,func=~mean(RH100), id=NULL) head(RH100mean)
## mean ## 34.5598 r

'Computing LVIS metrics by id

RH100metrics<-L2Stats(level2spdf=level2spdfsub,func=~mySetOfMetrics(RH100), id=level2spdf_sub@data$CLIPID) head(RH100metrics)

##   id  min   max   mean        sd
##   1 2.06 65.40 32.48820  9.996999
##   3 2.47 57.26 37.95028 12.054305
##   2 6.92 59.78 37.23889  5.176369

```

'Gridding canopy and ground metrics as raster layers

```r

' Computing serie of LVIS metrics

mlvis<-GridMetrics(level2spdf=level2spdf,func=~mySetOfMetrics(RH100), res=0.0005) plot(mlvis) ```

```r

' Computing single LVIS metrics

maxRH100<-GridMetrics(level2spdf=level2spdf,func=~max(RH100), res=0.0005) plot(maxRH100, xlab="UTM Easting", ylab="UTM Nothing") ```

r plot3D(maxRH100, col="forestgreen")

```r

' Computing single LVIS metrics

ZGmean<-GridMetrics(level2spdf=level2spdf,func=~mean(ZG), res=0.0005) plot(ZGmean, xlab="UTM Easting", ylab="UTM Nothing") ```

r plot3D(ZGmean, col="gray", add=T) aspect3d(1,1,0.1)

' Scatterplot of a 1:1 comparison

```r

Importing libraries

library(raster) library(rasterVis) library(viridis) library(gridExtra)

Importing dataset

sfagb1hapath <- system.file("extdata", "sfagb1ha.tif", package="rLVIS") lfagb1hapath <- system.file("extdata", "lfagb1ha.tif", package="rLVIS")

sfagb<-raster(sfagb1hapath) lfagb<-raster(lfagb1hapath)

Ploting AGB maps

s <- stack(sfagb,lfagb) agb.maps<-levelplot(s, layout=c(1, 2), margin=FALSE, colorkey=list( space='right', labels=list(at=seq(0, 500, 50), font=4), axis.line=list(col='black'), width=1), par.settings=list( strip.border=list(col='transparent'), strip.background=list(col='transparent'), axis.line=list(col='transparent') ), scales=list(draw=TRUE), col.regions=viridis, at=seq(0, 500, len=101), names.attr=c("SFAGB","LFAGB"))

Ploting Stats

colours<-viridis(10) basesize=15 legend.position= c(0.85, 0.3) stat.size=5 stats.position=c(100,400,50) basesize=basesize xlim=c(0,500) legend.size=c(8,15,10,2) ylim=c(0,500) ylab="LF-derived AGB (Mg/ha)" xlab="SF-derived AGB (Mg/ha)" fit.line.col=c("black","gray") title="SF vs LF lidar" xaxis=TRUE y_axis=TRUE

x11() agb.comp<-plotStats(y=getValues(r1), x=getValues(r2), colours=colours, legend.position= legend.position, stat.size=stat.size, stats.position=stats.position, basesize=basesize, xlim=xlim, legend.size=legend.size, ylim=ylim, ylab=ylab, xlab=xlab, fit.line.col=fit.line.col, title=title, xaxis=xaxis, yaxis=yaxis)

Combining plots

grid.arrange(agb.maps,agb.comp$plotg, nrow = 1) ```

References

Silva, C. A.; Saatchi, S.; Alonso, M. G. ; Labriere, N. ; Klauberg, C. ; Ferraz, A. ; Meyer, V. ; Jeffery, K. J. ; Abernethy, K. ; White, L. ; Zhao, K. ; Lewis, S. L. ; Hudak, A. T. (2018) Comparison of Small- and Large-Footprint Lidar Characterization of Tropical Forest Aboveground Structure and Biomass: A Case Study from Central Gabon. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, p. 1-15. https://ieeexplore.ieee.org/document/8331845

LVIS webpage. Accessed on February 15 2018 https://lvis.gsfc.nasa.gov/Home/index.html

Acknowledgements

The NASA's Goddard Space Flight Center for developing LVIS.

Reporting Issues

Please report any issue reagardling the rLVIS package to Carlos Silva (carlos_engflorestal@outlook.com).

Citing rGEDI

Silva,C.A; Hamamura,C.;Klauberg, C. rLVIS: NASA's Land, Vegetation, and Ice Sensor (LVIS) Data Visualization and Processing. version 0.0.1, accessed on Oct. 1 2019, available at: <>

Disclaimer

rLVIS package has not been developted by the LVIS team. It comes with no guarantee, expressed or implied, and the authors hold no responsibility for its use or reliability of its outputs.

Owner

  • Name: Carlos Alberto Silva
  • Login: carlos-alberto-silva
  • Kind: user
  • Company: University of Florida

GitHub Events

Total
Last Year

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • MASS * imports
  • Rcpp * imports
  • data.table * imports
  • ggplot2 * imports
  • gridExtra * imports
  • h5 * imports
  • lazyeval * imports
  • methods * imports
  • raster * imports
  • rasterVis * imports
  • rgdal * imports
  • rgeos * imports
  • rgl * imports
  • sp * imports
  • viridis * imports