I would like to suggest the attached fixes for the basemap module to improve its treatment of celestial (rather than geographic) coordinates.
The first changes the call function in basemap's init.py to correctly transform lat/lon values into xy map coordinates in the case of a cyclic or polycyclic projection with lon_0 not equal to 0.
The second changes one line in the drawparallels. This line is to avoid drawing lines between points on the parallel that span the whole map. However, the old version uses a fixed value for the distance between the points rather than scaling it to the radius of the sphere used in the projection, so if you use a non-default radius (such as 180/pi, so your x-y values are in degrees on the sky instead of meters on the earth) it won't work. This fix scales the cutoff value to the radius of the projection sphere.
The following example illustrates the issues that are addressed here:
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
Fixes issue with using lon_0 not equal to 0 for celestial coordinates…
… in a cyclic or polycyclic projection.
fixes bug in drawparallels when the radius of the sphere of the proje…
…ction is set to something other than the default.
applied to master - thanks!