Use threading to speed up main. Had to also change map function slightly to only accept one argument (an indice, represented by a tuple (r,y)) and therefore cahnge get_magnitudes in ftdata to accept ind instead of r,y .