Updated python script to match the code used to generate the publication plots