skrf.frequency.Frequency.round_to

Frequency.round_to(val='Hz')[source]

Round off frequency values to a specified precision.

This is useful for dealing with finite precision limitations of VNA’s and/or other software

Parameters:

val (string or number) – if val is a string it should be a frequency unit (ie ‘Hz’, ‘MHz’,etc). if its a number, then this returns f = f-f%val

Return type:

None

Examples

>>> f = skrf.Frequency.from_f([.1,1.2,3.5],unit='Hz')
>>> f.round_to('Hz')