示例#1
0
def dcbias_single_dat(dat: DatHDF, fig_x_func: Callable, x_label: str):
    plotter = OneD(dat=dat)
    x = dat.Transition.x
    data = dat.Transition.data
    func, params = _get_transition_fit_func_params(x,
                                                   data[0],
                                                   'i_sense',
                                                   theta=None,
                                                   gamma=0)
    fits = dat.Transition.get_row_fits(name='i_sense',
                                       fit_func=func,
                                       initial_params=None,
                                       check_exists=False,
                                       overwrite=False)
    thetas = [fit.best_values.theta for fit in fits]
    fig_x = fig_x_func(dat)
    fig = plotter.plot(
        data=thetas,
        x=fig_x,
        xlabel=x_label,
        ylabel='Theta /mV',
        mode='markers+lines',
        title=
        f'Dat{dat.datnum}: MC temp={dat.Logs.temps.mc * 1000:.1f}mK DCBias thetas'
    )
    return fig
示例#2
0
    title = f'Dat{dat.datnum}: {TransitionGraphText.get_full_name_from_param(param_name)} for each row'
    ylabel = TransitionGraphText.get_ylabel_from_param(par_name=param_name)

    x = dat.Data.y
    xlabel = dat.Logs.ylabel

    if param_name not in (keys := dat.Transition.get_fit(which='row', name=fit_name, row=0).best_values.keys):
        raise KeyError(f'{param_name} not in {keys}')

    params = [fit.params.get(param_name) for fit in dat.Transition.get_row_fits(name=fit_name)]
    fit_values = [param.value for param in params]
    fit_errs = [param.stderr for param in params]

    plotter = OneD(dat=dat)
    fig = plotter.plot(data=fit_values, data_err=fit_errs, x=x,
                       xlabel=xlabel, ylabel=ylabel,
                       title=title,
                       mode='markers')
    return fig


def plot_multiple_transition_row_fit_with_stdev(dats: Iterable[DatHDF],
                                                param_name: str,
                                                fit_name: str = 'default',
                                                x: U.ARRAY_LIKE = None,
                                                xlabel: str = 'Datnum',
                                                stdev_only=False) -> go.Figure:
    """
    Display avg of row fit values with stdev or just stdev for Transition fits of multiple dats (i.e. for looking
    at how varied single scan fits are for multiple dats)

    Args: