Skip to contents

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.

Usage

seasonder_validateCSHeaderStructure(header)

Arguments

header

A list representing the header metadata of a cross spectra file.

Value

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

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)