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
Snippets
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
Sean Leavey
pykat
Commits
827bd529
Commit
827bd529
authored
9 years ago
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
starting to fix aligo fft example
parent
bdb772ad
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/aligo/FFT_ArmCavity_precompute.py
+34
-4
34 additions, 4 deletions
examples/aligo/FFT_ArmCavity_precompute.py
with
34 additions
and
4 deletions
examples/aligo/FFT_ArmCavity_precompute.py
+
34
−
4
View file @
827bd529
...
@@ -13,12 +13,11 @@ import pylab as pl
...
@@ -13,12 +13,11 @@ import pylab as pl
import
pykat
import
pykat
from
pykat.components
import
*
from
pykat.components
import
*
from
pykat.utilities.plotting.tools
import
printPDF
from
pykat.external.progressbar
import
ProgressBar
,
ETA
,
Percentage
,
Bar
,
Timer
from
pykat.external.progressbar
import
ProgressBar
,
ETA
,
Percentage
,
Bar
,
Timer
from
pykat.optics.maps
import
*
from
pykat.optics.maps
import
*
from
pykat.optics.gaussian_beams
import
HG_beam
,
beam_param
from
pykat.optics.gaussian_beams
import
HG_beam
,
beam_param
from
pykat.optics.fft
import
*
from
pykat.optics.fft
import
*
from
pykat.
utilitie
s.plotting.tools
import
plot_field
,
plot_propagation
#
from pykat.
tool
s.plotting.tools import plot_field, plot_propagation
from
aligo
import
*
from
aligo
import
*
...
@@ -67,8 +66,8 @@ def main():
...
@@ -67,8 +66,8 @@ def main():
LX
=
kat
.
LX
.
L
.
value
LX
=
kat
.
LX
.
L
.
value
kat
.
maxtem
=
0
kat
.
maxtem
=
0
out
=
kat
.
run
()
out
=
kat
.
run
()
w0
=
out
.
y
[
0
]
w0
=
out
.
y
[
0
]
[
0
]
z0
=-
out
.
y
[
1
]
z0
=-
out
.
y
[
0
][
1
]
# load and create mirror maps
# load and create mirror maps
global
itm
,
etm
global
itm
,
etm
...
@@ -166,6 +165,37 @@ def FFT_apply_map(field, Map, Lambda):
...
@@ -166,6 +165,37 @@ def FFT_apply_map(field, Map, Lambda):
k
=
2.0
*
np
.
pi
/
Lambda
k
=
2.0
*
np
.
pi
/
Lambda
return
field
*
np
.
exp
(
-
1j
*
2.0
*
k
*
Map
.
data
*
Map
.
scaling
);
return
field
*
np
.
exp
(
-
1j
*
2.0
*
k
*
Map
.
data
*
Map
.
scaling
);
def
plot_field
(
field
):
ax
,
fig
=
plot_setup
()
im
=
ax
.
imshow
(
np
.
abs
(
field
),
origin
=
'
lower
'
,
aspect
=
'
auto
'
)
cb
=
fig
.
colorbar
(
im
,
format
=
"
%.4g
"
)
#cb.set_clim(-1.0*zlimit, zlimit)
ax
.
autoscale
(
False
)
#
plt
.
show
(
block
=
0
)
def
plot_propagation
(
field
,
grid
,
Lambda
,
axis
,
normalise
,
Lrange
,
nr
):
# axis = 0 for x and =1 for y crosssection
# if normalise = 1, each slice is normalises to peak intensity
[
n
,
m
]
=
field
.
shape
slices
=
np
.
zeros
((
n
,
np
.
size
(
Lrange
)))
from
pykat.optics.fft
import
FFT_propagate
for
idx
,
L
in
enumerate
(
Lrange
):
field2
=
FFT_propagate
(
field
,
grid
,
Lambda
,
L
,
nr
)
if
axis
==
0
:
slices
[:,
idx
]
=
np
.
abs
(
field2
[:,
int
(
m
/
2
)])
**
2
else
:
slices
[:,
idx
]
=
np
.
abs
(
field2
[
int
(
n
/
2
),:])
**
2
if
normalise
==
1
:
peak_intensity
=
np
.
abs
(
field2
[
int
(
n
/
2
),
int
(
m
/
2
)])
**
2
slices
[:,
idx
]
=
slices
[:,
idx
]
/
peak_intensity
ax
,
fig
=
plot_setup
()
im
=
ax
.
imshow
(
slices
,
aspect
=
'
auto
'
)
cb
=
fig
.
colorbar
(
im
,
format
=
"
%.4g
"
)
#cb.set_clim(-1.0*zlimit, zlimit)
ax
.
autoscale
(
False
)
plt
.
show
(
block
=
0
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
main
()
main
()
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