NanoVNA2-firmware icon indicating copy to clipboard operation
NanoVNA2-firmware copied to clipboard

How to calibrate the NanoVNA through Python?

Open 0xCoto opened this issue 3 years ago • 3 comments

I've managed to get everything working using the provided Python scripts and I am able to output touchstone files, plot them etc., but I see that the |S21| values disagree between the NanoVNA alone (i.e. not connected to python/a computer) and the ones the python script is measuring.

My understanding is that once I calibrate the device (SOLT) and connect it to the computer, the python interface does not seem to pick up the latest calibration on file. Is there a simple way to either load the latest calibration on file or manually re-run the SOLT calibration again through python, or do I have to write something up and save each state (OPEN, SHORT, LOAD, THRU) as a separate sNp file and apply the calibration locally?

0xCoto avatar Dec 18 '21 11:12 0xCoto

Hi. Have a look at the scikit-rf package (imported via skrf). It offers SOLT calibration and others, see this exmaple:

https://scikit-rf.readthedocs.io/en/latest/tutorials/Calibration.html#SOLT-Example

Vinc0110 avatar Mar 13 '22 08:03 Vinc0110

In case anyone is still watching this issue: The latest package release of scikit-rf (version 0.22.0) now includes a dedicated instrument class for the NanoVNA V2. The usage is documented and demonstrated in this example notebook: https://scikit-rf.readthedocs.io/en/latest/examples/metrology/NanoVNA_V2_4port-splitter.html

Vinc0110 avatar Apr 24 '22 15:04 Vinc0110

Is it possible to load a calibration slot from the device using the provided nanovna.py? Although I've already recalled a cal slot on the device itself, when I run the python script, I get non-calibrated values.

mrleongalaxyum avatar Mar 30 '23 04:03 mrleongalaxyum