<jupyter_start><jupyter_text>This IPython Notebook is for integrating filter curves with the spectra to show the Si gap's effect size on tranmission in IR imaging.Author: <NAME>, `<EMAIL>`Date: April 16, 2015 First, let's see if we can get the filter curve data from say... Thorlabs.<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns<jupyter_output><empty_output><jupyter_text>From the Thorlabs website:  https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=1000Read in the filter curve, `fc`<jupyter_code>fc = pd.read_excel("../data/FB1250-10.xlsx", sheetname='Transmission Data', parse_cols=[2,3,4], skipfooter=2)
fc.tail()
fc.columns<jupyter_output><empty_output><jupyter_text>Normalize the transmission<jupyter_code>fc['wavelength'] = fc['Wavelength (nm)']
fc['transmission'] = fc['% Transmission']/fc['% Transmission'].max()<jupyter_output><empty_output><jupyter_text>Drop wavelengths shorter than 1200 nm since they are absorbed.<jupyter_code>fc.drop(fc.index[fc.wavelength < 1150], inplace=True)
sns.set_context('notebook', font_scale=1.5)<jupyter_output><empty_output><jupyter_text>Construct a model.<jupyter_code>import etalon as etalon
np.random.seed(78704)
fc.wavelength.values
n1 = etalon.sellmeier_Si(fc.wavelength.values)
dsp = etalon.T_gap_Si_fast(fc.wavelength, 0.0, n1)
sns.set_context('paper', font_scale=1.6)
sns.set_style('ticks')
model_absolute = etalon.T_gap_Si_fast(fc.wavelength, 50.0, n1)
model = model_absolute/dsp
plt.plot(fc.wavelength, model,label='50 nm gap spectrum')
model_absolute = etalon.T_gap_Si_fast(fc.wavelength, 250.0, n1)
model = model_absolute/dsp
plt.plot(fc.wavelength, model,'--', label='250 nm gap spectrum')
plt.fill_betweenx(fc.transmission, fc.wavelength, color='k',alpha=0.3)
plt.text(1260, 0.5, 'FB1250-10', fontsize=14)
#plt.plot(fc.wavelength, fc.transmission, '--',label='Filter Curve')
plt.xlabel('$\lambda$ (nm)')
plt.ylabel('T')
plt.legend(loc='lower right')
plt.xlim(1200, 1400)
plt.savefig('../figs/F1250_10_filter.pdf')<jupyter_output><empty_output><jupyter_text>Plot the integrated flux for a variety of gap sizes. Define an integral function.<jupyter_code>fc.transmission_norm =  fc.transmission/fc.transmission.sum()
integrate_flux = lambda x: (x * fc.transmission_norm).sum()<jupyter_output><empty_output><jupyter_text>Small gaps.<jupyter_code>gap_sizes = np.arange(0, 50, 2)
gap_trans = [integrate_flux(etalon.T_gap_Si_fast(fc.wavelength, gap_size, n1)/dsp) for gap_size in gap_sizes]
sns.set_context('paper', font_scale=1.6)
sns.set_style('ticks')
plt.plot(gap_sizes, gap_trans, 's', label='Integrated transmission')
plt.xlabel('Gap axial extent $d$ (nm)')
plt.ylabel('FB1250-10 Transmission')
plt.hlines(1.0, 0, 50, label='100% transmission')
plt.hlines(0.998, 0, 50, linestyle='dashed', label = '99.8% transmission')
plt.legend(loc='lower left')
plt.savefig('../figs/FB1250-10_integ_trans.pdf')
out_tbl = pd.DataFrame({'d (nm)':gap_sizes[::4], 'FB1250-10 Transmission':gap_trans[::4]})
out_tbl['FB1250-10 Transmission'] = out_tbl['FB1250-10 Transmission'].round(3)
out_tbl = out_tbl[['d (nm)','FB1250-10 Transmission']]
out_tbl
out_tbl.to_latex('../tbls/tbl_FB1250_raw.tex', index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.154364471669219, 'fraction_numerical': 0.04716692189892802, 'mean_word_length': 7.64021164021164, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 31, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '179843', 'license': 'MIT', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1249, 'n_words': 231, 'path': 'notebooks/SiGaps_20_Thorlabs_filter_curve.ipynb', 'repo_name': 'Echelle/AO_bonding_paper', 'size': '3299'}