scripts for writing out onsets for PSA model