The code uses small angle approximation. It will break when a galaxy footprint cross the RA = 0/360 line...