Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LISA Instrument
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LISA Simulation
LISA Instrument
Commits
017c4839
Commit
017c4839
authored
2 years ago
by
Jean-Baptiste Bayle
Browse files
Options
Downloads
Patches
Plain Diff
Add logging to simulation
parent
79962513
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!116
Resolve "Implement basic structure for the hexagon experiment"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lisainstrument/hexagon.py
+15
-1
15 additions, 1 deletion
lisainstrument/hexagon.py
with
15 additions
and
1 deletion
lisainstrument/hexagon.py
+
15
−
1
View file @
017c4839
...
...
@@ -14,12 +14,15 @@ Authors:
Jean-Baptiste Bayle <j2b.bayle@gmail.com>
"""
import
logging
import
numpy
as
np
from
h5py
import
File
from
.
import
noises
logger
=
logging
.
getLogger
(
__name__
)
class
Hexagon
():
"""
Represent the Hexagon instrument.
...
...
@@ -52,12 +55,15 @@ class Hexagon():
self
.
duration
=
self
.
size
*
self
.
dt
self
.
time
=
np
.
arange
(
self
.
size
)
*
self
.
dt
logger
.
info
(
"
Initialize hexagon experiment (size=%d, dt=%f, duration=%f
"
,
self
.
size
,
self
.
dt
,
self
.
duration
)
self
.
primary_laser_asd
=
float
(
primary_laser_asd
)
self
.
locked_laser_asd
=
float
(
locked_laser_asd
)
self
.
central_freq
=
float
(
central_freq
)
if
offset_freqs
==
'
default
'
:
logger
.
debug
(
"
Use default set of offset frequencies
"
)
self
.
offset_freqs
=
{
'
1
'
:
0.0
,
'
2
'
:
15E6
,
'
3
'
:
7E6
}
else
:
self
.
offset_freqs
=
offset_freqs
...
...
@@ -76,9 +82,13 @@ class Hexagon():
def
simulate
(
self
):
"""
Run a simulation, and generate all intermediary signals.
"""
logger
.
info
(
"
Starting simulation
"
)
if
self
.
simulated
:
logger
.
warning
(
"
Overwriting previous simulated values
"
)
# Laser noise
logger
.
debug
(
"
Generating laser noise
"
)
self
.
laser_noises
=
np
.
empty
((
self
.
size
,
3
))
# (size, laser) [Hz]
# Laser 1 has its own stability
self
.
laser_noises
[:,
0
]
=
noises
.
laser
(
self
.
fs
,
self
.
size
,
self
.
primary_laser_asd
)
# Laser 2 replicated laser 1 with added locking noise
...
...
@@ -89,6 +99,7 @@ class Hexagon():
+
noises
.
white
(
self
.
fs
,
self
.
size
,
self
.
locked_laser_asd
)
# Carrier beams
logger
.
debug
(
"
Simulating carrier beams
"
)
self
.
carrier_fluctuations
=
self
.
laser_noises
# (size, laser) [Hz]
self
.
carrier_offsets
=
np
.
array
(
[[
self
.
offset_freqs
[
index
]
for
index
in
self
.
INDICES
]]
...
...
@@ -96,6 +107,7 @@ class Hexagon():
# Compute beatnotes
# Convention is from paper: beatnote ij is beam j - beam i
logger
.
debug
(
"
Computing carrier beatnotes
"
)
self
.
carrier_beatnote_offsets
=
np
.
stack
([
self
.
carrier_offsets
[:,
int
(
ij
[
1
])
-
1
]
-
self
.
carrier_offsets
[:,
int
(
ij
[
0
])
-
1
]
for
ij
in
self
.
BEATNOTES
...
...
@@ -107,9 +119,11 @@ class Hexagon():
self
.
carrier_beatnotes
=
self
.
carrier_beatnote_offsets
+
self
.
carrier_beatnote_fluctuations
# Three-signal combination
logger
.
debug
(
"
Forming three-signal combination
"
)
self
.
three_signal_combination
=
self
.
carrier_beatnotes
[:,
0
]
\
+
self
.
carrier_beatnotes
[:,
1
]
+
self
.
carrier_beatnotes
[:,
2
]
logger
.
info
(
"
Simulation complete
"
)
self
.
simulated
=
True
def
write
(
self
,
output
=
'
measurements.h5
'
,
mode
=
'
w
'
):
...
...
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