code to process data for plots on the cluster