seasonder_validateCSDataStructure {SeaSondeR}R Documentation

Validate the Data Structure of CrossSpectra Data

Description

This function checks the validity of the data structure for CrossSpectra (CS) data. It ensures that all required fields are present, the dimensions of the matrices are correct based on nRanges and nDoppler, and that the types of the data fields are as expected.

Usage

seasonder_validateCSDataStructure(data, nRanges, nDoppler)

Arguments

data

A list representing the CrossSpectra (CS) data. It should contain fields "SSA1", "SSA2", "SSA3", "CS12", "CS13", "CS23", and "QC".

nRanges

An integer specifying the expected number of range cells.

nDoppler

An integer specifying the expected number of Doppler cells.

Details

The function expects the following structure for the data list:

Value

Invisible NULL if the data structure is valid. Otherwise, an error is thrown.

Error Management

This function utilizes the rlang package to manage errors and provide detailed and structured error messages:

Condition Classes:

Condition Cases:

Examples

# Example with all required fields
data <- list(
  SSA1 = matrix(rep(NA_real_, 10 * 20), ncol = 20, byrow = TRUE),
  SSA2 = matrix(rep(NA_real_, 10 * 20), ncol = 20, byrow = TRUE),
  SSA3 = matrix(rep(NA_real_, 10 * 20), ncol = 20, byrow = TRUE),
  CS12 = matrix(complex(real = NA, imaginary = NA), nrow = 10, ncol = 20),
  CS13 = matrix(complex(real = NA, imaginary = NA), nrow = 10, ncol = 20),
  CS23 = matrix(complex(real = NA, imaginary = NA), nrow = 10, ncol = 20),
  QC   = matrix(rep(NA_real_, 10 * 20), ncol = 20, byrow = TRUE)
)
seasonder_validateCSDataStructure(data, 10, 20)


[Package SeaSondeR version 0.2.8 Index]