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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Steinlechner
pykat
Commits
05386a19
Commit
05386a19
authored
Dec 5, 2013
by
Daniel Brown
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitmaster.atlas.aei.uni-hannover.de:pykat/pykat
parents
b871e9a5
079b10b9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
pykat/components.py
+2
-2
2 additions, 2 deletions
pykat/components.py
pykat/detectors.py
+25
-11
25 additions, 11 deletions
pykat/detectors.py
pykat/finesse.py
+7
-5
7 additions, 5 deletions
pykat/finesse.py
with
34 additions
and
18 deletions
pykat/components.py
+
2
−
2
View file @
05386a19
...
@@ -269,11 +269,11 @@ class space(Component):
...
@@ -269,11 +269,11 @@ class space(Component):
@property
@property
def
L
(
self
):
return
Param
(
'
L
'
,
self
.
__L
)
def
L
(
self
):
return
Param
(
'
L
'
,
self
.
__L
)
@L.setter
@L.setter
def
L
(
self
,
value
):
self
.
__L
=
float
(
value
)
def
L
(
self
,
value
):
self
.
__L
=
SI
float
(
value
)
@property
@property
def
n
(
self
):
return
Param
(
'
n
'
,
self
.
__n
)
def
n
(
self
):
return
Param
(
'
n
'
,
self
.
__n
)
@n.setter
@n.setter
def
n
(
self
,
value
):
self
.
__n
=
float
(
value
)
def
n
(
self
,
value
):
self
.
__n
=
SI
float
(
value
)
@staticmethod
@staticmethod
def
parseFinesseText
(
text
):
def
parseFinesseText
(
text
):
...
...
This diff is collapsed.
Click to expand it.
pykat/detectors.py
+
25
−
11
View file @
05386a19
...
@@ -51,21 +51,26 @@ class Detector(object) :
...
@@ -51,21 +51,26 @@ class Detector(object) :
class
photodiode
(
Detector
):
class
photodiode
(
Detector
):
class
f
(
list
)
:
class
F
:
def
__init__
(
self
,
values
=
None
):
def
__init__
(
self
,
values
=
None
):
print
"
tadaaaaaaaaaaaaaaa
"
if
values
is
None
:
if
values
is
None
:
self
.
values
=
[]
self
.
values
=
[]
else
:
else
:
self
.
values
=
values
self
.
values
=
values
def
__len__
(
self
):
return
len
(
self
.
values
)
def
__getitem__
(
self
,
key
):
def
__getitem__
(
self
,
key
):
# if key is of invalid type or value, the list values will raise the error
return
self
.
values
[
key
]
return
self
.
values
[
key
]
def
__setitem__
(
self
,
key
,
value
):
def
__setitem__
(
self
,
key
,
value
):
print
"
setting
"
self
.
values
[
key
]
=
SIfloat
(
value
)
self
.
values
[
key
]
=
SIfloat
(
value
)
class
phi
(
list
):
class
Phi
():
def
__init__
(
self
,
values
=
None
):
def
__init__
(
self
,
values
=
None
):
print
values
print
values
if
values
is
None
:
if
values
is
None
:
...
@@ -85,7 +90,13 @@ class photodiode(Detector):
...
@@ -85,7 +90,13 @@ class photodiode(Detector):
self
.
values
[
key
]
=
value
self
.
values
[
key
]
=
value
else
:
else
:
self
.
values
[
key
]
=
SIfloat
(
value
)
self
.
values
[
key
]
=
SIfloat
(
value
)
def
append
(
self
,
value
):
self
.
values
.
append
(
value
)
@property
def
f
(
self
):
return
self
.
F
(
'
f
'
,
self
.
__f
)
@f.setter
def
f
(
self
,
key
,
value
):
self
.
__f
[
key
]
=
value
def
__init__
(
self
,
name
,
node
,
senstype
=
None
,
num_demods
=
0
,
demods
=
[]):
def
__init__
(
self
,
name
,
node
,
senstype
=
None
,
num_demods
=
0
,
demods
=
[]):
Detector
.
__init__
(
self
,
name
,
node
)
Detector
.
__init__
(
self
,
name
,
node
)
...
@@ -94,13 +105,16 @@ class photodiode(Detector):
...
@@ -94,13 +105,16 @@ class photodiode(Detector):
self
.
num_demods
=
num_demods
self
.
num_demods
=
num_demods
self
.
senstype
=
senstype
self
.
senstype
=
senstype
# every second element into f (starting at 1)
# every second element into f (starting at 1)
self
.
f
(
demods
[::
2
])
# every second element into phi (starting at 2)
self
.
__f
=
self
.
F
(
demods
[::
2
])
self
.
phi
([
1
,
2
])
# Every second element into phi (starting at 2)
self
.
__phi
=
self
.
Phi
()
for
i
in
demods
[
1
::
2
]:
for
i
in
demods
[
1
::
2
]:
self
.
phi
.
append
(
i
)
self
.
__phi
.
append
(
i
)
print
self
.
__phi
print
self
.
__phi
[
0
]
@staticmethod
@staticmethod
def
parseFinesseText
(
text
):
def
parseFinesseText
(
text
):
...
...
This diff is collapsed.
Click to expand it.
pykat/finesse.py
+
7
−
5
View file @
05386a19
...
@@ -193,6 +193,8 @@ class kat(object):
...
@@ -193,6 +193,8 @@ class kat(object):
obj
=
pykat
.
components
.
space
.
parseFinesseText
(
line
)
obj
=
pykat
.
components
.
space
.
parseFinesseText
(
line
)
elif
(
first
==
"
l
"
):
elif
(
first
==
"
l
"
):
obj
=
pykat
.
components
.
laser
.
parseFinesseText
(
line
)
obj
=
pykat
.
components
.
laser
.
parseFinesseText
(
line
)
elif
(
first
[
0
:
2
]
==
"
pd
"
):
obj
=
pykat
.
detectors
.
photodiode
.
parseFinesseText
(
line
)
elif
(
first
==
"
xaxis
"
or
first
==
"
x2axis
"
or
first
==
"
xaxis*
"
or
first
==
"
x2axis*
"
):
elif
(
first
==
"
xaxis
"
or
first
==
"
x2axis
"
or
first
==
"
xaxis*
"
or
first
==
"
x2axis*
"
):
obj
=
pykat
.
commands
.
xaxis
.
parseFinesseText
(
line
)
obj
=
pykat
.
commands
.
xaxis
.
parseFinesseText
(
line
)
else
:
else
:
...
@@ -200,7 +202,7 @@ class kat(object):
...
@@ -200,7 +202,7 @@ class kat(object):
obj
=
line
obj
=
line
# manually add the line to the block contents
# manually add the line to the block contents
self
.
__blocks
[
self
.
__currentTag
].
contents
.
append
(
line
)
self
.
__blocks
[
self
.
__currentTag
].
contents
.
append
(
line
)
print
obj
if
not
isinstance
(
obj
,
str
):
if
not
isinstance
(
obj
,
str
):
self
.
add
(
obj
)
self
.
add
(
obj
)
...
...
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