In [1]:
%%html
<script type="text/javascript">
     show=true;
     function toggle(){
         if (show){$('div.input').hide();}else{$('div.input').show();}
            show = !show}
 </script>
 <h2><a href="javascript:toggle()" target="_self">Click to toggle code input</a></h2>


Click to toggle code input

Air Gaps in bonded Si optics modelled as Fabry Pérot etalons

Michael Gully-Santiago

January 13, 2015

Read in all the data.


In [2]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [3]:
import seaborn as sns
sns.set_context("notebook", font_scale=1.5, rc={"lines.linewidth": 2.5})
cmap = sns.cubehelix_palette(light=1, as_cmap=True)
sns.palplot(sns.cubehelix_palette(light=1))



In [4]:
import pandas as pd
pd.set_option('display.max_columns', 100)

20150206

Carleen, Sierra, and I all went to CNM to use the Cary5000. We took many repeated empty measurements to measure the baseline and variance drift. We had to stop one measurement in the middle, so it will have missing data.

Parameter value
$\Delta\lambda$ (nm) 1255-1775
$\delta\lambda$ (nm) 2
Sampling (nm) 10
$N$ samples 53
$N$ columns 61
$N$ baselines 2
$N$ non-baselines 59

In [5]:
#! subl ../data/20150206_cary5000.csv

Here is the code when you need to parse the raw data file. It extracts the relevant column names and picks out those columns.

fn = '../data/20150206_cary5000.csv'
nrows = 53
dat = pd.read_csv(fn, sep=',', skiprows=[1], nrows=nrows, engine='python')
vals = dat.columns[0:-1:2].values
n_cols = vals.shape[0]
cols = [0] + range(1,n_cols*2, 2)
names = ['wavelength'] + vals.tolist()
df = pd.read_csv(fn, sep=',', skiprows=[0,1], na_values='',
                  nrows=nrows, engine='python', usecols=cols, names=names)
df.set_index('wavelength', inplace=True)
df=df/100.0
del df['empty_4_2']
df.to_csv('../data/cln_20150206_cary5000.csv')

Read in the cleaned dataset.


In [6]:
nrows = 53
df = pd.read_csv('../data/cln_20150206_cary5000.csv')
df.set_index('wavelength', inplace=True)
df.head()


Out[6]:
Baseline 100%T empty_1 empty_2_1 empty_2_2 empty_2_3 empty_2_4 empty_2_5 empty_2_6 empty_2_7 empty_2_8 empty_2_9 empty_2_10 empty_2_11 empty_2_12 empty_2_13 empty_2_14 empty_2_15 empty_3_1 empty_3_2 empty_3_3 empty_3_4 empty_3_5 VG05_1_1 VG05_1_2 VG05_1_3 VG05_1_4 VG05_1_5 Baseline 100%T.1 empty_4_1 empty_4_2 VG09-12_1_0 VG09-12_1_2 VG09-12_1_4 VG09-12_1_6 VG09-12_1_8 VG09-12_1_10 VG09-12_1_12 VG09-12_1_14 VG09-12_1_16 VG09-12_1_18 VG09-12_1_20 VG09-12_1_22 VG09-12_1_24 VG09-12_1_26 VG09-12_1_28 VG09-12_1_30 VG09-12_1_32 VG09-12_1_34 VG09-12_1_36 VG09-12_1_38 VG09-12_1_40 VG09-12_1_42 VG09-12_1_44 VG09-12_1_46 VG09-12_1_48 VG09-12_1_50 empty_5_1 empty_5_2 empty_5_3 empty_5_4 empty_5_5
wavelength
1775 0.054900 0.996738 0.994788 0.993000 0.992427 0.992727 0.992566 0.993178 0.993542 0.993699 0.993695 0.994273 0.994382 0.994913 0.995192 0.997182 0.996089 1.000317 1.000646 1.000757 1.001592 1.001691 0.531966 0.532362 0.532803 0.532895 0.533078 0.055321 1.000382 1.001054 1.001493 0.874571 0.520288 0.513987 0.520696 0.522658 0.526750 0.526497 0.571637 0.535314 0.535065 0.534981 0.534620 0.535057 0.535745 0.536009 0.536586 0.536681 0.537011 0.537481 0.517272 0.491913 1.005398 1.008597 1.009794 1.010392 1.011241 1.011373 1.011569 1.011567 1.011826
1765 0.056587 0.996698 0.994949 0.993029 0.992323 0.992540 0.992392 0.993101 0.993253 0.993590 0.993916 0.994138 0.994222 0.994880 0.995069 0.997146 0.996170 1.000276 1.000489 1.000754 1.001109 1.001378 0.532075 0.532165 0.532466 0.532575 0.532848 0.057007 1.000621 1.001228 1.001283 0.875052 0.519546 0.514007 0.520622 0.522183 0.526571 0.525914 0.571612 0.535326 0.534940 0.534768 0.534424 0.535212 0.536067 0.535856 0.536452 0.536578 0.537032 0.537514 0.517388 0.491351 1.005273 1.008588 1.010112 1.010448 1.011166 1.011300 1.011852 1.011722 1.012028
1755 0.058528 0.996616 0.994781 0.993856 0.992115 0.992431 0.992578 0.993081 0.993325 0.993445 0.993944 0.994041 0.994368 0.994741 0.995185 0.995766 0.996120 1.000049 1.000574 1.000839 1.001166 1.001465 0.531898 0.532115 0.532214 0.532562 0.532866 0.058966 1.000626 1.001093 1.001497 0.875337 0.518847 0.513831 0.520083 0.521865 0.526216 0.525509 0.571603 0.535314 0.534978 0.534978 0.534248 0.535097 0.535835 0.535614 0.536186 0.536287 0.536813 0.537127 0.517123 0.491549 1.005627 1.008868 1.009983 1.010426 1.011105 1.011550 1.011774 1.011923 1.011949
1745 0.060380 0.996552 0.994699 0.993798 0.992180 0.992515 0.992373 0.992759 0.993148 0.993443 0.993975 0.994108 0.994200 0.994774 0.994995 0.995585 0.996152 0.999933 1.000622 1.000973 1.001230 1.001656 0.531830 0.532072 0.532285 0.532506 0.532870 0.060837 1.000456 1.000733 1.001119 0.875349 0.518504 0.513229 0.519425 0.521210 0.526331 0.525357 0.571421 0.534957 0.534713 0.534617 0.533917 0.534785 0.535579 0.535679 0.536352 0.536031 0.536497 0.537138 0.516903 0.491059 1.005182 1.008798 1.010065 1.010098 1.011155 1.011324 1.011586 1.011805 1.011863
1735 0.062304 0.996772 0.994961 0.993465 0.992449 0.992538 0.992429 0.993018 0.993122 0.993576 0.994022 0.994134 0.994595 0.994813 0.995260 0.995902 0.996312 1.000246 1.000612 1.000831 1.001297 1.002066 0.531885 0.532085 0.532417 0.532486 0.532722 0.062780 1.000677 1.001025 1.001375 0.875580 0.518685 0.513199 0.518752 0.520695 0.526437 0.525202 0.571170 0.534776 0.534700 0.534697 0.534020 0.534712 0.535287 0.535903 0.535945 0.536309 0.536709 0.536990 0.516755 0.491418 1.005340 1.008855 1.010012 1.010301 1.011332 1.011411 1.011607 1.011826 1.011643

In [7]:
plt.figure(figsize=(12,20));
sns.heatmap(df.iloc[::1,::1], vmin=0, vmax=1.05);
plt.yticks(rotation=0);
plt.title(u'Transmission through bonded Si');


One of the columns, 'empty_4_2' was cancelled mid-way-through. Let's simply delete that one.


In [8]:
del df['empty_4_2']

Let's look at the variance of the first 15 measurements.


In [9]:
empty_cols = [col_name[0:5] == 'empty' for col_name in df.columns.values]
df[df.columns[empty_cols]].head()


Out[9]:
empty_1 empty_2_1 empty_2_2 empty_2_3 empty_2_4 empty_2_5 empty_2_6 empty_2_7 empty_2_8 empty_2_9 empty_2_10 empty_2_11 empty_2_12 empty_2_13 empty_2_14 empty_2_15 empty_3_1 empty_3_2 empty_3_3 empty_3_4 empty_3_5 empty_4_1 empty_5_1 empty_5_2 empty_5_3 empty_5_4 empty_5_5
wavelength
1775 0.996738 0.994788 0.993000 0.992427 0.992727 0.992566 0.993178 0.993542 0.993699 0.993695 0.994273 0.994382 0.994913 0.995192 0.997182 0.996089 1.000317 1.000646 1.000757 1.001592 1.001691 1.000382 1.011241 1.011373 1.011569 1.011567 1.011826
1765 0.996698 0.994949 0.993029 0.992323 0.992540 0.992392 0.993101 0.993253 0.993590 0.993916 0.994138 0.994222 0.994880 0.995069 0.997146 0.996170 1.000276 1.000489 1.000754 1.001109 1.001378 1.000621 1.011166 1.011300 1.011852 1.011722 1.012028
1755 0.996616 0.994781 0.993856 0.992115 0.992431 0.992578 0.993081 0.993325 0.993445 0.993944 0.994041 0.994368 0.994741 0.995185 0.995766 0.996120 1.000049 1.000574 1.000839 1.001166 1.001465 1.000626 1.011105 1.011550 1.011774 1.011923 1.011949
1745 0.996552 0.994699 0.993798 0.992180 0.992515 0.992373 0.992759 0.993148 0.993443 0.993975 0.994108 0.994200 0.994774 0.994995 0.995585 0.996152 0.999933 1.000622 1.000973 1.001230 1.001656 1.000456 1.011155 1.011324 1.011586 1.011805 1.011863
1735 0.996772 0.994961 0.993465 0.992449 0.992538 0.992429 0.993018 0.993122 0.993576 0.994022 0.994134 0.994595 0.994813 0.995260 0.995902 0.996312 1.000246 1.000612 1.000831 1.001297 1.002066 1.000677 1.011332 1.011411 1.011607 1.011826 1.011643

In [10]:
empty = df[df.columns[empty_cols]]

In [11]:
plt.plot(empty.index, empty)
plt.ylabel('$T$')
plt.xlabel('$\lambda$ (nm)')
plt.ylim(0.9, 1.1)


Out[11]:
(0.9, 1.1)

In [12]:
n_empty = len(empty.columns)
print n_empty
t = np.arange(0, n_empty) # rank order of time


27

In [13]:
cmap=sns.diverging_palette(-100, 0, as_cmap=True)
sns.palplot(sns.diverging_palette(-100, 0))



In [14]:
for i in range(0, nrows, 1):
    plt.scatter(t, empty.iloc[i]/empty.iloc[i, 24], c=[empty.index[i]]*n_empty, alpha=0.35, cmap=cmap, vmin=1250, vmax=1780)

plt.plot([-10, 100], [1.0, 1.0], 'k--')
plt.ylabel("$T$")
plt.xlabel("$t$ (rank order)")
plt.xlim(0, 30)
plt.ylim(0.98, 1.002)
plt.legend(loc='best')
plt.colorbar()


/Users/gully/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.py:476: UserWarning: No labelled objects found. Use label='...' kwarg on individual plots.
  warnings.warn("No labelled objects found. "
Out[14]:
<matplotlib.colorbar.Colorbar instance at 0x10a9bc950>

In [15]:
for j in range(0, n_empty, 1):
    #plt.scatter(empty.index, empty[[j]]/np.mean(empty[[j]]), c=[t[j]]*nrows, alpha=0.35, cmap=cmap, vmin=0, vmax=27)
    plt.scatter(empty.index, empty[[j]], c=[t[j]]*nrows, alpha=1.0, cmap=cmap, vmin=0, vmax=27)

#plt.plot([-10, 100], [1.0, 1.0], 'k--')
plt.ylabel("$T$")
plt.xlabel("$\lambda$ (nm)")
plt.xlim(1250, 1780)
plt.ylim(0.98, 1.02)
#plt.legend(loc='best')
plt.colorbar()


Out[15]:
<matplotlib.colorbar.Colorbar instance at 0x10b647710>

In [16]:
print df.columns.values


['Baseline 100%T' 'empty_1' 'empty_2_1' 'empty_2_2' 'empty_2_3' 'empty_2_4'
 'empty_2_5' 'empty_2_6' 'empty_2_7' 'empty_2_8' 'empty_2_9' 'empty_2_10'
 'empty_2_11' 'empty_2_12' 'empty_2_13' 'empty_2_14' 'empty_2_15'
 'empty_3_1' 'empty_3_2' 'empty_3_3' 'empty_3_4' 'empty_3_5' 'VG05_1_1'
 'VG05_1_2' 'VG05_1_3' 'VG05_1_4' 'VG05_1_5' 'Baseline 100%T.1' 'empty_4_1'
 'VG09-12_1_0' 'VG09-12_1_2' 'VG09-12_1_4' 'VG09-12_1_6' 'VG09-12_1_8'
 'VG09-12_1_10' 'VG09-12_1_12' 'VG09-12_1_14' 'VG09-12_1_16' 'VG09-12_1_18'
 'VG09-12_1_20' 'VG09-12_1_22' 'VG09-12_1_24' 'VG09-12_1_26' 'VG09-12_1_28'
 'VG09-12_1_30' 'VG09-12_1_32' 'VG09-12_1_34' 'VG09-12_1_36' 'VG09-12_1_38'
 'VG09-12_1_40' 'VG09-12_1_42' 'VG09-12_1_44' 'VG09-12_1_46' 'VG09-12_1_48'
 'VG09-12_1_50' 'empty_5_1' 'empty_5_2' 'empty_5_3' 'empty_5_4' 'empty_5_5']

In [17]:
plt.errorbar(range(len(df.columns)), 
             df.apply(np.mean, axis=0),
             yerr=df.apply(np.std, axis=0), fmt='.')
plt.ylim(0.99, 1.02)


Out[17]:
(0.99, 1.02)

Read in the time information from the original data file.