Skip to content
Snippets Groups Projects
Commit 3ed45714 authored by Pascal Engeler's avatar Pascal Engeler
Browse files

Fixed output units

parent fc29e2ab
No related branches found
No related tags found
No related merge requests found
......@@ -41,10 +41,13 @@ def dataToAmpsPhase(data):
if sindata[i]&(2**63) != 0:
sindata[i] = sindata[i]-2**64
amps = [2**-15*np.sqrt(2.*cosdata[i]**2+2.*sindata[i]**2)/numdata[i] for i in range(len(numdata))] #probably pm
#do 2**-18 to bring sin,cos to [-1,1]
#a 2**-6 already done by LockInAccumulator output, so do additional 2**6 to get to pm
#now do 10**-3 to get to nm
amps = [2**-12*10**-3*np.sqrt(2.*cosdata[i]**2+2.*sindata[i]**2)/numdata[i] for i in range(len(numdata))] #nm
angles = [2.*np.arctan(sindata[i]/cosdata[i]) for i in range(len(numdata))]
angles = np.angle(np.array(cosdata)+1j*np.array(sindata))
angles_unwr = np.unwrap(angles)
cosportion = [2**-15*np.abs(np.sqrt(2)*cosdata[i])/numdata[i] for i in range(len(amps))]
sinportion = [2**-15*np.abs(np.sqrt(2)*sindata[i])/numdata[i] for i in range(len(amps))]
cosportion = [2**-12*10**-3*np.abs(np.sqrt(2)*cosdata[i])/numdata[i] for i in range(len(amps))]
sinportion = [2**-12*10**-3*np.abs(np.sqrt(2)*sindata[i])/numdata[i] for i in range(len(amps))]
return np.array(amps), [np.array(angles), np.array(angles_unwr)], np.array(cosportion), np.array(sinportion), np.array(numdata)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment