Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
finesse
pykat
Commits
ac92bae1
Commit
ac92bae1
authored
Dec 18, 2014
by
Andreas Freise
Browse files
small change to new example
parent
0f657ec6
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/remove_add_components.py
View file @
ac92bae1
# Example showing how to remove and add components with Pykat.
# Commands that get parsed into a pykat object can be interacted
# with in a object orientated manner. So you can call kat.component.remove()
# to remove it for example.
#
# This example shows how a kat object can be manipulated when pykat objects
# are available.
#
# If the a Finesse command hasn't been implemented as a pykat object yet
# the command will be added as an "extra line", these can still be removed
# and added to using the kat.removeLine and kat.addLine commands.
#
# Daniel Brown 17/12/14
"""
--------------------------------------------------------------
Example file for using PyKat to remove objects from a 'kat'
object for Finesse simulations
Finesse: http://www.gwoptics.org/finesse
PyKat: http://www.gwoptics.org/pykat
Example showing how to remove and add components with Pykat.
Commands that get parsed into a pykat object can be interacted
with in a object orientated manner. So you can call kat.component.remove()
to remove it for example.
This example shows how a kat object can be manipulated when pykat objects
are available.
If the a Finesse command hasn't been implemented as a pykat object yet
the command will be added as an "extra line", these can still be removed
and added to using the kat.removeLine and kat.addLine commands.
Daniel Brown 17/12/14
--------------------------------------------------------------
"""
import
pykat
from
pykat.components
import
*
...
...
@@ -51,4 +59,4 @@ kat.add(space("s3", "n3", "n3a", L=1))
kat
.
add
(
mirror
(
"m3"
,
"n2a"
,
"n3a"
,
R
=
0.9
,
T
=
0.1
,
phi
=
0
))
print
"After add with objects..."
print
""
.
join
(
kat
.
generateKatScript
())
\ No newline at end of file
print
""
.
join
(
kat
.
generateKatScript
())
Write
Preview
Markdown
is supported
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