Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some wavelength-dependent effects #4

Open
wants to merge 39 commits into
base: hole7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
050121d
Ignore binary files
dkirkby Jul 9, 2016
34f8d98
Use generic paths to boost, hdf5
dkirkby Jul 9, 2016
5731092
Use .hdf5 extension for HDF5 files
dkirkby Jul 9, 2016
eebeba2
Split up ignore rules
dkirkby Jul 10, 2016
2e1e39a
Remove top-level ignore rules
dkirkby Jul 10, 2016
32b71db
Use .dat extension for ASCII output data files
dkirkby Jul 10, 2016
3c6dc4c
Update revision log
dkirkby Jul 11, 2016
bb16300
Print some counter values to make it easier to navigate the many iden…
dkirkby Jul 11, 2016
9a1b0e0
Add VerboseLevel config option and be less verbose by default
dkirkby Jul 11, 2016
02526d3
Fix compiler warning
dkirkby Jul 11, 2016
bcb7624
Document units of physical constants in globals.h
dkirkby Jul 11, 2016
3ce34ae
Start some documentation on output files
dkirkby Jul 12, 2016
1474a5d
Add plot axis labels
dkirkby Jul 12, 2016
b5e717c
Fix plotting crash when NumElec = 0
dkirkby Jul 12, 2016
1119966
Update outputs.md
craiglagegit Jul 12, 2016
c73e9fe
Add description of Pts output file
dkirkby Jul 13, 2016
94225ab
Implement alternate electron path output format selected with LogPixe…
dkirkby Jul 13, 2016
a7e65e4
Do not save E field when LogEField=0. Only calculate areas for centra…
dkirkby Jul 14, 2016
7639073
Save phi,rho and do area calculations every 10 steps
dkirkby Jul 14, 2016
f71d271
Fix link error and compilation warnings under Ubuntu + GCC
dkirkby Jul 14, 2016
2602af8
Fix one more compiler warning
dkirkby Jul 14, 2016
78e3f93
Fix memory leak
dkirkby Jul 14, 2016
ac0afa5
Add config logic for wavelength-dependent depth sampling
dkirkby Jul 14, 2016
7ad5be5
Implement random depth sampling based on FilterBand in GetElectronDep…
dkirkby Jul 14, 2016
d984be9
Add jupyter notebook with wavelength dependent plots and calculations
dkirkby Jul 14, 2016
75dff58
Sample central pixel only when PixelBoundaryTestType=4
dkirkby Jul 14, 2016
aba9c4e
Add config files for wavelength-dependent simulations
dkirkby Jul 14, 2016
89a2a33
Convert string to c_str for ifstream ctor
dkirkby Jul 14, 2016
0f05149
Add SaveGrid() function to save 3D coordinate grid.
dkirkby Jul 15, 2016
6901292
Accumulate charge in TraceRegion when PixelBoundaryTestType = 4
dkirkby Jul 15, 2016
507a398
Move area calculation after tracing electrons
dkirkby Jul 15, 2016
7cd8319
Add script to make wavelength-dependent plots
dkirkby Jul 16, 2016
6e81a16
Put plots in plots/ folder
dkirkby Jul 16, 2016
b60eda0
Use POISSON_BANDS to find wavelength-dependent simulation outputs for…
dkirkby Jul 16, 2016
e5254ee
Better error reporting
dkirkby Jul 16, 2016
0b9e702
Fix grid path
dkirkby Jul 16, 2016
e79a537
Close figure after each plot
dkirkby Jul 16, 2016
f1beb42
Try a different way of cleaning up after each figure
dkirkby Jul 16, 2016
8f69683
Correcting minor bug in calculatiing depth_pdf lookup table
craiglagegit Mar 21, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions AreaPlot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

#Author: Craig Lage, NYU;
#Author: Craig Lage, NYU;
#Date: 16-Nov-15

#This program plots the pixel area plots from the Poisson CCD solver
Expand Down Expand Up @@ -77,7 +77,7 @@ def ReadAreaFile(filename, nx, ny):
j = int(items[1])
area[i,j] = float(items[2])
return area


#****************MAIN PROGRAM*****************

Expand All @@ -98,7 +98,7 @@ def ReadAreaFile(filename, nx, ny):
NyCenter = 4
Area_0 = 100.0

filename = outputfiledir + '/' + outputfilebase +'_%d_Area'%step
filename = outputfiledir + '/' + outputfilebase +'_%d_Area'%step+'.dat'

area = ReadAreaFile(filename, Nx, Ny)

Expand Down Expand Up @@ -183,7 +183,7 @@ def ReadAreaFile(filename, nx, ny):
for i in range(Nx+1):
plot([10.0 + 10.0 * i, 10.0 + 10.0 * i], [10.0, 100.0], color = 'black')
for j in range(Ny+1):
plot([10.0, 100.0], [10.0 + 10.0 * j, 10.0 + 10.0 * j], color = 'black')
plot([10.0, 100.0], [10.0 + 10.0 * j, 10.0 + 10.0 * j], color = 'black')
for i in range(Nx):
for j in range(Ny):
if i == NxCenter and j == NyCenter:
Expand Down
8 changes: 4 additions & 4 deletions AreaPlot_Corr.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

#Author: Craig Lage, NYU;
#Author: Craig Lage, NYU;
#Date: 16-Nov-15

#This program plots the pixel area plots from the Poisson CCD solver
Expand Down Expand Up @@ -77,7 +77,7 @@ def ReadAreaFile(filename, nx, ny):
j = int(items[1])
area[i,j] = float(items[2])
return area


#****************MAIN PROGRAM*****************

Expand All @@ -98,7 +98,7 @@ def ReadAreaFile(filename, nx, ny):
NyCenter = 4
Area_0 = 100.0

filename = outputfiledir + '/' + outputfilebase +'_%d_Area'%step
filename = outputfiledir + '/' + outputfilebase +'_%d_Area'%step+'.dat'

area = ReadAreaFile(filename, Nx, Ny)

Expand Down Expand Up @@ -183,7 +183,7 @@ def ReadAreaFile(filename, nx, ny):
for i in range(Nx+1):
plot([10.0 + 10.0 * i, 10.0 + 10.0 * i], [10.0, 100.0], color = 'black')
for j in range(Ny+1):
plot([10.0, 100.0], [10.0 + 10.0 * j, 10.0 + 10.0 * j], color = 'black')
plot([10.0, 100.0], [10.0 + 10.0 * j, 10.0 + 10.0 * j], color = 'black')
for i in range(Nx):
for j in range(Ny):
if i == NxCenter and j == NyCenter:
Expand Down
6 changes: 3 additions & 3 deletions AreaTrend.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

#Author: Craig Lage, NYU;
#Author: Craig Lage, NYU;
#Date: 16-Nov-15

#This program plots the pixel area plots from the Poisson CCD solver
Expand Down Expand Up @@ -77,7 +77,7 @@ def ReadAreaFile(filename, nx, ny):
j = int(items[1])
area[i,j] = float(items[2])
return area


#****************MAIN PROGRAM*****************
dirs = ["data/run1","data/run2","data/run3","data/run4","data/run6"]
Expand All @@ -99,7 +99,7 @@ def ReadAreaFile(filename, nx, ny):
NyCenter = int((ConfigData["FilledPixelCoords_0_0"][1] - ConfigData["PixelBoundaryLowerLeft"][1]) / ConfigData["PixelSize"])
NumElec = ConfigData["CollectedCharge_0_0"]

filename = outputfiledir + '/' + outputfilebase +'_0_Area'
filename = outputfiledir + '/' + outputfilebase +'_0_Area' + '.dat'

area = ReadAreaFile(filename, Nx, Ny)

Expand Down
18 changes: 6 additions & 12 deletions ChargeDistribution.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

#Author: Craig Lage, NYU;
#Author: Craig Lage, NYU;
#Date: 26-Jan-15

#This program plots the Poisson equation solutions from the C++ Poisson solver
Expand All @@ -12,13 +12,13 @@
#****************SUBROUTINES*****************
class Array3dHDF5Elec(object):
def __init__(self, dir, filebase, n):
elecfile = dir+'/'+filebase+'_'+str(n)+'_Elec'
elecfile = dir+'/'+filebase+'_'+str(n)+'_Elec' + '.hdf5'
hdfelec = h5py.File(elecfile,'r')
Dimension = hdfelec[hdfelec.items()[0][0]].attrs[u'Dimension']
self.nx=Dimension[0]
self.ny=Dimension[1]
self.nz=Dimension[2]

Lower_Left = hdfelec[hdfelec.items()[0][0]].attrs[u'Lower_Left']
self.xmin=Lower_Left[0]
self.ymin=Lower_Left[1]
Expand All @@ -28,11 +28,11 @@ def __init__(self, dir, filebase, n):
self.xmax=Upper_Right[0]
self.ymax=Upper_Right[1]
self.zmax=100.0

self.dx=(self.xmax-self.xmin)/self.nx
self.dy=(self.ymax-self.ymin)/self.ny
self.dzp=(self.zmax-self.zmin)/(ConfigData["Nx"] * ConfigData["ScaleFactor"] + 1)

self.x=linspace(self.xmin+self.dx/2,self.xmax-self.dx/2,self.nx)
self.y=linspace(self.ymin+self.dy/2,self.ymax-self.dy/2,self.ny)
self.zp=linspace(self.zmin+self.dzp/2,self.zmax-self.dzp/2,(ConfigData["Nx"] * ConfigData["ScaleFactor"] + 1))[0:16*ConfigData["ScaleFactor"]]
Expand Down Expand Up @@ -140,7 +140,7 @@ def ReadConfigFile(filename):
# This holds all of the data
ScaleFactor = ConfigData["ScaleFactor"]
GridsPerPixel = ConfigData["GridsPerPixel"]
dat = Array3dHDF5Elec(outputfiledir, outputfilebase, run)
dat = Array3dHDF5Elec(outputfiledir, outputfilebase, run)

nxx = dat.nx - 1
nyy = dat.ny - 1
Expand Down Expand Up @@ -228,9 +228,3 @@ def ReadConfigFile(filename):
ax3.imshow(log10(fliplr(plotarray)), interpolation = 'nearest')
savefig(outputfiledir+"/plots/ChargeDistribution_%d.pdf"%run)
close(fig)






18 changes: 6 additions & 12 deletions ChargeDistribution_XYZDist.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

#Author: Craig Lage, NYU;
#Author: Craig Lage, NYU;
#Date: 26-Jan-15

#This program plots the Poisson equation solutions from the C++ Poisson solver
Expand All @@ -12,13 +12,13 @@
#****************SUBROUTINES*****************
class Array3dHDF5Elec(object):
def __init__(self, dir, filebase, n):
elecfile = dir+'/'+filebase+'_'+str(n)+'_Elec'
elecfile = dir+'/'+filebase+'_'+str(n)+'_Elec' + '.hdf5'
hdfelec = h5py.File(elecfile,'r')
Dimension = hdfelec[hdfelec.items()[0][0]].attrs[u'Dimension']
self.nx=Dimension[0]
self.ny=Dimension[1]
self.nz=Dimension[2]

Lower_Left = hdfelec[hdfelec.items()[0][0]].attrs[u'Lower_Left']
self.xmin=Lower_Left[0]
self.ymin=Lower_Left[1]
Expand All @@ -28,11 +28,11 @@ def __init__(self, dir, filebase, n):
self.xmax=Upper_Right[0]
self.ymax=Upper_Right[1]
self.zmax=100.0

self.dx=(self.xmax-self.xmin)/self.nx
self.dy=(self.ymax-self.ymin)/self.ny
self.dzp=(self.zmax-self.zmin)/(ConfigData["Nx"] * ConfigData["ScaleFactor"] + 1)

self.x=linspace(self.xmin+self.dx/2,self.xmax-self.dx/2,self.nx)
self.y=linspace(self.ymin+self.dy/2,self.ymax-self.dy/2,self.ny)
self.zp=linspace(self.zmin+self.dzp/2,self.zmax-self.dzp/2,(ConfigData["Nx"] * ConfigData["ScaleFactor"] + 1))[0:16*ConfigData["ScaleFactor"]]
Expand Down Expand Up @@ -140,7 +140,7 @@ def ReadConfigFile(filename):
# This holds all of the data
ScaleFactor = ConfigData["ScaleFactor"]
GridsPerPixel = ConfigData["GridsPerPixel"]
dat = Array3dHDF5Elec(outputfiledir, outputfilebase, run)
dat = Array3dHDF5Elec(outputfiledir, outputfilebase, run)

nxx = dat.nx - 1
nyy = dat.ny - 1
Expand Down Expand Up @@ -257,9 +257,3 @@ def ReadConfigFile(filename):
ax6.set_ylabel("Charge Density")
savefig(outputfiledir+"/plots/ChargeDistribution_XYZ_%d.pdf"%run)
close(fig)






30 changes: 12 additions & 18 deletions ChargeDistribution_XYZDist_N.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

#Author: Craig Lage, NYU;
#Author: Craig Lage, NYU;
#Date: 26-Jan-15

#This program plots the Poisson equation solutions from the C++ Poisson solver
Expand All @@ -12,15 +12,15 @@
#****************SUBROUTINES*****************
class Array3dHDF5Elec(object):
def __init__(self, dir, filebase, n):
elecfile = dir+'/'+filebase+'_'+str(n)+'_Elec'
elecfile = dir+'/'+filebase+'_'+str(n)+'_Elec' + '.hdf5'
hdfelec = h5py.File(elecfile,'r')
holefile = dir+'/'+filebase+'_'+str(n)+'_Hole'
holefile = dir+'/'+filebase+'_'+str(n)+'_Hole' + '.hdf5'
hdfhole = h5py.File(holefile,'r')
Dimension = hdfelec[hdfelec.items()[0][0]].attrs[u'Dimension']
self.nx=Dimension[0]
self.ny=Dimension[1]
self.nz=Dimension[2]

Lower_Left = hdfelec[hdfelec.items()[0][0]].attrs[u'Lower_Left']
self.xmin=Lower_Left[0]
self.ymin=Lower_Left[1]
Expand All @@ -30,11 +30,11 @@ def __init__(self, dir, filebase, n):
self.xmax=Upper_Right[0]
self.ymax=Upper_Right[1]
self.zmax=100.0

self.dx=(self.xmax-self.xmin)/self.nx
self.dy=(self.ymax-self.ymin)/self.ny
self.dzp=(self.zmax-self.zmin)/(ConfigData["Nx"] * ConfigData["ScaleFactor"] + 1)

self.x=linspace(self.xmin+self.dx/2,self.xmax-self.dx/2,self.nx)
self.y=linspace(self.ymin+self.dy/2,self.ymax-self.dy/2,self.ny)
self.zp=linspace(self.zmin+self.dzp/2,self.zmax-self.dzp/2,(ConfigData["Nx"] * ConfigData["ScaleFactor"] + 1))[0:32*ConfigData["ScaleFactor"]]
Expand Down Expand Up @@ -74,7 +74,7 @@ def ZIndex(z):
self.Channelkmin = ZIndex(ConfigData["GateOxide"] * EPSILON_SI / EPSILON_OX)

self.elec=array(hdfelec[hdfelec.items()[0][0]])
self.hole=array(hdfhole[hdfhole.items()[0][0]])
self.hole=array(hdfhole[hdfhole.items()[0][0]])

def ReadConfigFile(filename):
# This reads the config file for the necessary settings
Expand Down Expand Up @@ -143,7 +143,7 @@ def ReadConfigFile(filename):
# This holds all of the data
ScaleFactor = ConfigData["ScaleFactor"]
GridsPerPixel = ConfigData["GridsPerPixel"]
dat = Array3dHDF5Elec(outputfiledir, outputfilebase, run)
dat = Array3dHDF5Elec(outputfiledir, outputfilebase, run)

nxx = dat.nx - 1
nyy = dat.ny - 1
Expand Down Expand Up @@ -186,7 +186,7 @@ def ReadConfigFile(filename):

if i == 1:
nxcenter += ScaleFactor * GridsPerPixel / 2
nycenter += ScaleFactor * GridsPerPixel / 2
nycenter += ScaleFactor * GridsPerPixel / 2

fig = figure(figsize = (12,12))
suptitle("%s Charge Distribution"%carriers[i], fontsize = 36)
Expand Down Expand Up @@ -265,20 +265,14 @@ def ReadConfigFile(filename):
ax6.plot(dat.z[:],plotarray, label = '(X,Y) = (%.2f,%.2f)'%(dat.x[nxcenter],dat.y[nycenter]))
if i == 1:
plotarray = log10(plotdata[nxcenter,nycenter,:]+0.01)
ax6.plot(dat.z[:],plotarray, label = '(X,Y) = (%.2f,%.2f)'%(dat.x[nxcenter],dat.y[nycenter]))
nycenter -= ScaleFactor * GridsPerPixel / 2
ax6.plot(dat.z[:],plotarray, label = '(X,Y) = (%.2f,%.2f)'%(dat.x[nxcenter],dat.y[nycenter]))
nycenter -= ScaleFactor * GridsPerPixel / 2
plotarray = log10(plotdata[nxcenter,nycenter,:]+0.01)
ax6.plot(dat.z[:],plotarray, label = '(X,Y) = (%.2f,%.2f)'%(dat.x[nxcenter],dat.y[nycenter]))
ax6.plot(dat.z[:],plotarray, label = '(X,Y) = (%.2f,%.2f)'%(dat.x[nxcenter],dat.y[nycenter]))
legend(bbox_to_anchor=(1.05, 0.5), loc=2, fontsize = 9)
ax6.set_ylabel("Log Charge Density")
ax6.set_xlim(ax6.get_xlim()[::-1])
ax6.set_xticks([0.0,1.0,2.0])
ax6.set_xlabel("Z ( Microns)")
savefig(outputfiledir+"/plots/%sDistribution_XYZ_%d.pdf"%(carriers[i],run))
close(fig)






Loading