From ef37114a6b73409575234c805db3fb926deaf643 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bayle <j2b.bayle@gmail.com> Date: Tue, 2 Feb 2021 13:35:14 +0100 Subject: [PATCH] Optimize laser noise generation when using three lasers --- lisainstrument/instrument.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lisainstrument/instrument.py b/lisainstrument/instrument.py index 96095d5..d41cb06 100644 --- a/lisainstrument/instrument.py +++ b/lisainstrument/instrument.py @@ -107,7 +107,7 @@ class Instrument: self.three_lasers = bool(three_lasers) # 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_fknees = ForEachMOSA(modulation_fknees) self.modulation_freqs = ForEachMOSA(modulation_freqs) if modulation_freqs is not None \ @@ -351,7 +351,9 @@ class Instrument: self.local_carrier_offsets = self.offsets_freqs 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") self.local_usb_offsets = ForEachMOSA(lambda mosa: @@ -360,8 +362,8 @@ class Instrument: logging.info("Computing upper sideband frequency fluctuations for local beams") self.local_usb_fluctuations = ForEachMOSA(lambda mosa: - self.laser_noises[mosa] + self.modulation_freqs[mosa] \ - * (self.clock_noise_fluctuations[mosa[0]] + self.modulation_noises[mosa]) + self.laser_noises[ForEachMOSA.sc(mosa)] if self.three_lasers else self.laser_noises[mosa] \ + + self.modulation_freqs[mosa] * (self.clock_noise_fluctuations[mosa[0]] + self.modulation_noises[mosa]) ) logging.info("Computing local timer deviations") @@ -746,17 +748,18 @@ class Instrument: def simulate_noises(self): """Generate noise time series.""" + ## Laser noise - # TODO: optimize in case of three lasers 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: - for mosa in self.MOSAS[:3]: - self.laser_noises[ForEachMOSA.adjacent(mosa)] = self.laser_noises[mosa] + self.laser_noises = ForEachSC(lambda sc: + 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 # TODO: better optimize when clock_freqlindrifts and clock_freqquaddrifts == 0 -- GitLab