diff --git a/lisainstrument/instrument.py b/lisainstrument/instrument.py index 723b87272a9c6418c67c0f28a50e7696277a8bfd..08b10a9456350ec4fcce9ea275165cc862faf325 100644 --- a/lisainstrument/instrument.py +++ b/lisainstrument/instrument.py @@ -23,6 +23,8 @@ from . import meta from . import dsp from . import noises +logger = logging.getLogger(__name__) + class Instrument: """Represents an instrumental simulation.""" @@ -88,7 +90,7 @@ class Instrument: the transition band """ # pylint: disable=too-many-arguments,too-many-statements - logging.info("Initializing instrumental simulation") + logger.info("Initializing instrumental simulation") self.git_url = 'https://gitlab.in2p3.fr/lisa-simulation/instrument' self.version = meta.__version__ self.simulated = False @@ -106,7 +108,7 @@ class Instrument: self.physics_size = self.size * self.physics_upsampling self.physics_dt = self.dt / self.physics_upsampling self.physics_fs = self.fs * self.physics_upsampling - logging.info("Computing physics time vector (size=%s, dt=%s)", self.physics_size, self.physics_dt) + logger.info("Computing physics time vector (size=%s, dt=%s)", self.physics_size, self.physics_dt) self.physics_t = self.t0 + numpy.arange(self.physics_size, dtype=numpy.float64) * self.physics_dt # Instrument topology @@ -191,7 +193,7 @@ class Instrument: self.interpolation_order = None self.interpolate = lambda x, _: x elif callable(interpolation): - logging.info("Using user-provided interpolation function") + logger.info("Using user-provided interpolation function") self.interpolation_order = None self.interpolate = lambda x, shift: x if numpy.isscalar(x) else interpolation(x, shift) else: @@ -209,7 +211,7 @@ class Instrument: self.downsampled = lambda _, x: x if numpy.isscalar(x) else x[::self.physics_upsampling] if aafilter is None: - logging.info("Disabling antialiasing filter") + logger.info("Disabling antialiasing filter") self.aafilter_coeffs = None self.aafilter = lambda _, x: x elif isinstance(aafilter, (list, numpy.ndarray)): @@ -218,11 +220,11 @@ class Instrument: self.aafilter = lambda _, x: x if numpy.isscalar(x) else \ scipy.signal.lfilter(self.aafilter_coeffs, 1, x) elif callable(aafilter): - logging.info("Using user-provided antialiasing filter function") + logger.info("Using user-provided antialiasing filter function") self.aafilter_coeffs = None self.aafilter = lambda _, x: x if numpy.isscalar(x) else aafilter(x) else: - logging.info("Design antialiasing filter (%s)", aafilter) + logger.info("Designing antialiasing filter %s", aafilter) self.aafilter_coeffs = self.design_aafilter(aafilter) self.aafilter = lambda _, x: x if numpy.isscalar(x) else \ scipy.signal.lfilter(self.aafilter_coeffs, 1, x) @@ -244,17 +246,17 @@ class Instrument: nyquist = self.physics_fs / 2 if method == 'kaiser': - logging.debug("Designing finite-impulse response filter from Kaiser window") + logger.debug("Designing finite-impulse response filter from Kaiser window") attenuation, freq1, freq2 = parameters[1], parameters[2], parameters[3] if attenuation == 0: logging.debug("Vanishing filter attenuation, disabling filtering") return lambda x: x - logging.debug("Filter attenuation is %s dB", attenuation) - logging.debug("Filter transition band is [%s Hz, %s Hz]", freq1, freq2) + logger.debug("Filter attenuation is %s dB", attenuation) + logger.debug("Filter transition band is [%s Hz, %s Hz]", freq1, freq2) numtaps, beta = scipy.signal.kaiserord(attenuation, (freq2 - freq1) / nyquist) - logging.debug("Kaiser window has %s taps and beta is %s", numtaps, beta) + logger.debug("Kaiser window has %s taps and beta is %s", numtaps, beta) taps = scipy.signal.firwin(numtaps, (freq1 + freq2) / (2 * nyquist), window=('kaiser', beta)) - logging.debug("Filter taps are %s", taps) + logger.debug("Filter taps are %s", taps) return taps raise ValueError(f"invalid filter parameters '{parameters}'") @@ -265,17 +267,17 @@ class Instrument: logging.info("Using orbit file '%s'", orbits) self.orbit_file = orbits orbitf = h5py.File(self.orbit_file, 'r') - logging.debug("Interpolating proper pseudo-ranges") + logger.debug("Interpolating proper pseudo-ranges") self.pprs = ForEachMOSA(lambda mosa: scipy.interpolate.InterpolatedUnivariateSpline( orbitf['tcb']['t'][:], orbitf['tcb'][f'l_{mosa}']['ppr'], k=5, ext='raise')(self.physics_t) ) - logging.debug("Interpolating proper pseudo-range derivatives") + logger.debug("Interpolating proper pseudo-range derivatives") self.d_pprs = ForEachMOSA(lambda mosa: scipy.interpolate.InterpolatedUnivariateSpline( orbitf['tcb']['t'][:], orbitf['tcb'][f'l_{mosa}']['d_ppr'], k=5, ext='raise')(self.physics_t) ) orbitf.close() elif orbits is None: - logging.info("Using default set of constant proper pseudo-ranges") + logger.info("Using default set of constant proper pseudo-ranges") self.orbit_file = None self.pprs = ForEachMOSA({ # Default PPRs based on first samples of Keplerian orbits (v1.0) '12': 8.3324, '23': 8.3028, '31': 8.3324, @@ -283,7 +285,7 @@ class Instrument: }) self.d_pprs = ForEachMOSA(0) else: - logging.info("Using user-provided proper pseudo-ranges and derivatives thereof") + logger.info("Using user-provided proper pseudo-ranges and derivatives thereof") self.orbit_file = None self.pprs = ForEachMOSA(orbits) self.d_pprs = self.pprs.transformed(lambda sc, x: @@ -294,18 +296,18 @@ class Instrument: """Initialize gravitational-wave responses.""" if isinstance(gws, str): self.gw_file = gws - logging.info("Interpolating gravitational-wave responses from GW file '%s'", self.gw_file) + logger.info("Interpolating gravitational-wave responses from GW file '%s'", self.gw_file) gwf = h5py.File(self.gw_file, 'r') self.gws = ForEachMOSA(lambda mosa: scipy.interpolate.InterpolatedUnivariateSpline( gwf['t'][:], gwf[f'l_{mosa}'][:], k=5, ext='raise')(self.physics_t) ) gwf.close() elif gws is None: - logging.debug("No gravitational-wave responses") + logger.debug("No gravitational-wave responses") self.gw_file = None self.gws = ForEachMOSA(0) else: - logging.info("Using user-provided gravitational-wave responses") + logger.info("Using user-provided gravitational-wave responses") self.gw_file = None self.gws = ForEachMOSA(gws) @@ -320,7 +322,7 @@ class Instrument: """ if isinstance(glitches, str): self.glitch_file = glitches - logging.info("Interpolating glitch signals from glitch file '%s'", self.glitch_file) + logger.info("Interpolating glitch signals from glitch file '%s'", self.glitch_file) glitchf = h5py.File(self.glitch_file, 'r') self.glitch_tms = ForEachMOSA(lambda mosa: 0 if f'tm_{mosa}' not in glitchf else \ @@ -341,7 +343,7 @@ class Instrument: ) glitchf.close() elif glitches is None: - logging.debug("No glitches") + logger.debug("No glitches") self.glitch_file = None self.glitch_tms = ForEachMOSA(0) self.glitch_lasers = ForEachSC(0) if self.three_lasers else ForEachMOSA(0) @@ -398,16 +400,19 @@ class Instrument: """ # pylint: disable=too-many-locals,too-many-statements,too-many-branches - logging.info("Starting simulation") + logger.info("Starting simulation") self.keep_all = keep_all self.simulated = True self.simulate_noises() ## Local beams + logger.info("Simulating local beams") + + logging.debug("Computing carrier offsets for local beams") self.local_carrier_offsets = self.offsets_freqs - logging.info("Computing carrier frequency fluctuations for local beams") + logger.debug("Computing carrier fluctuations for local beams") if self.three_lasers: self.local_carrier_fluctuations = ForEachMOSA(lambda mosa: self.laser_noises[ForEachMOSA.sc(mosa)] + self.glitch_lasers[ForEachMOSA.sc(mosa)] @@ -417,12 +422,12 @@ class Instrument: self.laser_noises[mosa] + self.glitch_lasers[mosa] ) - logging.info("Computing upper sideband frequency offsets for local beams") + logger.debug("Computing upper sideband offsets for local beams") self.local_usb_offsets = ForEachMOSA(lambda mosa: self.offsets_freqs[mosa] + self.modulation_freqs[mosa] * (1 + self.clock_noise_offsets[mosa[0]]) ) - logging.info("Computing upper sideband frequency fluctuations for local beams") + logger.debug("Computing upper sideband fluctuations for local beams") if self.three_lasers: self.local_usb_fluctuations = ForEachMOSA(lambda mosa: self.laser_noises[ForEachMOSA.sc(mosa)] + self.glitch_lasers[ForEachMOSA.sc(mosa)] @@ -434,7 +439,7 @@ class Instrument: + self.modulation_freqs[mosa] * (self.clock_noise_fluctuations[mosa[0]] + self.modulation_noises[mosa]) ) - logging.info("Computing local timer deviations") + logger.debug("Computing local timer deviations") self.local_timer_deviations = ForEachSC(lambda sc: self.clock_offsets[sc] + numpy.cumsum( numpy.broadcast_to(self.clock_noise_offsets[sc] + self.clock_noise_fluctuations[sc], \ @@ -443,7 +448,9 @@ class Instrument: ## Propagation to distant MOSA - logging.info("Propagating carrier frequency offsets to distant MOSA") + logger.info("Propagating local beams to distant MOSAs") + + logger.debug("Propagating carrier offsets to distant MOSAs") self.distant_carrier_offsets = ForEachMOSA(lambda mosa: (1 - self.d_pprs[mosa]) * \ self.interpolate(self.local_carrier_offsets[ForEachMOSA.distant(mosa)], @@ -451,14 +458,14 @@ class Instrument: - self.d_pprs[mosa] * self.central_freq ) - logging.info("Propagating carrier frequency fluctuations to distant MOSA") + logger.debug("Propagating carrier fluctuations to distant MOSAs") self.distant_carrier_fluctuations = ForEachMOSA(lambda mosa: self.central_freq * self.gws[mosa] + (1 - self.d_pprs[mosa]) * \ self.interpolate(self.local_carrier_fluctuations[ForEachMOSA.distant(mosa)], -self.pprs[mosa] * self.physics_fs) ) - logging.info("Propagating upper sideband frequency offsets to distant MOSA") + logger.debug("Propagating upper sideband offsets to distant MOSAs") self.distant_usb_offsets = ForEachMOSA(lambda mosa: (1 - self.d_pprs[mosa]) * \ self.interpolate(self.local_usb_offsets[ForEachMOSA.distant(mosa)], @@ -466,14 +473,14 @@ class Instrument: - self.d_pprs[mosa] * self.central_freq ) - logging.info("Propagating upper sideband frequency fluctuations to distant MOSA") + logger.debug("Propagating upper sideband fluctuations to distant MOSAs") self.distant_usb_fluctuations = ForEachMOSA(lambda mosa: self.central_freq * self.gws[mosa] + (1 - self.d_pprs[mosa]) * \ self.interpolate(self.local_usb_fluctuations[ForEachMOSA.distant(mosa)], - self.pprs[mosa] * self.physics_fs) ) - logging.info("Propagating timer deviations to distant MOSA") + logger.debug("Propagating timer deviations to distant MOSAs") self.distant_timer_deviations = ForEachMOSA(lambda mosa: self.interpolate(self.local_timer_deviations[mosa[1]], - self.pprs[mosa] * self.physics_fs) \ @@ -482,23 +489,25 @@ class Instrument: ## Propagation to adjacent MOSA - logging.info("Propagating carrier frequency offsets to adjacent MOSA") + logging.info("Propagating local beams to adjacent MOSAs") + + logger.debug("Propagating carrier offsets to adjacent MOSAs") self.adjacent_carrier_offsets = ForEachMOSA(lambda mosa: self.local_carrier_offsets[ForEachMOSA.adjacent(mosa)] ) - logging.info("Propagating carrier frequency fluctuations to adjacent MOSA") + logger.debug("Propagating carrier fluctuations to adjacent MOSAs") self.adjacent_carrier_fluctuations = ForEachMOSA(lambda mosa: self.local_carrier_fluctuations[ForEachMOSA.adjacent(mosa)] \ + self.central_freq * self.backlink_noises[mosa] ) - logging.info("Propagating upper sideband frequency offsets to adjacent MOSA") + logger.debug("Propagating upper sideband offsets to adjacent MOSAs") self.adjacent_usb_offsets = ForEachMOSA(lambda mosa: self.local_usb_offsets[ForEachMOSA.adjacent(mosa)] ) - logging.info("Propagating upper sideband frequency fluctuations to adjacent MOSA") + logger.debug("Propagating upper sideband fluctuations to adjacent MOSAs") self.adjacent_usb_fluctuations = ForEachMOSA(lambda mosa: self.local_usb_fluctuations[ForEachMOSA.adjacent(mosa)] \ + self.central_freq * self.backlink_noises[mosa] @@ -506,57 +515,63 @@ class Instrument: ## Inter-spacecraft interferometer local beams - logging.info("Propagating local carrier frequency offsets to inter-spacecraft interferometer") + logger.info("Propagating local beams to inter-spacecraft interferometers") + + logger.debug("Propagating local carrier offsets to inter-spacecraft interferometer") self.local_isc_carrier_offsets = self.local_carrier_offsets - logging.info("Propagating local carrier frequency fluctuations to inter-spacecraft interferometer") + logger.debug("Propagating local carrier fluctuations to inter-spacecraft interferometer") self.local_isc_carrier_fluctuations = self.local_carrier_fluctuations - logging.info("Propagating local upper sideband frequency offsets to inter-spacecraft interferometer") + logger.debug("Propagating local upper sideband offsets to inter-spacecraft interferometer") self.local_isc_usb_offsets = self.local_usb_offsets - logging.info("Propagating local upper sideband frequency fluctuations to inter-spacecraft interferometer") + logger.debug("Propagating local upper sideband fluctuations to inter-spacecraft interferometer") self.local_isc_usb_fluctuations = self.local_usb_fluctuations ## Inter-spacecraft interferometer distant beams - logging.info("Propagating distant carrier frequency offsets to inter-spacecraft interferometer") + logger.info("Propagating distant beams to inter-spacecraft interferometers") + + logger.debug("Propagating distant carrier offsets to inter-spacecraft interferometer") self.distant_isc_carrier_offsets = self.distant_carrier_offsets - logging.info("Propagating distant carrier frequency fluctuations to inter-spacecraft interferometer") + logger.debug("Propagating distant carrier fluctuations to inter-spacecraft interferometer") self.distant_isc_carrier_fluctuations = self.distant_carrier_fluctuations - logging.info("Propagating distant upper sideband frequency offsets to inter-spacecraft interferometer") + logger.debug("Propagating distant upper sideband offsets to inter-spacecraft interferometer") self.distant_isc_usb_offsets = self.distant_usb_offsets - logging.info("Propagating distant upper sideband frequency fluctuations to inter-spacecraft interferometer") + logger.debug("Propagating distant upper sideband fluctuations to inter-spacecraft interferometer") self.distant_isc_usb_fluctuations = self.distant_usb_fluctuations ## Inter-spacecraft interferometer beatnotes on TPS (high-frequency) - logging.info("Computing inter-spacecraft carrier beatnote frequency offsets on TPS") + logger.info("Computing inter-spacecraft beatnotes on TPS") + + logger.debug("Computing inter-spacecraft carrier beatnote offsets on TPS") self.tps_isc_carrier_offsets = ForEachMOSA(lambda mosa: self.distant_isc_carrier_offsets[mosa] - self.local_isc_carrier_offsets[mosa] ) - logging.info("Computing inter-spacecraft carrier beatnote frequency fluctuations on TPS") + logger.debug("Computing inter-spacecraft carrier beatnote fluctuations on TPS") self.tps_isc_carrier_fluctuations = ForEachMOSA(lambda mosa: self.distant_isc_carrier_fluctuations[mosa] - self.local_isc_carrier_fluctuations[mosa] ) - logging.info("Computing inter-spacecraft upper sideband beatnote frequency offsets on TPS") + logging.debug("Computing inter-spacecraft upper sideband beatnote offsets on TPS") self.tps_isc_usb_offsets = ForEachMOSA(lambda mosa: self.distant_isc_usb_offsets[mosa] - self.local_isc_usb_offsets[mosa] ) - logging.info("Computing inter-spacecraft upper sideband beatnote frequency fluctuations on TPS") + logger.debug("Computing inter-spacecraft upper sideband beatnote fluctuations on TPS") self.tps_isc_usb_fluctuations = ForEachMOSA(lambda mosa: self.distant_isc_usb_fluctuations[mosa] - self.local_isc_usb_fluctuations[mosa] ) ## Measured pseudo-ranging on TPS grid (high-frequency) - logging.info("Computing measured pseudo-ranges on TPS") + logger.info("Computing measured pseudo-ranges on TPS") self.tps_mprs = ForEachMOSA(lambda mosa: self.local_timer_deviations[ForEachMOSA.sc(mosa)] \ - self.distant_timer_deviations[mosa] + self.ranging_noises[mosa] @@ -564,19 +579,21 @@ class Instrument: ## Test-mass interferometer local beams - logging.info("Propagating local carrier frequency offsets to test-mass interferometer") + logger.info("Propagating local beams to test-mass interferometers") + + logger.debug("Propagating local carrier offsets to test-mass interferometer") self.local_tm_carrier_offsets = self.local_carrier_offsets - logging.info("Propagating local carrier frequency fluctuations to test-mass interferometer") + logging.debug("Propagating local carrier fluctuations to test-mass interferometer") self.local_tm_carrier_fluctuations = ForEachMOSA(lambda mosa: self.local_carrier_fluctuations[mosa] + self.central_freq * (self.testmass_noises[mosa] + self.glitch_tms[mosa] / c) ) - logging.info("Propagating local upper sideband frequency offsets to test-mass interferometer") + logger.debug("Propagating local upper sideband offsets to test-mass interferometer") self.local_tm_usb_offsets = self.local_usb_offsets - logging.info("Propagating local upper sideband frequency fluctuations to test-mass interferometer") + logger.debug("Propagating local upper sideband fluctuations to test-mass interferometer") self.local_tm_usb_fluctuations = ForEachMOSA(lambda mosa: self.local_usb_fluctuations[mosa] + self.central_freq * (self.testmass_noises[mosa] + self.glitch_tms[mosa] / c) @@ -584,191 +601,231 @@ class Instrument: ## Test-mass interferometer adjacent beams - logging.info("Propagating adjacent carrier frequency offsets to test-mass interferometer") + logger.info("Propagating adjacent beams to test-mass interferometers") + + logger.debug("Propagating adjacent carrier offsets to test-mass interferometer") self.adjacent_tm_carrier_offsets = self.adjacent_carrier_offsets - logging.info("Propagating adjacent carrier frequency fluctuations to test-mass interferometer") + logger.debug("Propagating adjacent carrier fluctuations to test-mass interferometer") self.adjacent_tm_carrier_fluctuations = self.adjacent_carrier_fluctuations - logging.info("Propagating adjacent upper sideband frequency offsets to test-mass interferometer") + logger.debug("Propagating adjacent upper sideband offsets to test-mass interferometer") self.adjacent_tm_usb_offsets = self.adjacent_usb_offsets - logging.info("Propagating adjacent upper sideband frequency fluctuations to test-mass interferometer") + logger.debug("Propagating adjacent upper sideband fluctuations to test-mass interferometer") self.adjacent_tm_usb_fluctuations = self.adjacent_usb_fluctuations ## Test-mass interferometer beatnotes on TPS (high-frequency) - logging.info("Computing test-mass carrier beatnote frequency offsets on TPS") + logger.info("Computing test-mass beatnotes on TPS") + + logger.debug("Computing test-mass carrier beatnote offsets on TPS") self.tps_tm_carrier_offsets = ForEachMOSA(lambda mosa: self.adjacent_tm_carrier_offsets[mosa] - self.local_tm_carrier_offsets[mosa] ) - logging.info("Computing test-mass carrier beatnote frequency fluctuations on TPS") + logger.debug("Computing test-mass carrier beatnote fluctuations on TPS") self.tps_tm_carrier_fluctuations = ForEachMOSA(lambda mosa: self.adjacent_tm_carrier_fluctuations[mosa] - self.local_tm_carrier_fluctuations[mosa] ) - logging.info("Computing test-mass upper sideband beatnote frequency offsets on TPS") + logger.debug("Computing test-mass upper sideband beatnote offsets on TPS") self.tps_tm_usb_offsets = ForEachMOSA(lambda mosa: self.adjacent_tm_usb_offsets[mosa] - self.local_tm_usb_offsets[mosa] ) - logging.info("Computing test-mass upper sideband beatnote frequency fluctuations on TPS") + logger.debug("Computing test-mass upper sideband beatnote fluctuations on TPS") self.tps_tm_usb_fluctuations = ForEachMOSA(lambda mosa: self.adjacent_tm_usb_fluctuations[mosa] - self.local_tm_usb_fluctuations[mosa] ) ## Reference interferometer local beams - logging.info("Propagating local carrier frequency offsets to reference interferometer") + logger.info("Propagating local beams to reference interferometers") + + logger.debug("Propagating local carrier offsets to reference interferometer") self.local_ref_carrier_offsets = self.local_carrier_offsets - logging.info("Propagating local carrier frequency fluctuations to reference interferometer") + logger.debug("Propagating local carrier fluctuations to reference interferometer") self.local_ref_carrier_fluctuations = self.local_carrier_fluctuations - logging.info("Propagating local upper sideband frequency offsets to reference interferometer") + logger.debug("Propagating local upper sideband offsets to reference interferometer") self.local_ref_usb_offsets = self.local_usb_offsets - logging.info("Propagating local upper sideband frequency fluctuations to reference interferometer") + logger.debug("Propagating local upper sideband fluctuations to reference interferometer") self.local_ref_usb_fluctuations = self.local_usb_fluctuations ## Reference interferometer adjacent beams - logging.info("Propagating adjacent carrier frequency offsets to reference interferometer") + logger.info("Propagating adjacent beams to reference interferometers") + + logger.debug("Propagating adjacent carrier offsets to reference interferometer") self.adjacent_ref_carrier_offsets = self.adjacent_carrier_offsets - logging.info("Propagating adjacent carrier frequency fluctuations to reference interferometer") + logger.debug("Propagating adjacent carrier fluctuations to reference interferometer") self.adjacent_ref_carrier_fluctuations = self.adjacent_carrier_fluctuations - logging.info("Propagating adjacent upper sideband frequency offsets to reference interferometer") + logger.debug("Propagating adjacent upper sideband offsets to reference interferometer") self.adjacent_ref_usb_offsets = self.adjacent_usb_offsets - logging.info("Propagating adjacent upper sideband frequency fluctuations to reference interferometer") + logger.debug("Propagating adjacent upper sideband fluctuations to reference interferometer") self.adjacent_ref_usb_fluctuations = self.adjacent_usb_fluctuations ## Reference interferometer beatnotes on TPS (high-frequency) - logging.info("Computing reference carrier beatnote frequency offsets on TPS") + logger.info("Computing reference beatnotes on TPS") + + logger.debug("Computing reference carrier beatnote offsets on TPS") self.tps_ref_carrier_offsets = ForEachMOSA(lambda mosa: self.adjacent_ref_carrier_offsets[mosa] - self.local_ref_carrier_offsets[mosa] ) - logging.info("Computing reference carrier beatnote frequency fluctuations on TPS") + logger.debug("Computing reference carrier beatnote fluctuations on TPS") self.tps_ref_carrier_fluctuations = ForEachMOSA(lambda mosa: self.adjacent_ref_carrier_fluctuations[mosa] - self.local_ref_carrier_fluctuations[mosa] ) - logging.info("Computing reference upper sideband beatnote frequency offsets on TPS") + logger.debug("Computing reference upper sideband beatnote offsets on TPS") self.tps_ref_usb_offsets = ForEachMOSA(lambda mosa: self.adjacent_ref_usb_offsets[mosa] - self.local_ref_usb_offsets[mosa] ) - logging.info("Computing reference upper sideband beatnote frequency fluctuations on TPS") + logger.debug("Computing reference upper sideband beatnote fluctuations on TPS") self.tps_ref_usb_fluctuations = ForEachMOSA(lambda mosa: self.adjacent_ref_usb_fluctuations[mosa] - self.local_ref_usb_fluctuations[mosa] ) ## Sampling beatnotes and measured pseudo-ranges to THE grid + logger.info("Inverting timer deviations") self.inverse_timer_deviations = ForEachSC(lambda sc: self.invert_timer_deviations(self.local_timer_deviations[sc], sc) ) timestamp = lambda x, sc: self.interpolate(x, -self.inverse_timer_deviations[sc] * self.physics_fs) - logging.info("Sampling inter-spacecraft carrier beatnote frequency offsets to THE grid") + logger.info("Sampling inter-spacecraft beatnotes to THE grid") + + logger.debug("Sampling inter-spacecraft carrier beatnote fluctuations to THE grid") self.the_isc_carrier_offsets = ForEachMOSA(lambda mosa: timestamp(self.tps_isc_carrier_offsets[mosa] / (1 + self.clock_noise_offsets[mosa[0]]), mosa[0]) ) - logging.info("Sampling inter-spacecraft carrier beatnote frequency fluctuations to THE grid") + + logger.debug("Sampling inter-spacecraft carrier beatnote fluctuations to THE grid") self.the_isc_carrier_fluctuations = ForEachMOSA(lambda mosa: timestamp(self.tps_isc_carrier_fluctuations[mosa] / (1 + self.clock_noise_offsets[mosa[0]]) - self.tps_isc_carrier_offsets[mosa] * self.clock_noise_fluctuations[mosa[0]] / (1 + self.clock_noise_offsets[mosa[0]])**2, mosa[0]) ) - logging.info("Sampling inter-spacecraft upper sideband beatnote frequency offsets to THE grid") + logging.debug("Sampling inter-spacecraft upper sideband beatnote offsets to THE grid") self.the_isc_usb_offsets = ForEachMOSA(lambda mosa: timestamp(self.tps_isc_usb_offsets[mosa] / (1 + self.clock_noise_offsets[mosa[0]]), mosa[0]) ) - logging.info("Sampling inter-spacecraft upper sideband beatnote frequency fluctuations to THE grid") + logger.debug("Sampling inter-spacecraft upper sideband beatnote fluctuations to THE grid") self.the_isc_usb_fluctuations = ForEachMOSA(lambda mosa: timestamp(self.tps_isc_usb_fluctuations[mosa] / (1 + self.clock_noise_offsets[mosa[0]]) - self.tps_isc_usb_offsets[mosa] * self.clock_noise_fluctuations[mosa[0]] / (1 + self.clock_noise_offsets[mosa[0]])**2, mosa[0]) ) - logging.info("Sampling measured pseudo-ranges to THE grid") + logger.info("Sampling measured pseudo-ranges to THE grid") self.the_mprs = ForEachMOSA(lambda mosa: timestamp(self.tps_mprs[mosa], mosa[0]) ) - logging.info("Sampling test-mass beatnotes to THE grid") + logger.info("Sampling test-mass beatnotes to THE grid") + + logger.debug("Sampling test-mass carrier beatnote offsets to THE grid") self.the_tm_carrier_offsets = ForEachMOSA(lambda mosa: timestamp(self.tps_tm_carrier_offsets[mosa] / (1 + self.clock_noise_offsets[mosa[0]]), mosa[0]) ) + + logger.debug("Sampling test-mass carrier beatnote fluctuations to THE grid") self.the_tm_carrier_fluctuations = ForEachMOSA(lambda mosa: timestamp(self.tps_tm_carrier_fluctuations[mosa] / (1 + self.clock_noise_offsets[mosa[0]]) - self.tps_tm_carrier_offsets[mosa] * self.clock_noise_fluctuations[mosa[0]] / (1 + self.clock_noise_offsets[mosa[0]])**2, mosa[0]) ) + + logger.debug("Sampling test-mass upper sideband beatnote offsets to THE grid") self.the_tm_usb_offsets = ForEachMOSA(lambda mosa: timestamp(self.tps_tm_usb_offsets[mosa] / (1 + self.clock_noise_offsets[mosa[0]]), mosa[0]) ) + + logging.debug("Sampling test-mass upper sideband beatnote fluctuations to THE grid") self.the_tm_usb_fluctuations = ForEachMOSA(lambda mosa: timestamp(self.tps_tm_usb_fluctuations[mosa] / (1 + self.clock_noise_offsets[mosa[0]]) - self.tps_tm_usb_offsets[mosa] * self.clock_noise_fluctuations[mosa[0]] / (1 + self.clock_noise_offsets[mosa[0]])**2, mosa[0]) ) - logging.info("Sampling reference beatnotes to THE grid") + logger.info("Sampling reference beatnotes to THE grid") + + logger.debug("Sampling reference carrier beatnote offsets to THE grid") self.the_ref_carrier_offsets = ForEachMOSA(lambda mosa: timestamp(self.tps_ref_carrier_offsets[mosa] / (1 + self.clock_noise_offsets[mosa[0]]), mosa[0]) ) + + logger.debug("Sampling reference carrier beatnote fluctuations to THE grid") self.the_ref_carrier_fluctuations = ForEachMOSA(lambda mosa: timestamp(self.tps_ref_carrier_fluctuations[mosa] / (1 + self.clock_noise_offsets[mosa[0]]) - self.tps_ref_carrier_offsets[mosa] * self.clock_noise_fluctuations[mosa[0]] / (1 + self.clock_noise_offsets[mosa[0]])**2, mosa[0]) - ) + ) + + logger.debug("Sampling reference upper sideband beatnote offsets to THE grid") self.the_ref_usb_offsets = ForEachMOSA(lambda mosa: timestamp(self.tps_ref_usb_offsets[mosa] / (1 + self.clock_noise_offsets[mosa[0]]), mosa[0]) ) + + logger.debug("Sampling reference upper sideband beatnote fluctuations to THE grid") self.the_ref_usb_fluctuations = ForEachMOSA(lambda mosa: timestamp(self.tps_ref_usb_fluctuations[mosa] / (1 + self.clock_noise_offsets[mosa[0]]) - self.tps_ref_usb_offsets[mosa] * self.clock_noise_fluctuations[mosa[0]] / (1 + self.clock_noise_offsets[mosa[0]])**2, mosa[0]) - ) + ) ## Total frequencies - logging.info("Computing inter-spacecraft beatnote total frequencies") + logger.info("Computing total beatnote frequencies") + + logger.debug("Computing total inter-spacecraft carrier beatnotes") self.the_isc_carriers = ForEachMOSA(lambda mosa: self.the_isc_carrier_offsets[mosa] + self.the_isc_carrier_fluctuations[mosa] ) + + logger.debug("Computing total inter-spacecraft upper sideband beatnotes") self.the_isc_usbs = ForEachMOSA(lambda mosa: self.the_isc_usb_offsets[mosa] + self.the_isc_usb_fluctuations[mosa] ) - logging.info("Computing test-mass beatnote total frequencies") + logger.debug("Computing total test-mass carrier beatnotes") self.the_tm_carriers = ForEachMOSA(lambda mosa: self.the_tm_carrier_offsets[mosa] + self.the_tm_carrier_fluctuations[mosa] ) + + logger.debug("Computing total test-mass upper sideband beatnotes") self.the_tm_usbs = ForEachMOSA(lambda mosa: self.the_tm_usb_offsets[mosa] + self.the_tm_usb_fluctuations[mosa] ) - logging.info("Computing reference beatnote total frequencies") + logger.debug("Computing total reference carrier beatnotes") self.the_ref_carriers = ForEachMOSA(lambda mosa: self.the_ref_carrier_offsets[mosa] + self.the_ref_carrier_fluctuations[mosa] ) + + logger.debug("Computing total reference upper sideband beatnotes") self.the_ref_usbs = ForEachMOSA(lambda mosa: self.the_ref_usb_offsets[mosa] + self.the_ref_usb_fluctuations[mosa] ) ## Antialiasing filtering - logging.info("Filtering inter-spacecraft beatnotes") + logger.info("Filtering beatnotes") + + logger.debug("Filtering inter-spacecraft beatnotes") self.filtered_isc_carrier_offsets = self.the_isc_carrier_offsets.transformed(self.aafilter) self.filtered_isc_carrier_fluctuations = self.the_isc_carrier_fluctuations.transformed(self.aafilter) self.filtered_isc_carriers = self.the_isc_carriers.transformed(self.aafilter) @@ -776,10 +833,10 @@ class Instrument: self.filtered_isc_usb_fluctuations = self.the_isc_usb_fluctuations.transformed(self.aafilter) self.filtered_isc_usbs = self.the_isc_usbs.transformed(self.aafilter) - logging.info("Filtering measured pseudo-ranges") + logger.debug("Filtering measured pseudo-ranges") self.filtered_mprs = self.the_mprs.transformed(self.aafilter) - logging.info("Filtering test-mass beatnotes") + logger.debug("Filtering test-mass beatnotes") self.filtered_tm_carrier_offsets = self.the_tm_carrier_offsets.transformed(self.aafilter) self.filtered_tm_carrier_fluctuations = self.the_tm_carrier_fluctuations.transformed(self.aafilter) self.filtered_tm_carriers = self.the_tm_carriers.transformed(self.aafilter) @@ -787,7 +844,7 @@ class Instrument: self.filtered_tm_usb_fluctuations = self.the_tm_usb_fluctuations.transformed(self.aafilter) self.filtered_tm_usbs = self.the_tm_usbs.transformed(self.aafilter) - logging.info("Filtering reference beatnotes") + logger.debug("Filtering reference beatnotes") self.filtered_ref_carrier_offsets = self.the_ref_carrier_offsets.transformed(self.aafilter) self.filtered_ref_carrier_fluctuations = self.the_ref_carrier_fluctuations.transformed(self.aafilter) self.filtered_ref_carriers = self.the_ref_carriers.transformed(self.aafilter) @@ -797,7 +854,9 @@ class Instrument: ## Downsampling filtering - logging.info("Downsampling inter-spacecraft beatnotes") + logger.info("Downsampling beatnotes") + + logger.debug("Downsampling inter-spacecraft beatnotes") self.isc_carrier_offsets = self.filtered_isc_carrier_offsets.transformed(self.downsampled) self.isc_carrier_fluctuations = self.filtered_isc_carrier_fluctuations.transformed(self.downsampled) self.isc_carriers = self.filtered_isc_carriers.transformed(self.downsampled) @@ -805,10 +864,10 @@ class Instrument: self.isc_usb_fluctuations = self.filtered_isc_usb_fluctuations.transformed(self.downsampled) self.isc_usbs = self.filtered_isc_usbs.transformed(self.downsampled) - logging.info("Filtering and downsampling measured pseudo-ranges") + logger.debug("Downsampling measured pseudo-ranges") self.mprs = self.filtered_mprs.transformed(self.downsampled) - logging.info("Filtering and downsampling test-mass beatnotes") + logger.debug("Downsampling test-mass beatnotes") self.tm_carrier_offsets = self.filtered_tm_carrier_offsets.transformed(self.downsampled) self.tm_carrier_fluctuations = self.filtered_tm_carrier_fluctuations.transformed(self.downsampled) self.tm_carriers = self.filtered_tm_carriers.transformed(self.downsampled) @@ -816,7 +875,7 @@ class Instrument: self.tm_usb_fluctuations = self.filtered_tm_usb_fluctuations.transformed(self.downsampled) self.tm_usbs = self.filtered_tm_usbs.transformed(self.downsampled) - logging.info("Filtering and downsampling reference beatnotes") + logger.debug("Downsampling reference beatnotes") self.ref_carrier_offsets = self.filtered_ref_carrier_offsets.transformed(self.downsampled) self.ref_carrier_fluctuations = self.filtered_ref_carrier_fluctuations.transformed(self.downsampled) self.ref_carriers = self.filtered_ref_carriers.transformed(self.downsampled) @@ -825,19 +884,22 @@ class Instrument: self.ref_usbs = self.filtered_ref_usbs.transformed(self.downsampled) ## Closing simulation - logging.info("Simulation complete") + logger.info("Simulation complete") def simulate_noises(self): """Generate noise time series.""" ## Laser noise - logging.info("Generating laser noise time series") + logger.info("Generating laser noise") + if self.three_lasers: + logging.debug("Generating laser noise per spacecraft") self.laser_noises = ForEachSC(lambda sc: noises.laser(self.physics_fs, self.physics_size, self.laser_asds[sc]) ) else: + logger.debug("Generating laser noise per MOSA") self.laser_noises = ForEachMOSA(lambda mosa: noises.laser(self.physics_fs, self.physics_size, self.laser_asds[mosa]) ) @@ -848,24 +910,25 @@ 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] ) 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 ) - - logging.info("Generating clock noise fluctuations time series") + logger.debug("Generating clock noise fluctuations") self.clock_noise_fluctuations = ForEachSC(lambda sc: noises.clock(self.physics_fs, self.physics_size, self.clock_asds[sc]) ) ## Modulation noise - logging.info("Generating modulation noise time series") + logger.info("Generating modulation noise") self.modulation_noises = ForEachMOSA(lambda mosa: noises.modulation(self.physics_fs, self.physics_size, self.modulation_asds[mosa], self.modulation_fknees[mosa]) @@ -873,14 +936,14 @@ class Instrument: ## Backlink noise - logging.info("Generating backlink noise time series") + 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]) ) ## Test-mass acceleration noise - logging.info("Generating test-mass acceleration noise time series") + logger.info("Generating test-mass acceleration noise") self.testmass_noises = ForEachMOSA(lambda mosa: noises.testmass(self.physics_fs, self.physics_size, self.testmass_asds[mosa], self.testmass_fknees[mosa]) @@ -888,7 +951,7 @@ class Instrument: ## Ranging noise - logging.info("Generating ranging noise time series") + 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]) ) @@ -903,8 +966,8 @@ class Instrument: timer_deviations: array of timer deviations sc: spacecraft index """ - logging.info("Inverting timer deviations for spacecraft %s", sc) - logging.debug("Solving iteratively (tolerance=%s s, maxiter=%s)", + logger.debug("Inverting timer deviations for spacecraft %s", sc) + logger.debug("Solving iteratively (tolerance=%s s, maxiter=%s)", self.clockinv_tolerance, self.clockinv_maxiter) niter = 0 @@ -914,13 +977,13 @@ class Instrument: if niter >= self.clockinv_maxiter: logging.warning("Maximum number of iterations '%s' reached (error=%.2E)", niter, error) break - logging.debug("Starting iteration #%s", niter) + logger.debug("Starting iteration #%s", niter) inverse = next_inverse next_inverse = self.interpolate(timer_deviations, -inverse * self.physics_fs) error = numpy.max(numpy.abs(inverse - next_inverse)) logging.debug("End of iteration %s, with an error of %.2E s", niter, error) niter += 1 - logging.debug("End of timer deviation inversion after %s iterations with an error of %.2E s", niter, error) + logger.debug("End of timer deviation inversion after %s iterations with an error of %.2E s", niter, error) return inverse def write_metadata(self, hdf5): @@ -950,190 +1013,193 @@ class Instrument: if not self.simulated: self.simulate(keep_all=write_all) - logging.info("Writing metadata and physics time dataset to '%s'", output) + logger.info("Writing simulation to '%s'", output) + logging.debug("Writing metadata and physics time dataset to '%s'", output) + hdf5 = h5py.File(output, mode) self.write_metadata(hdf5) hdf5['physics_t'] = self.physics_t if write_all: - logging.info("Writing laser noise to '%s'", output) + + logger.debug("Writing laser noise to '%s'", output) self.laser_noises.write(hdf5, 'laser_noises') - logging.info("Writing clock noise to '%s'", output) + logging.debug("Writing clock noise to '%s'", output) self.clock_noise_offsets.write(hdf5, 'clock_noise_offsets') self.clock_noise_fluctuations.write(hdf5, 'clock_noise_fluctuations') - logging.info("Writing modulation noise to '%s'", output) + logger.debug("Writing modulation noise to '%s'", output) self.modulation_noises.write(hdf5, 'modulation_noises') - logging.info("Writing local beams to '%s'", output) + logging.debug("Writing local beams to '%s'", output) self.local_carrier_offsets.write(hdf5, 'local_carrier_offsets') self.local_carrier_fluctuations.write(hdf5, 'local_carrier_fluctuations') self.local_usb_offsets.write(hdf5, 'local_usb_offsets') self.local_usb_fluctuations.write(hdf5, 'local_usb_fluctuations') self.local_timer_deviations.write(hdf5, 'local_timer_deviations') - logging.info("Writing proper pseudo-ranges to '%s'", output) + logger.debug("Writing proper pseudo-ranges to '%s'", output) self.pprs.write(hdf5, 'pprs') - logging.info("Writing proper pseudo-range derivatives to '%s'", output) + logging.debug("Writing proper pseudo-range derivatives to '%s'", output) self.d_pprs.write(hdf5, 'd_pprs') - logging.info("Writing propagated distant beams to '%s'", output) + logger.debug("Writing propagated distant beams to '%s'", output) self.distant_carrier_offsets.write(hdf5, 'distant_carrier_offsets') self.distant_carrier_fluctuations.write(hdf5, 'distant_carrier_fluctuations') self.distant_usb_offsets.write(hdf5, 'distant_usb_offsets') self.distant_usb_fluctuations.write(hdf5, 'distant_usb_fluctuations') self.distant_timer_deviations.write(hdf5, 'distant_timer_deviations') - logging.info("Writing backlink noise to '%s'", output) + logger.debug("Writing backlink noise to '%s'", output) self.backlink_noises.write(hdf5, 'backlink_noises') - logging.info("Writing propagated adjacent beams to '%s'", output) + logger.debug("Writing propagated adjacent beams to '%s'", output) self.adjacent_carrier_offsets.write(hdf5, 'adjacent_carrier_offsets') self.adjacent_carrier_fluctuations.write(hdf5, 'adjacent_carrier_fluctuations') self.adjacent_usb_offsets.write(hdf5, 'adjacent_usb_offsets') self.adjacent_usb_fluctuations.write(hdf5, 'adjacent_usb_fluctuations') - logging.info("Writing local beams at inter-spacecraft interferometer to '%s'", output) + logger.debug("Writing local beams at inter-spacecraft interferometer to '%s'", output) self.local_isc_carrier_offsets.write(hdf5, 'local_isc_carrier_offsets') self.local_isc_carrier_fluctuations.write(hdf5, 'local_isc_carrier_fluctuations') self.local_isc_usb_offsets.write(hdf5, 'local_isc_usb_offsets') self.local_isc_usb_fluctuations.write(hdf5, 'local_isc_usb_fluctuations') - logging.info("Writing distant beams at inter-spacecraft interferometer to '%s'", output) + logger.debug("Writing distant beams at inter-spacecraft interferometer to '%s'", output) self.distant_isc_carrier_offsets.write(hdf5, 'distant_isc_carrier_offsets') self.distant_isc_carrier_fluctuations.write(hdf5, 'distant_isc_carrier_fluctuations') self.distant_isc_usb_offsets.write(hdf5, 'distant_isc_usb_offsets') self.distant_isc_usb_fluctuations.write(hdf5, 'distant_isc_usb_fluctuations') - logging.info("Writing inter-spacecraft beatnotes on TPS to '%s'", output) + logger.debug("Writing inter-spacecraft beatnotes on TPS to '%s'", output) self.tps_isc_carrier_offsets.write(hdf5, 'tps_isc_carrier_offsets') self.tps_isc_carrier_fluctuations.write(hdf5, 'tps_isc_carrier_fluctuations') self.tps_isc_usb_offsets.write(hdf5, 'tps_isc_usb_offsets') self.tps_isc_usb_fluctuations.write(hdf5, 'tps_isc_usb_fluctuations') - logging.info("Writing ranging noise to '%s'", output) + logger.debug("Writing ranging noise to '%s'", output) self.ranging_noises.write(hdf5, 'ranging_noises') - logging.info("Writing measured pseudo-ranges on TPS to '%s'", output) + logger.debug("Writing measured pseudo-ranges on TPS to '%s'", output) self.tps_mprs.write(hdf5, 'tps_mprs') - logging.info("Writing test-mass acceleration noise to '%s'", output) + logger.debug("Writing test-mass acceleration noise to '%s'", output) self.testmass_noises.write(hdf5, 'tm_noises') - logging.info("Writing local beams at test-mass interferometer to '%s'", output) + logger.debug("Writing local beams at test-mass interferometer to '%s'", output) self.local_tm_carrier_offsets.write(hdf5, 'local_tm_carrier_offsets') self.local_tm_carrier_fluctuations.write(hdf5, 'local_tm_carrier_fluctuations') self.local_tm_usb_offsets.write(hdf5, 'local_tm_usb_offsets') self.local_tm_usb_fluctuations.write(hdf5, 'local_tm_usb_fluctuations') - logging.info("Writing adjacent beams at test-mass interferometer to '%s'", output) + logging.debug("Writing adjacent beams at test-mass interferometer to '%s'", output) self.adjacent_tm_carrier_offsets.write(hdf5, 'adjacent_tm_carrier_offsets') self.adjacent_tm_carrier_fluctuations.write(hdf5, 'adjacent_tm_carrier_fluctuations') self.adjacent_tm_usb_offsets.write(hdf5, 'adjacent_tm_usb_offsets') self.adjacent_tm_usb_fluctuations.write(hdf5, 'adjacent_tm_usb_fluctuations') - logging.info("Writing test-mass beatnotes on TPS to '%s'", output) + logger.debug("Writing test-mass beatnotes on TPS to '%s'", output) self.tps_tm_carrier_offsets.write(hdf5, 'tps_tm_carrier_offsets') self.tps_tm_carrier_fluctuations.write(hdf5, 'tps_tm_carrier_fluctuations') self.tps_tm_usb_offsets.write(hdf5, 'tps_tm_usb_offsets') self.tps_tm_usb_fluctuations.write(hdf5, 'tps_tm_usb_fluctuations') - logging.info("Writing local beams at reference interferometer to '%s'", output) + logger.debug("Writing local beams at reference interferometer to '%s'", output) self.local_ref_carrier_offsets.write(hdf5, 'local_ref_carrier_offsets') self.local_ref_carrier_fluctuations.write(hdf5, 'local_ref_carrier_fluctuations') self.local_ref_usb_offsets.write(hdf5, 'local_ref_usb_offsets') self.local_ref_usb_fluctuations.write(hdf5, 'local_ref_usb_fluctuations') - logging.info("Writing adjacent beams at reference interferometer to '%s'", output) + logger.debug("Writing adjacent beams at reference interferometer to '%s'", output) self.adjacent_ref_carrier_offsets.write(hdf5, 'adjacent_ref_carrier_offsets') self.adjacent_ref_carrier_fluctuations.write(hdf5, 'adjacent_ref_carrier_fluctuations') self.adjacent_ref_usb_offsets.write(hdf5, 'adjacent_ref_usb_offsets') self.adjacent_ref_usb_fluctuations.write(hdf5, 'adjacent_ref_usb_fluctuations') - logging.info("Writing reference beatnotes on TPS to '%s'", output) + logger.debug("Writing reference beatnotes on TPS to '%s'", output) self.tps_ref_carrier_offsets.write(hdf5, 'tps_ref_carrier_offsets') self.tps_ref_carrier_fluctuations.write(hdf5, 'tps_ref_carrier_fluctuations') self.tps_ref_usb_offsets.write(hdf5, 'tps_ref_usb_offsets') self.tps_ref_usb_fluctuations.write(hdf5, 'tps_ref_usb_fluctuations') - logging.info("Writing inter-spacecraft beatnotes sampled to THE grid to '%s'", output) + logger.debug("Writing inter-spacecraft beatnotes sampled to THE grid to '%s'", output) self.the_isc_carrier_offsets.write(hdf5, 'the_isc_carrier_offsets') self.the_isc_carrier_fluctuations.write(hdf5, 'the_isc_carrier_fluctuations') self.the_isc_usb_offsets.write(hdf5, 'the_isc_usb_offsets') self.the_isc_usb_fluctuations.write(hdf5, 'the_isc_usb_fluctuations') - logging.info("Writing measured pseudo-ranges sampled to THE grid to '%s'", output) + logger.debug("Writing measured pseudo-ranges sampled to THE grid to '%s'", output) self.the_mprs.write(hdf5, 'the_mprs') - logging.info("Writing test-mass beatnotes sampled to THE grid to '%s'", output) + logger.debug("Writing test-mass beatnotes sampled to THE grid to '%s'", output) self.the_tm_carrier_offsets.write(hdf5, 'the_tm_carrier_offsets') self.the_tm_carrier_fluctuations.write(hdf5, 'the_tm_carrier_fluctuations') self.the_tm_usb_offsets.write(hdf5, 'the_tm_usb_offsets') self.the_tm_usb_fluctuations.write(hdf5, 'the_tm_usb_fluctuations') - logging.info("Writing reference beatnotes sampled to THE grid to '%s'", output) + logger.debug("Writing reference beatnotes sampled to THE grid to '%s'", output) self.the_ref_carrier_offsets.write(hdf5, 'the_ref_carrier_offsets') self.the_ref_carrier_fluctuations.write(hdf5, 'the_ref_carrier_fluctuations') self.the_ref_usb_offsets.write(hdf5, 'the_ref_usb_offsets') self.the_ref_usb_fluctuations.write(hdf5, 'the_ref_usb_fluctuations') - logging.info("Writing filtered inter-spacecraft beatnotes to '%s'", output) + logger.debug("Writing filtered inter-spacecraft beatnotes to '%s'", output) self.filtered_isc_carrier_offsets.write(hdf5, 'filtered_isc_carrier_offsets') self.filtered_isc_carrier_fluctuations.write(hdf5, 'filtered_isc_carrier_fluctuations') self.filtered_isc_usb_offsets.write(hdf5, 'filtered_isc_usb_offsets') self.filtered_isc_usb_fluctuations.write(hdf5, 'filtered_isc_usb_fluctuations') - logging.info("Writing filtered measured pseudo-ranges to '%s'", output) + logger.debug("Writing filtered measured pseudo-ranges to '%s'", output) self.filtered_mprs.write(hdf5, 'filtered_mprs') - logging.info("Writing filtered test-mass beatnotes to '%s'", output) + logger.debug("Writing filtered test-mass beatnotes to '%s'", output) self.filtered_tm_carrier_offsets.write(hdf5, 'filtered_tm_carrier_offsets') self.filtered_tm_carrier_fluctuations.write(hdf5, 'filtered_tm_carrier_fluctuations') self.filtered_tm_usb_offsets.write(hdf5, 'filtered_tm_usb_offsets') self.filtered_tm_usb_fluctuations.write(hdf5, 'filtered_tm_usb_fluctuations') - logging.info("Writing filtered reference beatnotes to '%s'", output) + logger.debug("Writing filtered reference beatnotes to '%s'", output) self.filtered_ref_carrier_offsets.write(hdf5, 'filtered_ref_carrier_offsets') self.filtered_ref_carrier_fluctuations.write(hdf5, 'filtered_ref_carrier_fluctuations') self.filtered_ref_usb_offsets.write(hdf5, 'filtered_ref_usb_offsets') self.filtered_ref_usb_fluctuations.write(hdf5, 'filtered_ref_usb_fluctuations') - logging.info("Writing downsampled inter-spacecraft beatnotes to '%s'", output) + logger.debug("Writing downsampled inter-spacecraft beatnotes to '%s'", output) self.isc_carrier_offsets.write(hdf5, 'isc_carrier_offsets') self.isc_carrier_fluctuations.write(hdf5, 'isc_carrier_fluctuations') self.isc_usb_offsets.write(hdf5, 'isc_usb_offsets') self.isc_usb_fluctuations.write(hdf5, 'isc_usb_fluctuations') - logging.info("Writing downsampled measured pseudo-ranges to '%s'", output) + logger.debug("Writing downsampled measured pseudo-ranges to '%s'", output) self.mprs.write(hdf5, 'mprs') - logging.info("Writing downsampled test-mass beatnotes to '%s'", output) + logger.debug("Writing downsampled test-mass beatnotes to '%s'", output) self.tm_carrier_offsets.write(hdf5, 'tm_carrier_offsets') self.tm_carrier_fluctuations.write(hdf5, 'tm_carrier_fluctuations') self.tm_usb_offsets.write(hdf5, 'tm_usb_offsets') self.tm_usb_fluctuations.write(hdf5, 'tm_usb_fluctuations') - logging.info("Writing downsampled reference beatnotes to '%s'", output) + logger.debug("Writing downsampled reference beatnotes to '%s'", output) self.ref_carrier_offsets.write(hdf5, 'ref_carrier_offsets') self.ref_carrier_fluctuations.write(hdf5, 'ref_carrier_fluctuations') self.ref_usb_offsets.write(hdf5, 'ref_usb_offsets') self.ref_usb_fluctuations.write(hdf5, 'ref_usb_fluctuations') - logging.info("Writing inter-spacecraft beatnote total frequencies to '%s'", output) + logger.debug("Writing inter-spacecraft beatnote total frequencies to '%s'", output) self.isc_carriers.write(hdf5, 'isc_carriers') self.isc_usbs.write(hdf5, 'isc_usbs') - logging.info("Writing test-mass beatnote total frequencies to '%s'", output) + logger.debug("Writing test-mass beatnote total frequencies to '%s'", output) self.tm_carriers.write(hdf5, 'tm_carriers') self.tm_usbs.write(hdf5, 'tm_usbs') - logging.info("Writing reference beatnote total frequencies to '%s'", output) + logger.debug("Writing reference beatnote total frequencies to '%s'", output) self.ref_carriers.write(hdf5, 'ref_carriers') self.ref_usbs.write(hdf5, 'ref_usbs') - logging.info("Closing output file '%s'", output) + logger.info("Closing measurement file '%s'", output) hdf5.close() def plot_fluctuations(self, output=None, skip=0): @@ -1165,7 +1231,7 @@ class Instrument: axis.legend() # Save or show glitch if output is not None: - logging.info("Saving plot to %s", output) + logger.info("Saving plot to %s", output) matplotlib.pyplot.savefig(output, bbox_inches='tight') else: matplotlib.pyplot.show() @@ -1199,7 +1265,7 @@ class Instrument: axis.legend() # Save or show glitch if output is not None: - logging.info("Saving plot to %s", output) + logger.info("Saving plot to %s", output) matplotlib.pyplot.savefig(output, bbox_inches='tight') else: matplotlib.pyplot.show() @@ -1215,7 +1281,7 @@ class Instrument: if not self.simulated: self.simulate() # Plot signals - logging.info("Plotting beatnote total frequencies") + logger.info("Plotting beatnote total frequencies") _, axes = matplotlib.pyplot.subplots(3, 1, figsize=(12, 12)) plot = lambda axis, x, label: axis.plot(self.t[skip:], numpy.broadcast_to(x, self.size)[skip:], label=label) for mosa in self.MOSAS: @@ -1233,7 +1299,7 @@ class Instrument: axis.legend() # Save or show glitch if output is not None: - logging.info("Saving plot to %s", output) + logger.info("Saving plot to %s", output) matplotlib.pyplot.savefig(output, bbox_inches='tight') else: matplotlib.pyplot.show() @@ -1265,7 +1331,7 @@ class Instrument: axis.legend() # Save or show glitch if output is not None: - logging.info("Saving plot to %s", output) + logger.info("Saving plot to %s", output) matplotlib.pyplot.savefig(output, bbox_inches='tight') else: matplotlib.pyplot.show()