GPUE  v1.0
GPU Gross-Pitaevskii Equation numerical solver for Bose-Einstein condensates
hist3d Namespace Reference

Functions

def plot_xyz_histogram (start, fin, incr, barcolor)
 
def plot_hist_pcolor (start, fin, incr, barcolor)
 

Variables

 c = ConfigParser.ConfigParser()
 
 xDim = int(c.getfloat('Params','xDim'))
 
 yDim = int(c.getfloat('Params','yDim'))
 
 gndMaxVal = int(c.getfloat('Params','gsteps'))
 
 evMaxVal = int(c.getfloat('Params','esteps'))
 
 incr = int(c.getfloat('Params','print_out'))
 
tuple sep = (c.getfloat('Params','dx'))
 
tuple dx = (c.getfloat('Params','dx'))
 
tuple dt = (c.getfloat('Params','dt'))
 
tuple xMax = (c.getfloat('Params','xMax'))
 
tuple yMax = (c.getfloat('Params','yMax'))
 
int num_vort = 0
 

Detailed Description

hist3d.py - GPUE: Split Operator based GPU solver for Nonlinear 
Schrodinger Equation, Copyright (C) 2011-2015, Lee J. O'Riordan 
<loriordan@gmail.com>, Tadhg Morgan, Neil Crowley. All rights reserved.

Redistribution and use in source and binary forms, with or without 
modification, are permitted provided that the following conditions are 
met:

1. Redistributions of source code must retain the above copyright 
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright 
notice, this list of conditions and the following disclaimer in the 
documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its 
contributors may be used to endorse or promote products derived from 
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ plot_hist_pcolor()

def hist3d.plot_hist_pcolor (   start,
  fin,
  incr,
  barcolor 
)

Definition at line 87 of file hist3d.py.

87 def plot_hist_pcolor(start,fin,incr, barcolor):
88  fig = plt.figure()
89 
90  data =[]
91  for i in range(start, fin, incr):
92  v_arr=genfromtxt('vort_lsq_' + str(i) + '.csv',delimiter=',' )
93  datatmp=[]
94  count=0
95 
96  for i1 in range(0,v_arr.size/2):
97  for i2 in range(i1,v_arr.size/2):
98  m_tmp = m.sqrt(abs(v_arr[i1][0]*sep - v_arr[i2][0]*sep)**2 + abs(v_arr[i1][1]*sep - v_arr[i2][1]*sep)**2 )
99  datatmp.append( m_tmp )
100  count = count + 1
101  hist=np.histogram(datatmp,bins=np.arange(0.0,240.0,0.1))
102  data.append(hist[:][0])
103 
104  # print data
105  ax = fig.add_subplot(111)
106  ax.imshow(data)
107  plt.gca().invert_yaxis()
108  ax.set_aspect('auto')
109 # plt.jet()
110  fig.savefig("HIST_PCOLOR.pdf")
111 
def plot_hist_pcolor(start, fin, incr, barcolor)
Definition: hist3d.py:87

◆ plot_xyz_histogram()

def hist3d.plot_xyz_histogram (   start,
  fin,
  incr,
  barcolor 
)

Definition at line 57 of file hist3d.py.

57 def plot_xyz_histogram(start,fin,incr, barcolor):
58  fig = plt.figure()
59  ax = Axes3D(fig)
60  data =[]
61  for i in range(start, fin, incr):
62  v_arr=genfromtxt('vort_lsq_' + str(i) + '.csv',delimiter=',' )
63  datatmp=[]
64  count=0
65 
66  for i1 in range(0,v_arr.size/2):
67  for i2 in range(i1,v_arr.size/2):
68  datatmp.append(m.sqrt( abs(v_arr[i1][0]*sep - v_arr[i2][0]*sep)**2 + abs(v_arr[i1][1]*sep - v_arr[i2][1]*sep)**2 ))
69  count = count + 1
70  hist=np.histogram(datatmp,bins=np.arange(1.0,m.sqrt(xDim**2 + yDim**2),1.0))
71  data.append(hist[:][0])
72  """ Takes in a matrix (see structure above) and generate a pseudo-3D histogram by overlaying close, semitransparent bars. """
73  for time, occurrence in zip(range(len(data)), data):
74  dist = range(len(occurrence))
75  barband = range(-45, 45, 5)
76  #for modifier in barband:
77  ax.bar(dist, occurrence, zs=time, zdir='y', color=np.random.rand(3,1), alpha=0.8)
78  #ax.bar(current, occurrence, zs=duration+(float(modifier)/100), zdir='y', color=np.random.rand(3,1), alpha=0.6)
79 
80  ax.set_xlabel('Dist')
81  ax.set_ylabel('Time')
82  ax.set_zlabel('Occurrances')
83 
84  plt.savefig("HIST_N.pdf")
85  plt.show()
86 
def plot_xyz_histogram(start, fin, incr, barcolor)
Definition: hist3d.py:57

Variable Documentation

◆ c

hist3d.c = ConfigParser.ConfigParser()

Definition at line 41 of file hist3d.py.

◆ dt

tuple hist3d.dt = (c.getfloat('Params','dt'))

Definition at line 51 of file hist3d.py.

◆ dx

tuple hist3d.dx = (c.getfloat('Params','dx'))

Definition at line 50 of file hist3d.py.

◆ evMaxVal

hist3d.evMaxVal = int(c.getfloat('Params','esteps'))

Definition at line 47 of file hist3d.py.

◆ gndMaxVal

hist3d.gndMaxVal = int(c.getfloat('Params','gsteps'))

Definition at line 46 of file hist3d.py.

◆ incr

hist3d.incr = int(c.getfloat('Params','print_out'))

Definition at line 48 of file hist3d.py.

◆ num_vort

int hist3d.num_vort = 0

Definition at line 54 of file hist3d.py.

◆ sep

float hist3d.sep = (c.getfloat('Params','dx'))

Definition at line 49 of file hist3d.py.

◆ xDim

hist3d.xDim = int(c.getfloat('Params','xDim'))

Definition at line 44 of file hist3d.py.

◆ xMax

tuple hist3d.xMax = (c.getfloat('Params','xMax'))

Definition at line 52 of file hist3d.py.

◆ yDim

hist3d.yDim = int(c.getfloat('Params','yDim'))

Definition at line 45 of file hist3d.py.

◆ yMax

tuple hist3d.yMax = (c.getfloat('Params','yMax'))

Definition at line 53 of file hist3d.py.