Convert Between Different Doppler Frequency Units
Source:R/SeaSondeRCS.R
seasonder_SwapDopplerUnits.RdThis function converts Doppler-related values between different units, including normalized Doppler frequency, Doppler bins, and absolute Doppler frequency (Hz), within a SeaSondeR object.
Arguments
- seasonder_cs_object
A
SeaSondeRcross-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.
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:
If converting from
"normalized doppler frequency":To
"bins": Usesseasonder_NormalizedDopplerFreq2Bins.To
"doppler frequency": Usesseasonder_NormalizedDopplerFreq2DopplerFreq.
If converting from
"bins":To
"normalized doppler frequency": Usesseasonder_Bins2NormalizedDopplerFreq.To
"doppler frequency": Usesseasonder_Bins2DopplerFreq.
If converting from
"doppler frequency":To
"bins": Usesseasonder_DopplerFreq2Bins.To
"normalized doppler frequency": Usesseasonder_DopplerFreq2NormalizedDopplerFreq.
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
seasonder_NormalizedDopplerFreq2Bins, seasonder_Bins2NormalizedDopplerFreq, seasonder_DopplerFreq2Bins, and related functions for unit-specific conversions.