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
294252ca
Commit
294252ca
authored
11 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
finishing gauss param parsing
parent
20571997
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
bin/test_aperture.py
+3
-3
3 additions, 3 deletions
bin/test_aperture.py
pykat/commands.py
+16
-9
16 additions, 9 deletions
pykat/commands.py
pykat/finesse.py
+8
-0
8 additions, 0 deletions
pykat/finesse.py
pykat/utilities/optics/gaussian_beams.py
+5
-5
5 additions, 5 deletions
pykat/utilities/optics/gaussian_beams.py
with
32 additions
and
17 deletions
bin/test_aperture.py
+
3
−
3
View file @
294252ca
...
...
@@ -11,16 +11,16 @@ s s1 10 1 n1 n2
m m1 1 0 0 n2 n3
pd refl n2
gauss g1 m1 n2 1e-3 0
xaxis m1 r_ap lin 0.1e-3 2e-3 10
"""
kat
=
finesse
.
kat
()
kat
.
parseCommands
(
code
)
maxtem
=
np
.
arang
e
(
0
,
2
,
2
)
maxtem
=
np
.
linspac
e
(
0
,
1
,
2
)
kat
.
m1
.
n2
.
q
=
gauss_param
(
w0
=
1e-3
,
z
=
0
)
#
kat.m1.n2.q = gauss_param(w0=1e-3, z=0)
for
tem
in
maxtem
:
print
"
Calculating maxtem
"
,
tem
,
"
...
"
...
...
This diff is collapsed.
Click to expand it.
pykat/commands.py
+
16
−
9
View file @
294252ca
...
...
@@ -12,6 +12,7 @@ from structs import *
from
pykat.param
import
Param
,
putter
import
pykat.exceptions
as
pkex
from
collections
import
namedtuple
from
pykat.utilities.optics.gaussian_beams
import
gauss_param
class
Command
(
object
):
def
__init__
(
self
):
...
...
@@ -54,23 +55,29 @@ class gauss(object):
component
=
values
[
2
]
node
=
values
[
3
]
if
values
[
0
].
endswith
(
"
**
"
):
if
values
[
0
]:
if
len
(
values
)
==
6
:
print
""
gp
=
gauss_param
(
w0
=
values
[
-
2
],
z
=
values
[
-
1
])
elif
len
(
values
)
==
8
:
print
""
gpx
=
gauss_param
(
w0
=
values
[
-
4
],
z
=
values
[
-
3
])
gpy
=
gauss_param
(
w0
=
values
[
-
2
],
z
=
values
[
-
1
])
elif
values
[
0
].
endswith
(
"
*
"
):
if
len
(
values
)
==
6
:
print
""
gp
=
gauss_param
(
z
=
values
[
-
2
],
zr
=
values
[
-
1
])
elif
len
(
values
)
==
8
:
print
""
gpx
=
gauss_param
(
z
=
values
[
-
4
],
zr
=
values
[
-
3
])
gpy
=
gauss_param
(
z
=
values
[
-
2
],
zr
=
values
[
-
1
])
else
:
if
len
(
values
)
==
6
:
print
""
gp
=
gauss_param
(
w
=
values
[
-
2
],
rc
=
values
[
-
1
])
elif
len
(
values
)
==
8
:
print
""
gpx
=
gauss_param
(
w
=
values
[
-
4
],
rc
=
values
[
-
3
])
gpy
=
gauss_param
(
w
=
values
[
-
2
],
rc
=
values
[
-
1
])
if
len
(
values
)
==
6
:
kat
.
nodes
[
node
].
setGauss
(
kat
.
components
[
component
],
gp
)
else
:
kat
.
nodes
[
node
].
setGauss
(
kat
.
components
[
component
],
gpx
,
gpy
)
class
tf
(
Command
):
fQ
=
namedtuple
(
'
fQ
'
,
[
'
f
'
,
'
Q
'
])
...
...
This diff is collapsed.
Click to expand it.
pykat/finesse.py
+
8
−
0
View file @
294252ca
...
...
@@ -310,6 +310,14 @@ class kat(object):
@getPerformanceData.setter
def
getPerformanceData
(
self
,
value
):
self
.
__time_code
=
bool
(
value
)
@property
def
components
(
self
):
return
self
.
__components
.
copy
()
@property
def
detectors
(
self
):
return
self
.
__detectors
.
copy
()
@property
def
noxaxis
(
self
):
return
self
.
__noxaxis
@noxaxis.setter
...
...
This diff is collapsed.
Click to expand it.
pykat/utilities/optics/gaussian_beams.py
+
5
−
5
View file @
294252ca
...
...
@@ -24,11 +24,11 @@ class gauss_param(object):
def
__init__
(
self
,
wavelength
=
1064e-9
,
nr
=
1
,
*
args
,
**
kwargs
):
self
.
__q
=
None
self
.
__lambda
=
wavelength
self
.
__nr
=
nr
self
.
__lambda
=
float
(
wavelength
)
self
.
__nr
=
float
(
nr
)
if
len
(
args
)
==
1
:
self
.
__q
=
args
[
0
]
self
.
__q
=
complex
(
args
[
0
]
)
elif
len
(
kwargs
)
==
1
:
if
"
q
"
in
kwargs
:
...
...
@@ -39,11 +39,11 @@ class gauss_param(object):
elif
len
(
kwargs
)
==
2
:
if
"
w0
"
in
kwargs
and
"
z
"
in
kwargs
:
q
=
float
(
kwargs
[
"
z
"
])
+
1j
*
float
(
math
.
pi
*
kwargs
[
"
w0
"
]
**
2
/
(
self
.
__lambda
/
self
.
__nr
)
)
q
=
float
(
kwargs
[
"
z
"
])
+
1j
*
float
(
math
.
pi
*
float
(
kwargs
[
"
w0
"
]
)
**
2
/
(
self
.
__lambda
/
self
.
__nr
)
)
elif
"
z
"
in
kwargs
and
"
zr
"
in
kwargs
:
q
=
float
(
kwargs
[
"
z
"
])
+
1j
*
float
(
kwargs
[
"
zr
"
])
elif
"
rc
"
in
kwargs
and
"
w
"
in
kwargs
:
one_q
=
1
/
kwargs
[
"
rc
"
]
-
1j
*
self
.
__lamda
/
(
math
.
pi
*
self
.
__nr
*
kwargs
[
"
w
"
]
**
2
)
one_q
=
1
/
float
(
kwargs
[
"
rc
"
]
)
-
1j
*
self
.
__lamda
/
(
math
.
pi
*
self
.
__nr
*
float
(
kwargs
[
"
w
"
]
)
**
2
)
q
=
1
/
one_q
else
:
raise
pkex
.
BasePyKatException
(
"
Must specify: z and w0 or z and zr or rc and w or q, to define the beam parameter
"
)
...
...
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