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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
finesse
pykat
Commits
ba0eeadb
Commit
ba0eeadb
authored
9 years ago
by
Daniel Toyra
Browse files
Options
Downloads
Patches
Plain Diff
Added instance variable notNan to the class surfacemap.
parent
e6b55c96
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pykat/optics/maps.py
+32
-6
32 additions, 6 deletions
pykat/optics/maps.py
with
32 additions
and
6 deletions
pykat/optics/maps.py
+
32
−
6
View file @
ba0eeadb
...
...
@@ -37,13 +37,14 @@ class MirrorROQWeights:
if
self
.
tBack
is
not
None
:
self
.
tBack
.
writeToFile
(
f
=
f
)
class
surfacemap
(
object
):
def
__init__
(
self
,
name
,
maptype
,
size
,
center
,
step_size
,
scaling
,
data
=
None
):
def
__init__
(
self
,
name
,
maptype
,
size
,
center
,
step_size
,
scaling
,
notNan
=
None
,
data
=
None
):
self
.
name
=
name
self
.
type
=
maptype
self
.
center
=
center
self
.
step_size
=
step_size
self
.
scaling
=
scaling
self
.
notNan
=
notNan
self
.
__interp
=
None
if
data
is
None
:
...
...
@@ -51,6 +52,11 @@ class surfacemap(object):
else
:
self
.
data
=
data
if
notNan
is
None
:
self
.
notNan
=
np
.
ones
(
size
)
else
:
self
.
notNan
=
notNan
self
.
_rom_weights
=
None
def
write_map
(
self
,
filename
):
...
...
@@ -360,6 +366,24 @@ class surfacemap(object):
return
fig
def
remove_curvature
(
self
,
Rc0
,
w
=
0
,
display
=
'
off
'
):
# Removes curvature from mirror map by fitting a sphere to
# mirror surface. Based on the file
# 'FT_remove_curvature_from_mirror_map.m'.
# Rc0 - Initial guess of the radius of curvature
# w - Beam radius on mirror [m], used for weighting. w=0
# switches off weighting.
# display - Display mode of the fitting routine. Can be 'off',
# 'iter', 'notify', or 'final'.
zOffset
=
self
.
data
[
round
(
self
.
center
[
1
]),
round
(
self
.
center
[
0
])]
params
=
Rc
print
(
zOffset
)
return
0
class
mergedmap
:
"""
A merged map combines multiple surfaces map to form one. Such a map can be used
...
...
@@ -697,10 +721,13 @@ class zernikemap(surfacemap):
self
.
data
=
data
# Reads surface map files and return surfacemap-object.
# supported mapFormat: 'finesse', 'ligo', 'zygo'.
# All ascii formats.
def
read_map
(
filename
,
mapFormat
=
'
finesse
'
):
# Function turning input x into float.
g
=
lambda
x
:
float
(
x
)
if
mapFormat
==
'
finesse
'
:
with
open
(
filename
,
'
r
'
)
as
f
:
...
...
@@ -717,7 +744,6 @@ def read_map(filename, mapFormat='finesse'):
data
=
np
.
loadtxt
(
filename
,
dtype
=
np
.
float64
,
ndmin
=
2
,
comments
=
'
%
'
)
# Converts raw zygo and ligo mirror maps to the finesse
# format. Based on translation of the matlab scripts
# 'FT_read_zygo_map.m' and 'FT_read_ligo_map.m'
...
...
@@ -931,13 +957,13 @@ def read_map(filename, mapFormat='finesse'):
data
[
isNan
]
=
0
# TODO: Add options for reading .xyz-zygo and virgo maps.
# TODO: Add options for reading virgo maps, and .xyz zygo
# maps (need .xys file for this). Binary ligo-maps?
# The intensity data is not used to anything here. Remove
# or add to pykat?
return
surfacemap
(
name
,
maptype
,
size
,
center
,
step
,
scaling
,
data
)
scaling
,
notNan
,
data
)
...
...
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