added a correction of the azimuth angle to the ordering function for IR handling