Commit 107cb99b authored by Christian Schneider's avatar Christian Schneider
Browse files

Added electrical delay for load_folder_grid function

parent 7e3cabf3
......@@ -388,7 +388,7 @@ def load_folder(folderpath, word_search=None, dm_pars=None,
return dm_list, pars
def load_folder_grid(folder, par_name, dtype='dB', interpolate=True):
def load_folder_grid(folder, par_name, dtype='dB', interpolate=True, delay=None):
"""Loads a folder and creates a data_grid from it.
If interpolate is set to True, it will interpolate all the data with the
finest measurement resolution. This is required since xarray has problems
......@@ -409,6 +409,8 @@ def load_folder_grid(folder, par_name, dtype='dB', interpolate=True):
Use Magnitude (dB) or Phase (phase) for complex datamodules.
interpolate : bool
If set to true, interpolate data and create uniform coordinate grid
delay: None, float
Delay for electrical delay correction. If None it will try to fit it
"""
tmp = load_folder(folder, dm_pars=[par_name])
......@@ -436,6 +438,7 @@ def load_folder_grid(folder, par_name, dtype='dB', interpolate=True):
for idx, d in enumerate(tmp[0]):
xvals.append(tmp[1][par_name][idx])
if dtype == 'phase':
d.correct_delay(delay) # Correct for electrical delay
zvals.append(np.interp(yvals, d.x, d.phase.y))
name = d.phase.name_y
else:
......
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