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')