Skip to content
Snippets Groups Projects
Commit ef37114a authored by Jean-Baptiste Bayle's avatar Jean-Baptiste Bayle
Browse files

Optimize laser noise generation when using three lasers

parent 5fb14486
No related branches found
No related tags found
1 merge request!2Add instrument simulation
Pipeline #102053 failed
...@@ -107,7 +107,7 @@ class Instrument: ...@@ -107,7 +107,7 @@ class Instrument:
self.three_lasers = bool(three_lasers) self.three_lasers = bool(three_lasers)
# Laser and modulation noise # Laser and modulation noise
self.laser_asds = ForEachMOSA(laser_asds) self.laser_asds = ForEachSC(laser_asds) if self.three_lasers else ForEachSC(laser_asds)
self.modulation_asds = ForEachMOSA(modulation_asds) self.modulation_asds = ForEachMOSA(modulation_asds)
self.modulation_fknees = ForEachMOSA(modulation_fknees) self.modulation_fknees = ForEachMOSA(modulation_fknees)
self.modulation_freqs = ForEachMOSA(modulation_freqs) if modulation_freqs is not None \ self.modulation_freqs = ForEachMOSA(modulation_freqs) if modulation_freqs is not None \
...@@ -351,7 +351,9 @@ class Instrument: ...@@ -351,7 +351,9 @@ class Instrument:
self.local_carrier_offsets = self.offsets_freqs self.local_carrier_offsets = self.offsets_freqs
logging.info("Computing carrier frequency fluctuations for local beams") logging.info("Computing carrier frequency fluctuations for local beams")
self.local_carrier_fluctuations = self.laser_noises self.local_carrier_fluctuations = ForEachMOSA(lambda mosa:
self.laser_noises[ForEachMOSA.sc(mosa)] if self.three_lasers else self.laser_noises[mosa]
)
logging.info("Computing upper sideband frequency offsets for local beams") logging.info("Computing upper sideband frequency offsets for local beams")
self.local_usb_offsets = ForEachMOSA(lambda mosa: self.local_usb_offsets = ForEachMOSA(lambda mosa:
...@@ -360,8 +362,8 @@ class Instrument: ...@@ -360,8 +362,8 @@ class Instrument:
logging.info("Computing upper sideband frequency fluctuations for local beams") logging.info("Computing upper sideband frequency fluctuations for local beams")
self.local_usb_fluctuations = ForEachMOSA(lambda mosa: self.local_usb_fluctuations = ForEachMOSA(lambda mosa:
self.laser_noises[mosa] + self.modulation_freqs[mosa] \ self.laser_noises[ForEachMOSA.sc(mosa)] if self.three_lasers else self.laser_noises[mosa] \
* (self.clock_noise_fluctuations[mosa[0]] + self.modulation_noises[mosa]) + self.modulation_freqs[mosa] * (self.clock_noise_fluctuations[mosa[0]] + self.modulation_noises[mosa])
) )
logging.info("Computing local timer deviations") logging.info("Computing local timer deviations")
...@@ -746,17 +748,18 @@ class Instrument: ...@@ -746,17 +748,18 @@ class Instrument:
def simulate_noises(self): def simulate_noises(self):
"""Generate noise time series.""" """Generate noise time series."""
## Laser noise ## Laser noise
# TODO: optimize in case of three lasers
logging.info("Generating laser noise time series") logging.info("Generating laser noise time series")
self.laser_noises = ForEachMOSA(lambda mosa:
noises.laser(self.physics_fs, self.physics_size, self.laser_asds[mosa])
)
if self.three_lasers: if self.three_lasers:
for mosa in self.MOSAS[:3]: self.laser_noises = ForEachSC(lambda sc:
self.laser_noises[ForEachMOSA.adjacent(mosa)] = self.laser_noises[mosa] noises.laser(self.physics_fs, self.physics_size, self.laser_asds[sc])
)
else:
self.laser_noises = ForEachMOSA(lambda mosa:
noises.laser(self.physics_fs, self.physics_size, self.laser_asds[mosa])
)
## Clock noise ## Clock noise
# TODO: better optimize when clock_freqlindrifts and clock_freqquaddrifts == 0 # TODO: better optimize when clock_freqlindrifts and clock_freqquaddrifts == 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment