genInterval: Interval Data

View source: R/genInterval.R

genIntervalR Documentation

Interval Data

Description

Generate a data.frame providing data on an interval basis (i.e. processed Sonic-Anemometer data etc.).

Usage

genInterval(Data = NULL, Ustar = 0.25, L = -2000, Zo = 0.01, sUu = 2.5, sVu = 2, 
  sWu = 1.25, z_sWu = 2, WD = 0, d = 0, N0=5E4, MaxFetch=500, SensorNames = "", 
  SourceNames = "")

Arguments

Data

a data.frame. Columns that match argument names below will be taken as input to the correspondent argument. Columns that don't match will be appended as additional data.

Ustar

friction velocity in m/s.

L

Obukhov-Length in meters.

Zo

roughness length in meters.

sUu

scaled standard deviation of the wind speed component u (i.e. alongwind): sigmaU/ustar.

sVu

scaled standard deviation of the wind speed component v (i.e. crosswind): sigmaV/ustar.

sWu

scaled standard deviation of the vertical wind speed component w: sigmaW/ustar.

z_sWu

measurement height of the wind statistics sigmaW/ustar (sWu) in meters. Only relevant for unstable conditions (L<0), where sigmaW/ustar is assumed to vary with height. Usually, this is the Sonic-Anemometer measurement height above ground.

WD

average wind direction in degrees deviating from North. I.e. wind blowing from 0/360 = north, 90 = east, 180 = south, 270 = west.

d

displacement height in meters.

N0

integer. Number of trajectories in model runs.

MaxFetch

numeric. Maximum upwind fetch (alongwind tracking distance). Negative numbers will try to optimize this value (see details below).

SensorNames

Names of the Sensors to calculate TDs, separated by ‘,’.

SourceNames

Names of the Sources to include, separated by ‘,’.

Details

Providing arguments directly will overwrite corresponding input from argument Data (see examples below).

Providing a negative MaxFetch argument will calculate the maximum distance between the sensor and the source and add the absolute value of the provided MaxFetch argument to this distance (see example below).

Value

a data.frame of class Sonic.

Author(s)

Christoph Haeni

See Also

genInputList, genSensors, genSources, genModel, genTolerances, runbLS, bLSmodelR-package.

Examples

## Not run: 
## default:
print(x <- genInterval())
class(x)

## providing Data argument:
dat <- data.frame(Ustar=0.2,L=c(-30,-300),add1='test',ustar=0.1)
genInterval(dat)

## partially overwriting Data argument:
genInterval(dat,Ustar=0.3)

## optimizing MaxFetch
Sensor <- genSensors(PS=list(x=0,y=0,z=2))
Source <- genSources(
  Src = list('c',M=c(0,50),R=20)
  ,Src = list(x = c(25,35,35,25), y = c(20,20,50,50))
  )
Ints <- genInterval(WD=c(0,22.5,45,67.5),MaxFetch=-20)
InList <- genInputList(Ints,Source,Sensor)

IntExt <- prepareIntervals(InList,getwd())
IntExt[,MaxFetch]

## checking graphically:
plot(InList)
IntExt[,{
  x0 <- sin(WD/180*pi)
  y0 <- cos(WD/180*pi)
  x <- x0*(MaxFetch - 20)
  y <- y0*(MaxFetch - 20)
  for(i in 1:4){
    lines(c(0,x[i]),c(0,y[i]),lty=i)
    lines(x[i]+c(-100,100)*y0[i],y[i]-c(-100,100)*x0[i],lwd=2,col='lightgrey',lty=i)
  }}]


## End(Not run)



ChHaeni/bLSmodelR documentation built on Dec. 5, 2024, 8:47 a.m.