To utilize this notebook, you will need:
Python and Jupyter notebook (the 32-bit version of Python is sufficient for working with the database in its current form).
The following Python packages: matplotlib, pandas, NumPy, SciPy, and MySQLdb.
The FreezeCasting.net database in SQL format, which is available here.
To import data via csv, an alternative form of this notebook is avaialble, here.
Bundled packages contianing most of the dependencies you will need can be obtained for free. The demonstrative notebook provided here was built using the Anaconda package, which includes the above packages. The Matplotlib extension, Basemap is needed to run the plot in Figure 2. The extension is not included in the Anaconda package. However, it may be installed via pip; corresponding lines of code are provided in the Figure 2 code block.
MySQL can be downloaded here.
Note: You may view the static, html format of the notebook here without installing Python.
Questions/concerns? Email: info@freezecasting.net
# Enables inline-plot rendering
%matplotlib inline
%config InlineBackend.figure_formats = {'png', 'retina'}
# Utilized to create and work with dataframes
import pandas as pd
import numpy as np
import math as m
# MATPLOTLIB
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib as mpl
import matplotlib.cm as cm
import matplotlib.colors as mcolors
from matplotlib import rc
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from pylab import rcParams
from matplotlib.ticker import AutoMinorLocator
import scipy.stats as stats
import statsmodels.api as sm
import matplotlib.ticker as ticker
# For point density plots:
from scipy.stats import gaussian_kde
import statsmodels.api as sm
# Set ipython's max row display
pd.set_option('display.max_row', 1000)
pd.set_option('display.max_columns', 100)
pd.set_option('display.max_colwidth', 2000)
# Specify matplotlib default plotting aesthetics
def default_plotting():
#fig
plt.rcParams['savefig.dpi'] = '100'
plt.rcParams['savefig.format'] = ('png')
#font
plt.rcParams['font.family'] = 'Georgia'
#plt.rcParams['font.size'] = 22
plt.rcParams['axes.labelsize'] = 18
plt.rcParams['axes.titlesize'] = 18
plt.rcParams['xtick.labelsize'] = 18
plt.rcParams['ytick.labelsize'] = 18
#legend
#plt.rcParams['legend.fontsize'] = 12
#axes
plt.rcParams['axes.linewidth'] = 1
plt.rcParams['axes.edgecolor'] = 'black'
plt.rcParams['axes.facecolor'] = 'white'
plt.rcParams['axes.grid'] = False
plt.rcParams['axes.labelpad'] = 10
plt.rcParams['axes.axisbelow'] = False
#tick marks
plt.gca().xaxis.set_ticks_position('bottom')
plt.gca().yaxis.set_ticks_position('left')
plt.rcParams['xtick.major.size'] = 7
plt.rcParams['ytick.major.size'] = 7
plt.rcParams['ytick.minor.size'] = 3
plt.rcParams['xtick.minor.size'] = 3
plt.rcParams['ytick.major.width'] = 1
plt.rcParams['ytick.minor.width'] = 1
plt.rcParams['xtick.major.width'] = 1
plt.rcParams['xtick.minor.width'] = 1
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
default_plotting()
plt.close()
import MySQLdb
#command-line arguments
import sys
conn = MySQLdb.connect(host="hostname",
user="userid",
passwd="password",
db="freezecasting_opendata")
# Create proxy cursor to interact with the database
cursor = conn.cursor()
Each MySQL table is imported via independent SQL queries. To work with the database tables within Python, queried data is placed within dataframes using the pandas toolkit.
For purposes of demonstrating table linkage, we will import most of the database tables, merge them into a single panda dataframe, plot various relationships, and export select data columns to a csv file. However, it is not necessary to import all of the database tables, and in most cases, it is much more practical to import only tables containing variables of interest. The only mandatory imports for joining secondary tables are the "papers" and "samples" table.
The "authors" table provides contact information for the corresponding author, the "papers" table provides the data necessary for citing the data, and the "samples" table provides the "sample_ID" necessary for linking secondary tables.
# IMPORT AUTHORS TABLE
cursor.execute('SELECT * FROM authors')
rows = cursor.fetchall()
authors = pd.DataFrame( [[ij for ij in i] for i in rows])
authors.rename(columns={0: 'author_ID', 1: 'name_author', 2:'affiliation',
3: 'city', 4: 'country', 5: 'long', 6: 'lat',
7: 'email', 8: 'last_updated'},
inplace = True);
# drop last_update column
authors = authors.drop('last_updated', axis = 1)
# Author_ID is imported as float; change to integer data type
authors['author_ID'] = authors['author_ID'].astype('int')
# IMPORT PAPERS TABLE
cursor.execute('SELECT * FROM papers')
rows = cursor.fetchall()
papers = pd.DataFrame( [[ij for ij in i] for i in rows])
# column names; i.e., variable names, can be changed below (just be sure to maintain order;
# see pandas documentation for reordering columns).
papers.rename(columns={0: 'paper_ID', 1: 'author_ID', 2:'peer_review',
3: 'usage', 4: 'authors', 5: 'title',
6: 'journal', 7: 'volume', 8: 'issue',
9: 'pages', 10: 'year', 11: 'doi',
12: 'material', 13: 'material_group',
14: 'last_updated'},
inplace = True);
# Drop last_updated column
# --A last_updated column is contained within all tables; it is an automatic timestamp that
# shows the last time the corresponding row was updated. These columns are unnecessary here,
# so we will drop the column from each table.
papers = papers.drop('last_updated', axis = 1)
papers['year'] = papers['year'].astype('int')
papers['paper_ID'] = papers['paper_ID'].astype('int')
# IMPORT SAMPLES TABLE
cursor.execute('SELECT * FROM samples')
rows = cursor.fetchall()
samples = pd.DataFrame( [[ij for ij in i] for i in rows])
samples.rename(columns={0: 'sample_ID', 1: 'paper_ID', 2: 'number', 3: 'material_ID',
4: 'vf_total', 5: 'particles_total', 6: 'fluids_total',
7: 'composite', 8: 'last_updated'},
inplace = True);
# drop last_update column
samples = samples.drop('last_updated', axis = 1)
samples['sample_ID'] = samples['sample_ID'].astype('int')
# Merge papers and authors tables to link corresponding author contact data
# --author_ID acts as primary key for authors table and foreign key for papers table
papers = pd.merge(papers, authors, on = 'author_ID', how = 'outer')
# Merge papers and samples table to link sample data to citation data
# --paper_ID acts as primary key for papers table and foreign key for samples table
samples = pd.merge(samples, papers, on = 'paper_ID', how = 'outer')
# Uncomment and run the following to verify column names and/or print the dataframe header
#samples.columns.values
#samples.head()
data = samples[(samples['sample_ID']) > 0]
Import suspension tables and merge with the dataframe
# IMPORT SUSPENSION TABLE
cursor.execute('SELECT * FROM suspension')
rows = cursor.fetchall()
suspension = pd.DataFrame( [[ij for ij in i] for i in rows])
suspension.rename(columns={0: 'suspension_ID', 1: 'sample_ID', 2: 'time_mill',
3: 'pH_susp', 4: 'viscosity_susp', 5: 'zeta_susp',
6: 'last_updated'},
inplace = True);
# drop last_update column
suspension = suspension.drop('last_updated', axis = 1)
# suspension_ID is a primary key for the suspension table; it is not needed here
suspension = suspension.drop('suspension_ID', axis = 1)
#-----FLUID TABLES-----#
# Fluid properties table
cursor.execute('SELECT * FROM props_fluids')
rows = cursor.fetchall()
props_fluids = pd.DataFrame( [[ij for ij in i] for i in rows])
props_fluids.rename(columns={0: 'props_fluid_ID', 1: 'name_fluid', 2: 'density_liq_fluid',
3: 'density_sol_fluid', 4: 'thermal_cond_liq_fluid',
5: 'thermal_cond_sol_fluid', 6: 'last_updated'},
inplace = True);
props_fluids = props_fluids.drop('last_updated', axis = 1)
# Fluid 1
cursor.execute('SELECT * FROM susp_fluid_1')
rows = cursor.fetchall()
susp_fluid_1 = pd.DataFrame( [[ij for ij in i] for i in rows])
susp_fluid_1.rename(columns={0: 'fluid_1_ID', 1: 'sample_ID', 2: 'props_fluid_ID',
3: 'vf_fluid_1', 4: 'last_updated'},
inplace = True);
susp_fluid_1 = susp_fluid_1.drop('last_updated', axis = 1)
susp_fluid_1 = susp_fluid_1.drop('fluid_1_ID', axis = 1)
# Merge fluid properties table with fluid 1 table; 'props_fluid_ID' is primary key
# for the fluid properties table and foreign key for the susp_fluid_1 table.
susp_fluid_1 = pd.merge(props_fluids, susp_fluid_1, on = 'props_fluid_ID', how = 'outer')
# rename the 'props_fluid_id' and other property columns such that they can be differentiated for fluid 1 and fluid 2
susp_fluid_1.rename(columns={'props_fluid_ID':'props_fluid_ID1'}, inplace=True)
susp_fluid_1.rename(columns={'name_fluid':'name_fluid1'}, inplace=True)
susp_fluid_1.rename(columns={'density_liq_fluid':'density_liq_fluid1'}, inplace=True)
susp_fluid_1.rename(columns={'density_sol_fluid':'density_sol_fluid1'}, inplace=True)
susp_fluid_1.rename(columns={'thermal_cond_liq_fluid':'thermal_cond_liq_fluid1'}, inplace=True)
susp_fluid_1.rename(columns={'thermal_cond_sol_fluid':'thermal_cond_sol_fluid1'}, inplace=True)
# Fluid 2
cursor.execute('SELECT * FROM susp_fluid_2')
rows = cursor.fetchall()
susp_fluid_2 = pd.DataFrame( [[ij for ij in i] for i in rows])
susp_fluid_2.rename(columns={0: 'fluid_2_ID', 1: 'sample_ID', 2: 'props_fluid_ID',
3: 'vf_fluid_2', 4: 'last_updated'},
inplace = True);
susp_fluid_2 = susp_fluid_2.drop('last_updated', axis = 1)
susp_fluid_2 = susp_fluid_2.drop('fluid_2_ID', axis = 1)
susp_fluid_2 = pd.merge(props_fluids, susp_fluid_2, on = 'props_fluid_ID', how = 'outer')
susp_fluid_2.rename(columns={'props_fluid_ID':'props_fluid_ID2'}, inplace=True)
susp_fluid_2.rename(columns={'name_fluid':'name_fluid2'}, inplace=True)
susp_fluid_2.rename(columns={'density_liq_fluid':'density_liq_fluid2'}, inplace=True)
susp_fluid_2.rename(columns={'density_sol_fluid':'density_sol_fluid2'}, inplace=True)
susp_fluid_2.rename(columns={'thermal_cond_liq_fluid':'thermal_cond_liq_fluid2'}, inplace=True)
susp_fluid_2.rename(columns={'thermal_cond_sol_fluid':'thermal_cond_sol_fluid2'}, inplace=True)
# Merge fluids tables
fluids = pd.merge(susp_fluid_1, susp_fluid_2, on = 'sample_ID', how = 'outer')
fluids = fluids[(fluids['sample_ID']) > 0]
# Merge suspension table
suspension = pd.merge(fluids, suspension, on = 'sample_ID', how = 'outer')
#-----PARTICLE TABLES-----#
# Particle properties table
cursor.execute('SELECT * FROM props_particles')
rows = cursor.fetchall()
props_particles = pd.DataFrame( [[ij for ij in i] for i in rows])
props_particles.rename(columns={0: 'props_part_ID', 1: 'name_part', 2: 'description_part',
3: 'density_part', 4: 'thermal_cond_part',
5: 'last_updated'},
inplace = True);
props_particles = props_particles.drop('last_updated', axis = 1)
# Particle 1
cursor.execute('SELECT * FROM susp_part_1')
rows = cursor.fetchall()
susp_part_1 = pd.DataFrame( [[ij for ij in i] for i in rows])
susp_part_1.rename(columns={0: 'particle_1_ID', 1: 'sample_ID', 2: 'props_part_ID',
3: 'shape_part_1', 4: 'dia_part_1', 5: 'diaI_part_1',
6: 'length_part_1', 7: 'thick_part_1', 8: 'vf_part_1',
9: 'last_updated'},
inplace = True);
susp_part_1 = susp_part_1.drop('last_updated', axis = 1)
susp_part_1 = susp_part_1.drop('particle_1_ID', axis = 1)
# Merge particle properties table with particle 1 table; 'props_part_1' is primary key
# for the particle properties table and foreign key for the susp_part_1 table.
susp_part_1 = pd.merge(props_particles, susp_part_1, on = 'props_part_ID', how = 'outer')
# rename the 'props_part_id' column and other property columns such that it can be differentiated for particle 1 and particle 2
susp_part_1.rename(columns={'props_part_ID':'props_part_ID1'}, inplace=True)
susp_part_1.rename(columns={'name_part':'name_part1'}, inplace=True)
susp_part_1.rename(columns={'description_part':'description_part1'}, inplace=True)
susp_part_1.rename(columns={'density_part':'density_part1'}, inplace=True)
susp_part_1.rename(columns={'thermal_cond_part':'thermal_cond_part1'}, inplace=True)
susp_part_1 = susp_part_1[(susp_part_1['sample_ID']) > 0]
# Particle 2
cursor.execute('SELECT * FROM susp_part_2')
rows = cursor.fetchall()
susp_part_2 = pd.DataFrame( [[ij for ij in i] for i in rows])
susp_part_2.rename(columns={0: 'particle_2_ID', 1: 'sample_ID', 2: 'props_part_ID',
3: 'shape_part_2', 4: 'dia_part_2', 5: 'diaI_part_2',
6: 'length_part_2', 7: 'thick_part_2', 8: 'vf_part_2',
9: 'last_updated'},
inplace = True);
susp_part_2 = susp_part_2.drop('last_updated', axis = 1)
susp_part_2 = susp_part_2.drop('particle_2_ID', axis = 1)
# Merge particle properties table with particle 2 table; 'props_part_2' is primary key
# for the particle properties table and foreign key for the susp_part_2 table.
susp_part_2 = pd.merge(props_particles, susp_part_2, on = 'props_part_ID', how = 'outer')
# rename the 'props_part_id' column and other property columns such that it can be differentiated for particle 1 and particle 2
susp_part_2.rename(columns={'props_part_ID':'props_part_ID2'}, inplace=True)
susp_part_2.rename(columns={'name_part':'name_part2'}, inplace=True)
susp_part_2.rename(columns={'description_part':'description_part2'}, inplace=True)
susp_part_2.rename(columns={'density_part':'density_part2'}, inplace=True)
susp_part_2.rename(columns={'thermal_cond_part':'thermal_cond_part2'}, inplace=True)
susp_part_2 = susp_part_2[(susp_part_2['sample_ID']) > 0]
# Merge particle tables, then merge particle table with suspension table
particles = pd.merge(susp_part_1, susp_part_2, on = 'sample_ID', how = 'outer')
suspension = pd.merge(particles, suspension, on = 'sample_ID', how = 'outer')
#-----ADDITIVE TABLES-----#
# Additive properties table
cursor.execute('SELECT * FROM props_adds')
rows = cursor.fetchall()
props_adds = pd.DataFrame( [[ij for ij in i] for i in rows])
props_adds.rename(columns={0: 'props_add_ID', 1: 'name_add', 2: 'density_add',
3: 'molecular_wt_add', 4: 'last_updated'},
inplace = True);
props_adds = props_adds.drop('last_updated', axis = 1)
# Binder 1
cursor.execute('SELECT * FROM susp_bind_1')
rows = cursor.fetchall()
susp_bind_1 = pd.DataFrame( [[ij for ij in i] for i in rows])
susp_bind_1.rename(columns={0: 'bind_1_ID', 1: 'sample_ID', 2: 'props_add_ID',
3: 'wf_bind_1', 4: 'last_updated'},
inplace = True);
susp_bind_1 = susp_bind_1.drop('last_updated', axis = 1)
susp_bind_1 = susp_bind_1.drop('bind_1_ID', axis = 1)
susp_bind_1 = pd.merge(props_adds, susp_bind_1, on = 'props_add_ID', how = 'outer')
susp_bind_1.rename(columns={'props_add_ID':'props_bind1_ID'}, inplace=True)
susp_bind_1.rename(columns={'name_add':'name_bind1'}, inplace=True)
susp_bind_1.rename(columns={'density_add':'density_bind1'}, inplace=True)
susp_bind_1.rename(columns={'molecular_wt_add':'molecular_wt_bind1'}, inplace=True)
susp_bind_1 = susp_bind_1[(susp_bind_1['sample_ID']) > 0]
# Binder 2
cursor.execute('SELECT * FROM susp_bind_2')
rows = cursor.fetchall()
susp_bind_2 = pd.DataFrame( [[ij for ij in i] for i in rows])
susp_bind_2.rename(columns={0: 'bind_2_ID', 1: 'sample_ID', 2: 'props_add_ID',
3: 'wf_bind_2', 4: 'last_updated'},
inplace = True);
susp_bind_2 = susp_bind_2.drop('last_updated', axis = 1)
susp_bind_2 = susp_bind_2.drop('bind_2_ID', axis = 1)
susp_bind_2 = pd.merge(props_adds, susp_bind_2, on = 'props_add_ID', how = 'outer')
susp_bind_2.rename(columns={'props_add_ID':'props_bind2_ID'}, inplace=True)
susp_bind_2.rename(columns={'name_add':'name_bind2'}, inplace=True)
susp_bind_2.rename(columns={'density_add':'density_bind2'}, inplace=True)
susp_bind_2.rename(columns={'molecular_wt_add':'molecular_wt_bind2'}, inplace=True)
susp_bind_2 = susp_bind_2[(susp_bind_2['sample_ID']) > 0]
# Dispersant 1
cursor.execute('SELECT * FROM susp_disp_1')
rows = cursor.fetchall()
susp_disp_1 = pd.DataFrame( [[ij for ij in i] for i in rows])
susp_disp_1.rename(columns={0: 'disp_1_ID', 1: 'sample_ID', 2: 'props_add_ID',
3: 'wf_disp_1', 4: 'last_updated'},
inplace = True);
susp_disp_1 = susp_disp_1.drop('last_updated', axis = 1)
susp_disp_1 = susp_disp_1.drop('disp_1_ID', axis = 1)
susp_disp_1 = pd.merge(props_adds, susp_disp_1, on = 'props_add_ID', how = 'outer')
susp_disp_1.rename(columns={'props_add_ID':'props_disp1_ID'}, inplace=True)
susp_disp_1.rename(columns={'name_add':'name_disp_1'}, inplace=True)
susp_disp_1.rename(columns={'density_add':'density_disp_1'}, inplace=True)
susp_disp_1.rename(columns={'molecular_wt_add':'molecular_wt_disp_1'}, inplace=True)
susp_disp_1 = susp_disp_1[(susp_disp_1['sample_ID']) > 0]
# Dispersant 2
cursor.execute('SELECT * FROM susp_disp_2')
rows = cursor.fetchall()
susp_disp_2 = pd.DataFrame( [[ij for ij in i] for i in rows])
susp_disp_2.rename(columns={0: 'disp_2_ID', 1: 'sample_ID', 2: 'props_add_ID',
3: 'wf_disp_2', 4: 'last_updated'},
inplace = True);
susp_disp_2 = susp_disp_2.drop('last_updated', axis = 1)
susp_disp_2 = susp_disp_2.drop('disp_2_ID', axis = 1)
susp_disp_2 = pd.merge(props_adds, susp_disp_2, on = 'props_add_ID', how = 'outer')
susp_disp_2.rename(columns={'props_add_ID':'props_disp2_ID'}, inplace=True)
susp_disp_2.rename(columns={'name_add':'name_disp2'}, inplace=True)
susp_disp_2.rename(columns={'density_add':'density_disp_2'}, inplace=True)
susp_disp_2.rename(columns={'molecular_wt_add':'molecular_wt_disp_2'}, inplace=True)
susp_disp_2 = susp_disp_2[(susp_disp_2['sample_ID']) > 0]
# Cryoprotectant
cursor.execute('SELECT * FROM susp_cryo')
rows = cursor.fetchall()
susp_cryo = pd.DataFrame( [[ij for ij in i] for i in rows])
susp_cryo.rename(columns={0: 'cryo_ID', 1: 'sample_ID', 2: 'props_add_ID',
3: 'wf_cryo', 4: 'last_updated'},
inplace = True);
susp_cryo = susp_cryo.drop('last_updated', axis = 1)
susp_cryo = susp_cryo.drop('cryo_ID', axis = 1)
susp_cryo = pd.merge(props_adds, susp_cryo, on = 'props_add_ID', how = 'outer')
susp_cryo.rename(columns={'props_add_ID':'props_cryo_ID'}, inplace=True)
susp_cryo.rename(columns={'name_add':'name_cryo'}, inplace=True)
susp_cryo.rename(columns={'density_add':'density_cryo'}, inplace=True)
susp_cryo.rename(columns={'molecular_wt_add':'molecular_wt_cryo'}, inplace=True)
susp_cryo = susp_cryo[(susp_cryo['sample_ID']) > 0]
# Surfactant
cursor.execute('SELECT * FROM susp_surfact')
rows = cursor.fetchall()
susp_surfact = pd.DataFrame( [[ij for ij in i] for i in rows])
susp_surfact.rename(columns={0: 'surfact_ID', 1: 'sample_ID', 2: 'props_add_ID',
3: 'wf_surfact', 4: 'last_updated'},
inplace = True);
susp_surfact = susp_surfact.drop('last_updated', axis = 1)
susp_surfact = susp_surfact.drop('surfact_ID', axis = 1)
susp_surfact = pd.merge(props_adds, susp_surfact, on = 'props_add_ID', how = 'outer')
susp_surfact.rename(columns={'props_add_ID':'props_surfact_ID'}, inplace=True)
susp_surfact.rename(columns={'name_add':'name_surfact'}, inplace=True)
susp_surfact.rename(columns={'density_add':'density_surfact'}, inplace=True)
susp_surfact.rename(columns={'molecular_wt_add':'molecular_wt_surfact'}, inplace=True)
susp_surfact = susp_surfact[(susp_surfact['sample_ID']) > 0]
# The following additive tables pertain mainly to the freeze gel-casting technique; uncomment and run to import
# Catalyst
#cursor.execute('SELECT * FROM susp_catal')
#rows = cursor.fetchall()
#susp_catal = pd.DataFrame( [[ij for ij in i] for i in rows])
#susp_catal.rename(columns={0: 'catal_ID', 1: 'sample_ID', 2: 'props_add_ID',
# 3: 'wf_catal', 4: 'last_updated'},
# inplace = True);
#susp_catal = susp_catal.drop('last_updated', axis = 1)
#susp_catal = susp_catal.drop('catal_ID', axis = 1)
#susp_catal = pd.merge(props_adds, susp_catal, on = 'props_add_ID', how = 'outer')
#susp_catal.rename(columns={'props_add_ID':'props_catal_ID'}, inplace=True)
# Crosslinker
#cursor.execute('SELECT * FROM susp_cross')
#rows = cursor.fetchall()
#susp_cross = pd.DataFrame( [[ij for ij in i] for i in rows])
#susp_cross.rename(columns={0: 'cross_ID', 1: 'sample_ID', 2: 'props_add_ID',
# 3: 'wf_cross', 4: 'last_updated'},
# inplace = True);
#susp_cross = susp_cross.drop('last_updated', axis = 1)
#susp_cross = susp_cross.drop('cross_ID', axis = 1)
#susp_cross = pd.merge(props_adds, susp_cross, on = 'props_add_ID', how = 'outer')
#susp_cross.rename(columns={'props_add_ID':'props_cross_ID'}, inplace=True)
# Initiator
#cursor.execute('SELECT * FROM susp_init')
#rows = cursor.fetchall()
#susp_init = pd.DataFrame( [[ij for ij in i] for i in rows])
#susp_init.rename(columns={0: 'init_ID', 1: 'sample_ID', 2: 'props_add_ID',
# 3: 'wf_init', 4: 'last_updated'},
# inplace = True);
#susp_init = susp_init.drop('last_updated', axis = 1)
#susp_init = susp_init.drop('init_ID', axis = 1)
#susp_init = pd.merge(props_adds, susp_init, on = 'props_add_ID', how = 'outer')
#susp_init.rename(columns={'props_add_ID':'props_init_ID'}, inplace=True)
# Monomer
#cursor.execute('SELECT * FROM susp_mono')
#rows = cursor.fetchall()
#susp_mono = pd.DataFrame( [[ij for ij in i] for i in rows])
#susp_mono.rename(columns={0: 'mono_ID', 1: 'sample_ID', 2: 'props_add_ID',
# 3: 'wf_mono', 4: 'last_updated'},
# inplace = True);
#susp_mono = susp_mono.drop('last_updated', axis = 1)
#susp_mono = susp_mono.drop('mono_ID', axis = 1)
#susp_mono = pd.merge(props_adds, susp_mono, on = 'props_add_ID', how = 'outer')
#susp_mono.rename(columns={'props_add_ID':'props_mono_ID'}, inplace=True)
# Merge suspension tables
suspension = pd.merge(suspension, susp_bind_1, on = 'sample_ID', how = 'outer')
suspension = pd.merge(suspension, susp_bind_2, on = 'sample_ID', how = 'outer')
suspension = pd.merge(suspension, susp_disp_1, on = 'sample_ID', how = 'outer')
suspension = pd.merge(suspension, susp_disp_2, on = 'sample_ID', how = 'outer')
suspension = pd.merge(suspension, susp_cryo, on = 'sample_ID', how = 'outer')
suspension = pd.merge(suspension, susp_surfact, on = 'sample_ID', how = 'outer')
# Uncomment and run the code block below if freeze gel-casting additive tables were imported
#suspension = pd.merge(suspension, susp_catal_1, on = 'sample_ID', how = 'outer')
#suspension = pd.merge(suspension, susp_cross_1, on = 'sample_ID', how = 'outer')
#suspension = pd.merge(suspension, susp_init_2, on = 'sample_ID', how = 'outer')
#suspension = pd.merge(suspension, susp_mono, on = 'sample_ID', how = 'outer')
# Merge suspension table with dataframe
data = pd.merge(suspension, data, on = 'sample_ID', how = 'outer')
Import solidification, sublimation, and sintering tables, merging each group with the dataframe
#-----SOLIDIFICATION TABLES-----#
# Main solidification table
cursor.execute('SELECT * FROM solidification')
rows = cursor.fetchall()
solidification = pd.DataFrame( [[ij for ij in i] for i in rows])
solidification.rename(columns={0: 'solidification_ID', 1: 'sample_ID', 2: 'technique',
3: 'direction', 4: 'refrigerant', 5: 'cooling_rate',
6: 'temp_cold', 7: 'temp_hot', 8: 'temp_constant',
9: 'gravity', 10: 'gradient', 11: 'velocity',
12: 'temp_nuc', 13: 'temp_susp', 14: 'last_updated'},
inplace = True);
solidification = solidification.drop('last_updated', axis = 1)
solidification = solidification.drop('solidification_ID', axis = 1)
# Mold properties table
cursor.execute('SELECT * FROM props_mold')
rows = cursor.fetchall()
props_mold = pd.DataFrame( [[ij for ij in i] for i in rows])
props_mold.rename(columns={0: 'props_mold_ID', 1: 'name_mold_mat', 2: 'thermal_cond_mold',
},
inplace = True);
# Solidification mold table
cursor.execute('SELECT * FROM solidification_mold')
rows = cursor.fetchall()
solidification_mold = pd.DataFrame( [[ij for ij in i] for i in rows])
solidification_mold.rename(columns={0: 'mold_ID', 1: 'sample_ID', 2: 'shape_mold',
3: 'dia_mold', 4: 'height_mold', 5: 'length_mold',
6: 'width_mold', 7: 'wall_mold', 8: 'fillheight',
9: 'props_mold_ID', 10: 'last_update'},
inplace = True);
# Merge mold properties table with solidification_mold table
solidification_mold = pd.merge(props_mold, solidification_mold, on = 'props_mold_ID', how = 'outer')
# Merge solidification_mold table with solidification table
solidification = pd.merge(solidification_mold, solidification, on = 'sample_ID', how = 'outer')
# Drop rows that are not associated with a sample ID
solidification = solidification[(solidification['sample_ID']) > 0]
# Merge solidification table with dataframe
data = pd.merge(solidification, data, on = 'sample_ID', how = 'outer')
#-----SUBLIMATION TABLE-----#
cursor.execute('SELECT * FROM sublimation')
rows = cursor.fetchall()
sublimation = pd.DataFrame( [[ij for ij in i] for i in rows])
sublimation.rename(columns={0: 'sublimation_ID', 1: 'sample_ID', 2: 'sublimated',
3: 'pressure_sub', 4:'time_sub', 5: 'temp_sub', 6: 'last_updated'},
inplace = True);
sublimation = sublimation.drop('last_updated', axis = 1)
sublimation = sublimation.drop('sublimation_ID', axis = 1)
# Merge sublimation table with dataframe
data = pd.merge(sublimation, data, on = 'sample_ID', how = 'outer')
#-----SINTERING TABLES-----#
# Sinter1 table
cursor.execute('SELECT * FROM sinter_1')
rows = cursor.fetchall()
sinter_1 = pd.DataFrame( [[ij for ij in i] for i in rows])
sinter_1.rename(columns={0: 'sinter_1_ID', 1: 'sample_ID', 2: 'time_sinter_1',
3: 'temp_sinter_1', 4: 'rampC_sinter_1', 5: 'rampH_sinter_1',
6: 'last_updated'},
inplace = True);
sinter_1 = sinter_1.drop('last_updated', axis = 1)
sinter_1 = sinter_1.drop('sinter_1_ID', axis = 1)
# Sinter2 table
cursor.execute('SELECT * FROM sinter_2')
rows = cursor.fetchall()
sinter_2 = pd.DataFrame( [[ij for ij in i] for i in rows])
sinter_2.rename(columns={0: 'sinter_2_ID', 1: 'sample_ID', 2: 'time_sinter_2',
3: 'temp_sinter_2', 4: 'rampC_sinter_2', 5: 'rampH_sinter_2',
6: 'last_updated'},
inplace = True);
sinter_2 = sinter_2.drop('last_updated', axis = 1)
sinter_2 = sinter_2.drop('sinter_2_ID', axis = 1)
# Merge sintering tables, then merge sintering table with samples table
sinter = pd.merge(sinter_1, sinter_2, on = 'sample_ID', how = 'outer')
data = pd.merge(sinter, data, on = 'sample_ID', how = 'outer')
#Shrinkage table
cursor.execute('SELECT * FROM shrinkage')
rows = cursor.fetchall()
shrink = pd.DataFrame( [[ij for ij in i] for i in rows])
shrink.rename(columns={0: 'shrinkage_ID', 1: 'sample_ID', 2: 'shrink_vol',
3: 'shrink_dia', 4: 'shrink_lin', 5: 'last_updated'},
inplace = True);
shrink = shrink.drop('last_updated', axis = 1)
shrink = shrink.drop('shrinkage_ID', axis = 1)
data = pd.merge(shrink, data, on = 'sample_ID', how = 'outer')
Import microstructure and mechanical properties tables, merging each with the dataframe
#-----MICROSTRUCTURE TABLES-----#
cursor.execute('SELECT * FROM microstructure')
rows = cursor.fetchall()
microstructure = pd.DataFrame( [[ij for ij in i] for i in rows])
microstructure.rename(columns={0: 'micro_ID', 1: 'sample_ID', 2: 'pore_structure',
3: 'porosity', 4:'spacing', 5:'pore', 6: 'wall',
7: 'aspectRatio_pore', 8: 'aspectRatio_wall',
9: 'surface_area', 10: 'last_updated'},
inplace = True);
microstructure = microstructure.drop('last_updated', axis = 1)
microstructure = microstructure.drop('micro_ID', axis = 1)
# Merge microstructure table with dataframe
data = pd.merge(microstructure, data, on = 'sample_ID', how = 'outer')
#-----MECHANICAL TABLES-----#
# Main mechanical table
cursor.execute('SELECT * FROM mechanical')
rows = cursor.fetchall()
mechanical = pd.DataFrame( [[ij for ij in i] for i in rows])
mechanical.rename(columns={0: 'mech_ID', 1: 'sample_ID', 2: 'shape_mech',
3: 'height_mech', 4: 'dia_mech', 5: 'length_mech',
6: 'width_mech', 7: 'ratio_mech', 8: 'volume_mech',
9: 'compressive', 10: 'flexural', 11: 'elastic',
12: 'strain_rate', 13: 'crossheadspeed', 14: 'last_updated'},
inplace = True);
mechanical = mechanical.drop('last_updated', axis = 1)
mechanical = mechanical.drop('mech_ID', axis = 1)
# Bulk material properties table
cursor.execute('SELECT * FROM props_mech_bulk')
rows = cursor.fetchall()
mech_bulk = pd.DataFrame( [[ij for ij in i] for i in rows])
mech_bulk.rename(columns={0: 'material_ID', 1: 'name_material', 2: 'density_material_bulk',
3: 'compressive_bulk', 4: 'elastic_bulk', 5: 'flexural_bulk',
6: 'last_updated'},
inplace = True);
# Merge bulk mechanical and bulk material properties tables with dataframe
data = pd.merge(mechanical, data, on = 'sample_ID', how = 'outer')
data = pd.merge(data, mech_bulk, on = 'material_ID', how = 'outer')
# Drop rows that are not associated with a sample ID
data = data[(data['sample_ID']) > 0]
# Create columns for normalized mechanical values
data['norm_compressive'] = (data['compressive']/data['compressive_bulk'])
data['norm_flexural'] = (data['flexural']/data['flexural_bulk'])
data['norm_elastic'] = (data['elastic']/data['elastic_bulk'])
# define function to return number of papers for a specified figure
def printPapers(data, FigX):
set_Papers = set(data['paper_ID'])
num_Papers = len(set_Papers)
print 'Number of papers', '(', FigX, '):', num_Papers
Print list of material types fabricated using the freeze-casting technique
materials = papers['material'].unique()
materials.sort()
print materials
# Return number of array elements, which gives us the total number of unique materials
materials.__len__()
Print list of binder and dispersant types that have been utilized
additives = data[['name_bind1', 'name_bind2', 'name_disp_1', 'name_disp2', 'name_cryo', 'name_surfact']].copy()
# Here, we are locating unique values thorughout the dataframe, irrespective of column value
additivesUnique = pd.unique(additives.values.ravel())
print additivesUnique
# Return number of array elements, which gives us the total number of unique additives
additivesUnique.__len__()
fig1 = plt.figure(figsize=(8,5))
ax = fig1.add_subplot(111)
# Create variable for year papers were published; drop na values and convert the datatype to integer
b = papers['year']
b = b.dropna()
b = b.astype(int)
# create x-array for years
x = [2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008, 2009, 2010, 2011, 2012, 2013,
2014, 2015, 2016]
# create y-array using the sum of papers published in a given year
y = [
sum(i == 2000 for i in b), sum(i == 2001 for i in b), sum(i == 2002 for i in b),
sum(i == 2003 for i in b), sum(i == 2004 for i in b), sum(i == 2005 for i in b),
sum(i == 2006 for i in b), sum(i == 2007 for i in b), sum(i == 2008 for i in b),
sum(i == 2009 for i in b), sum(i == 2010 for i in b), sum(i == 2011 for i in b),
sum(i == 2012 for i in b), sum(i == 2013 for i in b), sum(i == 2014 for i in b),
sum(i == 2015 for i in b), sum(i == 2016 for i in b)
]
# bar graph
ax.bar(x, y, alpha=0.7)
# set x and y limits
ax.set(xlim = [2000, 2017])
ax.set(ylim = [0, 200])
# tick positions and rotation
ax.xaxis.set_ticks(np.arange(2000, 2017, 1))
ax.yaxis.set_ticks(np.arange(50, 250, 50))
ax.yaxis.set_ticks_position('left')
ax.xaxis.set_ticks_position('bottom')
for tick in ax.get_xticklabels():
tick.set_rotation(60)
# x and y labels
ax.set_ylabel('Number of papers published')
ax.set_xlabel('Year')
# minor ticks
minorLocator1 = AutoMinorLocator()
ax.yaxis.set_minor_locator(minorLocator1)
# Uncomment lines below to either install or upgrade matplotlib basemap
# ! pip install basemap
# ! pip install basemap --upgrade
from mpl_toolkits.basemap import Basemap
fig2 = plt.figure(figsize=(10,10))
fig2 = Basemap(projection = 'robin', resolution = "c", area_thresh=100000.0, lon_0 = 15, lat_0 = 0)
fig2.drawcoastlines(linewidth=0.9)
fig2.drawcountries(linewidth=0.9)
# If memory issues are encountered rendering the figure, reduce the scale value below
fig2.etopo(scale=0.5, alpha=0.6)
fig2.drawmeridians(np.arange(0, 360, 30), linewidth=0.8)
fig2.drawparallels(np.arange(-90, 90, 30), linewidth=0.8)
# x and y are longitude/latitude values
x,y = fig2(authors['lat'].values, authors['long'].values)
fig2.plot(x, y, '*', markersize=10, color="red")
porosity_micro = data[(data['porosity']) > 0]
porosity_pore = porosity_micro[(porosity_micro['pore']) > 0]
porosity_wall = porosity_micro[(porosity_micro['wall']) > 0]
porosity_spacing = porosity_micro[(porosity_micro['spacing']) > 0]
fig3 = plt.figure(figsize = (6,15))
# three subplots, vertically aligned
ax1 = fig3.add_subplot(3, 1, 1)
ax2 = fig3.add_subplot(3, 1, 2)
ax3 = fig3.add_subplot(3, 1, 3)
minorLocator = AutoMinorLocator()
x1 = porosity_pore['porosity']*100
x2 = porosity_wall['porosity']*100
x3 = porosity_spacing['porosity']*100
y1 = porosity_pore['pore']
y2 = porosity_wall['wall']
y3 = porosity_spacing['spacing']
ax1.set(xlim = [0, 100])
ax1.set(ylim = [0.1, 1000])
ax2.set(xlim = [0, 100])
ax2.set(ylim = [0.1, 1000])
ax3.set(xlim = [0, 100])
ax3.set(ylim = [0.1, 1000])
ax1.xaxis.set_minor_locator(minorLocator)
ax2.xaxis.set_minor_locator(minorLocator)
ax3.xaxis.set_minor_locator(minorLocator)
ax1.set_ylabel('Pore width (${\mu}$m)', fontsize = 20)
ax2.set_ylabel('Wall width (${\mu}$m)', fontsize = 20)
ax3.set_ylabel('Primary spacing (${\mu}$m)', fontsize = 20)
ax3.set_xlabel('Porosity (%)', fontsize = 20)
ax1.set_yscale('log')
ax2.set_yscale('log')
ax3.set_yscale('log')
ax1.set_xticklabels([])
ax2.set_xticklabels([])
ax1.scatter(x1, y1, color = 'black', s = 20, edgecolor = 'none')
ax2.scatter(x2, y2, color = 'black', s = 20, edgecolor = 'none')
ax3.scatter(x3, y3, color = 'black', s = 20, edgecolor = 'none')
ax1.xaxis.set_ticks_position('bottom')
ax2.xaxis.set_ticks_position('bottom')
ax3.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
ax2.yaxis.set_ticks_position('left')
ax3.yaxis.set_ticks_position('left')
plt.subplots_adjust(hspace=0, wspace=0)
ax3.xaxis.set_ticks(np.arange(0, 120, 20))
ax1.yaxis.set_major_locator(ticker.LogLocator(base = 10.0))
ax2.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
ax3.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
# print number of papers corresponding to data points on each subplot
printPapers(porosity_pore, 'fig3a')
printPapers(porosity_wall, 'fig3b')
printPapers(porosity_spacing, 'fig3c')
# store paper_IDs as reference variables for each subplot
Ref_3a = porosity_pore['paper_ID'].unique()
Ref_3b = porosity_wall['paper_ID'].unique()
Ref_3c = porosity_spacing['paper_ID'].unique()
porosity = data[(data['porosity']) > 0]
porosity = porosity[(porosity['vf_total']) > 0]
porosity_water = porosity[(porosity['props_fluid_ID1']) == 1]
porosity_camphene = porosity[(porosity['props_fluid_ID1']) == 2]
porosity_tba = porosity[(porosity['props_fluid_ID1']) == 3]
porosity_other = porosity[(porosity['props_fluid_ID1']) > 3]
minorLocator1 = AutoMinorLocator()
minorLocator2 = AutoMinorLocator()
x = porosity['vf_total']*100
y = porosity['porosity']*100
# Calculate the point density
xy = np.vstack([x,y])
z = gaussian_kde(xy)(xy)
fig4, ax = plt.subplots(figsize = (7,8))
ax.scatter(x, y, c=z, s=25, edgecolor='')
ax.set(xlim = [0, 60])
ax.set(ylim = [0, 100])
ax.yaxis.set_minor_locator(minorLocator1)
ax.xaxis.set_minor_locator(minorLocator2)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.set_ylabel('Porosity (%)', fontsize = 20)
ax.set_xlabel('Solid loading (vol.%)', fontsize = 20)
printPapers(porosity, 'fig4')
Ref_4 = porosity['paper_ID'].unique()
# Perform linear regressions based on fluid type
X1 = porosity_water['vf_total']*100
X1 = sm.add_constant(X1)
y1 = porosity_water['porosity']*100
linear_regression_porosityWater = sm.OLS(y1, X1)
fitted_model_porosityWater = linear_regression_porosityWater.fit()
#print(fitted_model_porosityWater.summary())
betas = np.array(fitted_model_porosityWater.params)
fitted_values_porosityWater = fitted_model_porosityWater.predict(X1)
print('water: ', fitted_model_porosityWater.params)
X2 = porosity_camphene['vf_total']*100
X2 = sm.add_constant(X2)
y2 = porosity_camphene['porosity']*100
linear_regression_porosityCamphene = sm.OLS(y2, X2)
fitted_model_porosityCamphene = linear_regression_porosityCamphene.fit()
#print(fitted_model_porosityWater.summary())
betas = np.array(fitted_model_porosityCamphene.params)
fitted_values_porosityCamphene = fitted_model_porosityCamphene.predict(X2)
print('Camphene: ', fitted_model_porosityCamphene.params)
X3 = porosity_tba['vf_total']*100
X3 = sm.add_constant(X3)
y3 = porosity_tba['porosity']*100
linear_regression_porosityTBA = sm.OLS(y3, X3)
fitted_model_porosityTBA = linear_regression_porosityTBA.fit()
#print(fitted_model_porosityWater.summary())
betas = np.array(fitted_model_porosityTBA.params)
fitted_values_porosityTBA = fitted_model_porosityTBA.predict(X3)
print('TBA: ', fitted_model_porosityTBA.params)
fig5 = plt.figure(figsize = (10,5))
ax1 = fig5.add_subplot(1, 3, 1)
ax2 = fig5.add_subplot(1, 3, 2)
ax3 = fig5.add_subplot(1, 3, 3)
minorLocator1 = AutoMinorLocator()
minorLocator2 = AutoMinorLocator()
x1 = porosity_water['vf_total']*100
x2 = porosity_camphene['vf_total']*100
x3 = porosity_tba['vf_total']*100
y1 = porosity_water['porosity']*100
y2 = porosity_camphene['porosity']*100
y3 = porosity_tba['porosity']*100
# add regression lines based on fits provided
fit1 = -0.727306*x1 + 78.415081
fit2 = -1.121741*x2 + 80.926954
fit3 = -0.666201*x3 + 73.261886
ax1.set(xlim = [0, 60])
ax1.set(ylim = [0, 100])
ax2.set(xlim = [0, 60])
ax2.set(ylim = [0, 100])
ax3.set(xlim = [0, 60])
ax3.set(ylim = [0, 100])
ax1.yaxis.set_minor_locator(minorLocator1)
ax1.xaxis.set_minor_locator(minorLocator2)
ax2.yaxis.set_minor_locator(minorLocator1)
ax2.xaxis.set_minor_locator(minorLocator2)
ax3.yaxis.set_minor_locator(minorLocator1)
ax3.xaxis.set_minor_locator(minorLocator2)
ax1.set_ylabel('Porosity', fontsize = 20)
ax2.set_xlabel('Solid loading (vol.%)', fontsize = 20)
ax1.scatter(x1, y1, color = 'blue', s = 10, edgecolor = 'none')
ax1.plot(x1, fit1, color = 'black')
ax2.scatter(x2, y2, color = 'red', s = 10, edgecolor = 'none')
ax2.plot(x2, fit2, color = 'black')
ax3.scatter(x3, y3, color = 'green', s = 10, edgecolor = 'none')
ax3.plot(x3, fit3, color = 'black')
ax1.xaxis.set_ticks_position('bottom')
ax2.xaxis.set_ticks_position('bottom')
ax3.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
ax2.yaxis.set_ticks_position('left')
ax3.yaxis.set_ticks_position('left')
ax1.xaxis.set_ticks(np.arange(0, 60, 10))
ax1.yaxis.set_ticks(np.arange(20, 100, 20))
ax2.xaxis.set_ticks(np.arange(10, 60, 10))
ax3.xaxis.set_ticks(np.arange(10, 70, 10))
ax2.set_yticklabels([])
ax3.set_yticklabels([])
ax1.set_title("Water")
ax2.set_title("Camphene")
ax3.set_title("TBA")
plt.subplots_adjust(hspace=0, wspace=0)
printPapers(porosity_water, 'fig5a')
printPapers(porosity_camphene, 'fig5b')
printPapers(porosity_tba, 'fig5c')
Ref_5a = porosity_water['paper_ID'].unique()
Ref_5b = porosity_camphene['paper_ID'].unique()
Ref_5c = porosity_tba['paper_ID'].unique()
porosityCera = porosity[(porosity['material_group']) == 'Ceramic']
porosityMetal = porosity[(porosity['material_group']) == 'Metal']
porosityPoly = porosity[(porosity['material_group']) == 'Polymer']
porosityCera_water = porosityCera[(porosityCera['props_fluid_ID1']) == 1]
porosityCera_camphene = porosityCera[(porosityCera['props_fluid_ID1']) == 2]
porosityCera_TBA = porosityCera[(porosityCera['props_fluid_ID1']) == 3]
porosityMetal_water = porosityMetal[(porosityMetal['props_fluid_ID1']) == 1]
porosityMetal_camphene = porosityMetal[(porosityMetal['props_fluid_ID1']) == 2]
porosityMetal_TBA = porosityMetal[(porosityMetal['props_fluid_ID1']) == 3]
porosityPoly_water = porosityPoly[(porosityPoly['props_fluid_ID1']) == 1]
porosityPoly_camphene = porosityPoly[(porosityPoly['props_fluid_ID1']) == 2]
porosityPoly_TBA = porosityPoly[(porosityPoly['props_fluid_ID1']) == 3]
fig = plt.figure(figsize = (12,12))
ax1 = fig.add_subplot(3, 3, 1)
ax2 = fig.add_subplot(3, 3, 2)
ax3 = fig.add_subplot(3, 3, 3)
ax4 = fig.add_subplot(3, 3, 4)
ax5 = fig.add_subplot(3, 3, 5)
ax6 = fig.add_subplot(3, 3, 6)
ax7 = fig.add_subplot(3, 3, 7)
ax8 = fig.add_subplot(3, 3, 8)
ax9 = fig.add_subplot(3, 3, 9)
minorLocator1 = AutoMinorLocator()
minorLocator2 = AutoMinorLocator()
x1 = porosityCera_water['vf_total']*100
y1 = porosityCera_water['porosity']*100
x2 = porosityMetal_water['vf_total']*100
y2 = porosityMetal_water['porosity']*100
x3 = porosityPoly_water['vf_total']*100
y3 = porosityPoly_water['porosity']*100
x4 = porosityCera_camphene['vf_total']*100
y4 = porosityCera_camphene['porosity']*100
x5 = porosityMetal_camphene['vf_total']*100
y5 = porosityMetal_camphene['porosity']*100
x6 = porosityPoly_camphene['vf_total']*100
y6 = porosityPoly_camphene['porosity']*100
x7 = porosityCera_TBA['vf_total']*100
y7 = porosityCera_TBA['porosity']*100
x8 = porosityMetal_TBA['vf_total']*100
y8 = porosityMetal_TBA['porosity']*100
x9 = porosityPoly_TBA['vf_total']*100
y9 = porosityPoly_TBA['porosity']*100
ax1.scatter(x1, y1, color = 'blue', s = 10)
ax2.scatter(x2, y2, color = 'blue', s = 10)
ax3.scatter(x3, y3, color = 'blue', s = 10)
ax4.scatter(x4, y4, color = 'red', s = 10)
ax5.scatter(x5, y5, color = 'red', s = 10)
ax6.scatter(x6, y6, color = 'red', s = 10)
ax7.scatter(x7, y7, color = 'green', s = 10)
ax8.scatter(x8, y8, color = 'green', s = 10)
ax9.scatter(x9, y9, color = 'green', s = 10)
ax1.set(xlim = [0, 60])
ax1.set(ylim = [0, 100])
ax2.set(xlim = [0, 60])
ax2.set(ylim = [0, 100])
ax3.set(xlim = [0, 60])
ax3.set(ylim = [0, 100])
ax4.set(xlim = [0, 60])
ax4.set(ylim = [0, 100])
ax5.set(xlim = [0, 60])
ax5.set(ylim = [0, 100])
ax6.set(xlim = [0, 60])
ax6.set(ylim = [0, 100])
ax7.set(xlim = [0, 60])
ax7.set(ylim = [0, 100])
ax8.set(xlim = [0, 60])
ax8.set(ylim = [0, 100])
ax9.set(xlim = [0, 60])
ax9.set(ylim = [0, 100])
ax1.set_xticklabels([])
ax2.set_xticklabels([])
ax3.set_xticklabels([])
ax4.set_xticklabels([])
ax5.set_xticklabels([])
ax6.set_xticklabels([])
ax2.set_yticklabels([])
ax3.set_yticklabels([])
ax5.set_yticklabels([])
ax6.set_yticklabels([])
ax8.set_yticklabels([])
ax9.set_yticklabels([])
ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
ax2.xaxis.set_ticks_position('bottom')
ax2.yaxis.set_ticks_position('left')
ax3.xaxis.set_ticks_position('bottom')
ax3.yaxis.set_ticks_position('left')
ax4.xaxis.set_ticks_position('bottom')
ax4.yaxis.set_ticks_position('left')
ax5.xaxis.set_ticks_position('bottom')
ax5.yaxis.set_ticks_position('left')
ax6.xaxis.set_ticks_position('bottom')
ax6.yaxis.set_ticks_position('left')
ax7.xaxis.set_ticks_position('bottom')
ax7.yaxis.set_ticks_position('left')
ax8.xaxis.set_ticks_position('bottom')
ax8.yaxis.set_ticks_position('left')
ax9.xaxis.set_ticks_position('bottom')
ax9.yaxis.set_ticks_position('left')
ax7.xaxis.set_ticks(np.arange(10, 60, 10))
ax8.xaxis.set_ticks(np.arange(10, 60, 10))
ax9.xaxis.set_ticks(np.arange(10, 70, 10))
ax1.yaxis.set_ticks(np.arange(20, 120, 20))
ax3.yaxis.set_ticks(np.arange(20, 100, 20))
ax7.yaxis.set_ticks(np.arange(0, 100, 20))
ax3.yaxis.set_label_position("right")
ax6.yaxis.set_label_position("right")
ax9.yaxis.set_label_position("right")
ax3.yaxis.labelpad = 20
ax6.yaxis.labelpad = 20
ax9.yaxis.labelpad = 20
ax1.yaxis.set_minor_locator(minorLocator1)
ax1.xaxis.set_minor_locator(minorLocator2)
ax2.yaxis.set_minor_locator(minorLocator1)
ax2.xaxis.set_minor_locator(minorLocator2)
ax3.yaxis.set_minor_locator(minorLocator1)
ax3.xaxis.set_minor_locator(minorLocator2)
ax4.yaxis.set_minor_locator(minorLocator1)
ax4.xaxis.set_minor_locator(minorLocator2)
ax5.yaxis.set_minor_locator(minorLocator1)
ax5.xaxis.set_minor_locator(minorLocator2)
ax6.yaxis.set_minor_locator(minorLocator1)
ax6.xaxis.set_minor_locator(minorLocator2)
ax7.yaxis.set_minor_locator(minorLocator1)
ax7.xaxis.set_minor_locator(minorLocator2)
ax8.yaxis.set_minor_locator(minorLocator1)
ax8.xaxis.set_minor_locator(minorLocator2)
ax9.yaxis.set_minor_locator(minorLocator1)
ax9.xaxis.set_minor_locator(minorLocator2)
fig.subplots_adjust(wspace = 0, hspace = 0)
ax4.set_ylabel('Porosity (%)')
ax8.set_xlabel('Solid loading (vol.%)')
w = ax3.set_ylabel('Water')
c = ax6.set_ylabel('Camphene')
t = ax9.set_ylabel('TBA')
w.set_rotation(-90)
c.set_rotation(-90)
t.set_rotation(-90)
ax1.set_axis_bgcolor('aliceblue')
ax2.set_axis_bgcolor('aliceblue')
ax3.set_axis_bgcolor('aliceblue')
ax4.set_axis_bgcolor('mistyrose')
ax5.set_axis_bgcolor('mistyrose')
ax6.set_axis_bgcolor('mistyrose')
ax7.set_axis_bgcolor('honeydew')
ax8.set_axis_bgcolor('honeydew')
ax9.set_axis_bgcolor('honeydew')
ax1.set_title("Ceramic")
ax2.set_title("Metal")
ax3.set_title("Polymer")
printPapers(porosityCera_water, 'fig6a')
printPapers(porosityMetal_water, 'fig6b')
printPapers(porosityPoly_water, 'fig6c')
printPapers(porosityCera_camphene, 'fig6d')
printPapers(porosityMetal_camphene, 'fig6e')
printPapers(porosityPoly_camphene, 'fig6f')
printPapers(porosityCera_TBA, 'fig6g')
printPapers(porosityMetal_TBA, 'fig6h')
printPapers(porosityPoly_TBA, 'fig6i')
Ref_6a = porosityCera_water['paper_ID'].unique()
Ref_6b = porosityMetal_water['paper_ID'].unique()
Ref_6c = porosityPoly_water['paper_ID'].unique()
Ref_6d = porosityCera_camphene['paper_ID'].unique()
Ref_6e = porosityMetal_camphene['paper_ID'].unique()
Ref_6f = porosityPoly_camphene['paper_ID'].unique()
Ref_6g = porosityCera_TBA['paper_ID'].unique()
Ref_6h = porosityMetal_TBA['paper_ID'].unique()
Ref_6i = porosityPoly_TBA['paper_ID'].unique()
# obtain data pertaining to aluminum oxide materials, only
Al2O3_porosity = porosity[(porosity['material_ID']) == 1]
x = Al2O3_porosity['vf_total']*100
y = Al2O3_porosity['porosity']*100
minorLocator1 = AutoMinorLocator()
minorLocator2 = AutoMinorLocator()
# Calculate the point density
xy = np.vstack([x,y])
z = gaussian_kde(xy)(xy)
fig7, ax = plt.subplots(figsize = (5,6))
ax.scatter(x, y, c=z, s=25, edgecolor='')
ax.set(xlim = [0, 60])
ax.set(ylim = [0, 100])
ax.yaxis.set_minor_locator(minorLocator1)
ax.xaxis.set_minor_locator(minorLocator2)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.set_ylabel('Porosity (%)', fontsize = 20)
ax.set_xlabel('Solid loading (vol.% Al2O3)', fontsize = 20)
printPapers(Al2O3_porosity, 'fig7')
Ref_7 = Al2O3_porosity['paper_ID'].unique()
pore = data[(data['pore']) > 0]
pore = pore[(pore['vf_total']) > 0]
wall = data[(data['wall']) > 0]
wall = wall[(wall['vf_total']) > 0]
pore_water = pore[(pore['props_fluid_ID1']) == 1]
pore_camphene = pore[(pore['props_fluid_ID1']) == 2]
pore_tba = pore[(pore['props_fluid_ID1']) == 3]
wall_water = wall[(wall['props_fluid_ID1']) == 1]
wall_camphene = wall[(wall['props_fluid_ID1']) == 2]
wall_tba = wall[(wall['props_fluid_ID1']) == 3]
fig = plt.figure(figsize = (10,12))
minorLocator = AutoMinorLocator()
ax1 = fig.add_subplot(3, 2, 1)
ax4 = fig.add_subplot(3, 2, 2)
ax2 = fig.add_subplot(3, 2, 3)
ax5 = fig.add_subplot(3, 2, 4)
ax3 = fig.add_subplot(3, 2, 5)
ax6 = fig.add_subplot(3, 2, 6)
x1 = pore_water['vf_total']*100
x2 = pore_camphene['vf_total']*100
x3 = pore_tba['vf_total']*100
y1 = pore_water['pore']
y2 = pore_camphene['pore']
y3 = pore_tba['pore']
x4 = wall_water['vf_total']*100
x5 = wall_camphene['vf_total']*100
x6 = wall_tba['vf_total']*100
y4 = wall_water['wall']
y5 = wall_camphene['wall']
y6 = wall_tba['wall']
ax1.scatter(x1, y1, color = 'blue', s = 10)
ax2.scatter(x2, y2, color = 'red', s = 10)
ax3.scatter(x3, y3, color = 'green', s = 10)
ax4.scatter(x4, y4, color = 'blue', s = 10)
ax5.scatter(x5, y5, color = 'red', s = 10)
ax6.scatter(x6, y6, color = 'green', s = 10)
ax1.set_yscale('log')
ax2.set_yscale('log')
ax3.set_yscale('log')
ax4.set_yscale('log')
ax5.set_yscale('log')
ax6.set_yscale('log')
ax1.set(xlim = [0, 50])
ax1.set(ylim = [0.1, 1000])
ax2.set(xlim = [0, 50])
ax2.set(ylim = [0.1, 1000])
ax3.set(xlim = [0, 50])
ax3.set(ylim = [0.1, 1000])
ax4.set(xlim = [0, 50])
ax4.set(ylim = [0.1, 1000])
ax5.set(xlim = [0, 50])
ax5.set(ylim = [0.1, 1000])
ax6.set(xlim = [0, 50])
ax6.set(ylim = [0.1, 1000])
ax1.yaxis.set_ticks_position('left')
ax2.yaxis.set_ticks_position('left')
ax3.yaxis.set_ticks_position('left')
ax1.xaxis.set_ticks_position('none')
ax2.xaxis.set_ticks_position('none')
ax4.yaxis.set_ticks_position('left')
ax5.yaxis.set_ticks_position('left')
ax6.yaxis.set_ticks_position('left')
ax4.xaxis.set_ticks_position('none')
ax5.xaxis.set_ticks_position('none')
ax3.xaxis.set_ticks_position('bottom')
ax6.xaxis.set_ticks_position('bottom')
ax3.xaxis.set_minor_locator(minorLocator)
ax6.xaxis.set_minor_locator(minorLocator)
ax2.set_ylabel('Pore width (${\mu}$m)')
ax5.set_ylabel('Wall width (${\mu}$m)')
ax3.set_xlabel('Solid loading (vol.%)')
ax6.set_xlabel('Solid loading (vol.%)')
ax1.set_xticklabels([])
ax2.set_xticklabels([])
ax4.set_xticklabels([])
ax5.set_xticklabels([])
ax3.xaxis.set_ticks(np.arange(10, 50, 10))
ax6.xaxis.set_ticks(np.arange(10, 50, 10))
fig.subplots_adjust(wspace = 0.4, hspace = 0)
ax1.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
ax2.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
ax3.yaxis.set_major_locator(ticker.LogLocator(base = 10.0))
ax4.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
ax5.yaxis.set_major_locator(ticker.LogLocator(base = 100.0))
ax6.yaxis.set_major_locator(ticker.LogLocator(base = 10.0))
printPapers(pore_water, 'fig8a')
printPapers(pore_camphene, 'fig8b')
printPapers(pore_tba, 'fig8c')
printPapers(wall_water, 'fig8d')
printPapers(wall_camphene, 'fig8e')
printPapers(wall_tba, 'fig8f')
Ref_8a = pore_water['paper_ID'].unique()
Ref_8b = pore_camphene['paper_ID'].unique()
Ref_8c = pore_tba['paper_ID'].unique()
Ref_8d = wall_water['paper_ID'].unique()
Ref_8e = wall_camphene['paper_ID'].unique()
Ref_8f = wall_tba['paper_ID'].unique()
compressPorosity = data[(data['porosity']) > 0]
compressPorosity = compressPorosity[(compressPorosity['norm_compressive']) > 0]
compressPorosity_water = compressPorosity[(compressPorosity['props_fluid_ID1']) == 1]
compressPorosity_camphene = compressPorosity[(compressPorosity['props_fluid_ID1']) == 2]
compressPorosity_tba = compressPorosity[(compressPorosity['props_fluid_ID1']) == 3]
x1 = compressPorosity_water['porosity']*100
x2 = compressPorosity_camphene['porosity']*100
x3 = compressPorosity_tba['porosity']*100
y1 = compressPorosity_water['norm_compressive']
y2 = compressPorosity_camphene['norm_compressive']
y3 = compressPorosity_tba['norm_compressive']
fig = plt.figure(figsize = (7,7))
ax1 = fig.add_subplot(1, 1, 1)
ax2 = fig.add_subplot(1, 1, 1)
ax3 = fig.add_subplot(1, 1, 1)
minorLocator = AutoMinorLocator()
ax1.set(xlim = [1, 100])
ax1.set(ylim = [0.00001, 1])
ax1.xaxis.set_minor_locator(minorLocator)
ax1.set_ylabel('Normalized compressive strength', fontsize = 20)
ax1.set_xlabel('Porosity (%)', fontsize = 20)
ax1.set_yscale('log')
ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'green', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'red', s = 40, edgecolor = 'black')
ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
printPapers(compressPorosity_water, 'fig9water')
printPapers(compressPorosity_camphene, 'fig9camphene')
printPapers(compressPorosity_tba, 'fig9tba')
Ref_9a = compressPorosity_water['paper_ID'].unique()
Ref_9b = compressPorosity_camphene['paper_ID'].unique()
Ref_9c = compressPorosity_tba['paper_ID'].unique()
x1 = compressPorosity_water['porosity']*100
x2 = compressPorosity_camphene['porosity']*100
x3 = compressPorosity_tba['porosity']*100
y1 = compressPorosity_water['norm_compressive']
y2 = compressPorosity_camphene['norm_compressive']
y3 = compressPorosity_tba['norm_compressive']
fig = plt.figure(figsize = (12,7))
ax1 = fig.add_subplot(1, 3, 1)
ax2 = fig.add_subplot(1, 3, 2)
ax3 = fig.add_subplot(1, 3, 3)
minorLocator = AutoMinorLocator()
ax1.set(xlim = [1, 100])
ax1.set(ylim = [0.00001, 1])
ax1.xaxis.set_minor_locator(minorLocator)
ax2.set(xlim = [1, 100])
ax2.set(ylim = [0.00001, 1])
ax2.xaxis.set_minor_locator(minorLocator)
ax3.set(xlim = [1, 100])
ax3.set(ylim = [0.00001, 1])
ax3.xaxis.set_minor_locator(minorLocator)
ax1.set_ylabel('Normalized compressive strength', fontsize = 20)
ax2.set_xlabel('Porosity (%)', fontsize = 20)
ax1.set_yscale('log')
ax2.set_yscale('log')
ax3.set_yscale('log')
ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'green', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'red', s = 40, edgecolor = 'black')
ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
fig.subplots_adjust(wspace = 0, hspace = 0)
ax2.set_yticklabels([])
ax3.set_yticklabels([])
ax1.xaxis.set_ticks(np.arange(20, 100, 20))
ax2.xaxis.set_ticks(np.arange(20, 100, 20))
ax3.xaxis.set_ticks(np.arange(20, 100, 20))
printPapers(compressPorosity_water, 'fig10a')
printPapers(compressPorosity_camphene, 'fig10b')
printPapers(compressPorosity_tba, 'fig10c')
Ref_10a = compressPorosity_water['paper_ID'].unique()
Ref_10b = compressPorosity_camphene['paper_ID'].unique()
Ref_10c = compressPorosity_tba['paper_ID'].unique()
compressShrink = data[(data['norm_compressive']) > 0]
compressShrink_dia = compressShrink[(compressShrink['shrink_dia']) > 0]
compressShrink_vol = compressShrink[(compressShrink['shrink_vol']) > 0]
compressShrink_lin = compressShrink[(compressShrink['shrink_lin']) > 0]
x1 = compressShrink_dia['shrink_dia']*100
x2 = compressShrink_vol['shrink_vol']*100
x3 = compressShrink_lin['shrink_lin']*100
y1 = compressShrink_dia['norm_compressive']
y2 = compressShrink_vol['norm_compressive']
y3 = compressShrink_lin['norm_compressive']
fig = plt.figure(figsize = (12,7))
ax1 = fig.add_subplot(1, 3, 2)
ax2 = fig.add_subplot(1, 3, 3)
ax3 = fig.add_subplot(1, 3, 1)
minorLocator = AutoMinorLocator()
ax1.set(xlim = [1, 100])
ax2.set(xlim = [1, 100])
ax3.set(xlim = [1, 100])
ax1.set(ylim = [0.00001, 1])
ax2.set(ylim = [0.00001, 1])
ax3.set(ylim = [0.00001, 1])
ax1.xaxis.set_minor_locator(minorLocator)
ax1.set_xlabel('Shrinkage (%diameter)', fontsize = 16)
ax2.set_xlabel('Volumetric shrinkage (%)', fontsize = 16)
ax3.set_xlabel('Linear shrinkage (%)', fontsize = 16)
ax3.set_ylabel('Normalized compressive strength', fontsize = 20)
ax1.set_yscale('log')
ax2.set_yscale('log')
ax3.set_yscale('log')
ax1.set_xscale('log')
ax2.set_xscale('log')
ax3.set_xscale('log')
ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'blue', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'blue', s = 40, edgecolor = 'black')
ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
ax2.xaxis.set_ticks_position('bottom')
ax2.yaxis.set_ticks_position('left')
ax3.xaxis.set_ticks_position('bottom')
ax3.yaxis.set_ticks_position('left')
fig.subplots_adjust(wspace = 0, hspace = 0)
ax1.set_yticklabels([])
ax2.set_yticklabels([])
printPapers(compressShrink_dia, 'fig11a')
printPapers(compressShrink_vol, 'fig11b')
printPapers(compressShrink_lin, 'fig11c')
Ref_11a = compressShrink_dia['paper_ID'].unique()
Ref_11b = compressShrink_vol['paper_ID'].unique()
Ref_11c = compressShrink_lin['paper_ID'].unique()
flexuralPorosity = data[(data['porosity']) > 0]
flexuralPorosity = flexuralPorosity[(flexuralPorosity['norm_flexural']) > 0]
flexuralPorosity_water = flexuralPorosity[(flexuralPorosity['props_fluid_ID1']) == 1]
flexuralPorosity_camphene = flexuralPorosity[(flexuralPorosity['props_fluid_ID1']) == 2]
flexuralPorosity_tba = flexuralPorosity[(flexuralPorosity['props_fluid_ID1']) == 3]
x1 = flexuralPorosity_water['porosity']*100
x2 = flexuralPorosity_camphene['porosity']*100
x3 = flexuralPorosity_tba['porosity']*100
y1 = flexuralPorosity_water['norm_flexural']
y2 = flexuralPorosity_camphene['norm_flexural']
y3 = flexuralPorosity_tba['norm_flexural']
fig = plt.figure(figsize = (7,7))
ax1 = fig.add_subplot(1, 1, 1)
ax2 = fig.add_subplot(1, 1, 1)
ax3 = fig.add_subplot(1, 1, 1)
minorLocator = AutoMinorLocator()
ax1.set(xlim = [1, 100])
ax1.set(ylim = [0.001, 1])
ax1.xaxis.set_minor_locator(minorLocator)
ax1.set_ylabel('Normalized flexural strength', fontsize = 20)
ax1.set_xlabel('Porosity (%)', fontsize = 20)
ax1.set_yscale('log')
ax1.scatter(x1, y1, color = 'blue', s = 40, edgecolor = 'black')
ax3.scatter(x3, y3, color = 'green', s = 40, edgecolor = 'black')
ax2.scatter(x2, y2, color = 'red', s = 40, edgecolor = 'black')
ax1.xaxis.set_ticks_position('bottom')
ax1.yaxis.set_ticks_position('left')
printPapers(flexuralPorosity_water, 'fig')
printPapers(flexuralPorosity_camphene, 'fig')
printPapers(flexuralPorosity_tba, 'fig')
Ref_12a = flexuralPorosity_water['paper_ID'].unique()
Ref_12b = flexuralPorosity_camphene['paper_ID'].unique()
Ref_12c = flexuralPorosity_tba['paper_ID'].unique()
print(list(data.columns.values))
# Create new dataframe with columns of interest - Here, we'll export the dataframe used for the interactive plotting application
dataExport = data[['paper_ID', 'peer_review', 'authors', 'title', 'journal', 'volume', 'issue', 'pages', 'year', 'doi',
'material', 'material_group', 'name_fluid1', 'vf_total', 'dia_part_1', 'porosity', 'spacing', 'pore', 'wall',
'cooling_rate', 'temp_cold', 'temp_constant', 'temp_nuc', 'velocity', 'wf_bind_1', 'wf_disp_1',
'dia_mold', 'height_mold', 'shrink_vol', 'shrink_dia', 'shrink_lin', 'norm_compressive',
'norm_flexural', 'norm_elastic', 'compressive', 'flexural', 'elastic']].copy()
# Perform any unit conversions
dataExport['vf_total'] = dataExport['vf_total']*100
dataExport['dia_part_1'] = dataExport['dia_part_1']*10**6
dataExport['porosity'] = dataExport['porosity']*100
dataExport['shrink_dia'] = dataExport['shrink_dia']*100
dataExport['shrink_vol'] = dataExport['shrink_vol']*100
dataExport['shrink_lin'] = dataExport['shrink_lin']*100
dataExport['wf_bind_1'] = dataExport['wf_bind_1']*100
dataExport['wf_disp_1'] = dataExport['wf_disp_1']*100
dataExport['dia_mold'] = dataExport['dia_mold']*10**3
dataExport['height_mold'] = dataExport['height_mold']*10**3
# View header to verify
print dataExport.head()
# Export dataframe to csv
dataExport.to_csv(path_or_buf='filepath/data.csv',
header=True)
Define function to print citation for figures. To utilize, run, "Refs(Ref_x)," replacing "x" with the figure number. Since the reference lists are large, here, we will just print reference numbers (paper_IDs) that correspond to data points within the figures.
references = data
references['paper_ID'] = references['paper_ID'].astype('int')
references = references.set_index('paper_ID')
authors = references['authors']
year = references['year'].astype('int')
doi = references['doi']
journal = references['journal']
volume = references['volume']
issue = references['issue']
title = references['title']
pages = references['pages']
references['citation'] = (
authors.str.cat(year.astype(str), sep = ' (').str.cat(
title, sep = '). "').str.cat(journal, sep = '." ').str.cat(
volume.astype(str), sep = ', ').str.cat(issue.astype(str), sep = '(').str.cat(
pages, sep = '), ').str.cat(doi, sep = '. doi: '))
def Refs(index):
for i in references.index:
return (references.loc[index,'citation'])
print 'Fig3a', Ref_3a
print 'Figure 4: ', Ref_4
print 'Figure 5a', Ref_5a
print 'Figure 5b', Ref_5b
print 'Figure 5c', Ref_5c
print 'Figure 6a', Ref_6a
print 'Figure 6b', Ref_6b
print 'Figure 6c', Ref_6c
print 'Figure 6d', Ref_6d
print 'Figure 6e', Ref_6e
print 'Figure 6f', Ref_6f
print 'Figure 6g', Ref_6g
print 'Figure 6h', Ref_6h
print 'Figure 6i', Ref_6i
print 'Figure 7', Ref_7
print 'Figure 8a', Ref_8a
print 'Figure 8b', Ref_8b
print 'Figure 8c', Ref_8c
print 'Figure 8d', Ref_8d
print 'Figure 8e', Ref_8e
print 'Figure 8f', Ref_8f
print 'Figure 9a', Ref_9a
print 'Figure 9b', Ref_9b
print 'Figure 9c', Ref_9c
print 'Figure 10a', Ref_10a
print 'Figure 10b', Ref_10b
print 'Figure 10c', Ref_10c
print 'Figure 11a', Ref_11a
print 'Figure 11b', Ref_11b
print 'Figure 11c', Ref_11c
print 'Figure 12a', Ref_12a
print 'Figure 12b', Ref_12b
print 'Figure 12c', Ref_12c
#%install_ext http://raw.github.com/jrjohansson/version_information/master/version_information.py
%load_ext version_information
%reload_ext version_information
%version_information numpy, scipy, matplotlib