Development of a low-cost system for measuring conditional time-averaged gradients of SO2 and NH3