average.secondary: average.secondary

Description Usage Arguments Details Value See Also Examples

View source: R/average.secondary.R

Description

Applies a function summarizing replicated ADCP data and calculates transect direction (from river right) and distance along transect.

Usage

1
2
average.secondary(data, transectNames, depthReference = "unit",
  project = TRUE, binWidth, binHeight, FUN = mean)

Arguments

data

Either a list of MATLAB files exported from RiverSurveyor to be compiled or an object of class "adcp.planform".

transectNames

A list of transect names corresponding to the transects represented by the MATLAB files. See 'details' for additional information.

depthReference

Defines the depth measurements to be used. The default ("unit") uses the method defined in RiverSurveyor, but depthReference can be set to use measurements from the vertical beam ("VB"), bottom-track beams ("BT"), or both ("composite").

project

Logical. If TRUE (default), transect replicates are projected to a mean transect line using an orthogonal projection of the x and y coordinates. If FALSE transects are not projected to a mean transect line.

binWidth

Width used to bin data along a transect, for summarization. Default is the 95 percentile of distances between samples.

binHeight

Depth interval used to bin data within an ensemble, for summarization. If missing, 95 percentile of cell depths is used group cells for summarization.

FUN

Function used to summarize ADCP data, default is mean

Details

When assigning transectNames, order matters, the transect names must be in the same order of the MATLAB files assigned to the data argument. Ex., if the first two files in the list are Transect1a and Transect1b, which are replicates of Transect1, t first two files in the name list are "Transect1" and "Transect1". The processing functions will spatially average and compile all data from the same transects, this tells the processing functions to average and compile these two files. Listing the names as "Transect1a" and "Transect1b" results in the transects being processed separately. transectNames will only expect characters and names must be enclosed in "".

Value

A data.table with the transect name (transectName), the distance from the right bank (tDist), cell depth, cell id, depth averaged velocity to the east (Mean.Vel.E), depth averaged velocity to the north (Mean.Vel.N), depth, east velocity within a cell (Vel.E), north velocity within a cell (Vel.N), vertical velocity within a cell (Vel.up), error velocity within a cell (Vel.error), blanking distance or depth where measurements first begin (StartDepth), cell height, cell number within an ensemble (cell one is closest to the surface; cellNumber), cell depth, UTM x coordinates (UTM_X), UTM y coordinates (UTM_Y), longitude, latitude, heading of transect (assumes transect starts at river right), cellWidth, speed within a cell (speed), flow heading within a cell (velHeading), and cell altitude. If project = TRUE, orthogonally projected longitude, latitude, and UTM coordinates (Longitude_Proj, Latitude_Proj, UTM_X_Proj, UTM_Y_Proj) are also returned.

See Also

xSec.secondary and transectHeading.

Examples

1
2
3
4
5
6
data(mNine)
#mNine is a list of MATLAB files
names(mNine)
#Drop the last letter (l or r) from the MATLAB file names
tNames <- substr(names(mNine), 0, nchar(names(mNine))-1)
average.secondary(mNine, tNames)

jasonfischer/rivSurveyR documentation built on May 18, 2019, 5:54 p.m.