The π−π+ ratio of photoproduction on deuterium for energies between 240 and 400 MeV