Commit 4f60182c authored by Camilla Galloni's avatar Camilla Galloni
Browse files

Add latency to create VFAT config

parent e5b019fb
Pipeline #3684344 passed with stages
in 3 minutes and 30 seconds
......@@ -10,6 +10,7 @@ PARAMETER_MAPPING = {
"iref": "CFG_IREF",
"threshold": "CFG_THR_ARM_DAC",
"vref-adc": "CFG_VREF_ADC",
"latency": "CFG_LATENCY",
}
......@@ -21,6 +22,7 @@ def create_configuration(
calibration_filename,
dac_filenames,
threshold_filenames,
latency_filenames,
):
def write_configuration(df):
"""Write the configuration file for a given OptoHybrid"""
......@@ -150,6 +152,22 @@ def create_configuration(
)
parameter_dataframes.append(df_thresholds)
if latency_filenames:
# Load input files
df_latencies = pd.concat(
(pd.read_csv(f, sep=";") for f in latency_filenames), ignore_index=True
)
# Keep only needed parameters
df_latencies = df_latencies[["fed", "slot", "oh", "vfat", "latency"]]
# Rename parameter names using mapping to their register names
df_latencies.rename(columns=PARAMETER_MAPPING, inplace=True)
df_latencies = df_latenciess.melt(
id_vars=["fed", "slot", "oh", "vfat"], var_name="parameter", value_name="value"
)
parameter_dataframes.append(df_latencies)
df_vfat_parameters = pd.concat(parameter_dataframes, ignore_index=True)
# Update the configuration files for each VFAT present in the parameters DataFrame
......
......@@ -151,6 +151,14 @@ def main():
action="append",
help="File containing the VFAT thresholds obtained by an sbit rate scan",
)
create_config_vfat_parser.add_argument(
"-l",
"--latency",
dest="latency_files",
type=pathlib.Path,
action="append",
help="File containing the VFAT latencies obtained by a latency scan",
)
create_config_vfat_parser.add_argument(
"--default",
dest="default_file",
......@@ -177,6 +185,7 @@ def main():
calibration_filename=args.calibration_file,
dac_filenames=args.dac_files,
threshold_filenames=args.threshold_files,
latency_filenames=args.latency_files,
)
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment