Skip to contents

This function converts Doppler-related values between different units, including normalized Doppler frequency, Doppler bins, and absolute Doppler frequency (Hz), within a SeaSondeR object.

Usage

seasonder_SwapDopplerUnits(seasonder_cs_object, values, in_units, out_units)

Arguments

seasonder_cs_object

A SeaSondeR cross-spectral object containing Doppler bin metadata.

values

A numeric vector specifying the Doppler values to be converted.

in_units

A character string specifying the current unit of values. Must be one of:

  • "normalized doppler frequency": Values are normalized by the Bragg frequency.

  • "bins": Values represent Doppler bin indices.

  • "doppler frequency": Values are in Hz.

out_units

A character string specifying the target unit for conversion. Must be one of the same three options as in_units.

Value

A numeric vector with the converted Doppler values in the specified output unit.

Details

The function first validates that the input and output units are among the allowed options. If in_units and out_units are the same, the function returns the original values without modification.

The unit conversions follow this logic:

  1. If converting from "normalized doppler frequency":

  2. If converting from "bins":

  3. If converting from "doppler frequency":

Overall, the functions used for Doppler units conversion mimic the implementation of Doppler units displayed in SpectraPlotterMap 12 in Radial Suite R8

References

COS. SeaSonde Radial Suite Release 8; CODAR Ocean Sensors (COS): Mountain View, CA, USA, 2016.

See also