Skip to content

Commit

Permalink
Quick implementation of absorption measurement.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-polk committed Dec 3, 2024
1 parent 893c032 commit 3fa52cd
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions fluorescence_assay/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,52 @@ def plot_dose_response(
differences.append(difference)

axes.plot(concentrations, differences, ".", color=color, label=label)

def plot_absorption_spectrum(
self,
axes: matplotlib.axes._axes.Axes,
section: str,
well: str,
cycle: Optional[int] = 1,
color: Optional[tuple] = (0, 0, 0),
label: Optional[str] = None,
) -> None:

data = np.array(list(self._plate_read.get_well(section, well, cycle).values()))

lmin, lmax, lstep = (
self._plate_read.get_parameter(section, parameter)
for parameter in [
"Wavelength Start",
"Wavelength End",
"Wavelength Step Size",
]
)

ll = np.arange(lmin, lmax + lstep, lstep)

axes.plot(ll, data, color=color, label=label)

def plot_absorption_across_row(
self,
axes: matplotlib.axes._axes.Axes,
section: str,
row: str,
wavelength: int,
concentrations: list[float],
cycle: Optional[int] = 1,
color: Optional[tuple] = (0, 0, 0),
label: Optional[str] = None,
) -> None:

values = []

for i in range(len(concentrations)):

value = self._plate_read.get_well(
section, f"{row}{i+1}", cycle
)[wavelength]

values.append(value)

axes.plot(concentrations, values, ".", color=color, label=label)

0 comments on commit 3fa52cd

Please sign in to comment.