def getTotalContribStrFromSpectraOutput( spectraOutput, energyFmt=None, intensityFmt=None ):
	""" Gets a string used to write total spectrum output to a file
	
	Args:
		spectraOutput: (GenSpectraOutput object) This contains all information for a generated spectrum
		energyFmt: (Str, optional) The format string for the energies. Default = "{:.9g}"
		intensityFmt: (Str, optional) The format string for the intensities. Default = "{:.9g}"
			 
	Returns
		 outStr: (Str) String containing data on the total generated spectrum
 
	Raises:
		 Errors
	"""

	energyFmt = "{:.9g}" if energyFmt is None else energyFmt
	intensityFmt = "{:.9g}" if intensityFmt is None else intensityFmt
	formStr = "{}, {}".format( energyFmt, intensityFmt )

	outData = spectraOutput.totalSpectralContributions
	outStrList = ["#Energy, Intensities"]
	for line in outData:
		outStrList.append( formStr.format(line[0],line[1]) )


	return "\n".join(outStrList)