Call:
value(signal_y, signal_x, x_value)
or
value(df, x_value)
Gets the y-value of an x-value of a signal or expression.
Get the value of the signal ‘v(inv_in)’ at ’time’ of 400 microseconds
value(
'v(inv_in)',
'time',
400u
)

def value(*args):
if len(args) == 3:
x = process_operator(args[1])
y = process_operator(args[0])
x_index = args[2]
elif len(args) == 2:
if isinstance(args[0], pd.DataFrame):
x = args[0]['x']
y = args[0]['y']
x_index = args[1]
else:
return pd.DataFrame()
else:
return pd.DataFrame()
index = x.tolist()
values = y.tolist()
if isinstance(x_index, pd.DataFrame):
x_index = x_index['y'][0]
data_dict = {'x': [x_index], 'y': [np.interp(x_index, index, values)]}
df_out = pd.DataFrame(data_dict)
return df_out