From 3fa059c62a5e86d30fc6f98d7260ca3b0a1c50be Mon Sep 17 00:00:00 2001 From: Satoru Takakura <37561290+satoru99@users.noreply.github.com> Date: Wed, 16 Sep 2026 13:38:05 +0900 Subject: [PATCH] Fix polarity issue in _fit_tau_effs (#518) and add a note about TES behavior --- sodetlib/operations/bias_steps.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sodetlib/operations/bias_steps.py b/sodetlib/operations/bias_steps.py index 32a340e1..2c58ed79 100644 --- a/sodetlib/operations/bias_steps.py +++ b/sodetlib/operations/bias_steps.py @@ -782,10 +782,17 @@ def _fit_tau_effs(self, tmin=None, weight_exp=0.3): if not len(ts[~np.isnan(ts)]): continue for rc in rcs: + # Here, the polarity of resp is aligned to dIbias + # and the offset is adjusted to be zero at the end. + # Immediately after the bias increase, temperature of TES + # cannot follow the change and the resistance is the same. + # In this regime, resp increases in electrical time constant. + # Then, as the temperature and resistance gradually rise, + # resp decreases in thermal time constant, tau_eff. + # We first find the peak and fit the latter part. resp = self.mean_resp[rc] if tmin is None: - sgn = self.polarity[rc] * -1 - tmin_m = sgn*resp > 0.9 * np.nanmax(sgn*resp) + tmin_m = resp > 0.9 * np.nanmax(resp) if not tmin_m.any(): continue fit_tmin = np.max((0, ts[tmin_m][-1]))