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
finesse
pykat
Commits
2fecc0f6
Commit
2fecc0f6
authored
11 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
can now do kat.m1.n1.q = 1+100j and it converts it correctly into a gaussian beam parameter object
parent
de03e236
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
+3
-3
3 additions, 3 deletions
pykat/components.py
pykat/node_network.py
+5
-4
5 additions, 4 deletions
pykat/node_network.py
pykat/utilities/optics/gaussian_beams.py
+8
-0
8 additions, 0 deletions
pykat/utilities/optics/gaussian_beams.py
with
16 additions
and
7 deletions
pykat/components.py
+
3
−
3
View file @
2fecc0f6
...
...
@@ -32,21 +32,21 @@ class NodeGaussSetter(object):
@q.setter
def
q
(
self
,
value
):
self
.
__node
.
setGauss
(
self
.
__comp
,
value
)
self
.
__node
.
setGauss
(
self
.
__comp
,
complex
(
value
)
)
@property
def
qx
(
self
):
return
self
.
__node
.
qx
@qx.setter
def
qx
(
self
,
value
):
self
.
__node
.
setGauss
(
self
.
__comp
,
value
)
self
.
__node
.
setGauss
(
self
.
__comp
,
complex
(
value
)
)
@property
def
qy
(
self
):
return
self
.
__node
.
qy
@qy.setter
def
qy
(
self
,
value
):
self
.
__node
.
setGauss
(
self
.
__comp
,
self
.
qx
,
value
)
self
.
__node
.
setGauss
(
self
.
__comp
,
self
.
qx
,
complex
(
value
)
)
class
Component
(
object
)
:
def
__init__
(
self
,
name
):
...
...
This diff is collapsed.
Click to expand it.
pykat/node_network.py
+
5
−
4
View file @
2fecc0f6
...
...
@@ -9,6 +9,7 @@ import pykat.gui.graphics
import
pykat.exceptions
as
pkex
from
pykat.components
import
Component
from
pykat.detectors
import
Detector
from
pykat.utilities.optics.gaussian_beams
import
gauss_param
class
NodeNetwork
(
object
):
def
__init__
(
self
,
kat
):
...
...
@@ -241,11 +242,11 @@ class Node(object):
self
.
__q_comp
=
component
if
len
(
args
)
==
1
:
self
.
__q_x
=
args
[
0
]
self
.
__q_y
=
args
[
0
]
self
.
__q_x
=
gauss_param
(
q
=
args
[
0
]
)
self
.
__q_y
=
gauss_param
(
q
=
args
[
0
]
)
elif
len
(
args
)
==
2
:
self
.
__q_x
=
args
[
0
]
self
.
__q_y
=
args
[
1
]
self
.
__q_x
=
gauss_param
(
q
=
args
[
0
]
)
self
.
__q_y
=
gauss_param
(
q
=
args
[
1
]
)
else
:
raise
pkex
.
BasePyKatException
(
"
Must specify either 1 Gaussian beam parameter or 2 for astigmatic beams
"
)
...
...
This diff is collapsed.
Click to expand it.
pykat/utilities/optics/gaussian_beams.py
+
8
−
0
View file @
2fecc0f6
...
...
@@ -14,6 +14,7 @@ class gauss_param(object):
q = gauss_param(w0=w0, z=z)
q = gauss_param(z=z, zr=zr)
q = gauss_param(wz=wz, rc=rc)
q = gauss_param(q=a) # where a is a complex number
or change default wavelength and refractive index with:
...
...
@@ -27,6 +28,13 @@ class gauss_param(object):
if
len
(
args
)
==
1
:
self
.
__q
=
args
[
0
]
elif
len
(
kwargs
)
==
1
:
if
"
q
"
in
kwargs
:
self
.
__q
=
complex
(
kwargs
[
"
q
"
])
else
:
raise
pkex
.
BasePyKatException
(
"
Must specify: z and w0 or z and zr or rc and wz, to define the beam parameter
"
)
elif
len
(
kwargs
)
==
2
:
if
"
w0
"
in
kwargs
and
"
z
"
in
kwargs
:
...
...
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