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
ab3919ea
Commit
ab3919ea
authored
8 years ago
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
improving pretuning script
parent
9ae075ec
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
playground/andreas/testLIGO/testLIGO.py
+39
-25
39 additions, 25 deletions
playground/andreas/testLIGO/testLIGO.py
with
39 additions
and
25 deletions
playground/andreas/testLIGO/testLIGO.py
+
39
−
25
View file @
ab3919ea
...
...
@@ -42,7 +42,7 @@ def main():
kat
.
ITMX
.
mass
=
1e9
kat
.
ITMY
.
mass
=
1e9
kat
.
verbose
=
False
kat
.
maxtem
=
"
off
"
kat
.
maxtem
=
4
#
"off"
kat
.
phase
=
2
#----------------------------------------------------------
...
...
@@ -62,20 +62,24 @@ def main():
LIGO1
.
plot_error_signals
(
kat
,
xlimits
=
[
-
1e-2
,
1e-2
])
#----------------------------------------------------------
"""
kat_lock
=
prepare_locks
(
kat
,
verbose
=
True
)
kat_lock
.
saveScript
(
"
locks.kat
"
)
"""
kat_lock = finesse.kat(tempdir=
"
.
"
,tempname=
"
test
"
)
kat_lock.verbose = False
kat_lock.loadKatFile(
"
locks.kat
"
)
# run once
"""
print
(
"
-----------------------------------------------------
"
)
print
(
"
run once:
"
)
kat_lock
.
noxaxis
=
True
kat_lock
.
verbose
=
True
out
=
kat_lock
.
run
()
LIGO1
.
apply_lock_feedback
(
kat_lock
,
out
)
LIGO1
.
apply_lock_feedback
(
kat
,
out
)
print
(
"
-----------------------------------------------------
"
)
print
(
"
test locks with BS:
"
)
kat_check
=
kat_lock
.
deepcopy
()
# test lock with BS tuning
code
=
"""
...
...
@@ -92,33 +96,43 @@ def main():
plt
.
legend
()
plt
.
show
()
# check f1 resonance in PRC
kat_check
=
kat_lock
.
deepcopy
()
LIGO1
.
check_f1_PRC_resonance
(
kat_check
)
print
(
"
-----------------------------------------------------
"
)
print
(
"
check f1 resonance in PRC
"
)
#kat_check = kat_lock.deepcopy()
#LIGO1.check_f1_PRC_resonance(kat_check)
print
(
"
-----------------------------------------------------
"
)
print
(
"
writing file
"
)
baseBlocks
=
LIGO1
.
rawBlocks
header_code
=
baseBlocks
.
blocks
[
"
header
"
]
baseBlocks
.
remove
([
"
tunings
"
,
"
errsigs
"
,
"
powers
"
,
"
locks
"
,
"
header
"
])
kat_code1
=
LIGO1
.
generate_tuning_block
(
kat
)
kat_code2
=
LIGO1
.
generate_errsig_block
(
kat
)
LIGO1
.
generate_locks
(
kat
)
kat_code3
=
LIGO1
.
generate_lock_block
(
kat
)
kat_code1
=
LIGO1
.
generate_tuning_block
(
kat_check
)
kat_code2
=
LIGO1
.
generate_errsig_block
(
kat_check
)
kat_code3
=
LIGO1
.
generate_lock_block
(
kat_check
)
import
datetime
strtoday
=
datetime
.
datetime
.
now
()
pre_code1
=
"
# Pretuned with ifo.py (PyKat) on
"
+
strtoday
.
strftime
(
"
%d.%m.%Y %H:%M:%S
"
)
pre_code1
=
"
# Pretuned with ifo.py (PyKat) on
"
+
strtoday
.
strftime
(
"
%d.%m.%Y %H:%M:%S
"
)
+
"
\n
"
tunings
=
LIGO1
.
get_tunings
(
kat
)
_maxtemStr
=
"
{
:3
}
"
.
format
(
tunings
[
"
maxtem
"
])
_maxtemStr
=
"
{}
"
.
format
(
tunings
[
"
maxtem
"
])
if
tunings
[
"
maxtem
"
]
==
-
1
:
_maxtemStr
=
"
off
"
pre_code2
=
"
# tuned for maxtem = {}, phase = {:2}
"
.
format
(
_maxtemStr
,
int
(
kat_check
.
phase
))
pre_code2
=
"
# tuned for maxtem = {}, phase = {:2}
\n
"
.
format
(
_maxtemStr
,
int
(
kat_check
.
phase
))
header_code
=
header_code
+
pre_code1
header_code
=
header_code
+
pre_code2
header_code
=
header_code
+
"
#--------------------------------------------------------------------------
"
print
(
kat_code1
)
print
(
kat_code2
)
print
(
kat_code3
)
baseBlocks
=
LIGO1
.
rawBlocks
baseBlocks
.
remove
([
"
tunings
"
,
"
errsigs
"
,
"
locks
"
])
#baseBlocks.remove("tunings")
#baseBlocks.remove("errsigs")
#baseBlocks.remove("locks")
baseBlocks
.
add
(
'
header
'
,
header_code
)
baseBlocks
.
add
(
'
tuning
'
,
kat_code1
)
baseBlocks
.
write
(
"
mytest.kat
"
)
baseBlocks
.
ordering
.
remove
(
'
header
'
)
baseBlocks
.
ordering
.
insert
(
0
,
'
header
'
)
baseBlocks
.
ordering
.
remove
(
'
NO_BLOCK
'
)
baseBlocks
.
ordering
.
append
(
'
NO_BLOCK
'
)
baseBlocks
.
write
(
"
LIGO_pretuned_maxtem_{}.kat
"
.
format
(
_maxtemStr
))
print
(
"
---------------------------------------------------------------------
"
)
...
...
@@ -159,7 +173,7 @@ def prepare_locks(_kat, DCoffset=None, verbose=False):
code
=
LIGO1
.
generate_errsig_block
(
kat
,
noplot
=
True
)
kat
.
parseCommands
(
code
)
#code = LIGO1.generate_lock_block(kat, _accuracies = [1e-5, 1e-5, 1e-5, 1e-5, 1e-5])
code
=
LIGO1
.
generate_locks
(
kat
,
verbose
=
True
)
LIGO1
.
generate_locks
(
kat
,
verbose
=
True
)
code
=
LIGO1
.
generate_lock_block
(
kat
,
verbose
=
True
)
kat
.
parseCommands
(
code
)
return
kat
...
...
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