In [1]:
from IPython.core.display import Image
Image(filename='../extremefill/kPlusVkMinus.png')
Out[1]:
In [10]:
%load_ext autoreload
%autoreload 2
from tools import getSMTRecords, smt_ipy_table, switch_smt_database
switch_smt_database('extremefill')
records = getSMTRecords()
annular26Records = getSMTRecords(records=records, tags=['annular26'])
switch_smt_database('extremefill2D')
Out[10]:
In [2]:
print len(annular26Records)
The simulation below will act as a test case for obtaining the length of the void.
In [78]:
from tools import getSMTRecords
from tools import getRecord
from multiViewer import MultiViewer
kPlus=np.logspace(3, 4, 20)[0]
kMinus=np.logspace(7.6, 8.6, 20)[11]
record = getSMTRecords(annular26Records, parameters={'kPlus' : kPlus, 'kMinus' : kMinus})[0]
viewer = MultiViewer([record], figsize=(1.5, 6))
viewer.plot(times=np.arange(10) * 4000. / 9.)
smt_ipy_table([record], fields=['label', 'timestamp', 'parameters', 'duration', 'version', 'tags'], parameters=['kPlus', 'kMinus'])
print 'void_size, height:',find_void_size(record)
The find_void_size function returns the void size and fill height as a proportion of the trench depth.
In [58]:
from tools import find_void_size
print find_void_size(record)
In [9]:
for record in annular26Records:
newpath = os.path.join(record.datastore.root, record.output_data[0].path)
oldpath = newpath.replace('extremefill2D', 'extremefill2D-old')
!ln -s {oldpath} {newpath}
In [79]:
%load_ext autoreload
%autoreload 2
from tools import getSMTRecords
from tools import getRecord
from multiViewer import MultiViewer
from tools import find_void_size
kPlus=np.logspace(3, 4, 20)[0]
kMinus=np.logspace(7.6, 8.6, 20)[7]
record = getSMTRecords(annular26Records, parameters={'kPlus' : kPlus, 'kMinus' : kMinus})[0]
viewer = MultiViewer([record], figsize=(1.5, 6))
viewer.plot(times=np.arange(10) * 4000. / 9.)
smt_ipy_table([record], fields=['label', 'timestamp', 'parameters', 'duration', 'version', 'tags'], parameters=['kPlus', 'kMinus'])
print 'void_size, height:',find_void_size(record)
The above is not classed as a void as this is actually not disconnected.
In [80]:
%load_ext autoreload
%autoreload 2
from tools import getSMTRecords
from tools import getRecord
from multiViewer import MultiViewer
from tools import find_void_size
kPlus=np.logspace(3, 4, 20)[0]
kMinus=np.logspace(7.6, 8.6, 20)[2]
record = getSMTRecords(annular26Records, parameters={'kPlus' : kPlus, 'kMinus' : kMinus})[0]
viewer = MultiViewer([record], figsize=(1.5, 6))
viewer.plot(times=np.arange(10) * 4000. / 9.)
smt_ipy_table([record], fields=['label', 'timestamp', 'parameters', 'duration', 'version', 'tags'], parameters=['kPlus', 'kMinus'])
print 'void_size, height:',find_void_size(record)
In [81]:
%load_ext autoreload
%autoreload 2
from tools import getSMTRecords
from tools import getRecord
from multiViewer import MultiViewer
from tools import find_void_size
kPlus=np.logspace(3, 4, 20)[0]
kMinus=np.logspace(7.6, 8.6, 20)[5]
record = getSMTRecords(annular26Records, parameters={'kPlus' : kPlus, 'kMinus' : kMinus})[0]
viewer = MultiViewer([record], figsize=(1.5, 6))
viewer.plot(times=np.arange(10) * 4000. / 9.)
smt_ipy_table([record], fields=['label', 'timestamp', 'parameters', 'duration', 'version', 'tags'], parameters=['kPlus', 'kMinus'])
print 'void_size, height:',find_void_size(record)
In [38]:
!date
%load_ext autoreload
%autoreload 4
from tools import VoidSizeFinder
kPluses = np.logspace(3, 4, 20)
kMinuses = np.logspace(7.6, 8.6, 20)
N = 400
kPs, kMs = np.meshgrid(kPluses, kMinuses)
kPs = kPs.flatten()
kMs = kMs.flatten()
ks = np.array((kPs, kMs)).transpose()
vv = VoidSizeFinder()
def void_size(kPlus, kMinus):
record = getSMTRecords(annular26Records, parameters={'kPlus' : kPlus, 'kMinus' : kMinus})[0]
return vv.find_void_size(record)
void_size_vectorized = np.vectorize(void_size)
import cProfile
#cProfile.run("void_sizes = void_size_vectorized(ks[:N,0], ks[:N,1])", filename='profile1.stats')
void_size, fill_height = void_size_vectorized(ks[:N,0], ks[:N,1])
#print void_sizes
!date
Compare this with annular6 notebook.
In [44]:
void_sizes_reshape = void_size.reshape((20, 20)).transpose()
plt.figure(figsize=(8, 6))
a = plt.contourf(kMinuses, kPluses, void_sizes_reshape, np.linspace(0, 1, 11))
a.ax.set_xscale('log')
a.ax.set_yscale('log')
plt.xlabel(r'$k^-')
plt.ylabel(r'$k^+')
plt.colorbar()
plt.title(r'Void Size')
Out[44]:
Compare this with annular6 notebook.
In [43]:
fill_height_reshape = fill_height.reshape((20, 20)).transpose()
plt.figure(figsize=(8, 6))
a = plt.contourf(kMinuses, kPluses, fill_height_reshape, np.linspace(0, 1, 11))
a.ax.set_xscale('log')
a.ax.set_yscale('log')
plt.xlabel(r'$k^-')
plt.ylabel(r'$k^+')
plt.colorbar()
plt.title(r'Fill Height')
Out[43]:
annular25See the notebook.
In [1]:
%load_ext autoreload
%autoreload 2
from tools import getSMTRecords, smt_ipy_table, switch_smt_database
switch_smt_database('extremefill')
records = getSMTRecords()
annular25Records = getSMTRecords(records=records, tags=['annular25'])
switch_smt_database('extremefill2D')
Out[1]:
Create links to these old records in new directory
In [4]:
import os
for record in annular25Records:
newpath = os.path.join(record.datastore.root, record.output_data[0].path)
oldpath = newpath.replace('extremefill2D', 'extremefill2D-old')
!ln -s {oldpath} {newpath}
Pull out the fill_height and void_size arrays
In [6]:
!date
%load_ext autoreload
%autoreload 4
from tools import VoidSizeFinder
kPluses=np.logspace(1, 3, 20)
kMinuses=np.logspace(7, 8, 10)
N = 200
kPs, kMs = np.meshgrid(kPluses, kMinuses)
kPs = kPs.flatten()
kMs = kMs.flatten()
ks = np.array((kPs, kMs)).transpose()
vv = VoidSizeFinder()
def void_size(kPlus, kMinus):
record = getSMTRecords(annular25Records, parameters={'kPlus' : kPlus, 'kMinus' : kMinus})[0]
return vv.find_void_size(record)
void_size_vectorized = np.vectorize(void_size)
import cProfile
#cProfile.run("void_sizes = void_size_vectorized(ks[:N,0], ks[:N,1])", filename='profile1.stats')
void_size, fill_height = void_size_vectorized(ks[:N,0], ks[:N,1])
#print void_sizes
!date
In [8]:
void_sizes_reshape = void_size.reshape((10, 20)).transpose()
plt.figure(figsize=(8, 6))
a = plt.contourf(kMinuses, kPluses, void_sizes_reshape, np.linspace(0, 1, 11))
a.ax.set_xscale('log')
a.ax.set_yscale('log')
plt.xlabel(r'$k^-')
plt.ylabel(r'$k^+')
plt.colorbar()
plt.title(r'Void Size')
Out[8]:
In [9]:
fill_height_reshape = fill_height.reshape((10, 20)).transpose()
plt.figure(figsize=(8, 6))
a = plt.contourf(kMinuses, kPluses, fill_height_reshape, np.linspace(0, 1, 11))
a.ax.set_xscale('log')
a.ax.set_yscale('log')
plt.xlabel(r'$k^-')
plt.ylabel(r'$k^+')
plt.colorbar()
plt.title(r'Fill Height')
Out[9]:
In [12]:
overall_reshape = fill_height_reshape - void_sizes_reshape
plt.figure(figsize=(8, 6))
a = plt.contourf(kMinuses, kPluses, overall_reshape, np.linspace(0, 1, 11))
a.ax.set_xscale('log')
a.ax.set_yscale('log')
plt.xlabel(r'$k^-')
plt.ylabel(r'$k^+')
plt.colorbar()
plt.title(r'Fill Proportion')
Out[12]:
In [ ]: