Coercivity and microstructure in Co-Pt and Co-Pd thin films