read_and_qc_field {SeaSondeR}R Documentation

Read and Quality Control a Single Field

Description

This auxiliary function reads a field from a binary file using a provided specification and applies a quality control function on the retrieved data. The expectations and functioning of the quality control functions are described in detail in the documentation for seasonder_readSeaSondeCSFileBlock.

Usage

read_and_qc_field(field_spec, connection, endian = "big")

Arguments

field_spec

A list containing the specifications for the field to read. It should contain:

  • type: the type of data to read, passed to seasonder_readCSField.

  • qc_fun: the name of a quality control function. As detailed in seasonder_readSeaSondeCSFileBlock, 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: a list of additional parameters to pass to the quality control function. See seasonder_readSeaSondeCSFileBlock for detailed expectations of the QC function behavior.

connection

A connection to the binary file.

endian

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

Value

The value of the field after applying quality control.

Condition Management

This function utilizes the rlang package to manage conditions and provide detailed and structured condition messages:

Condition Classes:

Condition Cases:

Restart Options: The function provides structured mechanisms to recover from errors/conditions during its execution using withRestarts. The following restart options are available:

See Also

seasonder_rerun_qc_with_fun, seasonder_readCSField

It's also important to note that within read_and_qc_field, the function seasonder_readCSField is used. This function has its own error management and restart options, which are detailed in its documentation.


[Package SeaSondeR version 0.2.8 Index]