Skip to content

Commit

Permalink
add integration_length from octave manager
Browse files Browse the repository at this point in the history
  • Loading branch information
paulQM committed Jan 31, 2025
1 parent 05f78a6 commit 5cc1468
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion qualang_tools/octave_tools/calibration_result_plotter.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
import inspect
import logging
from typing import Optional

import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.patches import Rectangle
from qm.octave.octave_manager import _add_calibration_entries_to_config
from qm.octave.octave_mixer_calibration import MixerCalibrationResults
from qm.type_hinting.general import Number
from qualang_tools.units import unit


logger = logging.getLogger(__name__)


def get_integration_length():
# Get the source code of the function
source_code = inspect.getsource(_add_calibration_entries_to_config)
# Find the line where integration_length is defined
for line in source_code.split("\n"):
if "integration_length" in line:
# Extract the value of integration_length
integration_length = int(line.split("=")[1].strip())
return integration_length
return None


integration_length = get_integration_length()


class CalibrationResultPlotter:
colors = ["black", "midnightblue", "navy", "darkblue", "mediumblue", "dodgerblue", "white", "lightgrey"]
custom_cmap = LinearSegmentedColormap.from_list("custom_diverging", colors, N=256)
Expand Down

0 comments on commit 5cc1468

Please sign in to comment.