CdTe array spectrometers for X- and γ-ray astronomy