Isochrone ages for field dwarfs: method and application to the age–metallicity relation