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
7af711e5
Commit
7af711e5
authored
11 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
fixing gauss param and adding example
parent
eb54342e
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
examples/gauss_param.py
+15
-0
15 additions, 0 deletions
examples/gauss_param.py
pykat/utilities/optics/ABCD.py
+2
-1
2 additions, 1 deletion
pykat/utilities/optics/ABCD.py
pykat/utilities/optics/gaussian_beams.py
+1
-1
1 addition, 1 deletion
pykat/utilities/optics/gaussian_beams.py
with
18 additions
and
2 deletions
examples/gauss_param.py
0 → 100644
+
15
−
0
View file @
7af711e5
from
pykat.utilities.optics.ABCD
import
apply
,
mirror_trans
from
pykat.utilities.optics.gaussian_beams
import
gauss_param
nr1
=
1
nr2
=
1.44963098985906
q1
=
gauss_param
(
q
=
5.96343
+
3.04713j
)
abcd
=
mirror_trans
(
nr1
,
nr2
,
float
(
"
inf
"
))
# into material
q2
=
apply
(
abcd
,
q1
,
nr1
,
nr2
)
# and out again
q3
=
apply
(
abcd
,
q2
,
nr2
,
nr1
)
print
"
q1 =
"
,
q1
,
"
w0 =
"
,
q1
.
w0
,
"
wz =
"
,
q1
.
wz
,
"
z =
"
,
q1
.
z
print
"
q2 =
"
,
q2
,
"
w0 =
"
,
q2
.
w0
,
"
wz =
"
,
q2
.
wz
,
"
z =
"
,
q2
.
z
print
"
q3 =
"
,
q3
,
"
w0 =
"
,
q3
.
w0
,
"
wz =
"
,
q3
.
wz
,
"
z =
"
,
q3
.
z
This diff is collapsed.
Click to expand it.
pykat/utilities/optics/ABCD.py
+
2
−
1
View file @
7af711e5
import
numpy
as
np
import
numpy
as
np
from
pykat.utilities.optics.gaussian_beams
import
gauss_param
def
apply
(
ABCD
,
q1
,
n1
,
n2
):
def
apply
(
ABCD
,
q1
,
n1
,
n2
):
return
n2
*
(
ABCD
[
0
,
0
]
*
q1
/
n1
+
ABCD
[
0
,
1
])
/
(
ABCD
[
1
,
0
]
*
q1
/
n1
+
ABCD
[
1
,
1
])
return
gauss_param
(
nr
=
n2
,
q
=
n2
*
(
ABCD
[
0
,
0
]
*
q1
/
n1
+
ABCD
[
0
,
1
])
/
(
ABCD
[
1
,
0
]
*
q1
/
n1
+
ABCD
[
1
,
1
])
)
def
mirror_trans
(
n1
,
n2
,
Rc
):
def
mirror_trans
(
n1
,
n2
,
Rc
):
return
np
.
matrix
([[
1
,
0
],[(
n2
-
n1
)
/
Rc
,
1
]])
return
np
.
matrix
([[
1
,
0
],[(
n2
-
n1
)
/
Rc
,
1
]])
...
...
This diff is collapsed.
Click to expand it.
pykat/utilities/optics/gaussian_beams.py
+
1
−
1
View file @
7af711e5
...
@@ -68,7 +68,7 @@ class gauss_param(object):
...
@@ -68,7 +68,7 @@ class gauss_param(object):
@property
@property
def
wz
(
self
):
def
wz
(
self
):
return
math
.
sqrt
(
self
.
__lambda
/
(
self
.
__nr
*
math
.
pi
)
*
abs
(
self
.
__q
)
/
self
.
__q
.
imag
)
return
self
.
w0
*
math
.
sqrt
(
1
+
(
self
.
__q
.
real
/
self
.
__q
.
imag
)
**
2
)
@property
@property
def
w0
(
self
):
def
w0
(
self
):
...
...
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