Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pykat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Steinlechner
pykat
Commits
9511bc5c
Commit
9511bc5c
authored
10 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
more updates on removing, all goes through kat.remove() to call any gui updates etc.
parent
04dcdf4f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/test_fsig.py
+6
-0
6 additions, 0 deletions
bin/test_fsig.py
pykat/finesse.py
+10
-6
10 additions, 6 deletions
pykat/finesse.py
with
16 additions
and
6 deletions
bin/test_fsig.py
+
6
−
0
View file @
9511bc5c
...
@@ -27,10 +27,14 @@ put up_refl f $x1
...
@@ -27,10 +27,14 @@ put up_refl f $x1
put low_refl f $mx1
put low_refl f $mx1
yaxis log re:im
yaxis log re:im
fsig noise 9
"""
"""
kat
=
finesse
.
kat
(
kat_code
=
code
)
kat
=
finesse
.
kat
(
kat_code
=
code
)
kat
.
removeLine
(
"
fsig noise 9
"
)
kat
.
signals
.
apply
(
kat
.
l1
.
P
,
1
,
0
)
kat
.
signals
.
apply
(
kat
.
l1
.
P
,
1
,
0
)
kat
.
signals
.
apply
(
kat
.
m1
.
phi
,
1
,
90
)
kat
.
signals
.
apply
(
kat
.
m1
.
phi
,
1
,
90
)
...
@@ -48,3 +52,5 @@ pl.xlabel(out.xlabel)
...
@@ -48,3 +52,5 @@ pl.xlabel(out.xlabel)
pl
.
title
(
"
Reflection quadratures with no relative carrier phase
"
)
pl
.
title
(
"
Reflection quadratures with no relative carrier phase
"
)
pl
.
legend
([
"
Amplitude
"
,
"
Phase
"
])
pl
.
legend
([
"
Amplitude
"
,
"
Phase
"
])
#pl.show()
#pl.show()
kat
.
remove
(
kat
.
signals
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pykat/finesse.py
+
10
−
6
View file @
9511bc5c
...
@@ -39,6 +39,7 @@ import ctypes
...
@@ -39,6 +39,7 @@ import ctypes
import
ctypes.util
import
ctypes.util
import
collections
import
collections
import
re
import
re
import
copy
from
collections
import
namedtuple
,
OrderedDict
from
collections
import
namedtuple
,
OrderedDict
...
@@ -260,6 +261,9 @@ class Signals(object):
...
@@ -260,6 +261,9 @@ class Signals(object):
def
removed
(
self
):
return
self
.
__removed
def
removed
(
self
):
return
self
.
__removed
def
remove
(
self
):
def
remove
(
self
):
self
.
__signal
.
_kat
.
remove
(
self
)
def
_on_remove
(
self
):
if
self
.
__removed
:
if
self
.
__removed
:
raise
pkex
.
BasePyKatException
(
"
Signal {0} has already been marked as removed
"
.
format
(
self
.
name
))
raise
pkex
.
BasePyKatException
(
"
Signal {0} has already been marked as removed
"
.
format
(
self
.
name
))
else
:
else
:
...
@@ -312,18 +316,18 @@ class Signals(object):
...
@@ -312,18 +316,18 @@ class Signals(object):
for
t
in
self
.
targets
:
for
t
in
self
.
targets
:
t
.
remove
()
t
.
remove
()
del
self
.
targets
[:]
@property
@property
def
f
(
self
):
return
self
.
__f
def
f
(
self
):
return
self
.
__f
@f.setter
@f.setter
def
f
(
self
,
value
):
self
.
__f
.
value
=
SIfloat
(
value
)
def
f
(
self
,
value
):
self
.
__f
.
value
=
SIfloat
(
value
)
def
__init__
(
self
,
kat
):
def
__init__
(
self
,
kat
):
if
kat
==
None
:
raise
pkex
.
BasePyKatException
(
"
kat object must be specified
"
)
self
.
targets
=
[]
self
.
targets
=
[]
self
.
_params
=
[]
self
.
_params
=
[]
self
.
__kat
=
kat
self
.
__f
=
Param
(
"
f
"
,
self
,
1
)
self
.
__f
=
Param
(
"
f
"
,
self
,
1
)
self
.
_kat
=
kat
def
_register_param
(
self
,
param
):
def
_register_param
(
self
,
param
):
self
.
_params
.
append
(
param
)
self
.
_params
.
append
(
param
)
...
@@ -1073,7 +1077,7 @@ class kat(object):
...
@@ -1073,7 +1077,7 @@ class kat(object):
elif
isinstance
(
obj
,
pykat
.
finesse
.
Signals
):
elif
isinstance
(
obj
,
pykat
.
finesse
.
Signals
):
obj
.
remove
()
obj
.
remove
()
elif
isinstance
(
obj
,
pykat
.
finesse
.
Signals
.
fsig
):
elif
isinstance
(
obj
,
pykat
.
finesse
.
Signals
.
fsig
):
obj
.
remove
()
obj
.
_on_
remove
()
for
b
in
self
.
__blocks
:
for
b
in
self
.
__blocks
:
if
obj
in
self
.
__blocks
[
b
].
contents
:
if
obj
in
self
.
__blocks
[
b
].
contents
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment