Mapping the magnetic and crystal structure in cobalt nanowires.