seasonder_readSeaSondeCSFileBlock {SeaSondeR}R Documentation

Read and Apply Quality Control to a Block of Fields

Description

Reads a block of fields from a binary file based on provided specifications. Each field is read and then processed with a specified quality control function.

Usage

seasonder_readSeaSondeCSFileBlock(spec, connection, endian = "big")

Arguments

spec

A named list of specifications for fields to read. Each specification should be in the form: list(type = "data_type", qc_fun = "qc_function_name", qc_params = list(param1 = value1, ...)) Where:

  • type: is the data type to read, which will be passed to seasonder_readCSField.

  • qc_fun: is the name of a quality control function. This function should be present in the shared environment seasonder_the and must accept field_value as its first argument, followed by any other arguments specified in qc_params.

  • qc_params: is a list of additional parameters to pass to the quality control function.

connection

A connection to the binary file.

endian

A character string indicating the byte order. Options are "big" and "little" (default is "big").

Details

The quality control (QC) functions (qc_fun) specified within spec play a pivotal role in ensuring the reliability of the data that's read. Here's the expected behavior of these QC functions:

Value

A named list where each entry corresponds to a field that has been read. Each key is the field name, and its associated value is the data for that field after quality control.

See Also

read_and_qc_field

Examples

spec <- list(field1 = list(type = "UInt8", qc_fun = "qc_check_unsigned", qc_params = list()))
con <- rawConnection(as.raw(c(0x01)))
block <- seasonder_readSeaSondeCSFileBlock(spec, con, endian = "big")
print(block)
close(con)

[Package SeaSondeR version 0.2.8 Index]