Rutger's legacy code for PTA analysis