A study of the inelastic scattering of pions from 40,42,44,48Ca and 54Fe