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): ...@@ -373,7 +373,7 @@ class Notch(circuit):
# Notch model # Notch model
value = (self.a*np.exp(1j*self.alpha)*(1 - self.Ql/self.absQc* value = (self.a*np.exp(1j*self.alpha)*(1 - self.Ql/self.absQc*
np.exp(1j*self.phi0)/ np.exp(1j*self.phi0)/
(1. + 2j * self.Ql*(self.freq / (1. + 2j * self.Ql*(freqs /
self.fr - 1)))) self.fr - 1))))
# Subtract Background # Subtract Background
try: try:
...@@ -385,7 +385,7 @@ class Notch(circuit): ...@@ -385,7 +385,7 @@ class Notch(circuit):
pass pass
# Electric delay # Electric delay
value *= np.exp(-2j * np.pi * self.freq * self.delay) value *= np.exp(-2j * np.pi * freqs * self.delay)
return value return value
...@@ -470,6 +470,6 @@ class Reflection(circuit): ...@@ -470,6 +470,6 @@ class Reflection(circuit):
pass pass
# Electric delay # Electric delay
value *= np.exp(-2j * np.pi * self.freq * self.delay) value *= np.exp(-2j * np.pi * freqs * self.delay)
return value return value
...@@ -161,7 +161,7 @@ def load_datamodule(filename, upgrade=True): ...@@ -161,7 +161,7 @@ def load_datamodule(filename, upgrade=True):
tmp = data_grid([[0], [0], [[0]]]) tmp = data_grid([[0], [0], [[0]]])
# Save xarray DataArray # Save xarray DataArray
tmp.df = ds[list(ds.keys())[0]] tmp.df = ds[list(ds.keys())[0]].copy()
# Set attributes of dm object # Set attributes of dm object
for key, value in eval(tmp.df.attrs['dm_metadata']).items(): for key, value in eval(tmp.df.attrs['dm_metadata']).items():
......
...@@ -113,10 +113,11 @@ class PS(object): ...@@ -113,10 +113,11 @@ class PS(object):
Frequency in Hz. Use '?' to query current value. Frequency in Hz. Use '?' to query current value.
""" """
resp = self.instr.frequency(frequency) resp = self.instr.frequency(frequency)
# Update database values # Update database values
if str(frequency) != "?": if str(frequency) != "?" and str(frequency) != "min?" and str(frequency) != "max?":
update_db(self) update_db(self)
# Return value # Return value
...@@ -131,10 +132,11 @@ class PS(object): ...@@ -131,10 +132,11 @@ class PS(object):
Phase in degree. Use '?' to query current value. Phase in degree. Use '?' to query current value.
""" """
resp = self.instr.phase(phase) resp = self.instr.phase(phase)
# Update database values # Update database values
if str(phase) != "?": if str(phase) != "?" and str(phase) != "min?" and str(phase) != "max?" and str(phase) != "step?":
update_db(self) update_db(self)
# Return value # Return value
...@@ -142,12 +144,7 @@ class PS(object): ...@@ -142,12 +144,7 @@ class PS(object):
# Database functions ####################################################### # Database functions #######################################################
def get_parameters(self): def get_parameters(self):
d = {'Phase': '{} degree'.format(self.phase()), d = {'Phase': '{} degree'.format(self.phase()),
'Frequency': '{} Hz'.format(self.frequency()), '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?')),
}
return d 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