Skip to contents

This function reads a raw binary stream from a provided connection, expecting a specific format that contains the sign bits for self spectra values. The data is divided into 3 groups corresponding to: cs1a, cs2a, and cs3a.

Usage

seasonder_CSSW_read_asign(connection, key)

Arguments

connection

A binary connection to read raw bytes from.

key

A list containing:

size

An integer specifying the total number of bytes to be read. It must equal 3 times the number of bytes per group.

key

A string identifier (expected to be "asign").

Value

A named list of 3 vectors, each containing bits as integers (0 or 1) for self spectra sign data.

Details

The function performs the following steps:

  • Reads key$size bytes from the specified connection.

  • Verifies that the number of bytes read matches the expected size.

  • Checks that the total number of bytes is divisible by 3, allowing equal distribution among the groups.

  • Splits the raw byte vector into 3 groups based on the calculated number of bytes per group.

  • Converts each byte into its 8-bit binary representation (using rawToBits) and flattens the results for each group.