mirror of
https://github.com/ttrftech/NanoVNA.git
synced 2026-04-05 22:45:43 +00:00
set scale and refpos temporally
This commit is contained in:
parent
75ea6308ed
commit
295ec105e6
6 changed files with 154 additions and 135 deletions
File diff suppressed because one or more lines are too long
|
|
@ -158,6 +158,9 @@ class NanoVNA():
|
|||
def resume(self):
|
||||
self.send_command("resume\r")
|
||||
|
||||
def pause(self):
|
||||
self.send_command("pause\r")
|
||||
|
||||
def scan(self, port = None):
|
||||
self.set_port(port)
|
||||
return np.vectorize(self.gamma)(self.frequencies)
|
||||
|
|
@ -176,6 +179,15 @@ class NanoVNA():
|
|||
x.append(float(d[0])+float(d[1])*1.j)
|
||||
return np.array(x)
|
||||
|
||||
def fetch_frequencies(self):
|
||||
self.send_command("frequencies\r")
|
||||
data = self.fetch_data()
|
||||
x = []
|
||||
for line in data.split('\n'):
|
||||
if line:
|
||||
x.append(float(line))
|
||||
self._frequencies = np.array(x)
|
||||
|
||||
def logmag(self, x):
|
||||
pl.grid(True)
|
||||
pl.plot(self.frequencies, 20*np.log10(np.abs(x)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue