ad2cpHeaderValue: Decode an item from a Nortek AD2CP file header

View source: R/adp.nortek.R

ad2cpHeaderValueR Documentation

Decode an item from a Nortek AD2CP file header


Decode an item from a Nortek AD2CP file header


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



an adp object that holds AD2CP data.


Character value that identifies a particular line in x[["text"]].


Character value indicating the name of the item sought.


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


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)


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.

See Also

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


## Not run: 
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")

beam1Angle <- ad2cpHeaderValue(d, "BEAMCFGLIST,BEAM=1", "THETA")
frequency <- ad2cpHeaderValue(d, "BEAMCFGLIST,BEAM=1", "FREQ", default=NA)

## End(Not run)

oce documentation built on June 12, 2022, 1:05 a.m.