pygaia/plot/sky.py
def _orderGridlinePoints(x, y):
  """
  This code takes care of ordering the points (x,y), calculated for a sky map parallel or merdian, such
  that the drawing code can start at one end of the curve and end at the other (so no artifacts due to
  connecting the disjoint ends occur).

  Parameters
  ----------

  x - Set of x coordinates
  y - Set of y coordinates

  Returns
  -------

  x, y: Order set of (x,y) points
  """
  xroll=roll(x,1)
  yroll=roll(y,1)
  distance=(xroll-x)**2+(yroll-y)**2
  indexmax=argmax(distance)
  return roll(x,-indexmax), roll(y,-indexmax)
def _orderGridlinePoints(x, y):
  """
  This code takes care of ordering the points (x,y), calculated for a sky map parallel or merdian, such
  that the drawing code can start at one end of the curve and end at the other (so no artifacts due to
  connecting the disjoint ends occur).

  Parameters
  ----------

  x - Set of x coordinates
  y - Set of y coordinates

  Returns
  -------

  x, y: Order set of (x,y) points
  """
  xroll=roll(x,1)
  yroll=roll(y,1)
  distance=(xroll-x)**2+(yroll-y)**2
  indexmax=argmax(distance)
  return roll(x,-indexmax), roll(y,-indexmax)
This code takes care of ordering the points (x,y), calculated for a sky map parallel or merdian, such
  that the drawing code can start at one end of the curve and end at the other (so no artifacts due to
  connecting the disjoint ends occur).

  Parameters
  ----------

  x - Set of x coordinates
  y - Set of y coordinates

  Returns
  -------

  x, y: Order set of (x,y) points