ad2cpHeaderValue: Infer an Item From a Nortek AD2CP File Header

View source: R/adp.nortek.ad2cp.R

ad2cpHeaderValueR Documentation

Infer an Item From a Nortek AD2CP File Header

Description

Infer an Item From a Nortek AD2CP File Header

Usage

ad2cpHeaderValue(x, key, item, numeric = TRUE, default)

Arguments

x

an adp object that holds AD2CP data.

key

Character value that identifies a particular line in the file header.

item

Character value indicating the name of the item sought.

numeric

Logical value indicating whether to convert the return value from a string to a numerical value.

default

Optional value to be used if the item is not found in the header, or if the header is NULL (as in the case of a split-up file that lacks the initial header information)

Value

String or number interpreted from the x[["text"]], or NULL, if the desired item is not found there, or if x is not of the required class and variety.

Sample of Usage

if (file.exists("a.ad2cp")) {
    d <- read.oce("a.ad2cp")
    # The examples start with the line in x[["text"]][[1]]; note that in the second
    # example, it would be insuficient to use a key of "BEAMCFGLIST", because that will
    # yield 4 lines, and the function is not designed to handle that.

    # ID,STR=\"Signature1000\",SN=123456
    type <- ad2cpHeaderValue(d, "ID", "STR", numeric=FALSE)
    serialNumber <- ad2cpHeaderValue(d, "ID", "SN")

    # BEAMCFGLIST,BEAM=1,THETA=25.00,PHI=0.00,FREQ=1000,BW=25,BRD=1,HWBEAM=1,ZNOM=60.00
    beam1Angle <- ad2cpHeaderValue(d, "BEAMCFGLIST,BEAM=1", "THETA")
    frequency <- ad2cpHeaderValue(d, "BEAMCFGLIST,BEAM=1", "FREQ", default=NA)
}

Author(s)

Dan Kelley

See Also

Other things related to adp data: [[,adp-method, [[<-,adp-method, ad2cpCodeToName(), adp, adp-class, adpAd2cpFileTrim(), adpConvertRawToNumeric(), adpEnsembleAverage(), adpFlagPastBoundary(), adpRdiFileTrim(), adp_rdi.000, applyMagneticDeclination,adp-method, as.adp(), beamName(), beamToXyz(), beamToXyzAdp(), beamToXyzAdpAD2CP(), beamToXyzAdv(), beamUnspreadAdp(), binmapAdp(), enuToOther(), enuToOtherAdp(), handleFlags,adp-method, is.ad2cp(), plot,adp-method, read.adp(), read.adp.ad2cp(), read.adp.nortek(), read.adp.rdi(), read.adp.sontek(), read.adp.sontek.serial(), read.aquadopp(), read.aquadoppHR(), read.aquadoppProfiler(), rotateAboutZ(), setFlags,adp-method, subset,adp-method, subtractBottomVelocity(), summary,adp-method, toEnu(), toEnuAdp(), velocityStatistics(), xyzToEnu(), xyzToEnuAdp(), xyzToEnuAdpAD2CP()

Other things related to ad2cp data: ad2cpCodeToName(), adpAd2cpFileTrim(), is.ad2cp(), read.adp.ad2cp()


dankelley/oce documentation built on March 18, 2024, 2:02 p.m.