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
84ac1ea0
Commit
84ac1ea0
authored
10 years ago
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
adding a different version of FFT propgagation for texting
parent
c390d826
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
pykat/optics/fft.py
+26
-0
26 additions, 0 deletions
pykat/optics/fft.py
with
26 additions
and
0 deletions
pykat/optics/fft.py
+
26
−
0
View file @
84ac1ea0
...
...
@@ -37,6 +37,32 @@ def FFT_propagate(field, grid, Lambda, distance, nr):
return
field
def
FFT_propagate_simple
(
field
,
xpoints
,
ypoints
,
xstep
,
ystep
,
Lambda
,
distance
,
nr
):
# FFT propagation code
# - xpoints, xsize give the number of points and physical size of one
# tile in the grid on which the field is defined along the xaxis.
# ypoints, ysize do the same for the yaxis.
# - field is the initial field E
# - distance is the ditance over which to propgagte in meters
# - Lambda is the vacuum wavelength, nr the index of refraction
k
=
2.0
*
np
.
pi
/
Lambda
*
nr
plD
=
np
.
pi
*
Lambda
*
distance
/
nr
# compute FFT axis vectors and compute propagator
f_x
=
np
.
fft
.
fftshift
(
np
.
fft
.
fftfreq
(
xpoints
)
/
xstep
)
f_y
=
np
.
fft
.
fftshift
(
np
.
fft
.
fftfreq
(
ypoints
)
/
ystep
)
F_x
,
F_y
=
np
.
meshgrid
(
f_x
,
f_y
)
f_r_squared
=
F_x
**
2
+
F_y
**
2
Kp
=
np
.
fft
.
fftshift
(
np
.
exp
(
1j
*
plD
*
f_r_squared
))
field
=
np
.
fft
.
fft2
(
field
)
# perform FFT
field
=
field
*
np
.
exp
(
-
1j
*
k
*
distance
)
*
Kp
# apply propagator
field
=
np
.
fft
.
ifft2
(
field
)
# perform reverse FFT
return
field
def
FFT_scale_propagate
(
field
,
grid0
,
grid1
,
Lambda
,
distance
,
w0
,
w1
,
nr
):
# FFT propagation code with an adaptive grid size.
# Propagates to a scaled coordinate system, see Virgo Book of
...
...
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