Read Complex Spectral Sign Information from a Connection
Source:R/SeaSondeRCSSY.R
seasonder_CSSY_read_csign.Rd
This function reads a raw binary stream from a provided connection, expecting a specific format
that contains the sign bits for complex spectral values. The data is divided into 6 groups corresponding
to: C13r
, C13i
, C23r
, C23i
, C12r
, and C12i
.
Value
A named list of 6 vectors. Each vector represents one group (e.g., C13r
, C13i
, etc.)
and contains integers (0 or 1) corresponding to the bits (in little-endian order) extracted from the raw data.
Details
The function performs the following steps:
Reads
key$size
bytes from the specified connection.Checks if enough bytes were read.
Ensures that the total number of bytes is divisible by 6, allowing equal distribution among the groups.
Splits the raw byte vector into 6 groups based on the calculated number of bytes per group.
Converts each byte into its 8-bit representation (using
rawToBits
) and flattens the result.