Example #1
0
def process_single_channel(input_path, channel, output_path):
    vped_calibrator = VpedCalibrator()
    vped_calibrator.load(input_path)

    p_vped = VPEDPlot()
    p_vped.ax.set_xlabel("VPED")
    p_vped.ax.set_ylabel("Voltage (mV)")
    p_vped.add_legend(loc='best')
    p_vped.plot(vped_calibrator.vped[channel], vped_calibrator.voltage[channel])
    p_vped.save(output_path)
Example #2
0
def process(input_path, output_path):
    vped_calibrator = VpedCalibrator()
    vped_calibrator.load(input_path)

    n_channels, n_amplitudes = vped_calibrator.vped.shape
    p_vped = VPEDPlot()
    for channel in range(n_channels):
        p_vped.plot(vped_calibrator.vped[channel], vped_calibrator.voltage[channel])
    p_vped.ax.set_xlabel("VPED")
    p_vped.ax.set_ylabel("Voltage (mV)")
    p_vped.add_legend(loc='best')
    p_vped.save(output_path)
Example #3
0
def process_mean_std(input_path, mean_path, std_path):
    vped_calibrator = VpedCalibrator()
    vped_calibrator.load(input_path)

    vped = vped_calibrator.vped[0]
    mean = vped_calibrator.voltage.mean(0)
    std = vped_calibrator.voltage.std(0)
    std /= mean

    p_mean = VPEDPlot()
    p_mean.plot(vped, mean)
    p_mean.ax.set_xlabel("VPED")
    p_mean.ax.set_ylabel("Voltage Average Across Channels(mV)")
    p_mean.save(mean_path)

    p_std = VPEDPlot()
    p_std.plot(vped, std)
    p_std.ax.set_xlabel("VPED")
    p_std.ax.set_ylabel("Voltage Spread Across Channels(mV)")
    p_std.save(std_path)
Example #4
0
def process_different_temps(input_paths, channel, output_path):
    p_vped = VPEDPlot()

    reference_voltage = None
    for input_path in input_paths:
        regex_ped = re.search(r".+_([\d.]+)deg.h5", input_path)
        temperature = f"{float(regex_ped.group(1))} °C"

        vped_calibrator = VpedCalibrator()
        vped_calibrator.load(input_path)
        vped = vped_calibrator.vped[channel]
        voltage = vped_calibrator.voltage[channel]

        if reference_voltage is None:
            reference_voltage = voltage
            temperature = temperature + " (ref)"

        p_vped.plot(vped, voltage/reference_voltage, label=temperature)
    p_vped.ax.set_xlabel("VPED")
    p_vped.ax.set_ylabel("Relative Voltage")
    p_vped.add_legend(loc='best')
    p_vped.save(output_path)
Example #5
0
def get_dc_tf(dc_tf_path, vped_calibration_path):
    tf = TFDC.from_file(dc_tf_path)
    vped_calibrator = VpedCalibrator()
    vped_calibrator.load(vped_calibration_path)
    tf.finish_generation(vped_calibrator)
    return tf