def _comp_meas(self, plane, seg_model, sign): uplane = plane.upper() model_ph = seg_model.loc[:, "MU{}".format(uplane)] if not self._segment.element: meas_ph, meas_err = Phase.get_at(slice(None, None, None), self._meas, plane) names = _common_indices(seg_model.index, meas_ph.index) seg_meas_ph = sign * (meas_ph.loc[names] - meas_ph.loc[names[0]]) % 1. ph_beating = (seg_meas_ph[names] - model_ph[names]) % 1. ph_beating[ph_beating > 0.5] = ph_beating[ph_beating > 0.5] - 1 bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_phase(errbet0, erralf0, model_ph[names], bet0, alf0) err_ph = _quadratic_add(meas_err, prop_err) return ph_beating, err_ph else: prop_ph = model_ph[model_ph.index[0]] bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_phase( errbet0, erralf0, model_ph[model_ph.index[0]], bet0, alf0) return prop_ph, prop_err
def _comp_meas(self, plane, seg_model, sign): uplane = plane.upper() model_ph = seg_model.loc[:, "MU{}".format(uplane)] if not self._segment.element: meas_ph, meas_err = Phase.get_at(slice(None, None, None), self._meas, plane) names = _common_indices(seg_model.index, meas_ph.index) seg_meas_ph = sign * (meas_ph.loc[names] - meas_ph.loc[names[0]]) % 1. ph_beating = (seg_meas_ph[names] - model_ph[names]) % 1. ph_beating[ph_beating > 0.5] = ph_beating[ph_beating > 0.5] - 1 bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_phase(errbet0, erralf0, model_ph[names], bet0, alf0) err_ph = _quadratic_add(meas_err, prop_err) return ph_beating, err_ph else: prop_ph = model_ph[model_ph.index[0]] bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_phase(errbet0, erralf0, model_ph[model_ph.index[0]], bet0, alf0) return prop_ph, prop_err
def _comp_meas(self, plane, seg_model): uplane = plane.upper() model_beta = seg_model.loc[:, "BET{}".format(uplane)] model_ph = seg_model.loc[:, "MU{}".format(uplane)] if not self._segment.element: bphase, errbphase = BetaPhase.get_at(slice(None, None, None), self._meas, plane) names = _common_indices(seg_model.index, bphase.index) model_beta = model_beta.loc[names] errbphase = errbphase / model_beta ph_beating = (bphase - model_beta) / model_beta bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_beta(errbet0, erralf0, model_ph[names], model_beta, bet0, alf0) err_ph = _quadratic_add(errbphase, prop_err) return ph_beating, err_ph else: prop_beta = model_beta[model_beta.index[0]] bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_phase( errbet0, erralf0, model_beta[model_beta.index[0]], bet0, alf0) return prop_beta, prop_err
def _comp_meas(self, plane, seg_model): uplane = plane.upper() model_beta = seg_model.loc[:, "BET{}".format(uplane)] model_ph = seg_model.loc[:, "MU{}".format(uplane)] if not self._segment.element: bphase, errbphase = BetaPhase.get_at(slice(None, None, None), self._meas, plane) names = _common_indices(seg_model.index, bphase.index) model_beta = model_beta.loc[names] errbphase = errbphase / model_beta ph_beating = (bphase - model_beta) / model_beta bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_beta(errbet0, erralf0, model_ph[names], model_beta, bet0, alf0) err_ph = _quadratic_add(errbphase, prop_err) return ph_beating, err_ph else: prop_beta = model_beta[model_beta.index[0]] bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_phase(errbet0, erralf0, model_beta[model_beta.index[0]], bet0, alf0) return prop_beta, prop_err
def _comp_corr(self, plane, seg_model, seg_model_corr): uplane = plane.upper() model_ph = seg_model.loc[:, "MU{}".format(uplane)] corr_ph = seg_model_corr.loc[:, "MU{}".format(uplane)] if not self._segment.element: ph_beating = (corr_ph - model_ph) % 1. bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_phase(errbet0, erralf0, model_ph, bet0, alf0) return ph_beating, prop_err else: prop_ph = model_ph.iloc[0] bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_phase( errbet0, erralf0, model_ph[model_ph.index[0]], bet0, alf0) return prop_ph, prop_err
def _comp_corr(self, plane, seg_model, seg_model_corr): uplane = plane.upper() model_ph = seg_model.loc[:, "MU{}".format(uplane)] corr_ph = seg_model_corr.loc[:, "MU{}".format(uplane)] if not self._segment.element: ph_beating = (corr_ph - model_ph) % 1. bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_phase(errbet0, erralf0, model_ph, bet0, alf0) return ph_beating, prop_err else: prop_ph = model_ph.iloc[0] bet0, errbet0 = self.bet0[plane], self.errbet0[plane] alf0, erralf0 = self.alf0[plane], self.erralf0[plane] prop_err = sbs_math.propagate_error_phase(errbet0, erralf0, model_ph[model_ph.index[0]], bet0, alf0) return prop_ph, prop_err