Characterizing ammonia and hydrogen sulfide