diff --git a/lisainstrument/instrument.py b/lisainstrument/instrument.py index 558d4d1d5fefc32d24119b8d641670f5c3412d7b..603db909f21c116840314ab339994e44335ec4a8 100644 --- a/lisainstrument/instrument.py +++ b/lisainstrument/instrument.py @@ -414,35 +414,27 @@ class Instrument: self.local_carrier_offsets = self.offsets_freqs logger.debug("Computing carrier fluctuations for local beams") + self.local_carrier_fluctuations = self.laser_noises + self.glitch_lasers if self.three_lasers: - self.local_carrier_fluctuations = \ - self.laser_noises + self.glitch_lasers - else: - self.local_carrier_fluctuations = self.laser_noises + self.glitch_lasers + self.local_carrier_fluctuations = self.local_carrier_fluctuations.for_each_mosa() logger.debug("Computing upper sideband offsets for local beams") self.local_usb_offsets = \ - self.offsets_freqs \ - + self.modulation_freqs * (1 + self.clock_noise_offsets) + self.offsets_freqs + self.modulation_freqs * (1 + self.clock_noise_offsets) logger.debug("Computing upper sideband fluctuations for local beams") - if self.three_lasers: - self.local_usb_fluctuations = \ - self.laser_noises + self.glitch_lasers \ - + self.modulation_freqs * (self.clock_noise_fluctuations + self.modulation_noises) - else: - self.local_usb_fluctuations = \ - self.laser_noises + self.glitch_lasers \ - + self.modulation_freqs * (self.clock_noise_fluctuations + self.modulation_noises) + self.local_usb_fluctuations = \ + self.laser_noises + self.glitch_lasers \ + + self.modulation_freqs * (self.clock_noise_fluctuations + self.modulation_noises) logger.debug("Computing local timer deviations") self.local_timer_deviations = \ - self.clock_offsets \ - + ForEachSC(lambda sc: + self.clock_offsets + ForEachSC(lambda sc: numpy.cumsum(numpy.broadcast_to( self.clock_noise_offsets[sc] + self.clock_noise_fluctuations[sc], - self.physics_size,)) + self.physics_size) * self.dt) + ) ## Propagation to distant MOSA @@ -479,7 +471,6 @@ class Instrument: - self.pprs[mosa] ) - \ logging.info("Propagating local beams to adjacent") logger.debug("Propagating carrier offsets to adjacent MOSAs") @@ -875,15 +866,14 @@ class Instrument: if self.clock_freqlindrifts == self.clock_freqquaddrifts == 0: # Optimize to use a scalar if we only have a constant frequency offset logger.debug("Generating clock noise offsets as constant frequency offsets") - self.clock_noise_offsets = ForEachSC(lambda sc: - self.clock_freqoffsets[sc] - ) + self.clock_noise_offsets = self.clock_freqoffsets else: logger.debug("Generating clock noise offsets") t = self.physics_t - self.clock_noise_offsets = ForEachSC(lambda sc: - self.clock_freqoffsets[sc] + self.clock_freqlindrifts[sc] * t + self.clock_freqquaddrifts[sc] * t**2 - ) + self.clock_noise_offsets = \ + self.clock_freqoffsets \ + + self.clock_freqlindrifts * t \ + + self.clock_freqquaddrifts * t**2 logger.debug("Generating clock noise fluctuations") self.clock_noise_fluctuations = ForEachSC(lambda sc: @@ -902,7 +892,8 @@ class Instrument: logger.info("Generating backlink noise") self.backlink_noises = ForEachMOSA(lambda mosa: - noises.backlink(self.physics_fs, self.physics_size, self.backlink_asds[mosa], self.backlink_fknees[mosa]) + noises.backlink(self.physics_fs, self.physics_size, + self.backlink_asds[mosa], self.backlink_fknees[mosa]) ) ## Test-mass acceleration noise @@ -917,7 +908,8 @@ class Instrument: logger.info("Generating ranging noise") self.ranging_noises = ForEachMOSA(lambda mosa: - self.ranging_biases[mosa] + noises.ranging(self.physics_fs, self.physics_size, self.ranging_asds[mosa]) + self.ranging_biases[mosa] + noises.ranging(self.physics_fs, + self.physics_size, self.ranging_asds[mosa]) ) def invert_timer_deviations(self, timer_deviations, sc):