A rapid algorithm for passive remote sensing of gases with an infrared hyperspectral imaging system is reported that includes approximate and precise measurements. In the former, the spectral region of interest for the analytes is identified. In the latter, fitting calculations in the selected range and for spectral similarity measurements are employed to remove erroneous pixels from the approximate measurement to better characterize the gas sample. The results verify that the algorithm reduced the time for qualitative and quantitative determination of gases compared with conventional approaches.