The bunch pattern table is an array of 2700 values per train (the maximum number of pulses at 4.5 MHz provided by the machine) and contains information on how the pulses are distributed among SASE 1, 2, 3, and the various lasers at European XFEL.
The data stored in the bunch pattern table (mnemonic *bunchPatternTable*) can be extracted using the wrappers to the `euxfel_bunch_pattern <https://pypi.org/project/euxfel-bunch-pattern/>`_ package as follows:

.. code:: ipython3

    import toolbox_scs as tb
    import toolbox_scs.misc as tbm

    proposalNB = 2511
    runNB = 176

    run, data = tb.load(proposalNB, runNB, "bunchPatternTable")
    ppl_mask = tbm.is_ppl(data.bunchPatternTable)

ppl_mask is a boolean DataArray of dimensions trainId x 2700, where True values indicate where a laser pulse from the PP laser was triggered.

.. note::
   The position of the PP laser pulses with respect to that of the SASE 3 pulses is arbitrary. The PP laser pattern always starts at pulse Id 0, while that of SASE 3 can vary, depending on the machine parameters.

From this mask, one can obtain the number of pulses per train by summing along the 'pulse_slot' dimension:

.. code:: ipython3

   ppl_npulses = ppl_mask.sum(dim='pulse_slot')