##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Lance Simms, Stanford University 2009
##PURPOSE:
##    To plot a gaussian and look at its derivatives
##
##KEYWORDS:
##  Mode: int
##    0 - use an explicit method
##    1 - use a Newton Iteration methodd
##    2 - use an implicit method
##  TvFlag: int
##    0 - Don't plot
##    1 - Plot according to TvPPT
##  NSteps: int
##    The number of steps to execute
##  SaveFig: int
##    0 - Don't save any figures
##    1 - Save the figures at the end
##  Simple: int
##    0 - Approximate diode entirely with lightly doped n material
##    1 - Use p+ n n+ regions with abrupt junctions
##  UseEField: int
##    0 - Don't calculate J_drift
##    1 - Include J_drift in the FD
##  UseDiffusion: int
##    0 - Don't use diffusion
##    1 - Use diffusion in FD
##  CalcDataCube: int
##    0 - Don't fill up a datacube with signal values
##    1 - fill up a datacube with signal values
##  IncDarkCurrent: int
##    0 - Don't include dark current in the datacube
##    1 - Include dark current in the datacube
##  TP: int
##    The total number of points in the radial grid
##  RMax: float
##    The maximum value for the radial grid
##  dt: float
##    The time step used in the explicit method
##  CompProfiles: datacube
##    A set of radial profiles to compare the diffusion simulation to 
##  CompRadii: float arr
##    A set of radii to use in order to plot the Profile
##  PlotMode: int
##    0 - Plot the simulations on top of real data to see if it aligns
##    1 - Only plot simulations to speed things up and test things out
##
###################################################################
import matplotlib.pylab as mplot
from numpy import *
from pylab import *
from Return_Persistence_Quantities import *
from LU_decomposition import *
from RadGrid_1d import * 
import pdb

execfile('/afs/slac/u/ki/lances/python/python_HxRG/HxRG_Setup.py')
PlotDir = '/nfs/slac/g/ki/ki04/lances/PNSimulations/'

x      = frange(200000)/10000
Sigma  = 5.5
Gauss  = 50*exp(-x**2/(2*Sigma**2))
GaussD = -150*x/(2*Sigma**2)*exp(-x**2/(2*Sigma**2))
mplot.figure(0)
mplot.clf()
mplot.plot(x, Gauss,  'ro')
mplot.plot(x, GaussD, 'bo')

