A generalized algorithm for selecting optimal spectral channels for solving the sounding and absorption gas analysis problems is proposed. The algorithm is based on calculating information distance in space of gaseous object states. The conditions under which the problem of calculating the information distance is solved analytically and four algorithms that could be of practical interest are proposed.