# example script, copy and modify to your needs
# changes made to tis file will be overwritten with the next update
# import numpy as np ## NUMPY is not supported by IRONPYTHON !!

#print(samplename)
#print(modelname)
#print(productcode)
#print(range)
#print(datetime)
#print(xunit)
#print(yunit)
#print(spectrum)
#print(rangee)


# define output variables
error = ""
no_const = 3 # see below for this example
constituents = ["cons"] * no_const
units = ["unit"]* no_const
remarks = []
predictions = []
for r in range(nsamples):
	predictions.append([-99.99] * no_const)
	remarks.append([""] * no_const)


# arbitrary example output from python code
constituents[0] = "Wasser"
constituents[1] = "Protein"
constituents[2] = "Fett"
units[0] = "%"
units[1] = "% TM"
units[2] = "% TM"
predictions[0][0] = 1.23
predictions[0][2] = 111.23
remarks[0][2] = "zzz"


# some information logging 
with open("%s/documents/output.txt" % ("c:/users/tillmann") , "a") as file:
	file.write("Sample Name = %s \nModel name = %s \nDate = %s\nCode = %s\n" % (samplename, modelname, datetime, productcode))
	file.write("Number of samples = %d \n" % (nsamples))
	file.write("Data points = %d \n" % ndp)
	file.write("Range = %f - %f %s\n" % (rangee[0], rangee[1], xunit))
	counter = 0
	file.write("in %s\t" % (xunit))
	for x in spectrum:
		file.write("%f, " % (rangee[0] + counter * (rangee[1] - rangee[0]) / (rangee[2] - 1)))
		counter = counter + 1
	file.write("\n")
	file.write("in %s\t" % (yunit))
	#for x in range(0,nsamples,1):
	#	for y in range(0,ndp,1):
	#		file.write("%f, " % spectra[x][y])
	#	file.write("\n")
	file.write("\n")
	file.close