write clusters to format needed in ES-SDM