Magnetic properties and microstructure of cobalt nanoparticles in a polymer film