Validate the Header of CrossSpectra Data
Source:R/SeaSondeRCS.R
seasonder_validateCSHeaderStructure.Rd
This function validates the structure of a header list that is expected to represent the metadata for a cross spectra file. It checks if the header is indeed a list and whether mandatory elements, such as the number of range cells and the number of Doppler cells, are present.
Details
The function primarily checks for two conditions:
Whether the provided header argument is a list.
Whether the nRangeCells and nDopplerCells are present in the header.
Condition Management
This function utilizes the rlang
package to manage conditions and provide
detailed and structured condition messages:
Condition Classes:
seasonder_CS_header_is_not_a_list
: Triggered when the header parameter is not a list.seasonder_CS_missing_nRange_nDoppler_error
: Triggered when either nRangeCells or nDopplerCells is missing from the header.
Examples
header <- list(nRangeCells = 100, nDopplerCells = 256)
seasonder_validateCSHeaderStructure(header)