prep_beam_data function

Prepare data for BEAM analysis