seasonder_validateCSFileData {SeaSondeR} | R Documentation |
Validate SeaSondeR CS File Data
Description
This function performs multiple validation checks on a provided CS file in the SeaSondeR system. It checks the file for various conditions to determine if it meets the SeaSondeR standards.
Usage
seasonder_validateCSFileData(filepath, header)
Arguments
filepath |
A character string indicating the path to the CS file to validate. |
header |
A list containing header information of the CS file. |
Details
The function performs the following validation checks:
Verifies that the file size is greater than 10 bytes.
Validates the
nCsFileVersion
field in the header to ensure it's between 1 and 32.Depending on the
nCsFileVersion
, verifies the appropriate file size, and the extent of various version headers (nV1Extent
,nV2Extent
, etc.).Validates the
nRangeCells
andnDopplerCells
fields to ensure they are within permissible ranges.Depending on the
nCsKind
value, validates the file size against expected sizes based onnRangeCells
,nSpectraChannels
, andnDopplerCells
.
Value
NULL invisibly. The function mainly serves to validate and will stop execution and log an error using seasonder_logAndAbort
if any condition fails.
Condition Management
This function utilizes the rlang
package to manage conditions and provide detailed and structured condition messages:
Condition Classes:
-
seasonder_validate_cs_file_error
: An error class that indicates a validation requirement was not met.
Condition Cases:
Failure on any validation test.
References
Cross Spectra File Format Version 6. CODAR. 2016