Commit 3a8fe8ff authored by Hafiz Emin Kosar's avatar Hafiz Emin Kosar
Browse files

added H0 and default filter types

parent aad6ca31
%% Cell type:code id: tags:
``` python
%matplotlib notebook
from ipywidgets import interact, interactive, fixed
from ipywidgets import interact, interactive, fixed, HBox, VBox
import ipywidgets as widgets
from IPython.display import clear_output, display, HTML
from IPython.display import Markdown as md
from src.laplace_plot import pzPoint, pzPlot
import numpy as np
```
%% Cell type:code id: tags:
``` python
# Polstellen bei j , -j (1-fach)
pp1 = 1j
ord_pp1 = 1
# Nullstellen bei 0 (1-fach)
pn1 = 0
ord_pn1 = 1
pzp = pzPlot(np.array([pp1]),
np.array([pn1]),
np.array([ord_pp1]),
np.array([ord_pn1]))
pzp = pzPlot()
filter_type = interactive(pzp.update_filter,filtr=widgets.Dropdown(options=list(pzp.filter_types.keys()), value="manuell", description='Filter'))
action_type = interactive(pzp.update_action,action=widgets.Dropdown(options=list(pzp.action_types.keys()),value="Hinzufügen", description='Modus'))
display(action_type);
point_type = interactive(pzp.update_mode,mode=widgets.Dropdown(options=list(pzp.mode_types.keys()), value="Polstelle", description='Typ'))
display(point_type)
amp_type = interactive(pzp.update_amp, H0=widgets.IntSlider(min=1,max=10,step=1,value=1), description="H0")
left_box = VBox([filter_type, amp_type])
right_box = VBox([action_type, point_type])
HBox([left_box, right_box])
```
%% Cell type:code id: tags:
``` python
```
%% Cell type:code id: tags:
``` python
```
......
......@@ -33,6 +33,8 @@ class pzPlot():
fig = None
ax = None
handles = {'ph': None, 'axh': None, 'pH': None, 'axH': None}
filter_types = {'manuell' : 'man', 'Butterworth' : 'butr', 'Sprungfunktion' : 'unit', 'Sinus' : 'sin',
'Cosinus' : 'cos'}
mode = 'p'
mode_types = {'Polstelle': 'p', 'Nullstelle': 'z'}
action = 'add'
......@@ -257,6 +259,37 @@ class pzPlot():
def update_action(self, action):
self.action = self.action_types[action]
def update_amp(self, H0):
self.H0 = H0
self.update_plot()
def update_filter(self, filtr):
self.filter = self.filter_types[filtr]
filter_types = {'manuell': 'man', 'Butterworth': 'butr', 'Sprungfunktion': 'unit', 'Sinus': 'sin',
'Cosinus': 'cos'}
def filtr_man():
pass
def filtr_butr():
pass
def filtr_unit():
pass
def filtr_sin():
pass
def filtr_cos():
pass
cases = {
'man': filtr_man,
'butr': filtr_butr,
'unit': filtr_unit,
'sin': filtr_sin,
'cos': filtr_cos
}
cases.get(self.filter)()
self.update_roc()
def move_sympyplot_to_axes(self, p, ax):
backend = p.backend(p)
backend.ax = ax
......
Supports Markdown
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