Analysis Functions for the Detector Properties.

Function to perform analysis of the detector to get the resolution and efficiency.

analysis.detector_analysis.activity(A_0, half_life, time)

Returns the activity of a radioactive element at a given time.

analysis.detector_analysis.calibration(e_pre, a, b)

Returns the re-calibrated energy. Input are the calibration parameters a and b, and the pre-calibrated energy.

analysis.detector_analysis.calibration_err(e_pre, a, b, aerr, berr)

Calculate the error of the calibration.

analysis.detector_analysis.combine_new_key(df, func_str, **kwargs)

Add two new columns (values, errors) to a dataframe calculated by a function called by the name of the function.

analysis.detector_analysis.convert_frac(lst)

Converts a list of fractions to a numpy array of floats.

analysis.detector_analysis.eff_energy(energy, popt, pcov)

Returns the efficiency over energy and its error in percent.

analysis.detector_analysis.eff_energy_err(eff, energy, aerr, berr)

Error propagation for the efficiency over energy.

analysis.detector_analysis.factory_res()

Returns the resolution of the factory values in percent.

analysis.detector_analysis.g_factor(det_area, d)

Returns the geometry-factor for a given detector area and distance. Usually g << 1.

analysis.detector_analysis.get_A_norm(df, key, peak_dict)

Returns the normalized number of counts taking the emission fraction into account and its error for a given key.

analysis.detector_analysis.get_A_rel(df, key, peak_dict)

Returns the relative number of counts taking the emission fraction into account and its error for a given key.

analysis.detector_analysis.get_angles(df)

Returns the angles from the spectras.

analysis.detector_analysis.get_eff(df, key, eff_func, **kwargs)

Returns either the relative or intrinsic efficiency and its error for a given key.

analysis.detector_analysis.get_res(energy, popt, pcov)

Returns the resolution determined with the resolution function and its error in percent.

analysis.detector_analysis.get_resolution(df, key)

Returns the resolution and its error for a given key.

analysis.detector_analysis.get_temperatures()

Returns the temperatures during the acquisitions and their errors.

analysis.detector_analysis.intrinsic_eff(A_norm, A_norm_err, element, date)

Returns the intrinsic efficiency and its error for a given element.

analysis.detector_analysis.linear(x, a, b)

Linear function to fit the calibration over energy.

analysis.detector_analysis.log_eff(energy, a, b)

Function to fit the efficiency over energy in log scale.

analysis.detector_analysis.plot_angle_dependence(df, key)

Plots the angle dependence of a parameter of the detector.

analysis.detector_analysis.plot_temp_dependence(df, key)

Plots the temperature dependence of a parameter of the detector.

analysis.detector_analysis.relative_eff(A_rel, A_rel_err, element, events_dict)

Returns the relative efficiency and its error for a given element.

analysis.detector_analysis.res_func(energy, a, b, c)

Function to fit the resolution over energy.

analysis.detector_analysis.res_func_abs(energy, a, b)

Function to fit the absolute resolution over energy.

analysis.detector_analysis.res_func_err(energy, a, b, c, aerr, berr, cerr)

Error of the resolution function.

analysis.detector_analysis.resolution(energy, sigma)

Returns the relative resolution.

analysis.detector_analysis.sqrt_err(x, xerr)

Returns the error of the square root of x.

analysis.detector_analysis.time_diff(element, date)

Returns the time difference between the measurement and the last calibration of the source.

analysis.detector_analysis.z_err(z, x, y, xerr, yerr)

Error propagation for z = x/y or x*y.