Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aligo_finesse
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
finesse
aligo_finesse
Commits
1bd94e77
Commit
1bd94e77
authored
8 years ago
by
Anna Green
Browse files
Options
Downloads
Patches
Plain Diff
adapted tools from ifo.py to plot error signals and test locks in variable configurations
parent
e821ae22
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
playground/anna/PI_paper/kat_files/tune.py
+24
-38
24 additions, 38 deletions
playground/anna/PI_paper/kat_files/tune.py
playground/anna/PI_paper/kat_files/tune_tools.py
+62
-25
62 additions, 25 deletions
playground/anna/PI_paper/kat_files/tune_tools.py
with
86 additions
and
63 deletions
playground/anna/PI_paper/kat_files/tune.py
+
24
−
38
View file @
1bd94e77
from
pykat
import
finesse
from
pykat.commands
import
*
import
pykat.gw_detectors.ifo
as
ifo
import
matplotlib.pyplot
as
plt
from
tune_tools
import
*
def
main
():
########################
katfile
=
"
DRMi
"
########################
# LIGO1 = ifo.aLIGO(debug=True)
LIGO1
=
ifo
.
aLIGO
(
debug
=
True
)
kat
=
finesse
.
kat
()
kat
.
verbose
=
False
kat
.
loadKatFile
(
"
raw/PI-
"
+
katfile
+
"
.kat
"
)
#locks fail. compare to original aLIGO kat.
########################
katfile
=
"
DRMi
"
kat
.
loadKatFile
(
"
raw/PI-
"
+
katfile
+
"
.kat
"
)
# kat = LIGO1.kat
########################
kat
.
maxtem
=
0
#'off'
kat
.
phase
=
2
kat
.
ETMX
.
mass
=
1e9
#necessary for lock drags to work...
kat
.
ETMY
.
mass
=
1e9
kat
.
ITMX
.
mass
=
1e9
kat
.
ITMY
.
mass
=
1e9
################ make locks ####################
DRkat
=
DRMi_tuning
(
kat
)
# print(DRkat)
kat
.
maxtem
=
'
off
'
#0
kat
.
phase
=
2
################################################
################# test #####################
DRkat
=
DRMi_tuning
(
kat
,
debug
=
True
)
#locks fail. compare to testLIGO.
print
(
DRkat
)
# kat.verbose=True
dofs
=
[
LIGO1
.
DARM
,
LIGO1
.
CARM
,
LIGO1
.
PRCL
,
LIGO1
.
SRCL
,
LIGO1
.
MICH
]
plot_errs
(
DRkat
,
dofs
,
xlimits
=
[
-
1e-2
,
1e-2
])
## make own of these so not stuck with DRMi and locked
LIGO1
.
plot_error_signals
(
DRkat
,
xlimits
=
[
-
1e-2
,
1e-2
])
locks
=
[
"
ETMX_lock
"
,
"
ETMY_lock
"
,
"
PRCL_lock
"
,
"
MICH_lock
"
,
"
ITMY_lock
"
,
"
SRCL_lock
"
]
test_locks
(
DRkat
,
locks
)
test_locks
(
DRkat
,
locks
,
PRC
=
True
)
#################
#########
######################
#################
save
######################
# kat.saveScript("tuned/PI-"+katfile+".kat")
def
test_locks
(
_kat
,
locks
):
kat
=
_kat
.
deepcopy
()
# test lock with BS tuning
code
=
"""
xaxis BS phi lin 0 2 100
yaxis abs
#showiterate -1
"""
kat
.
parseCommands
(
code
)
out
=
kat
.
run
()
plt
.
figure
()
ifo
.
make_list_copy
(
locks
)
for
l
in
locks
:
plt
.
plot
(
out
.
x
,
out
[
l
],
label
=
l
)
plt
.
legend
()
plt
.
show
()
# check f1 resonance in PRC
kat
=
_kat
.
deepcopy
()
LIGO1
.
check_f1_PRC_resonance
(
kat
)
END
=
input
(
'
press enter to finish and close all plots
'
)
#to override auto-closing.
if
__name__
==
'
__main__
'
:
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
playground/anna/PI_paper/kat_files/tune_tools.py
+
62
−
25
View file @
1bd94e77
...
...
@@ -4,6 +4,7 @@ from __future__ import print_function
from
__future__
import
unicode_literals
import
matplotlib.pyplot
as
plt
from
matplotlib.ticker
import
FormatStrFormatter
import
numpy
as
np
from
pykat
import
finesse
...
...
@@ -12,12 +13,67 @@ import pykat.gw_detectors.ifo as ifo
LIGO1
=
ifo
.
aLIGO
(
debug
=
True
)
def
DRMi_tuning
(
_kat
,
debug
=
False
):
# simplified from Andreas' TestLIGO file
def
plot_errs
(
_kat
,
dofs
=
[
LIGO1
.
DARM
,
LIGO1
.
CARM
,
LIGO1
.
PRCL
,
LIGO1
.
SRCL
,
LIGO1
.
MICH
],
xlimits
=
[
-
1
,
1
]):
#based on ifo.py, adapted to select dofs
kat
=
_kat
.
deepcopy
()
kat
.
verbose
=
False
kat
.
noxaxis
=
True
#remove the lock block if it's present
BlockList
=
kat
.
_kat__blocks
if
'
locks
'
in
BlockList
:
kat
.
removeBlock
(
'
locks
'
)
if
'
errsigs
'
in
BlockList
:
kat
.
removeBlock
(
'
errsigs
'
)
if
'
powers
'
in
BlockList
:
kat
.
removeBlock
(
'
powers
'
)
#plotting
w
=
int
((
len
(
dofs
)
+
1
)
/
2
)
#make figure of nice size for number of dofs:
idx
=
1
fig
=
plt
.
figure
()
for
d
in
dofs
:
ax
=
fig
.
add_subplot
(
w
,
2
,
idx
)
idx
+=
1
out
=
ifo
.
scan_DOF
(
kat
,
d
,
xlimits
=
np
.
multiply
(
d
.
scale
,
xlimits
),
relative
=
True
)
ax
.
plot
(
out
.
x
,
out
[
d
.
signal_name
(
kat
)])
ax
.
set_xlim
([
np
.
min
(
out
.
x
),
np
.
max
(
out
.
x
)])
ax
.
set_xlabel
(
"
{} [deg]
"
.
format
(
d
.
name
))
ax
.
set_ylabel
(
'
{} [W]
'
.
format
(
d
.
port
.
name
))
ax
.
grid
()
plt
.
tight_layout
()
plt
.
show
(
block
=
0
)
def
test_locks
(
_kat
,
locks
,
PRC
=
False
):
# separated from DRMi_tuning
kat
=
_kat
.
deepcopy
()
if
PRC
==
True
:
# check f1 resonance in PRC
kat
=
_kat
.
deepcopy
()
LIGO1
.
check_f1_PRC_resonance
(
kat
)
# test lock with BS tuning
code
=
"""
xaxis BS phi lin 0 2 100
yaxis abs
#showiterate -1
"""
kat
.
parseCommands
(
code
)
out
=
kat
.
run
()
plt
.
figure
()
ifo
.
make_list_copy
(
locks
)
for
l
in
locks
:
plt
.
plot
(
out
.
x
,
out
[
l
],
label
=
l
)
plt
.
legend
()
plt
.
show
(
block
=
0
)
def
DRMi_tuning
(
_kat
):
# edited from Andreas' TestLIGO file
kat
=
_kat
.
deepcopy
()
BlockList
=
kat
.
_kat__blocks
if
'
locks
'
in
BlockList
:
kat
.
removeBlock
(
'
locks
'
)
if
'
errsigs
'
in
BlockList
:
kat
.
removeBlock
(
'
errsigs
'
)
if
'
powers
'
in
BlockList
:
kat
.
removeBlock
(
'
powers
'
)
#pretuning and DC offset
pretune
(
kat
,
verbose
=
True
,
debug
=
False
)
...
...
@@ -25,32 +81,13 @@ def DRMi_tuning(_kat,debug=False):
LIGO1
.
lengths_status
(
kat
)
DCoffset
=
20e-12
/
kat
.
lambda0
*
180.0
# 20 pm
LIGO1
.
set_DC_offset
(
kat
,
DCoffset
=
DCoffset
,
verbose
=
True
)
LIGO1
.
plot_error_signals
(
kat
,
xlimits
=
[
-
1e-2
,
1e-2
])
#
LIGO1.plot_error_signals(kat, xlimits=[-1e-2, 1e-2])
#locks
kat_lock
=
prepare_locks
(
kat
,
verbose
=
True
)
kat_lock
.
noxaxis
=
True
kat_lock
.
verbose
=
True
out
=
kat_lock
.
run
()
LIGO1
.
apply_lock_feedback
(
kat_lock
,
out
)
if
debug
==
True
:
kat_check
=
kat_lock
.
deepcopy
()
# test lock with BS tuning
code
=
"""
xaxis BS phi lin 0 2 100
yaxis abs
#showiterate -1
"""
kat_check
.
parseCommands
(
code
)
out
=
kat_check
.
run
()
plt
.
figure
()
locks
=
[
"
ETMX_lock
"
,
"
ETMY_lock
"
,
"
PRCL_lock
"
,
"
MICH_lock
"
,
"
ITMY_lock
"
,
"
SRCL_lock
"
]
for
l
in
locks
:
plt
.
plot
(
out
.
x
,
out
[
l
],
label
=
l
)
plt
.
legend
()
plt
.
show
()
# check f1 resonance in PRC
kat_check
=
kat_lock
.
deepcopy
()
LIGO1
.
check_f1_PRC_resonance
(
kat_check
)
return
kat_lock
def
pretune
(
kat
,
verbose
=
False
,
debug
=
False
):
...
...
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