VisualizeSpatial: Visualize WRF Hydro domain spatial data.

Description Usage Arguments Details Value See Also Examples

View source: R/visualize_spatial.R

Description

VisualizeSpatial creates basic plots of spatial data covering WRF-Hydro domain.

Usage

1
2
VisualizeSpatial(input, varName = "Variable", plot = TRUE,
  plotDf = NULL)

Arguments

input

A 2D array of data matching domain file.

varName

Character string specifying name of variable being plotted. Optional.

plot

Logical: plot or not?

plotDf

An optional data frame with the data from file already reprojected.

Details

Crude plots of the WRF Hydro spatial data. The routine accepts a grid of spatial data for either the geo (coarse resolution) or hydro (fine resolution) files. The return is a function (a closure which encapuslates the domain data) which creates a plot when called. The arguments to the function can be changed to tailor the plot (arguments are passed to ggmap and ggplot inside the function). This function (the closure) returns a ggplot object whose data can be accessed.

Value

A function which can be called to plot the data and allow adjustment of its arguments, the plotting parameters.

See Also

Other domain: GetDomainCoordsProj, VisualizeChanNtwk, VisualizeDomain

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
geoFile <- '/home/karsten/geo_em.d02.nc'
coordsProj <- GetDomainCoordsProj(geoFile)
ClosureGeo <- VisualizeSpatial(data[,,],varName='Temperature',plot=FALSE,plotDf=coordsProj)
closureMap <- 
  ClosureGeo(zoom=11,pointsize=9,
             gradNColors=rainbow(25),alpha=.6,maptype='terrain',
             subsetRange=range(plotDf$value),
             xlim=range(plotDf$long)+mapMargin*1.5,
             ylim=range(plotDf$lat)+mapMargin)

## End(Not run)

mccreigh/rwrfhydro documentation built on Feb. 28, 2021, 1:53 p.m.