def _topo_to_sph(topo):
 assert ((topo.ndim == 2) and (topo.shape[1] == 2))
 sph = np.ones((len(topo), 3))
 sph[:, 1] = (- np.deg2rad(topo[:, 0]))
 sph[:, 2] = (np.pi * topo[:, 1])
 return sph

def _topo_to_sph ( topo ) : assert ( ( topo . ndim == 2 ) and ( topo . shape [ 1 ] == 2 ) ) sph = np . ones ( ( len ( topo ) , 3 ) ) sph [ : , 1 ] = ( - np . deg2rad ( topo [ : , 0 ] ) ) sph [ : , 2 ] = ( np . pi * topo [ : , 1 ] ) return sph
convert 2d topo coordinates to spherical coordinates .