An airborne far-infrared spectrometer for astronomical observations