code: def to_rectangular(image):
      
      # xy image, vertical scaled to 360 degrees
      xy = pyvips.Image.xyz(image.width, image.height)
      xy *= [1, 360.0 / image.height]
  
      index = xy.rect()
  
      # scale to image rect
      scale = min(image.width, image.height) / float(image.width)
      index *= scale / 2.0
      index += [image.width / 2.0, image.height / 2.0]
  
      return image.mapim(index)
docs: Transform image coordinates to rectangular.
  
      The image is transformed so that it is unwrapped from a point in the
      centre. Circles or segments of circles become vertical straight lines,
      radial lines become horizontal lines.