Skip to content

Commit

Permalink
#21 test_qc1 on test data
Browse files Browse the repository at this point in the history
  • Loading branch information
kwabenantim committed Nov 20, 2024
1 parent de5602d commit cca851b
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 113 deletions.
18 changes: 12 additions & 6 deletions pcpostprocess/hergQC.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def __init__(self, sampling_rate=5, plot_dir=None, voltage=np.array([]),
n_sweeps=None, removal_time=5):
# TODO docstring

if plot_dir is not None:
self.plot_dir = plot_dir
self._plot_dir = plot_dir

self._n_qc = 16

Expand Down Expand Up @@ -134,8 +133,15 @@ def __init__(self, sampling_rate=5, plot_dir=None, voltage=np.array([]),

self._debug = True

def set_trace(self, before, after, qc_vals_before,
qc_vals_after, n_sweeps):
@property
def plot_dir(self):
return self._plot_dir

@plot_dir.setter
def plot_dir(self, path):
self._plot_dir = path

def set_trace(self, before, after, qc_vals_before, qc_vals_after, n_sweeps):
self._before = before
self._qc_vals_before = qc_vals_before
self._after = after
Expand All @@ -154,7 +160,7 @@ def run_qc(self, voltage_steps, times,
@param before is the before-drug current trace
@param after is the post-drug current trace
@param qc_vals_before is an array of values for each pre-drug sweep where each row is (Rseal, Cm, Rseries)
@param qc_vals_before is an array of values for each post-drug sweep where each row is (Rseal, Cm, Rseries)
@param qc_vals_after is an array of values for each post-drug sweep where each row is (Rseal, Cm, Rseries)
@n_sweeps is the number of sweeps to be considered
"""

Expand Down Expand Up @@ -241,7 +247,7 @@ def run_qc(self, voltage_steps, times,
QC['qc6.1.subtracted'].append(qc6_1)
QC['qc6.2.subtracted'].append(qc6_2)

if self._debug:
if self.plot_dir and self._debug:
fig = plt.figure(figsize=(8, 5))
ax = fig.subplots()
ax.plot(times, (before - after).T, label='subtracted')
Expand Down
Loading

0 comments on commit cca851b

Please sign in to comment.