Space-resolved chemistry from infrared extinction spectra