Added name to measurement.

This commit is contained in:
jupfi 2024-05-05 15:11:59 +02:00
parent 1ebda98a0b
commit 84b542d19f

View file

@ -1,6 +1,7 @@
"""The controller module for the simulator spectrometer.""" """The controller module for the simulator spectrometer."""
import logging import logging
from datetime import datetime
import numpy as np import numpy as np
from nqrduck_spectrometer.base_spectrometer_controller import BaseSpectrometerController from nqrduck_spectrometer.base_spectrometer_controller import BaseSpectrometerController
from nqrduck_spectrometer.measurement import Measurement from nqrduck_spectrometer.measurement import Measurement
@ -57,7 +58,12 @@ class SimulatorController(BaseSpectrometerController):
tdx = tdx[evidx] tdx = tdx[evidx]
result = result[evidx] result = result[evidx]
# Measurement name date + module + target frequency + averages + sequence name
name = f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - Simulator - {self.module.model.target_frequency / 1e6} MHz - {self.module.model.averages} averages - {self.module.model.pulse_programmer.model.pulse_sequence.name}"
logger.debug(f"Measurement name: {name}")
measurement_data = Measurement( measurement_data = Measurement(
name,
tdx, tdx,
result / simulation.averages, result / simulation.averages,
sample.resonant_frequency, sample.resonant_frequency,