def _add_peak_labels(self, line): opt = self.options xs = line.index.get_data() ys = line.value.get_data() if xs.shape[0]: xp, yp = fast_find_peaks(ys, xs) self.peaks = xp if opt.label_all_peaks: border = opt.peak_label_border border_color = opt.peak_label_border_color bgcolor = opt.peak_label_bgcolor if opt.peak_label_bgcolor_enabled else 'transparent' for xi, yi in zip(xp, yp): label = PeakLabel(line, data_point=(xi, yi), label_text=floatfmt( xi, n=opt.peak_label_sigfigs), border_visible=bool(border), border_width=border, border_color=border_color, bgcolor=bgcolor) line.overlays.append(label)
def _add_peak_labels(self, line, ages, errors): xs = line.index.get_data() ys = line.value.get_data() xp, yp = fast_find_peaks(ys, xs) for xi, yi in zip(xp, yp): label = PeakLabel(line, data_point=(xi, yi), label_text=floatfmt(xi, n=3), border_visible=False, marker_visible=False, show_label_coords=False) line.overlays.append(label)
def _calculate_stats(self, xs, ys): ag = self.analysis_group ag.attribute = self.options.index_attr ag.weighted_age_error_kind = self.options.error_calc_method ag.include_j_error_in_mean = self.options.include_j_error_in_mean ag.include_j_error_in_individual_analyses = self.options.include_j_error mswd, valid_mswd, n = self.analysis_group.get_mswd_tuple() if self.options.mean_calculation_kind == 'kernel': wm, we = 0, 0 peak_xs, peak_ys = fast_find_peaks(ys, xs) wm = peak_xs[0] # wm = np_max(maxs, axis=1)[0] else: wage = self.analysis_group.weighted_age wm, we = wage.nominal_value, wage.std_dev return wm, we, mswd, valid_mswd
def _calculate_stats(self, xs, ys): ag = self.analysis_group options = self.options ag.attribute = options.index_attr ag.weighted_age_error_kind = options.error_calc_method ag.set_j_error(options.include_j_position_error, options.include_j_error_in_mean, dirty=True) mswd, valid_mswd, n = self.analysis_group.get_mswd_tuple() if options.mean_calculation_kind == 'kernel': wm, we = 0, 0 peak_xs, peak_ys = fast_find_peaks(ys, xs) wm = peak_xs[0] # wm = np_max(maxs, axis=1)[0] else: wage = self.analysis_group.weighted_age wm, we = nominal_value(wage), std_dev(wage) return wm, we, mswd, valid_mswd, n