Skip to contents

This function returns a list of power spectra extracted from a SeaSondeRCS object for each combination of the specified antennae, range intervals, and Doppler intervals. It allows users to focus on subregions of the self-spectra data. Additionally, the resulting nested list can be collapsed into a single-level list.

Usage

seasonder_getSeaSondeRCS_SelfSpectra(
  seasonder_cs_object,
  antennae,
  dist_ranges = NULL,
  doppler_ranges = NULL,
  dist_in_km = FALSE,
  collapse = FALSE,
  smoothed = FALSE
)

Arguments

seasonder_cs_object

A SeaSondeRCS object containing spectral data.

antennae

A vector specifying the antenna(s) from which to extract self-spectra. If not named, the antennae will be automatically named as "A1", "A2", etc.

dist_ranges

Optional. A list (or vector) of range cell indices or ranges of interest. If not provided, it defaults to using the full range available.

doppler_ranges

Optional. A list (or vector) of Doppler bin indices or ranges of interest. If not provided, defaults to the complete Doppler range.

dist_in_km

Logical; if TRUE, the distance ranges provided in kilometers are converted into range cell numbers.

collapse

Logical; if TRUE, the nested list structure of the output is flattened into a single list.

smoothed

Logical; if TRUE, smoothed self-spectra data is used (via seasonder_SmoothSS); otherwise, raw self-spectra data is used.

Value

A (potentially nested) list of self-spectra power matrices corresponding to each combination of antenna, range interval, and Doppler interval. If collapse = TRUE, the list is flattened.

Details

The function operates as follows:

  1. If doppler_ranges is not provided, it sets a default list with the full Doppler range, using the total number of Doppler cells.

  2. If dist_ranges is not provided, it sets a default list with the full range, using the total number of range cells.

  3. If any of antennae, dist_ranges, or doppler_ranges are not named, they are automatically named using a default naming scheme.

  4. Based on the smoothed flag, the function retrieves either smoothed self-spectra data via seasonder_SmoothSS or raw self-spectra data via seasonder_getSeaSondeRCS_antenna_SSdata.

  5. If dist_in_km is TRUE, the distance ranges provided in kilometers are converted to range cell numbers using seasonder_rangeCellsDists2RangeNumber.

  6. For each self-spectra matrix, the function slices the matrix over the specified range and Doppler intervals.

  7. Finally, if collapse = TRUE, the nested list is flattened into a single-level list.