This guide will introduce you to some of the basic datasets pre-loaded with pyparty. Most of these are based off of spectral data of Gold Nanoparticles (AuNPs) in our lab. The data is free to distribute, but please cite skspec if you use the data in a published work.
Configure notebook style (see NBCONFIG.ipynb), add imports and paths. The %run magic used below requires IPython 2.0 or higher.
%run NBCONFIG.ipynb
Populating the interactive namespace from numpy and matplotlib ['dti', 'd', 'h', 'm', 'us', 's', 'ms', 'intvl', 'ns']
aunps_water()
corresponds to an experiment a cuvetted, intially with only water, is mixed with 12nm Diameter Gold Nanoparticles. The characterisitc plasmon resonance peak is clearly visible in the absorption spectrum. Additionally, UV-absorption shows the residual gold chloride in the AuNP solution. More nanoparticles are added at a later time, corresponding to the next jump in the spectrum.
from skspec.data import aunps_water
from skspec.plotting import quad_plot
ts = aunps_water()
figure = quad_plot(ts, colormap='bone')
WARNING:skspec.core.spectra:Spectrum does not have subtracted baseline; could affect result in specious absorbance data. WARNING:skspec.core.spectra:Spectrum does not have subtracted baseline; could affect result in specious absorbance data. WARNING:skspec.plotting.basic_plots:Recomputing area from shape (651, 78) to (78,)
Cutting out the UV wavelengths, we can look more closely at the plasmon resonance peak:
t2 = ts.ix[400:700]
t2.plot(iunit='a', cbar=True, title='Plasmon Resonance Shift ($\lambda=528 nm$)');
WARNING:skspec.core.spectra:Spectrum does not have subtracted baseline; could affect result in specious absorbance data.
There are three datasets corresponds on the self-assembly process of gold nanoparticles onto glass. The sets represent various quality of gold monolayers as follows:
from skspec.data import aunps_glass
from skspec.plotting import splot #Multiplot wrapper
from skspec.plotting.plot_utils import hide_axis
# Load all three styles into memory
ag = aunps_glass
SPECTRA= [ag(style=1), ag(style=2), ag(style=3)]
# 2 x 3 plot showing raw spectra and absorption spectra
AXES = splot(2,3, figsize=(10,8))
for (idx, spectra) in enumerate(SPECTRA):
spectra.plot(ax=AXES[idx], xlabel='')
spectra.plot(iunit='r', ax=AXES[idx+3], title='');
if idx != 0 and idx != 3:
hide_axis(AXES[idx], axis='y'); #Hide axies on center,right plots
hide_axis(AXES[idx+3], axis='y'); #Hide axies on center,right plot
WARNING:skspec.core.spectra:Spectrum does not have subtracted baseline; could affect result in specious absorbance data. WARNING:skspec.core.spectra:Spectrum does not have subtracted baseline; could affect result in specious absorbance data. WARNING:skspec.core.spectra:Spectrum does not have subtracted baseline; could affect result in specious absorbance data. WARNING:skspec.core.spectra:Spectrum does not have subtracted baseline; could affect result in specious absorbance data. WARNING:skspec.core.spectra:Spectrum does not have subtracted baseline; could affect result in specious absorbance data. WARNING:skspec.core.spectra:Spectrum does not have subtracted baseline; could affect result in specious absorbance data.
from skspec.data import solvent_evap
help(solvent_evap)
Help on function solvent_evap in module skspec.data: solvent_evap(*args, **kwargs) Model solvent evaporation dataset graciously shared by Dr. Isao Noda; used in his 2004 book Two-Dimensional Correlation Spectroscopy. From page 47: 'The system described here is a three-component solution mixture of polystyrene (PS) dissolved in a 50:50 blblend of metyl etyl ketone (MEK) and perdeuterated tolune. The initial concentration of PS is about 1.0wt%. Once the solution mixture is exposed to the open atmosphere, the solvents start evaporating, and the PS concentraiton increases with time. However, due to the substantial difference in the volatility of MEK and toluene coupled with their slightly dissimilar affinity to PS, the composition of the solution mixture changes as a function of time in a rather complex manner during hte spontaneous evaporation process. The transient IR spectra were collected as the two solvents evaporated, eventually leaving a PS film behind, as shown schematically in Figure 4.1 (A). The measurement was actually made using a horizontal attenuated total reflectance (ATR) prism. ... As expected, the intensities of bands at 2980 and 1720 cm-1 due to violatile MEK and those of bands at 2275 and 820cm-1 assigned to perdeuterated toluene gradually decrease, while those of PS bands at 3020 and 1450cm-1 increase with time.'
ts=solvent_evap()
ts.plot();
WARNING:skspec.core.spectra:Spectrum does not have subtracted baseline; could affect result in specious absorbance data.
Notice that the index has been implicitly reversed, as is customary in this unit system. When working with reversed units, slicing should still work normally, just slice from large to small. In this case, we will use the nearby
slicer since we don't know exact value ranges that we're interested in:
ts.nearby[3100.0:2800.0].plot(cbar=True);
WARNING:skspec.core.spectra:Spectrum does not have subtracted baseline; could affect result in specious absorbance data.