Scan frequency in an instrument. :param start: Start frequency. :type start: Quantity :param stop: Stop frequency. :type stop: Quantity :param step: Step frequency. :type step: Quantity :param wait: Waiting time. :type wait: Quantity
(inst, start, stop, step, wait)
| 14 | |
| 15 | |
| 16 | def scan_frequency(inst, start, stop, step, wait): |
| 17 | """Scan frequency in an instrument. |
| 18 | |
| 19 | :param start: Start frequency. |
| 20 | :type start: Quantity |
| 21 | :param stop: Stop frequency. |
| 22 | :type stop: Quantity |
| 23 | :param step: Step frequency. |
| 24 | :type step: Quantity |
| 25 | :param wait: Waiting time. |
| 26 | :type wait: Quantity |
| 27 | |
| 28 | """ |
| 29 | in_secs = wait.to('seconds').magnitude |
| 30 | current = start |
| 31 | while current < stop: |
| 32 | inst.frequency = current |
| 33 | time.sleep(in_secs) |
| 34 | current += step |
| 35 | |
| 36 | |
| 37 | if __name__ == '__main__': |
no outgoing calls
no test coverage detected