The X-ray structure of supernova remnants - I. Cassiopeia A.