split rows into two plots
authorDan White <dan@whiteaudio.com>
Fri, 8 Aug 2014 08:14:32 +0000 (03:14 -0500)
committerDan White <dan@whiteaudio.com>
Fri, 8 Aug 2014 08:14:32 +0000 (03:14 -0500)
python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-05-05.pdf
python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-05-15.pdf
python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-05-20.pdf
python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-10-10.pdf
python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-10-30.pdf
python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-unity.pdf
python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase-10.pdf [new file with mode: 0644]
python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase-5.pdf [new file with mode: 0644]
python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase.pdf
python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase.py

index 1c0fd1a91e01656e17fb3ff3dfd1605e2b2cb40c..7577de59c2dcabe736e3ee43710c2dda8fa756af 100644 (file)
Binary files a/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-05-05.pdf and b/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-05-05.pdf differ
index 9ec2b2c1f39a130e02e838c92188c1f6377af058..616596692d117cf07a361603b669eec17d2110c6 100644 (file)
Binary files a/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-05-15.pdf and b/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-05-15.pdf differ
index 4b28628bcb3f4167394d8886ab066fd0997754f3..9ddb04d40cd6bbe2673a45e43d3f0a9f0a3b5238 100644 (file)
Binary files a/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-05-20.pdf and b/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-05-20.pdf differ
index d772099fac8ad82b6a208643912d0608cb6e4d6d..21a4a8e4b63234f1b5ceefc27e10a88f7d46c59d 100644 (file)
Binary files a/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-10-10.pdf and b/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-10-10.pdf differ
index 9a11286823d661abdd9aea1c462dd6c1a2374df6..e728af6e19d1ffad892b32494c766c635414b025 100644 (file)
Binary files a/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-10-30.pdf and b/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-10-30.pdf differ
index c97a9199da5e13743de2782201dc728a7d27fcfa..5a90d5eac8710d0939bcfed6fbe866de204a8012 100644 (file)
Binary files a/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-unity.pdf and b/python-lib/test-data/chip14/arb0/harmonic-sin-phase/aht-unity.pdf differ
diff --git a/python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase-10.pdf b/python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase-10.pdf
new file mode 100644 (file)
index 0000000..e9699df
Binary files /dev/null and b/python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase-10.pdf differ
diff --git a/python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase-5.pdf b/python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase-5.pdf
new file mode 100644 (file)
index 0000000..29db6bb
Binary files /dev/null and b/python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase-5.pdf differ
index da749e019f5046c0f2938f18c1ad07e2061af34a..f33b130cff7195406aedf5069f8f7d005242f093 100644 (file)
Binary files a/python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase.pdf and b/python-lib/test-data/chip14/arb0/harmonic-sin-phase/harmonic-phase.pdf differ
index ddda41255764f5b105b244a8be2f2af19e76b29a..b31fe60922b36a09b1ddb289ca5829ddef07d163 100644 (file)
@@ -100,7 +100,195 @@ text(0.55, 0.01,
      horizontalalignment='center',
      rotation='horizontal')
 
-savefig('harmonic-phase.pdf')
+#savefig('harmonic-phase.pdf')
+
+
+
+#
+# 5 Hz basis row only
+#
+fig = figure(figsize=(6.0, 2.0))
+subplots_adjust(top=0.97, bottom=0.25, left=0.10, right=0.98)
+
+for name in glob('arb0-*5.0-005-*.npz'):
+    # ['f0', 'fs', 'vout', 'phase', 'Nperiods', 'fh', 'fsin', 'duration']
+    data = np.load(name)
+
+    # arb0-2013-04-08_130324_5.0-005-005.npz
+    s = name.split('_')[-1].rstrip('.npz')
+    s = s.split('-')
+    fh = int(s[1][1:])
+    fsin = int(s[2][1:])
+
+    wphase = 180/pi * (data['phase'] % (2*pi))
+    vout = data['vout']
+
+    #save for later
+    angles[fh, fsin] = wphase
+    vouts[fh, fsin] = vout
+
+    col = (fh / 5) - 1
+    row = (fsin / 5) - 1
+    #idx = 2*row + col + 1
+    idx = 7*col + row + 1
+    print col, row, idx
+
+
+    ax = subplot(1, 7, row+1)
+
+    if (1.0*fsin/fh % 2) == 1:
+        style = '.b'
+        text(180, 0.2,
+             'n=%i'%(fsin/fh),
+             horizontalalignment='center')
+    else:
+        style = 'xg'
+
+    zphase_outs[col, row] = vout[0] - vout.mean()
+
+    a = zeros((16,))
+    vo = zeros((16,))
+    for i, ang in enumerate(arange(0, 360, 360/16.)):
+        a[i] = ang
+        vo[i] = mean(vout[range(i, len(wphase), 16)])
+
+    #plot(wphase, vout, style)
+    #plot(wphase, vout-vout.mean(), style)
+    #plot(a, vo-vo.mean(), style)
+    plot(a, vo, style)
+
+    ylim([-0.8, 0.8])
+    xlim([0, 360])
+
+    hlines(0, 0, 360, linewidth=0.5, color='0.40')
+
+    ax = plt.gca()
+    xticks = range(0, 361, 90)
+    ax.set_xticks(xticks)
+    ax.set_xticklabels([''] * len(xticks))
+
+    yticks = linspace(-0.8, 0.8, 5)
+    ax.set_yticks(yticks)
+    if (idx % 7) == 1:
+        ylabel('$%i$' % fsin)
+    else:
+        ax.set_yticklabels([''] * len(yticks))
+
+    if idx in (1, 8):
+        ylabel(r'$y_Q(\phi)$, V')
+
+    xlabel('%i Hz' % fsin)
+
+#text(0.01, 0.55,
+#     'Harmonic correlator frequency',
+#     size='large',
+#     transform=fig.transFigure,
+#     verticalalignment='center',
+#     rotation='vertical')
+
+text(0.55, 0.02,
+     'Input frequency',
+     size='large',
+     transform=fig.transFigure,
+     horizontalalignment='center',
+     rotation='horizontal')
+
+savefig('harmonic-phase-5.pdf')
+
+
+#
+# 10 Hz basis row only
+#
+fig = figure(figsize=(6.0, 2.0))
+subplots_adjust(top=0.97, bottom=0.25, left=0.10, right=0.98)
+
+for name in glob('arb0-*5.0-010-*.npz'):
+    # ['f0', 'fs', 'vout', 'phase', 'Nperiods', 'fh', 'fsin', 'duration']
+    data = np.load(name)
+
+    # arb0-2013-04-08_130324_5.0-005-005.npz
+    s = name.split('_')[-1].rstrip('.npz')
+    s = s.split('-')
+    fh = int(s[1][1:])
+    fsin = int(s[2][1:])
+
+    wphase = 180/pi * (data['phase'] % (2*pi))
+    vout = data['vout']
+
+    #save for later
+    angles[fh, fsin] = wphase
+    vouts[fh, fsin] = vout
+
+    col = (fh / 5) - 1
+    row = (fsin / 5) - 1
+    #idx = 2*row + col + 1
+    idx = 7*col + row + 1
+    print col, row, idx
+
+
+    ax = subplot(1, 7, row+1)
+
+    if (1.0*fsin/fh % 2) == 1:
+        style = '.b'
+        text(180, 0.2,
+             'n=%i'%(fsin/fh),
+             horizontalalignment='center')
+    else:
+        style = 'xg'
+
+    zphase_outs[col, row] = vout[0] - vout.mean()
+
+    a = zeros((16,))
+    vo = zeros((16,))
+    for i, ang in enumerate(arange(0, 360, 360/16.)):
+        a[i] = ang
+        vo[i] = mean(vout[range(i, len(wphase), 16)])
+
+    #plot(wphase, vout, style)
+    #plot(wphase, vout-vout.mean(), style)
+    #plot(a, vo-vo.mean(), style)
+    plot(a, vo, style)
+
+    ylim([-0.8, 0.8])
+    xlim([0, 360])
+
+    hlines(0, 0, 360, linewidth=0.5, color='0.40')
+
+    ax = plt.gca()
+    xticks = range(0, 361, 90)
+    ax.set_xticks(xticks)
+    ax.set_xticklabels([''] * len(xticks))
+
+    yticks = linspace(-0.8, 0.8, 5)
+    ax.set_yticks(yticks)
+    if (idx % 7) == 1:
+        ylabel('$%i$' % fsin)
+    else:
+        ax.set_yticklabels([''] * len(yticks))
+
+    if idx in (1, 8):
+        ylabel(r'$y_Q(\phi)$, V')
+
+    xlabel('%i Hz' % fsin)
+
+#text(0.01, 0.55,
+#     'Harmonic correlator frequency',
+#     size='large',
+#     transform=fig.transFigure,
+#     verticalalignment='center',
+#     rotation='vertical')
+
+text(0.55, 0.02,
+     'Input frequency',
+     size='large',
+     transform=fig.transFigure,
+     horizontalalignment='center',
+     rotation='horizontal')
+
+savefig('harmonic-phase-10.pdf')
+
+
+
 
 
 
@@ -133,6 +321,7 @@ for fh, fsin in ((5, 5),
                  (5, 20),
                  (10, 10),
                  (10, 30)):
+    break
     fig = figure(figsize=(5.0, 3.0))
     subplots_adjust(top=0.92, bottom=0.14, left=0.12, right=0.96)
 
@@ -182,6 +371,7 @@ fig = figure(figsize=(6.0, 4.0))
 subplots_adjust(top=0.92, bottom=0.14, left=0.12, right=0.96)
 
 for n, fh in enumerate((5, 10)):
+    break
     print n, fh
 
     si = 0
@@ -227,5 +417,5 @@ xlabel('$\Delta \phi$, deg')
 #title(r'Input = $%i\,\mathrm{Hz}$, Harmonic = $%i\,\mathrm{Hz}$'
 #        % (fh, fsin))
 
-savefig('aht-unity.pdf')
+#savefig('aht-unity.pdf')