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.
Value
NULL invisibly. The function mainly serves to validate and will stop execution and log an error using seasonder_logAndAbort
if any condition fails.
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
.
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.