ir_average function

Averages infrared spectra within groups