From fc15ada6c502437d3d37cd3bcb38239d422f8bd6 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Bayle <j2b.bayle@gmail.com>
Date: Mon, 8 Mar 2021 14:27:37 +0100
Subject: [PATCH] Use module-level logger

---
 lisainstrument/containers.py |  8 +++---
 lisainstrument/dsp.py        | 22 ++++++++--------
 lisainstrument/instrument.py | 50 +++++++++++++++++++-----------------
 lisainstrument/noises.py     | 34 ++++++++++++------------
 4 files changed, 61 insertions(+), 53 deletions(-)

diff --git a/lisainstrument/containers.py b/lisainstrument/containers.py
index f8fb922..4bc0a4d 100644
--- a/lisainstrument/containers.py
+++ b/lisainstrument/containers.py
@@ -13,6 +13,8 @@ import numpy
 import h5py
 import matplotlib.pyplot
 
+logger = logging.getLogger(__name__)
+
 
 class ForEachObject(abc.ABC):
     """Abstract class which represents a dictionary holding a value for each object."""
@@ -70,7 +72,7 @@ class ForEachObject(abc.ABC):
             if size != 1 and len(value) != size:
                 raise ValueError(f"incompatible sizes in dictionary '{size}' and '{len(size)}'")
             size = max(size, len(value))
-        logging.debug("Writing dataset of size '%s' with '%s' columns", size, len(self.indices()))
+        logger.debug("Writing dataset of size '%s' with '%s' columns", size, len(self.indices()))
         # Write dataset
         dtype = numpy.dtype({'names': self.indices(), 'formats': len(self.indices()) * [numpy.float64]})
         hdf5.create_dataset(dataset, (size,), dtype=dtype)
@@ -109,7 +111,7 @@ class ForEachObject(abc.ABC):
             size = len(self) if len(self) > 1 else 100
         t = t0 + numpy.arange(size) * dt
         # Plot signals
-        logging.info("Plotting signals for each object")
+        logger.info("Plotting signals for each object")
         matplotlib.pyplot.figure(figsize=(12, 4))
         for key, signal in self.items():
             matplotlib.pyplot.plot(t, numpy.broadcast_to(signal, size), label=key)
@@ -120,7 +122,7 @@ class ForEachObject(abc.ABC):
         matplotlib.pyplot.title(title)
         # 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()
diff --git a/lisainstrument/dsp.py b/lisainstrument/dsp.py
index 38dc235..5db2e42 100644
--- a/lisainstrument/dsp.py
+++ b/lisainstrument/dsp.py
@@ -11,6 +11,8 @@ import logging
 import scipy.sparse
 import numpy
 
+logger = logging.getLogger(__name__)
+
 
 def timeshift(data, shifts, order=31):
     """Shift `data` in time by `shifts` samples.
@@ -20,19 +22,19 @@ def timeshift(data, shifts, order=31):
         shifts: array of time shifts [samples]
         order: interpolation order
     """
-    logging.debug("Time shifting data '%s' by '%s' samples (order=%d)", data, shifts, order)
+    logger.debug("Time shifting data '%s' by '%s' samples (order=%d)", data, shifts, order)
 
     # Handle constant input and vanishing shifts
     data = numpy.asarray(data)
     shifts = numpy.asarray(shifts)
     if data.size == 1:
-        logging.debug("Input data is constant, skipping time-shift operation")
+        logger.debug("Input data is constant, skipping time-shift operation")
         return data
     if numpy.all(shifts == 0):
-        logging.debug("Time shifts are vanishing, skipping time-shift operation")
+        logger.debug("Time shifts are vanishing, skipping time-shift operation")
         return data
 
-    logging.debug("Computing Lagrange coefficients")
+    logger.debug("Computing Lagrange coefficients")
     halfp = (order + 1) // 2
     shift_ints = numpy.floor(shifts).astype(int)
     shift_fracs = shifts - shift_ints
@@ -40,17 +42,17 @@ def timeshift(data, shifts, order=31):
 
     # Handle constant shifts
     if shifts.size == 1:
-        logging.debug("Constant shifts, using correlation method")
+        logger.debug("Constant shifts, using correlation method")
         i_min = shift_ints - (halfp - 1)
         i_max = shift_ints + halfp + data.size
         if i_max - 1 < 0:
             return numpy.repeat(data[0], data.size)
         if i_min > data.size - 1:
             return numpy.repeat(data[-1], data.size)
-        logging.debug("Padding data (left=%d, right=%d)", max(0, -i_min), max(0, i_max - data.size))
+        logger.debug("Padding data (left=%d, right=%d)", max(0, -i_min), max(0, i_max - data.size))
         data_trimmed = data[max(0, i_min):min(data.size, i_max)]
         data_padded = numpy.pad(data_trimmed, (max(0, -i_min), max(0, i_max - data.size)), mode='edge')
-        logging.debug("Computing correlation product")
+        logger.debug("Computing correlation product")
         return numpy.correlate(data_padded, taps[0], mode='valid')
 
     # Check that sizes or compatible
@@ -58,7 +60,7 @@ def timeshift(data, shifts, order=31):
         raise ValueError(f"`data` and `shift` must be of the same size (got {data.size}, {shifts.size})")
 
     # Handle time-varying shifts
-    logging.debug("Time-varying shifts, using matrix method")
+    logger.debug("Time-varying shifts, using matrix method")
     indices = numpy.arange(data.size)
     i_min = numpy.min(shift_ints - (halfp - 1) + indices)
     i_max = numpy.max(shift_ints + halfp + indices + 1)
@@ -66,10 +68,10 @@ def timeshift(data, shifts, order=31):
         + numpy.repeat(shift_ints + indices, order + 1) - (halfp - 1)
     csr_ptr = (order + 1) * numpy.arange(data.size + 1)
     mat = scipy.sparse.csr_matrix((taps.reshape(-1), csr_ind - i_min, csr_ptr), shape=(data.size, i_max - i_min))
-    logging.debug("Padding data (left=%d, right=%d)", max(0, -i_min), max(0, i_max - data.size))
+    logger.debug("Padding data (left=%d, right=%d)", max(0, -i_min), max(0, i_max - data.size))
     data_trimmed = data[max(0, i_min):min(data.size, i_max)]
     data_padded = numpy.pad(data_trimmed, (max(0, -i_min), max(0, i_max - data.size)))
-    logging.debug("Computing matrix-vector product")
+    logger.debug("Computing matrix-vector product")
     return mat.dot(data_padded)
 
 
diff --git a/lisainstrument/instrument.py b/lisainstrument/instrument.py
index 916b68d..c13a260 100644
--- a/lisainstrument/instrument.py
+++ b/lisainstrument/instrument.py
@@ -189,7 +189,7 @@ class Instrument:
             parameters: see `interpolation` docstring in `__init__()`
         """
         if interpolation is None:
-            logging.info("Disabling interpolation")
+            logger.info("Disabling interpolation")
             self.interpolation_order = None
             self.interpolate = lambda x, _: x
         elif callable(interpolation):
@@ -201,7 +201,7 @@ class Instrument:
             method = str(interpolation[0])
             if method == 'lagrange':
                 self.interpolation_order = int(interpolation[1])
-                logging.debug("Using Lagrange interpolation of order %s", self.interpolation_order)
+                logger.debug("Using Lagrange interpolation of order %s", self.interpolation_order)
                 self.interpolate = lambda x, shift: x if numpy.isscalar(x) else \
                     dsp.timeshift(x, shift * self.physics_fs, self.interpolation_order)
             else:
@@ -216,7 +216,7 @@ class Instrument:
             self.aafilter_coeffs = None
             self.aafilter = lambda _, x: x
         elif isinstance(aafilter, (list, numpy.ndarray)):
-            logging.info("Using user-provided antialiasing filter coefficients")
+            logger.info("Using user-provided antialiasing filter coefficients")
             self.aafilter_coeffs = aafilter
             self.aafilter = lambda _, x: x if numpy.isscalar(x) else \
                 scipy.signal.lfilter(self.aafilter_coeffs, 1, x)
@@ -250,7 +250,7 @@ class Instrument:
             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")
+                logger.debug("Vanishing filter attenuation, disabling filtering")
                 return lambda x: x
             logger.debug("Filter attenuation is %s dB", attenuation)
             logger.debug("Filter transition band is [%s Hz, %s Hz]", freq1, freq2)
@@ -265,7 +265,7 @@ class Instrument:
     def init_orbits(self, orbits):
         """Initialize orbits."""
         if isinstance(orbits, str):
-            logging.info("Using orbit file '%s'", orbits)
+            logger.info("Using orbit file '%s'", orbits)
             self.orbit_file = orbits
             orbitf = h5py.File(self.orbit_file, 'r')
             logger.debug("Interpolating proper pseudo-ranges")
@@ -410,7 +410,7 @@ class Instrument:
 
         logger.info("Simulating local beams")
 
-        logging.debug("Computing carrier offsets for local beams")
+        logger.debug("Computing carrier offsets for local beams")
         self.local_carrier_offsets = self.offsets_freqs
 
         logger.debug("Computing carrier fluctuations for local beams")
@@ -471,7 +471,9 @@ class Instrument:
             - self.pprs[mosa]
         )
 
-        logging.info("Propagating local beams to adjacent")
+        ## Propagation to adjacent MOSA
+
+        logger.info("Propagating local beams to adjacent MOSAs")
 
         logger.debug("Propagating carrier offsets to adjacent MOSAs")
         self.adjacent_carrier_offsets = self.local_carrier_offsets.adjacent()
@@ -533,7 +535,7 @@ class Instrument:
         self.tps_isc_carrier_fluctuations = \
             self.distant_isc_carrier_fluctuations - self.local_isc_carrier_fluctuations
 
-        logging.debug("Computing inter-spacecraft upper sideband beatnote offsets on TPS")
+        logger.debug("Computing inter-spacecraft upper sideband beatnote offsets on TPS")
         self.tps_isc_usb_offsets = \
             self.distant_isc_usb_offsets - self.local_isc_usb_offsets
 
@@ -555,7 +557,7 @@ class Instrument:
         logger.debug("Propagating local carrier offsets to test-mass interferometer")
         self.local_tm_carrier_offsets = self.local_carrier_offsets
 
-        logging.debug("Propagating local carrier fluctuations to test-mass interferometer")
+        logger.debug("Propagating local carrier fluctuations to test-mass interferometer")
         self.local_tm_carrier_fluctuations = \
             self.local_carrier_fluctuations \
             + self.central_freq * (self.testmass_noises + self.glitch_tms / c)
@@ -679,7 +681,7 @@ class Instrument:
                 / (1 + self.clock_noise_offsets)**2
         ).transformed(self.timestamped)
 
-        logging.debug("Sampling inter-spacecraft upper sideband beatnote offsets to THE grid")
+        logger.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)
         ).transformed(self.timestamped)
@@ -715,7 +717,7 @@ class Instrument:
             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")
+        logger.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)
                 - self.tps_tm_usb_offsets * self.clock_noise_fluctuations
@@ -849,7 +851,7 @@ class Instrument:
         logger.info("Generating laser noise")
 
         if self.three_lasers:
-            logging.debug("Generating laser noise per spacecraft")
+            logger.debug("Generating laser noise per spacecraft")
             self.laser_noises = ForEachSC(lambda sc:
                 noises.laser(self.physics_fs, self.physics_size, self.laser_asds[sc])
             )
@@ -861,7 +863,7 @@ class Instrument:
 
         ## Clock noise
 
-        logger.info("Generating clock noise time series")
+        logger.info("Generating clock noise")
 
         if self.clock_freqlindrifts == self.clock_freqquaddrifts == 0:
             # Optimize to use a scalar if we only have a constant frequency offset
@@ -931,13 +933,13 @@ class Instrument:
         next_inverse = timer_deviations
         while not niter or error > self.clockinv_tolerance:
             if niter >= self.clockinv_maxiter:
-                logging.warning("Maximum number of iterations '%s' reached (error=%.2E)", niter, error)
+                logger.warning("Maximum number of iterations '%s' reached (error=%.2E)", niter, error)
                 break
             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)
+            logger.debug("End of iteration %s, with an error of %.2E s", niter, error)
             niter += 1
         logger.debug("End of timer deviation inversion after %s iterations with an error of %.2E s", niter, error)
         return inverse
@@ -955,7 +957,7 @@ class Instrument:
                 try:
                     hdf5.attrs[key] = str(value)
                 except RuntimeError:
-                    logging.warning("Cannot write metadata '%s' on '%s'", key, hdf5)
+                    logger.warning("Cannot write metadata '%s' on '%s'", key, hdf5)
 
     def write(self, output='measurements.h5', mode='x', write_all=False):
         """Run a simulation.
@@ -970,7 +972,7 @@ class Instrument:
             self.simulate(keep_all=write_all)
 
         logger.info("Writing simulation to '%s'", output)
-        logging.debug("Writing metadata and physics time dataset to '%s'", output)
+        logger.debug("Writing metadata and physics time dataset to '%s'", output)
 
         hdf5 = h5py.File(output, mode)
         self.write_metadata(hdf5)
@@ -981,14 +983,14 @@ class Instrument:
             logger.debug("Writing laser noise to '%s'", output)
             self.laser_noises.write(hdf5, 'laser_noises')
 
-            logging.debug("Writing clock noise to '%s'", output)
+            logger.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')
 
             logger.debug("Writing modulation noise to '%s'", output)
             self.modulation_noises.write(hdf5, 'modulation_noises')
 
-            logging.debug("Writing local beams to '%s'", output)
+            logger.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')
@@ -998,7 +1000,7 @@ class Instrument:
             logger.debug("Writing proper pseudo-ranges to '%s'", output)
             self.pprs.write(hdf5, 'pprs')
 
-            logging.debug("Writing proper pseudo-range derivatives to '%s'", output)
+            logger.debug("Writing proper pseudo-range derivatives to '%s'", output)
             self.d_pprs.write(hdf5, 'd_pprs')
 
             logger.debug("Writing propagated distant beams to '%s'", output)
@@ -1050,7 +1052,7 @@ class Instrument:
             self.local_tm_usb_offsets.write(hdf5, 'local_tm_usb_offsets')
             self.local_tm_usb_fluctuations.write(hdf5, 'local_tm_usb_fluctuations')
 
-            logging.debug("Writing adjacent beams at test-mass interferometer to '%s'", output)
+            logger.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')
@@ -1169,7 +1171,7 @@ class Instrument:
         if not self.simulated:
             self.simulate()
         # Plot signals
-        logging.info("Plotting beatnote frequency fluctuations")
+        logger.info("Plotting beatnote frequency fluctuations")
         _, 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:
@@ -1203,7 +1205,7 @@ class Instrument:
         if not self.simulated:
             self.simulate()
         # Plot signals
-        logging.info("Plotting beatnote frequency offsets")
+        logger.info("Plotting beatnote frequency offsets")
         _, 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:
@@ -1271,7 +1273,7 @@ class Instrument:
         if not self.simulated:
             self.simulate()
         # Plot signals
-        logging.info("Plotting measured pseudo-ranges")
+        logger.info("Plotting measured pseudo-ranges")
         _, axes = matplotlib.pyplot.subplots(2, 1, figsize=(12, 8))
         plot = lambda axis, x, label: axis.plot(self.t[skip:], numpy.broadcast_to(x, self.size)[skip:], label=label)
         for mosa in self.MOSAS:
diff --git a/lisainstrument/noises.py b/lisainstrument/noises.py
index 91042e9..417a511 100644
--- a/lisainstrument/noises.py
+++ b/lisainstrument/noises.py
@@ -16,6 +16,8 @@ import pyplnoise
 from numpy import pi, sqrt
 from lisaconstants import c
 
+logger = logging.getLogger(__name__)
+
 
 def white(fs, size, asd):
     """Generate a white noise.
@@ -25,9 +27,9 @@ def white(fs, size, asd):
         size: number of samples [samples]
         asd: amplitude spectral density [/sqrt(Hz)]
     """
-    logging.debug("Generating white noise (fs=%s Hz, size=%s, asd=%s)", fs, size, asd)
+    logger.debug("Generating white noise (fs=%s Hz, size=%s, asd=%s)", fs, size, asd)
     if not asd:
-        logging.debug("Vanishing power spectral density, bypassing noise generation")
+        logger.debug("Vanishing power spectral density, bypassing noise generation")
         return 0
     generator = pyplnoise.WhiteNoise(fs, asd**2 / 2)
     return generator.get_series(size)
@@ -40,9 +42,9 @@ def violet(fs, size, asd):
         fs: sampling frequency [Hz]
         size: number of samples [samples]
         asd: amplitude spectral density [/sqrt(Hz)]"""
-    logging.debug("Generating violet noise (fs=%s Hz, size=%s, asd=%s)", fs, size, asd)
+    logger.debug("Generating violet noise (fs=%s Hz, size=%s, asd=%s)", fs, size, asd)
     if not asd:
-        logging.debug("Vanishing power spectral density, bypassing noise generation")
+        logger.debug("Vanishing power spectral density, bypassing noise generation")
         return 0
     white_noise = white(fs, size, asd)
     return numpy.gradient(white_noise, 1 / fs) / (2 * pi)
@@ -55,9 +57,9 @@ def pink(fs, size, asd):
         fs: sampling frequency [Hz]
         size: number of samples [samples]
         asd: amplitude spectral density [/sqrt(Hz)]"""
-    logging.debug("Generating pink noise (fs=%s Hz, size=%s, asd=%s)", fs, size, asd)
+    logger.debug("Generating pink noise (fs=%s Hz, size=%s, asd=%s)", fs, size, asd)
     if not asd:
-        logging.debug("Vanishing power spectral density, bypassing noise generation")
+        logger.debug("Vanishing power spectral density, bypassing noise generation")
         return 0
     generator = pyplnoise.PinkNoise(fs, 1 / size, fs / 2)
     return asd / sqrt(2) * generator.get_series(size)
@@ -70,9 +72,9 @@ def red(fs, size, asd):
         fs: sampling frequency [Hz]
         size: number of samples [samples]
         asd: amplitude spectral density [/sqrt(Hz)]"""
-    logging.debug("Generating red noise (fs=%s Hz, size=%s, asd=%s)", fs, size, asd)
+    logger.debug("Generating red noise (fs=%s Hz, size=%s, asd=%s)", fs, size, asd)
     if not asd:
-        logging.debug("Vanishing power spectral density, bypassing noise generation")
+        logger.debug("Vanishing power spectral density, bypassing noise generation")
         return 0
     generator = pyplnoise.RedNoise(fs, 1 / size)
     return asd / sqrt(2) * generator.get_series(size)
@@ -85,9 +87,9 @@ def infrared(fs, size, asd):
         fs: sampling frequency [Hz]
         size: number of samples [samples]
         asd: amplitude spectral density [/sqrt(Hz)]"""
-    logging.debug("Generating infrared noise (fs=%s Hz, size=%s, asd=%s)", fs, size, asd)
+    logger.debug("Generating infrared noise (fs=%s Hz, size=%s, asd=%s)", fs, size, asd)
     if not asd:
-        logging.debug("Vanishing power spectral density, bypassing noise generation")
+        logger.debug("Vanishing power spectral density, bypassing noise generation")
         return 0
     red_noise = red(fs, size, asd)
     return numpy.cumsum(red_noise) * (2 * pi / fs)
@@ -103,7 +105,7 @@ def laser(fs, size, asd=28.2):
     Args:
         asd: amplitude spectral density [Hz/sqrt(Hz)]
     """
-    logging.debug("Generating laser noise (fs=%s Hz, size=%s, asd=%s Hz/sqrt(Hz))", fs, size, asd)
+    logger.debug("Generating laser noise (fs=%s Hz, size=%s, asd=%s Hz/sqrt(Hz))", fs, size, asd)
     return white(fs, size, asd)
 
 
@@ -117,7 +119,7 @@ def clock(fs, size, asd=6.32E-14):
     Args:
         asd: amplitude spectral density [/sqrt(Hz)]
     """
-    logging.debug("Generating clock noise fluctuations (fs=%s Hz, size=%s, asd=%s /sqrt(Hz))", fs, size, asd)
+    logger.debug("Generating clock noise fluctuations (fs=%s Hz, size=%s, asd=%s /sqrt(Hz))", fs, size, asd)
     return pink(fs, size, asd)
 
 
@@ -137,7 +139,7 @@ def modulation(fs, size, asd=1E-14, fknee=1.5E-2):
         asd: amplitude spectral density [s/sqrt(Hz)]
         fknee: cutoff frequency [Hz]
     """
-    logging.debug("Generating modulation noise (fs=%s Hz, size=%s, asd=%s s/sqrt(Hz), fknee=%s Hz)",
+    logger.debug("Generating modulation noise (fs=%s Hz, size=%s, asd=%s s/sqrt(Hz), fknee=%s Hz)",
         fs, size, asd, fknee)
     return white(fs, size, 2 * pi * asd * fknee) \
         + violet(fs, size, 2 * pi * asd)
@@ -162,7 +164,7 @@ def backlink(fs, size, asd=3E-12, fknee=2E-3):
         asd: amplitude spectral density [m/sqrt(Hz)]
         fknee: cutoff frequency [Hz]
     """
-    logging.debug("Generating modulation noise (fs=%s Hz, size=%s, asd=%s m/sqrt(Hz), fknee=%s Hz)",
+    logger.debug("Generating modulation noise (fs=%s Hz, size=%s, asd=%s m/sqrt(Hz), fknee=%s Hz)",
         fs, size, asd, fknee)
     return violet(fs, size, 2 * pi * asd / c) \
         + red(fs, size, 2 * pi * asd * fknee**2 / c)
@@ -178,7 +180,7 @@ def ranging(fs, size, asd=3E-9):
     Args:
         asd: amplitude spectral density [s/sqrt(Hz)]
     """
-    logging.debug("Generating ranging noise (fs=%s Hz, size=%s, asd=%s s/sqrt(Hz))", fs, size, asd)
+    logger.debug("Generating ranging noise (fs=%s Hz, size=%s, asd=%s s/sqrt(Hz))", fs, size, asd)
     return white(fs, size, asd)
 
 
@@ -198,7 +200,7 @@ def testmass(fs, size, asd=2.4E-15, fknee=0.4E-3):
         asd: amplitude spectral density [ms^(-2)/sqrt(Hz)]
         fknee: cutoff frequency [Hz]
     """
-    logging.debug("Generating test-mass noise (fs=%s Hz, size=%s, asd=%s ms^(-2)/sqrt(Hz), fknee=%s Hz)",
+    logger.debug("Generating test-mass noise (fs=%s Hz, size=%s, asd=%s ms^(-2)/sqrt(Hz), fknee=%s Hz)",
         fs, size, asd, fknee)
     return red(fs, size, asd / (2 * pi * c)) \
         + infrared(fs, size, asd * fknee / (2 * pi * c))
-- 
GitLab