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
04903640
Commit
04903640
authored
10 years ago
by
Daniel Brown
Browse files
Options
Downloads
Patches
Plain Diff
fixes to Rc computations and romhom
parent
2e7128a4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pykat/utilities/maps.py
+61
-8
61 additions, 8 deletions
pykat/utilities/maps.py
pykat/utilities/optics/gaussian_beams.py
+1
-1
1 addition, 1 deletion
pykat/utilities/optics/gaussian_beams.py
with
62 additions
and
9 deletions
pykat/utilities/maps.py
+
61
−
8
View file @
04903640
...
@@ -56,11 +56,24 @@ class surfacemap(object):
...
@@ -56,11 +56,24 @@ class surfacemap(object):
def
ROMWeights
(
self
):
def
ROMWeights
(
self
):
return
self
.
_rom_weights
return
self
.
_rom_weights
def
z_xy
(
self
,
wavelength
=
1064e-9
):
def
z_xy
(
self
,
wavelength
=
1064e-9
,
direction
=
"
reflection
"
,
nr1
=
1.0
,
nr2
=
1.0
):
if
direction
==
"
reflection
"
:
if
"
phase
"
in
self
.
type
:
if
"
phase
"
in
self
.
type
:
k
=
math
.
pi
*
2
/
wavelength
k
=
math
.
pi
*
2
/
wavelength
return
np
.
exp
(
2j
*
k
*
self
.
scaling
*
self
.
data
)
return
np
.
exp
(
2j
*
k
*
self
.
scaling
*
self
.
data
)
elif
"
absorption
"
in
self
.
type
:
return
np
.
sqrt
(
1.0
-
self
.
scaling
*
self
.
data
)
else
:
raise
BasePyKatException
(
"
Map type needs handling
"
)
elif
direction
==
"
transmission
"
:
if
"
phase
"
in
self
.
type
:
k
=
math
.
pi
*
2
/
wavelength
return
np
.
exp
((
nr1
-
nr2
)
*
k
*
self
.
scaling
*
self
.
data
)
elif
"
absorption
"
in
self
.
type
:
return
np
.
sqrt
(
1.0
-
self
.
scaling
*
self
.
data
)
else
:
raise
BasePyKatException
(
"
Map type needs handling
"
)
else
:
else
:
raise
BasePyKatException
(
"
Map type needs handling
"
)
raise
BasePyKatException
(
"
Map type needs handling
"
)
...
@@ -144,11 +157,51 @@ class surfacemap(object):
...
@@ -144,11 +157,51 @@ class surfacemap(object):
return
fig
return
fig
class
aperturemap
(
surfacemap
):
def
__init__
(
self
,
name
,
size
,
step_size
,
R
):
surfacemap
.
__init__
(
self
,
name
,
"
absorption both
"
,
size
,
(
np
.
array
(
size
)
+
1
)
/
2.0
,
step_size
,
1
)
self
.
R
=
R
@property
def
R
(
self
):
return
self
.
__R
@R.setter
def
R
(
self
,
value
):
self
.
__R
=
value
xx
,
yy
=
np
.
meshgrid
(
self
.
x
,
self
.
y
)
radius
=
np
.
sqrt
(
xx
**
2
+
yy
**
2
)
self
.
data
=
np
.
zeros
(
self
.
size
)
self
.
data
[
radius
>
self
.
R
]
=
1.0
class
curvedmap
(
surfacemap
):
def
__init__
(
self
,
name
,
size
,
step_size
,
Rc
):
surfacemap
.
__init__
(
self
,
name
,
"
phase reflection
"
,
size
,
(
np
.
array
(
size
)
+
1
)
/
2.0
,
step_size
,
1e-6
)
self
.
Rc
=
Rc
@property
def
Rc
(
self
):
return
self
.
__Rc
@Rc.setter
def
Rc
(
self
,
value
):
self
.
__Rc
=
value
xx
,
yy
=
np
.
meshgrid
(
self
.
x
,
self
.
y
)
Rsq
=
xx
**
2
+
yy
**
2
self
.
data
=
(
self
.
Rc
-
math
.
copysign
(
1.0
,
self
.
Rc
)
*
np
.
sqrt
(
self
.
Rc
**
2
-
Rsq
))
/
self
.
scaling
class
tiltmap
(
surfacemap
):
class
tiltmap
(
surfacemap
):
def
__init__
(
self
,
name
,
size
,
step_size
,
tilt
):
def
__init__
(
self
,
name
,
size
,
step_size
,
tilt
):
surfacemap
.
__init__
(
self
,
name
,
"
phase
"
,
size
,
(
np
.
array
(
size
)
+
1
)
/
2.0
,
step_size
,
1
)
surfacemap
.
__init__
(
self
,
name
,
"
phase
"
,
size
,
(
np
.
array
(
size
)
+
1
)
/
2.0
,
step_size
,
1
e-9
)
self
.
tilt
=
tilt
self
.
tilt
=
tilt
@property
@property
...
@@ -161,7 +214,7 @@ class tiltmap(surfacemap):
...
@@ -161,7 +214,7 @@ class tiltmap(surfacemap):
xx
,
yy
=
np
.
meshgrid
(
self
.
x
,
self
.
y
)
xx
,
yy
=
np
.
meshgrid
(
self
.
x
,
self
.
y
)
self
.
data
=
xx
*
self
.
tilt
[
1
]
+
yy
*
self
.
tilt
[
0
]
self
.
data
=
(
xx
*
self
.
tilt
[
1
]
+
yy
*
self
.
tilt
[
0
]
)
/
self
.
scaling
...
...
This diff is collapsed.
Click to expand it.
pykat/utilities/optics/gaussian_beams.py
+
1
−
1
View file @
04903640
...
@@ -140,7 +140,7 @@ class gauss_param(object):
...
@@ -140,7 +140,7 @@ class gauss_param(object):
@property
@property
def
Rc
(
self
):
def
Rc
(
self
):
if
self
.
__q
.
real
!=
0
:
if
self
.
__q
.
real
!=
0
:
return
abs
(
self
.
__q
)
/
self
.
__q
.
real
return
self
.
z
*
(
1
+
(
self
.
zr
/
self
.
z
)
**
2
)
else
:
else
:
return
float
(
"
inf
"
)
return
float
(
"
inf
"
)
...
...
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