Commit 335d558c authored by Romain Baptiste Dominique Albert's avatar Romain Baptiste Dominique Albert
Browse files

Merge branch 'master' into Bilt_voltage_source

parents 5445010c 26406f48
......@@ -373,7 +373,7 @@ class Notch(circuit):
# Notch model
value = (self.a*np.exp(1j*self.alpha)*(1 - self.Ql/self.absQc*
np.exp(1j*self.phi0)/
(1. + 2j * self.Ql*(self.freq /
(1. + 2j * self.Ql*(freqs /
self.fr - 1))))
# Subtract Background
try:
......@@ -385,7 +385,7 @@ class Notch(circuit):
pass
# Electric delay
value *= np.exp(-2j * np.pi * self.freq * self.delay)
value *= np.exp(-2j * np.pi * freqs * self.delay)
return value
......@@ -470,6 +470,6 @@ class Reflection(circuit):
pass
# Electric delay
value *= np.exp(-2j * np.pi * self.freq * self.delay)
value *= np.exp(-2j * np.pi * freqs * self.delay)
return value
......@@ -161,7 +161,7 @@ def load_datamodule(filename, upgrade=True):
tmp = data_grid([[0], [0], [[0]]])
# Save xarray DataArray
tmp.df = ds[list(ds.keys())[0]]
tmp.df = ds[list(ds.keys())[0]].copy()
# Set attributes of dm object
for key, value in eval(tmp.df.attrs['dm_metadata']).items():
......
......@@ -113,10 +113,11 @@ class PS(object):
Frequency in Hz. Use '?' to query current value.
"""
resp = self.instr.frequency(frequency)
# Update database values
if str(frequency) != "?":
if str(frequency) != "?" and str(frequency) != "min?" and str(frequency) != "max?":
update_db(self)
# Return value
......@@ -131,10 +132,11 @@ class PS(object):
Phase in degree. Use '?' to query current value.
"""
resp = self.instr.phase(phase)
# Update database values
if str(phase) != "?":
if str(phase) != "?" and str(phase) != "min?" and str(phase) != "max?" and str(phase) != "step?":
update_db(self)
# Return value
......@@ -142,12 +144,7 @@ class PS(object):
# Database functions #######################################################
def get_parameters(self):
d = {'Phase': '{} degree'.format(self.phase()),
'Frequency': '{} Hz'.format(self.frequency()),
'Minimum frequency': '{} Hz'.format(self.frequency('min?')),
'Maximum frequency': '{} Hz'.format(self.frequency('max?')),
'Minimum phase': '{} degree'.format(self.phase('min?')),
'Maximum phase': '{} degree'.format(self.phase('max?')),
'Step phase': '{} degree'.format(self.phase('step?')),
}
'Frequency': '{} Hz'.format(self.frequency())}
return d
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment