Package waver. January 29, 2018

Similar documents
Package gfcanalysis. August 29, 2016

Package postgistools

Package fastdummies. January 8, 2018

Package ECctmc. May 1, 2018

Package velox. R topics documented: December 1, 2017

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package datasets.load

Package spark. July 21, 2017

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package rbgm. May 18, 2018

Package mdftracks. February 6, 2017

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package messaging. May 27, 2018

Package crochet. January 8, 2018

Package rmapzen. October 7, 2018

Package jdx. R topics documented: January 9, Type Package Title 'Java' Data Exchange for 'R' and 'rjava'

Package redlistr. May 11, 2018

Package nngeo. September 29, 2018

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package jpmesh. December 4, 2017

Package tiler. June 9, 2018

Package bisect. April 16, 2018

Package gtrendsr. October 19, 2017

Package osrm. November 13, 2017

Package clipr. June 23, 2018

Package deductive. June 2, 2017

Package repec. August 31, 2018

Package canvasxpress

Package TrajDataMining

Package geogrid. August 19, 2018

Package gtrendsr. August 4, 2018

Package strat. November 23, 2016

Package rnaturalearth

Package ClusterBootstrap

Package raker. October 10, 2017

Package opencage. January 16, 2018

Package widyr. August 14, 2017

Package angstroms. May 1, 2017

Package Grid2Polygons

Package validara. October 19, 2017

Package dbx. July 5, 2018

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package rnrfa. April 13, 2018

Package kirby21.base

Package docxtools. July 6, 2018

Package splithalf. March 17, 2018

Package readxl. April 18, 2017

Package qualmap. R topics documented: September 12, Type Package

Package areal. December 31, 2018

Package ompr. November 18, 2017

Package grec. R topics documented: August 13, Type Package

Package geoops. March 19, 2018

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package gwfa. November 17, 2016

Package projector. February 27, 2018

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package tidyimpute. March 5, 2018

Package vinereg. August 10, 2018

Package sankey. R topics documented: October 22, 2017

Package readobj. November 2, 2017

Package SEMrushR. November 3, 2018

Package crossword.r. January 19, 2018

Package editdata. October 7, 2017

Package weco. May 4, 2018

Package marinespeed. February 17, 2017

Package io. January 15, 2018

Package balance. October 12, 2018

Package manet. September 19, 2017

Package regexselect. R topics documented: September 22, Version Date Title Regular Expressions in 'shiny' Select Lists

Package psda. September 5, 2017

Package stapler. November 27, 2017

Package rucrdtw. October 13, 2017

Package gridgraphics

Package jstree. October 24, 2017

Package quadprogxt. February 4, 2018

Package sfc. August 29, 2016

Package glcm. August 29, 2016

Package NUCOMBog. R topics documented:

Package robotstxt. November 12, 2017

Package ecoseries. R topics documented: September 27, 2017

Package sessioninfo. June 21, 2017

Package cancensus. February 4, 2018

Package calpassapi. August 25, 2018

Package slickr. March 6, 2018

Package available. November 17, 2017

Package barcoder. October 26, 2018

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package dotcall64. January 11, 2018

Package crossrun. October 8, 2018

Package smapr. October 20, 2017

Package lumberjack. R topics documented: July 20, 2018

Package cleangeo. July 4, 2017

Package diffusr. May 17, 2018

Package zoomgrid. January 3, 2019

Package rollply. R topics documented: August 29, Title Moving-Window Add-on for 'plyr' Version 0.5.0

Package sfdct. August 29, 2017

Package virustotal. May 1, 2017

Package geojson. November 8, 2017

Package SNPediaR. April 9, 2019

Package librarian. R topics documented:

Transcription:

Type Package Title Calculate Fetch and Wave Energy Version 0.2.1 Package waver January 29, 2018 Description Functions for calculating the fetch (length of open water distance along given directions) and estimating wave energy from wind and wave monitoring data. License GPL-3 URL https://github.com/pmarchand1/waver BugReports https://github.com/pmarchand1/waver/issues Depends R (>= 3.2.2), rgdal (>= 0.8), sp (>= 1.1) Imports geosphere (>= 1.5), methods, rgeos (>= 0.3) LazyData TRUE Suggests testthat RoxygenNote 6.0.1 NeedsCompilation no Author Philippe Marchand [aut, cre], David Gill [aut] Maintainer Philippe Marchand <marchand.philippe@gmail.com> Repository CRAN Date/Publication 2018-01-29 19:59:44 UTC R topics documented: fetch_len.......................................... 2 fetch_len_multi....................................... 3 wave_energy........................................ 4 Index 6 1

2 fetch_len fetch_len Calculate the fetch length around a point Description Given a point, a shoreline layer and a vector of wind directions (bearings), fetch_len calculates the distance from point to shore for each bearing. Usage fetch_len(p, bearings, shoreline, dmax, spread = 0, projected = FALSE, check_inputs = TRUE) Arguments p bearings shoreline dmax spread projected check_inputs SpatialPoints* object of length 1 (single point). Vector of bearings, in degrees. SpatialLines* or SpatialPolygons* object representing the shoreline. Maximum value of fetch length, returned if there is no land within a distance of dmax from a given bearing. Vector of relative bearings (in degrees) for which to calculate fetch around each main bearing (see details). Should projected coordinates be used to calculate fetch? Should the validity of inputs be checked? It is recommended to keep this TRUE, unless this function is called repeatedly from another function that already checks inputs. Details The fetch length (or fetch) is the distance of open water over which the wind can blow in a specific direction. Note that bearings represent the direction from where the wind originates. The optional spread argument defines relative directions that are added to each main bearing to produce a set of sub-bearings. The fetch lengths calculated for each sub-bearing are averaged with weights proportional to cos(spread). By default, spread = 0 and fetch length is calculated for the main bearings only. If projected is FALSE (the default), the input data must be in WGS84 geographic (longitude, latitude) coordinates. Geodesic distances are calculated using the distgeo function from the geosphere R package. All distance are expressed in meters. If projected is TRUE, the input data (p and shoreline) must share the same projection. Projected distances are calculated with the rgeos R package. All distances are expressed in the projection s coordinates. If the shoreline layer is given as SpatialPolygons*, the function verifies that the input point is outside all polygons (i.e. in water). If this is not the case, it issues a warning and returns a vector of NA.

fetch_len_multi 3 Value A named vector representing the fetch length for each direction given in bearings. See Also fetch_len_multi for an efficient alternative when computing fetch length for multiple points. Examples pt <- SpatialPoints(matrix(c(0, 0), ncol = 2), proj4string = CRS("+proj=longlat")) # Shoreline is a rectangle from (-0.2, 0.25) to (0.3, 0.5) rect <- Polygon(cbind(c(rep(-0.2, 2), rep(0.3, 2), -0.2), c(0.25, rep(0.3, 2), rep(0.25, 2)))) land <- SpatialPolygons(list(Polygons(list(rect), ID = 1)), proj4string = CRS("+proj=longlat")) fetch_len(pt, bearings = c(0, 45, 225, 315), land, dmax = 50000, spread = c(-10, 0, 10)) fetch_len_multi Calculate the fetch length for multiple points Description fetch_len_multi provides two methods to efficiently compute fetch length for multiple points. Usage fetch_len_multi(pts, bearings, shoreline, dmax, spread = 0, method = "btree", projected = FALSE) Arguments pts bearings shoreline dmax spread method projected A SpatialPoints* object. Vector of bearings, in degrees. SpatialLines* or SpatialPolygons* object representing the shoreline. Maximum value of fetch length, returned if there is no land within a distance of dmax from a given bearing. Vector of relative bearings (in degrees) for which to calculate fetch around each main bearing. Whether to use the "btree" (default) or "clip" method. See below for more details. Should projected coordinates be used to calculate fetch?

4 wave_energy Details With method = "btree", the gbinarystrtreequery function from the rgeos package is called to determine which polygons in shoreline could be within dmax of each point. This is a fast calculation based on bounding box overlap. With method = "clip", the shoreline layer is clipped to a polygon formed by the union of rectangular buffers around each point. In both cases, fetch_len is then applied to each point, using only the necessary portion of the shoreline. Generally, the "clip" method will produce the biggest time savings when points are clustered within distances less than dmax (so their clipping rectangles overlap), whereas the "btree" method will be more efficient when the shoreline is composed of multiple polygons and points are distant from each other. Value A matrix of fetch lengths, with one row by point in pts and one column by bearing in bearings. See Also fetch_len for details on the fetch length computation. wave_energy Calculate the wave energy flux Description Calculates the wave energy flux (power per meter of wave crest) given either (1) the significant wave height and peak period or (2) the wind speed at 10m, fetch length and (optionally) water depth. Usage wave_energy(height = NA, period = NA, wind = NA, fetch = NA, depth = NA) Arguments height period wind fetch depth Significant wave height, in meters. Peak wave period, in seconds. Wind speed at 10m, in m/s. Fetch length, in meters. Water depth, in meters.

wave_energy 5 Details Value Given the significant height (H) and peak period (T), the wave energy flux is calculated as: ρg 2 64π H2 T, where ρ is the density of water (998 kg/m^3) and g is the acceleration of gravity (9.81 m/s^2). If both height and period are missing, they are estimated from on the wind speed at 10m (U 10 ) and the fetch length (F) as described in Resio et al. (2003): (friction velocity) U f 2 = 0.001(1.1 + 0.035U 10 )U 10 2 gh 2 U = min(0.0413 gf 2 f U, 211.5) f gt U f = min(0.651( gf U f 2 )1/3, 239.8) If the depth (d) is specified, it imposes a limit on the peak period: d T max = 9.78 g (in seconds) Wave energy flux, in kw/m. References Resio, D.T., Bratos, S.M., and Thompson, E.F. (2003). Meteorology and Wave Climate, Chapter II-2. Coastal Engineering Manual. US Army Corps of Engineers, Washington DC, 72pp. Examples # With height and period arguments wave_energy(8, 1) # With wind, fetch and depth arguments (must be named) wave_energy(wind = 12, fetch = 15000, depth = 10)

Index distgeo, 2 fetch_len, 2, 4 fetch_len_multi, 3, 3 gbinarystrtreequery, 4 wave_energy, 4 6