def calc_league_points(pos_map, dsq_list):
	"""
	A function to work out the league points for each zone, given the rankings within that game.
	@param pos_map: a dict of position to array of zone numbers.
	@param dsq_list: a list of zones that shouldn't be awarded league points.
	@returns: a dict of zone number to league points.
	"""

	lpoints = {}

	for pos, zones in pos_map.iteritems():
		# remove any that are dsqaulified
		# note that we do this before working out the ties, so that any
		# dsq tie members are removed from contention
		zones = [ z for z in zones if z not in dsq_list ]
		if len(zones) == 0:
			continue

		# max points is 4, add one because pos is 1-indexed
		points = (4 + 1) - pos
		# Now that we have the value for this position if it were not a tie,
		# we need to allow for ties. In case of a tie, the available points
		# for all the places used are shared by all those thus placed.
		# Eg: three first places get 3pts each (4+3+2)/3.
		# Rather than generate a list and average it, it's quicker to just
		# do some maths using the max value and the length of the list
		points = points - ( (len(zones) - 1) / 2.0 )
		for z in zones:
			lpoints[z] = points

	# those that were dsq get 0
	for z in dsq_list:
		lpoints[z] = 0.0

	return lpoints