Read a Body Range Cell and Apply Scaling if Required
Source:R/SeaSondeRCSSY.R
seasonder_readCSSYBodyRangeCell.Rd
This function processes a block of keys from a binary connection according to a provided specification
('specs'). Each key is interpreted by reading it with seasonder_readSeaSondeCSFileBlock
and processing
it based on its key name. The key processing follows these rules:
Usage
seasonder_readCSSYBodyRangeCell(
connection,
specs,
dbRef,
endian = "big",
specs_key_size = NULL
)
Arguments
- connection
A binary connection from which keys and data are read.
- specs
A list defining the expected keys and their formats.
- dbRef
A numeric value providing the dB reference used in scaling.
- endian
A string specifying the byte order ("big" or "little"). Defaults to "big".
- specs_key_size
Optional specification for the key size block.
Details
Scaling Block ('scal'): Reads scaling parameters (fmax, fmin, fscale, dbRef) using
seasonder_readCSSYFields
and stores them for later use.Reduced Data Blocks (e.g., 'cs1a', 'cs2a', 'cs3a', 'c13r', 'c13i', etc.): Reads the block using
seasonder_read_reduced_encoded_data
. If scaling parameters were set by a preceding 'scal' block, the raw data is converted to voltage values usingseasonder_SeaSondeRCSSYApplyScaling
; otherwise, the raw data is returned.Other Keys (e.g., 'csgn' and 'asgn'): These keys invoke their specialized read functions for processing.
The function continues reading keys until it detects the 'END ' marker or a repeated 'indx' key, which signals the end of the block.