def getlambda(pixel, lo, hi):
#-----------------------------------------------------------------------------
   """
   Small utility to calculate lambda on a line for given position
   in pixels
   """
#-----------------------------------------------------------------------------
   if pixel is None:
      return 0.5
   delta = hi - lo
   if delta == 0.0:
      return 0.5
   return (pixel-lo)/(delta)