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
18b805c2
There was a problem fetching the pipeline summary.
Commit
18b805c2
authored
Apr 4, 2017
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
changing one more method to function
parent
d612ed3d
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pykat/gw_detectors/ifo.py
+17
-16
17 additions, 16 deletions
pykat/gw_detectors/ifo.py
with
17 additions
and
16 deletions
pykat/gw_detectors/ifo.py
+
17
−
16
View file @
18b805c2
...
@@ -59,10 +59,7 @@ class aLIGO(object):
...
@@ -59,10 +59,7 @@ class aLIGO(object):
self
.
kat
.
loadKatFile
(
katfile
)
self
.
kat
.
loadKatFile
(
katfile
)
self
.
rawBlocks
.
read
(
katfile
)
self
.
rawBlocks
.
read
(
katfile
)
else
:
else
:
"""
# TODO different files not yet implemented
if _name not in names: # TODO different files not yet implemented
printf(
"
aLIGO name `{}
'
not recognised, must be
'
default
'
,
'
LLO
'
or
'
LHO
'"
,_name)
"""
if
_name
!=
"
default
"
:
if
_name
!=
"
default
"
:
printf
(
"
aLIGO name `{}
'
not recognised, using
'
default
'"
,
_name
)
printf
(
"
aLIGO name `{}
'
not recognised, using
'
default
'"
,
_name
)
self
.
kat
.
loadKatFile
(
self
.
_data_path
+
"
aLIGO.kat
"
)
self
.
kat
.
loadKatFile
(
self
.
_data_path
+
"
aLIGO.kat
"
)
...
@@ -264,7 +261,7 @@ put f1m f $mx1
...
@@ -264,7 +261,7 @@ put f1m f $mx1
make_transparent
(
kat1
,[
"
PRM
"
,
"
SRM
"
])
make_transparent
(
kat1
,[
"
PRM
"
,
"
SRM
"
])
make_transparent
(
kat1
,[
"
ITMY
"
,
"
ETMY
"
])
make_transparent
(
kat1
,[
"
ITMY
"
,
"
ETMY
"
])
kat1
.
BS
.
setRTL
(
0.0
,
1.0
,
0.0
)
# set BS refl. for X arm
kat1
.
BS
.
setRTL
(
0.0
,
1.0
,
0.0
)
# set BS refl. for X arm
phi
,
precision
=
self
.
scan_to_precision
(
kat1
,
self
.
preARMX
,
pretune_precision
)
phi
,
precision
=
scan_to_precision
(
kat1
,
self
.
preARMX
,
pretune_precision
)
phi
=
round
(
phi
/
pretune_precision
)
*
pretune_precision
phi
=
round
(
phi
/
pretune_precision
)
*
pretune_precision
phi
=
round_to_n
(
phi
,
5
)
phi
=
round_to_n
(
phi
,
5
)
vprint
(
verbose
,
"
found max/min at: {} (precision = {:2g})
"
.
format
(
phi
,
precision
))
vprint
(
verbose
,
"
found max/min at: {} (precision = {:2g})
"
.
format
(
phi
,
precision
))
...
@@ -275,7 +272,7 @@ put f1m f $mx1
...
@@ -275,7 +272,7 @@ put f1m f $mx1
make_transparent
(
kat
,[
"
PRM
"
,
"
SRM
"
])
make_transparent
(
kat
,[
"
PRM
"
,
"
SRM
"
])
make_transparent
(
kat
,[
"
ITMX
"
,
"
ETMX
"
])
make_transparent
(
kat
,[
"
ITMX
"
,
"
ETMX
"
])
kat
.
BS
.
setRTL
(
1.0
,
0.0
,
0.0
)
# set BS refl. for Y arm
kat
.
BS
.
setRTL
(
1.0
,
0.0
,
0.0
)
# set BS refl. for Y arm
phi
,
precision
=
self
.
scan_to_precision
(
kat
,
self
.
preARMY
,
pretune_precision
)
phi
,
precision
=
scan_to_precision
(
kat
,
self
.
preARMY
,
pretune_precision
)
phi
=
round
(
phi
/
pretune_precision
)
*
pretune_precision
phi
=
round
(
phi
/
pretune_precision
)
*
pretune_precision
phi
=
round_to_n
(
phi
,
5
)
phi
=
round_to_n
(
phi
,
5
)
vprint
(
verbose
,
"
found max/min at: {} (precision = {:2g})
"
.
format
(
phi
,
precision
))
vprint
(
verbose
,
"
found max/min at: {} (precision = {:2g})
"
.
format
(
phi
,
precision
))
...
@@ -284,7 +281,7 @@ put f1m f $mx1
...
@@ -284,7 +281,7 @@ put f1m f $mx1
vprint
(
verbose
,
"
scanning MICH (minimising power)
"
)
vprint
(
verbose
,
"
scanning MICH (minimising power)
"
)
kat
=
_kat
.
deepcopy
()
kat
=
_kat
.
deepcopy
()
make_transparent
(
kat
,[
"
PRM
"
,
"
SRM
"
])
make_transparent
(
kat
,[
"
PRM
"
,
"
SRM
"
])
phi
,
precision
=
self
.
scan_to_precision
(
kat
,
self
.
preMICH
,
pretune_precision
,
minmax
=
"
min
"
,
precision
=
30.0
)
phi
,
precision
=
scan_to_precision
(
kat
,
self
.
preMICH
,
pretune_precision
,
minmax
=
"
min
"
,
precision
=
30.0
)
phi
=
round
(
phi
/
pretune_precision
)
*
pretune_precision
phi
=
round
(
phi
/
pretune_precision
)
*
pretune_precision
phi
=
round_to_n
(
phi
,
5
)
phi
=
round_to_n
(
phi
,
5
)
vprint
(
verbose
,
"
found max/min at: {} (precision = {:2g})
"
.
format
(
phi
,
precision
))
vprint
(
verbose
,
"
found max/min at: {} (precision = {:2g})
"
.
format
(
phi
,
precision
))
...
@@ -293,7 +290,7 @@ put f1m f $mx1
...
@@ -293,7 +290,7 @@ put f1m f $mx1
vprint
(
verbose
,
"
scanning PRCL (maximising power)
"
)
vprint
(
verbose
,
"
scanning PRCL (maximising power)
"
)
kat
=
_kat
.
deepcopy
()
kat
=
_kat
.
deepcopy
()
make_transparent
(
kat
,[
"
SRM
"
])
make_transparent
(
kat
,[
"
SRM
"
])
phi
,
precision
=
self
.
scan_to_precision
(
kat
,
self
.
prePRCL
,
pretune_precision
)
phi
,
precision
=
scan_to_precision
(
kat
,
self
.
prePRCL
,
pretune_precision
)
phi
=
round
(
phi
/
pretune_precision
)
*
pretune_precision
phi
=
round
(
phi
/
pretune_precision
)
*
pretune_precision
phi
=
round_to_n
(
phi
,
5
)
phi
=
round_to_n
(
phi
,
5
)
vprint
(
verbose
,
"
found max/min at: {} (precision = {:2g})
"
.
format
(
phi
,
precision
))
vprint
(
verbose
,
"
found max/min at: {} (precision = {:2g})
"
.
format
(
phi
,
precision
))
...
@@ -301,20 +298,13 @@ put f1m f $mx1
...
@@ -301,20 +298,13 @@ put f1m f $mx1
vprint
(
verbose
,
"
scanning SRCL (maximising carrier power, then adding 90 deg)
"
)
vprint
(
verbose
,
"
scanning SRCL (maximising carrier power, then adding 90 deg)
"
)
kat
=
_kat
.
deepcopy
()
kat
=
_kat
.
deepcopy
()
phi
,
precision
=
self
.
scan_to_precision
(
kat
,
self
.
preSRCL
,
pretune_precision
,
phi
=
0
)
phi
,
precision
=
scan_to_precision
(
kat
,
self
.
preSRCL
,
pretune_precision
,
phi
=
0
)
phi
=
round
(
phi
/
pretune_precision
)
*
pretune_precision
phi
=
round
(
phi
/
pretune_precision
)
*
pretune_precision
phi
=
round_to_n
(
phi
,
4
)
-
90.0
phi
=
round_to_n
(
phi
,
4
)
-
90.0
vprint
(
verbose
,
"
found max/min at: {} (precision = {:2g})
"
.
format
(
phi
,
precision
))
vprint
(
verbose
,
"
found max/min at: {} (precision = {:2g})
"
.
format
(
phi
,
precision
))
self
.
preSRCL
.
apply_tuning
(
_kat
,
phi
)
self
.
preSRCL
.
apply_tuning
(
_kat
,
phi
)
print
(
"
... done
"
)
print
(
"
... done
"
)
def
scan_to_precision
(
self
,
kat
,
DOF
,
pretune_precision
,
minmax
=
"
max
"
,
phi
=
0.0
,
precision
=
60.0
):
while
precision
>
pretune_precision
*
DOF
.
scale
:
out
=
scan_DOF
(
kat
,
DOF
,
xlimits
=
[
phi
-
1.5
*
precision
,
phi
+
1.5
*
precision
])
phi
,
precision
=
find_peak
(
out
,
DOF
.
port
.
portName
,
minmax
=
minmax
)
#print("** phi= {}".format(phi))
return
phi
,
precision
def
pretune_status
(
self
,
_kat
):
def
pretune_status
(
self
,
_kat
):
kat
=
_kat
.
deepcopy
()
kat
=
_kat
.
deepcopy
()
kat
.
verbose
=
False
kat
.
verbose
=
False
...
@@ -929,6 +919,17 @@ def set_tunings(kat, tunings):
...
@@ -929,6 +919,17 @@ def set_tunings(kat, tunings):
for
comp
in
keys
:
for
comp
in
keys
:
kat
.
components
[
comp
].
phi
=
tunings
[
comp
]
kat
.
components
[
comp
].
phi
=
tunings
[
comp
]
def
scan_to_precision
(
kat
,
DOF
,
pretune_precision
,
minmax
=
"
max
"
,
phi
=
0.0
,
precision
=
60.0
):
"""
find a maximum or minimum in a DOF within a given range
"""
while
precision
>
pretune_precision
*
DOF
.
scale
:
out
=
scan_DOF
(
kat
,
DOF
,
xlimits
=
[
phi
-
1.5
*
precision
,
phi
+
1.5
*
precision
])
phi
,
precision
=
find_peak
(
out
,
DOF
.
port
.
portName
,
minmax
=
minmax
)
#print("** phi= {}".format(phi))
return
phi
,
precision
def
scan_optics_string
(
_optics
,
_factors
,
_varName
,
linlog
=
"
lin
"
,
xlimits
=
[
-
100
,
100
],
steps
=
200
,
axis
=
1
,
relative
=
False
):
def
scan_optics_string
(
_optics
,
_factors
,
_varName
,
linlog
=
"
lin
"
,
xlimits
=
[
-
100
,
100
],
steps
=
200
,
axis
=
1
,
relative
=
False
):
optics
=
make_list_copy
(
_optics
)
optics
=
make_list_copy
(
_optics
)
factors
=
make_list_copy
(
_factors
)
factors
=
make_list_copy
(
_factors
)
...
...
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