Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
IENT
GDET3-Demos
Commits
3a8fe8ff
Commit
3a8fe8ff
authored
Apr 04, 2019
by
Hafiz Emin Kosar
Browse files
added H0 and default filter types
parent
aad6ca31
Changes
2
Hide whitespace changes
Inline
Side-by-side
GDET3 Laplace-Transformation.ipynb
View file @
3a8fe8ff
...
...
@@ -8,7 +8,7 @@
"source": [
"%matplotlib notebook\n",
"\n",
"from ipywidgets import interact, interactive, fixed\n",
"from ipywidgets import interact, interactive, fixed
, HBox, VBox
\n",
"import ipywidgets as widgets\n",
"from IPython.display import clear_output, display, HTML\n",
"from IPython.display import Markdown as md\n",
...
...
@@ -23,24 +23,27 @@
"metadata": {},
"outputs": [],
"source": [
"# Polstellen bei j , -j (1-fach)\n",
"pp1 = 1j\n",
"ord_pp1 = 1\n",
"# Nullstellen bei 0 (1-fach)\n",
"pn1 = 0\n",
"ord_pn1 = 1\n",
"pzp = pzPlot()\n",
"\n",
"pzp = pzPlot(np.array([pp1]),\n",
" np.array([pn1]),\n",
" np.array([ord_pp1]), \n",
" np.array([ord_pn1]))\n",
"\n",
"filter_type = interactive(pzp.update_filter,filtr=widgets.Dropdown(options=list(pzp.filter_types.keys()), value=\"manuell\", description='Filter'))\n",
"action_type = interactive(pzp.update_action,action=widgets.Dropdown(options=list(pzp.action_types.keys()),value=\"Hinzufügen\", description='Modus'))\n",
"display(action_type);\n",
"point_type = interactive(pzp.update_mode,mode=widgets.Dropdown(options=list(pzp.mode_types.keys()), value=\"Polstelle\", description='Typ'))\n",
"display(point_type)"
"amp_type = interactive(pzp.update_amp, H0=widgets.IntSlider(min=1,max=10,step=1,value=1), description=\"H0\")\n",
"\n",
"left_box = VBox([filter_type, amp_type])\n",
"right_box = VBox([action_type, point_type])\n",
"\n",
"HBox([left_box, right_box])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
...
...
%% 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
```
...
...
src/laplace_plot.py
View file @
3a8fe8ff
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment