def analyze_event_rate(scan_base, combine_n_readouts=<NUM_LIT:1000>, time_line_absolute=True, output_pdf=None, output_file=None):
time_stamp = []<EOL>rate = []<EOL>start_time_set = False<EOL>for data_file in scan_base:<EOL><INDENT>with tb.open_file(data_file + '<STR_LIT>', mode="<STR_LIT:r>") as in_file_h5:<EOL><INDENT>meta_data_array = in_file_h5.root.meta_data[:]<EOL>parameter_ranges = np.column_stack((analysis_utils.get_ranges_from_array(meta_data_array['<STR_LIT>'][::combine_n_readouts]), analysis_utils.get_ranges_from_array(meta_data_array['<STR_LIT>'][::combine_n_readouts])))<EOL>if time_line_absolute:<EOL><INDENT>time_stamp.extend(parameter_ranges[:-<NUM_LIT:1>, <NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>if not start_time_set:<EOL><INDENT>start_time = parameter_ranges[<NUM_LIT:0>, <NUM_LIT:0>]<EOL>start_time_set = True<EOL><DEDENT>time_stamp.extend((parameter_ranges[:-<NUM_LIT:1>, <NUM_LIT:0>] - start_time) / <NUM_LIT>)<EOL><DEDENT>rate.extend((parameter_ranges[:-<NUM_LIT:1>, <NUM_LIT:3>] - parameter_ranges[:-<NUM_LIT:1>, <NUM_LIT:2>]) / (parameter_ranges[:-<NUM_LIT:1>, <NUM_LIT:1>] - parameter_ranges[:-<NUM_LIT:1>, <NUM_LIT:0>]))  <EOL><DEDENT><DEDENT>if time_line_absolute:<EOL><INDENT>plotting.plot_scatter_time(time_stamp, rate, title='<STR_LIT>', marker_style='<STR_LIT:o>', filename=output_pdf)<EOL><DEDENT>else:<EOL><INDENT>plotting.plot_scatter(time_stamp, rate, title='<STR_LIT>', x_label='<STR_LIT>', y_label='<STR_LIT>', marker_style='<STR_LIT:o>', filename=output_pdf)<EOL><DEDENT>if output_file:<EOL><INDENT>with tb.open_file(output_file, mode="<STR_LIT:a>") as out_file_h5:<EOL><INDENT>rec_array = np.array(list(zip(time_stamp, rate)), dtype=[('<STR_LIT>', float), ('<STR_LIT>', float)]).view(np.recarray)<EOL>try:<EOL><INDENT>rate_table = out_file_h5.create_table(out_file_h5.root, name='<STR_LIT>', description=rec_array, title='<STR_LIT>', filters=tb.Filters(complib='<STR_LIT>', complevel=<NUM_LIT:5>, fletcher32=False))<EOL>rate_table[:] = rec_array<EOL><DEDENT>except tb.exceptions.NodeError:<EOL><INDENT>logging.warning(output_file + '<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>return time_stamp, rate<EOL>
Determines the number of events as a function of time. Therefore the data of a fixed number of read outs are combined ('combine_n_readouts'). The number of events is taken from the meta data info
    and stored into a pdf file.

    Parameters
    ----------
    scan_base: list of str
        scan base names (e.g.:  ['//data//SCC_50_fei4_self_trigger_scan_390', ]
    combine_n_readouts: int
        the number of read outs to combine (e.g. 1000)
    time_line_absolute: bool
        if true the analysis uses absolute time stamps
    output_pdf: PdfPages
        PdfPages file object, if none the plot is printed to screen