Exemple #1
0
def fit_energy_dependence(
    data, envir, curve_loader, db_conn, constrained_background=False, retries=10, rms_filter=True
):
    for s, t, w, pp, z, bg in zip(
        data.Timestamp.values, data.temperature_start.values, data.W.values, data.PP, data.Z.values, data.BG.values
    ):
        curve = curve_loader(s)
        for i in range(0, retries):
            result = update_hanle(
                data=curve,
                temperature=t * U_.kelvin,
                wavelength=w * U_.nanometer,
                probe_intensity=pp * U_.watt,
                mbr_brf_displacement=z * U_.millimeter,
                probe_background=bg * U_.radian,
                constrain_background=False,
                rms_filter=rms_filter,
                db_conn=db_conn,
                **expand_kwargs(update_hanle, envir)
            )
            print(result)
            if result is not None:
                print("Found better fit, updating db")
            else:
                print("Fit not updated")
Exemple #2
0
def fit_power_dependence(data, envir, curve_loader, db_conn, constrained_background=False, retries=10, rms_filter=True):
    for s, t, w, pup in zip(data.Timestamp.values, data.temperature_start.values, data.W.values, data.PuP):
        curve = curve_loader(s)
        for i in range(0, retries):
            result = update_hanle(
                data=curve,
                temperature=t * U_.kelvin,
                wavelength=w * U_.nanometer,
                pump_intensity=pup * U_.watts,
                constrain_background=False,
                rms_filter=rms_filter,
                db_conn=db_conn,
                **expand_kwargs(update_hanle, envir)
            )
            print(result)
            if result is not None:
                print("Found better fit, updating db")
            else:
                print("Fit not updated")