lib package#

Submodules#

lib.fit module#

lib.fit.Q_out(V_out, period)[source]#
lib.fit.SiPM_response(x, A, B, C, D, E)[source]#
lib.fit.bursts_SiPM(x, C, D, E)[source]#
lib.fit.dark_current_SiPM(x, A, B)[source]#
lib.fit.fit_SiPM_response(df: pandas.core.frame.DataFrame, filter_data: bool = False, save: bool = False, debug: bool = False) pandas.core.frame.DataFrame[source]#
lib.fit.fit_gaussians(x, y, *p0)[source]#
lib.fit.gauss(x, a, x0, sigma)[source]#
lib.fit.gaussian_train(x, *params)[source]#

lib.io module#

lib.io.get_duration(nunbers: list, labels: list, chs: list, ovs: list, ow: bool = True, debug: bool = False)[source]#
lib.io.load_analysis(numbers: list, labels: list, ovs: list, chs: list, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/ac-dc/checkouts/stable/analysis', debug: bool = False)[source]#
lib.io.load_data(numbers: list, labels: list, ovs: list, chs: list, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/ac-dc/checkouts/stable/analysis', debug: bool = False)[source]#
lib.io.load_df(stage: str, numbers: list, labels: list, ovs: list, chs: list, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/ac-dc/checkouts/stable/analysis', debug: bool = False)[source]#
lib.io.load_files(path: str) list[source]#
lib.io.load_fit(numbers: list, labels: list, ovs: list, chs: list, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/ac-dc/checkouts/stable/analysis', debug: bool = False)[source]#

lib.lib module#

lib.lib.get_DC_ADCs(file_path, header: int = 3, segments: int = 50, debug: bool = False)[source]#
lib.lib.get_SPE_ADCs(file_path, header: int = 5, segments: int = 0, debug: bool = False)[source]#
lib.lib.get_ped_lim(ADCs, buffer: int = 50, debug: bool = False)[source]#
lib.lib.get_times(file_path, header: int = 3, segments: int = 50, debug: bool = False)[source]#
lib.lib.merge_processed_files(file_list, data: str = 'DC', polarity=- 1, width: int = 3, threshold: float = 0.0, height: float = 0.001, header: int = 3, segments: int = 50, debug: bool = False)[source]#
lib.lib.peak_finder(ADCs, period, width=3, height: float = 0.001, threshold: float = 0.0, distance: int = 20, debug: bool = False)[source]#
lib.lib.process_file(file_path: str, data: str = 'DC', polarity: int = 1, width: int = 3, threshold: float = 0.0, height: float = 0.001, distance: int = 20, header: int = 3, segments: int = 50, debug: bool = False)[source]#
lib.lib.read_file(file_path, data: str = 'DC', header: int = 3, segments: int = 50, debug: bool = False)[source]#
lib.lib.smooth_ADCs(ADCs, debug: bool = False)[source]#

lib.ml module#

lib.ml.classify_df(df, method='SILHOUETTE', ow=False, debug=False)[source]#
lib.ml.generate_yaml(df: pandas.core.frame.DataFrame, name: str, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/ac-dc/checkouts/stable/analysis/', ow: bool = False, debug: bool = False)[source]#
lib.ml.save_yaml(data: dict, name: str, path: str = '/home/docs/checkouts/readthedocs.org/user_builds/ac-dc/checkouts/stable/analysis/', debug: bool = False) None[source]#

lib.plot module#

lib.plot.make_cloud_plot(df, save: bool = True, debug: bool = False)[source]#
lib.plot.make_hist_plot(df, save: bool = True, debug: bool = False)[source]#

lib.style module#

lib.style.format_coustom_plotly(fig, title=None, legend={}, fontsize=16, figsize=None, ranges=(None, None), matches=('x', 'y'), tickformat=('.s', '.s'), log=(False, False), margin={'auto': True}, add_units=False, debug=False)[source]#

Format a plotly figure

Parameters
  • fig (plotly.graph_objects.Figure) – plotly figure

  • title (str) – title of the figure (default: None)

  • legend (dict) – legend options (default: dict())

  • fontsize (int) – font size (default: 16)

  • figsize (tuple) – figure size (default: None)

  • ranges (tuple) – axis ranges (default: (None,None))

  • matches (tuple) – axis matches (default: (“x”,”y”))

  • tickformat (tuple) – axis tick format (default: (‘.s’,’.s’))

  • log (tuple) – axis log scale (default: (False,False))

  • margin (dict) – figure margin (default: {“auto”:True,”color”:”white”,”margin”:(0,0,0,0)})

  • add_units (bool) – True to add units to axis labels, False otherwise (default: False)

  • debug (bool) – True to print debug statements, False otherwise (default: False)

Returns

plotly figure

Return type

fig (plotly.graph_objects.Figure)

lib.style.get_units(var, debug=False)[source]#

Returns the units of a variable based on the variable name

Parameters

var (str) – variable name

Module contents#