Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
finesse
pykat
Commits
48be2d1b
Commit
48be2d1b
authored
Aug 07, 2015
by
Daniel Toyra
Browse files
More surface map stuff
parent
450ce175
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
pykat/maths/zernike.py
View file @
48be2d1b
...
...
@@ -46,13 +46,13 @@ def znm2Rc(A,R):
minimum curvature.
Inputs: A, R
A - List of amplitudes f
or
order 2 Zernike polynomials, ordered so that m
A - List of amplitudes
o
f order 2 Zernike polynomials, ordered so that m
increases with list index. 1 <= len(A) <= 3. [m]
R - Radius of the mirror surface in the xy-plane. [m]
Returns: Rc
Rc - If astigmatic modes are used (len(A) == 2 or 3) a numpy.array of length
2 containing m
in
and m
ax
curvatures is returned. If only the 'defocus'
2 containing m
ax
and m
in
curvatures is returned. If only the 'defocus'
mode is used Rc is a float number. [m]
Based on the Simtools function 'FT_Znm_to_Rc.m' by Charlotte Bond.
...
...
@@ -79,3 +79,33 @@ def znm2Rc(A,R):
Rc
=
((
2
*
a20
+
s
*
a22
)
**
2
+
R
**
2
)
/
(
2
*
(
2
*
a20
+
s
*
a22
))
return
Rc
def
Rc2znm
(
Rc
,
R
):
'''
Converts Radius of curvatue to amplitudes of the second order Zernike
polynomials.
Iputs: Rc, R
Rc - Radius of curvature. Either a number or a numpy.ndarray with
minimum and maximum curvature.
R - Radius of mirror in xy-plane.
Returns: A
A - Ampltude(s) of the second order Zernike polynomials needed. Is
a number if Rc is a number, and if R is a numpy.ndarray so is A.
Based on Simtools function 'FT_Rc_to_Znm.m' by Charlotte Bond.
'''
# Amplitude in x and y directions
c
=
(
Rc
-
np
.
sign
(
Rc
)
*
np
.
sqrt
(
Rc
**
2
-
R
**
2
)
)
/
2
if
isinstance
(
Rc
,
np
.
ndarray
):
A
=
np
.
array
([])
# Adding Z(2,0) amplitude
A
=
np
.
append
(
A
,
c
.
mean
())
# Adding Z(2,2) amplitude
A
=
np
.
append
(
A
,
2
*
(
c
[
0
]
-
A
[
0
]))
elif
isinstance
(
Rc
,
float
)
or
isinstance
(
Rc
,
int
):
A
=
c
return
A
pykat/optics/maps.py
View file @
48be2d1b
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment