From 717996addb32b70f04f578dd9d4734f607705da9 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bayle <j2b.bayle@gmail.com> Date: Mon, 8 Mar 2021 20:52:47 +0100 Subject: [PATCH] Use implicit broadcasting in simulation --- lisainstrument/instrument.py | 60 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/lisainstrument/instrument.py b/lisainstrument/instrument.py index ee48de8..558d4d1 100644 --- a/lisainstrument/instrument.py +++ b/lisainstrument/instrument.py @@ -416,24 +416,24 @@ class Instrument: logger.debug("Computing carrier fluctuations for local beams") if self.three_lasers: self.local_carrier_fluctuations = \ - self.laser_noises.for_each_mosa() + self.glitch_lasers.for_each_mosa() + self.laser_noises + self.glitch_lasers else: self.local_carrier_fluctuations = self.laser_noises + self.glitch_lasers logger.debug("Computing upper sideband offsets for local beams") self.local_usb_offsets = \ self.offsets_freqs \ - + self.modulation_freqs * (1 + self.clock_noise_offsets.for_each_mosa()) + + 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.for_each_mosa() + self.glitch_lasers.for_each_mosa() \ - + self.modulation_freqs * (self.clock_noise_fluctuations.for_each_mosa() + self.modulation_noises) + 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.for_each_mosa() + self.modulation_noises) + + self.modulation_freqs * (self.clock_noise_fluctuations + self.modulation_noises) logger.debug("Computing local timer deviations") self.local_timer_deviations = \ @@ -554,7 +554,7 @@ class Instrument: logger.info("Computing measured pseudo-ranges on TPS") self.tps_mprs = \ - self.local_timer_deviations.for_each_mosa() \ + self.local_timer_deviations \ - self.distant_timer_deviations + self.ranging_noises ## Test-mass interferometer local beams @@ -678,26 +678,26 @@ class Instrument: logger.debug("Sampling inter-spacecraft carrier beatnote fluctuations to THE grid") self.the_isc_carrier_offsets = ( - self.tps_isc_carrier_offsets / (1 + self.clock_noise_offsets.for_each_mosa()) + self.tps_isc_carrier_offsets / (1 + self.clock_noise_offsets) ).transformed(self.timestamped) logger.debug("Sampling inter-spacecraft carrier beatnote fluctuations to THE grid") self.the_isc_carrier_fluctuations = ( - self.tps_isc_carrier_fluctuations / (1 + self.clock_noise_offsets.for_each_mosa()) - - self.tps_isc_carrier_offsets * self.clock_noise_fluctuations.for_each_mosa() - / (1 + self.clock_noise_offsets.for_each_mosa())**2 + self.tps_isc_carrier_fluctuations / (1 + self.clock_noise_offsets) + - self.tps_isc_carrier_offsets * self.clock_noise_fluctuations + / (1 + self.clock_noise_offsets)**2 ).transformed(self.timestamped) logging.debug("Sampling inter-spacecraft upper sideband beatnote offsets to THE grid") self.the_isc_usb_offsets = ( - self.tps_isc_usb_offsets / (1 + self.clock_noise_offsets.for_each_mosa()) + self.tps_isc_usb_offsets / (1 + self.clock_noise_offsets) ).transformed(self.timestamped) logger.debug("Sampling inter-spacecraft upper sideband beatnote fluctuations to THE grid") self.the_isc_usb_fluctuations = ( - self.tps_isc_usb_fluctuations / (1 + self.clock_noise_offsets.for_each_mosa()) - - self.tps_isc_usb_offsets * self.clock_noise_fluctuations.for_each_mosa() - / (1 + self.clock_noise_offsets.for_each_mosa())**2 + self.tps_isc_usb_fluctuations / (1 + self.clock_noise_offsets) + - self.tps_isc_usb_offsets * self.clock_noise_fluctuations + / (1 + self.clock_noise_offsets)**2 ).transformed(self.timestamped) logger.info("Sampling measured pseudo-ranges to THE grid") @@ -709,52 +709,52 @@ class Instrument: logger.debug("Sampling test-mass carrier beatnote offsets to THE grid") self.the_tm_carrier_offsets = ( - self.tps_tm_carrier_offsets / (1 + self.clock_noise_offsets.for_each_mosa()) + self.tps_tm_carrier_offsets / (1 + self.clock_noise_offsets) ).transformed(self.timestamped) logger.debug("Sampling test-mass carrier beatnote fluctuations to THE grid") self.the_tm_carrier_fluctuations = ( - self.tps_tm_carrier_fluctuations / (1 + self.clock_noise_offsets.for_each_mosa()) - - self.tps_tm_carrier_offsets * self.clock_noise_fluctuations.for_each_mosa() - / (1 + self.clock_noise_offsets.for_each_mosa())**2 + self.tps_tm_carrier_fluctuations / (1 + self.clock_noise_offsets) + - self.tps_tm_carrier_offsets * self.clock_noise_fluctuations + / (1 + self.clock_noise_offsets)**2 ).transformed(self.timestamped) logger.debug("Sampling test-mass upper sideband beatnote offsets to THE grid") self.the_tm_usb_offsets = ( - self.tps_tm_usb_offsets / (1 + self.clock_noise_offsets.for_each_mosa()) + self.tps_tm_usb_offsets / (1 + self.clock_noise_offsets) ).transformed(self.timestamped) logging.debug("Sampling test-mass upper sideband beatnote fluctuations to THE grid") self.the_tm_usb_fluctuations = ( - self.tps_tm_usb_fluctuations / (1 + self.clock_noise_offsets.for_each_mosa()) - - self.tps_tm_usb_offsets * self.clock_noise_fluctuations.for_each_mosa() - / (1 + self.clock_noise_offsets.for_each_mosa())**2 + self.tps_tm_usb_fluctuations / (1 + self.clock_noise_offsets) + - self.tps_tm_usb_offsets * self.clock_noise_fluctuations + / (1 + self.clock_noise_offsets)**2 ).transformed(self.timestamped) logger.info("Sampling reference beatnotes to THE grid") logger.debug("Sampling reference carrier beatnote offsets to THE grid") self.the_ref_carrier_offsets = ( - self.tps_ref_carrier_offsets / (1 + self.clock_noise_offsets.for_each_mosa()) + self.tps_ref_carrier_offsets / (1 + self.clock_noise_offsets) ).transformed(self.timestamped) logger.debug("Sampling reference carrier beatnote fluctuations to THE grid") self.the_ref_carrier_fluctuations = ( - self.tps_ref_carrier_fluctuations / (1 + self.clock_noise_offsets.for_each_mosa()) - - self.tps_ref_carrier_offsets * self.clock_noise_fluctuations.for_each_mosa() - / (1 + self.clock_noise_offsets.for_each_mosa())**2 + self.tps_ref_carrier_fluctuations / (1 + self.clock_noise_offsets) + - self.tps_ref_carrier_offsets * self.clock_noise_fluctuations + / (1 + self.clock_noise_offsets)**2 ).transformed(self.timestamped) logger.debug("Sampling reference upper sideband beatnote offsets to THE grid") self.the_ref_usb_offsets = ( - self.tps_ref_usb_offsets / (1 + self.clock_noise_offsets.for_each_mosa()) + self.tps_ref_usb_offsets / (1 + self.clock_noise_offsets) ).transformed(self.timestamped) logger.debug("Sampling reference upper sideband beatnote fluctuations to THE grid") self.the_ref_usb_fluctuations = ( - self.tps_ref_usb_fluctuations / (1 + self.clock_noise_offsets.for_each_mosa()) - - self.tps_ref_usb_offsets * self.clock_noise_fluctuations.for_each_mosa() - / (1 + self.clock_noise_offsets.for_each_mosa())**2 + self.tps_ref_usb_fluctuations / (1 + self.clock_noise_offsets) + - self.tps_ref_usb_offsets * self.clock_noise_fluctuations + / (1 + self.clock_noise_offsets)**2 ).transformed(self.timestamped) ## Total frequencies -- GitLab