From bb2ae0b55302bbd78b16e96780669f7655303d1d Mon Sep 17 00:00:00 2001 From: Alain Plattner Date: Thu, 1 Aug 2019 14:43:12 -0500 Subject: [PATCH] updated makeDataCube to allow for more general profile length distribution --- gprpy/makeDataCube.py | 22 ++++++++++++++++------ gprpy/toolbox/splash.py | 2 +- setup.py | 2 +- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/gprpy/makeDataCube.py b/gprpy/makeDataCube.py index 2a6ee3d..95283aa 100644 --- a/gprpy/makeDataCube.py +++ b/gprpy/makeDataCube.py @@ -104,17 +104,27 @@ def makeDataCube(datalist,outname,nx=50,ny=50,nz=50,smooth=None,nprofile=None,nd one big positive reflector instead of cancelling out. [default: False] ''' - - gpr=gp.gprpyProfile(datalist[0]) - gpr,nprofile,ndepth = reduceSampling(gpr,nprofile,ndepth) + + # Read all profiles to find out total data size + totlen = 0 + totprof = 0 + for i in range(0,len(datalist)): + gpr=gp.gprpyProfile(datalist[i]) + #gpr,nprofile,ndepth=reduceSampling(gpr,nprofile,ndepth) + if gpr.data_pretopo is None: + totlen = totlen + gpr.data.shape[0]*gpr.data.shape[1] + totprof = totprof + gpr.data.shape[1] + else: + totlen = totlen + gpr.data_pretopo.shape[0]*gpr.data_pretopo.shape[1] + totprof = totprof + gpr.data_pretopo.shape[1] # Allocate memory based on nprofile and ndepth. May be overallocating - allpoints = np.zeros((nprofile*ndepth*len(datalist),3)) - alldata = np.zeros(nprofile*ndepth*len(datalist)) + allpoints = np.zeros((totlen,3)) + alldata = np.zeros(totlen) datalength = np.zeros(len(datalist),dtype=int) - topopoints = 2*np.zeros((nprofile*len(datalist),3)) + topopoints = 2*np.zeros((totprof,3)) topolength = np.zeros(len(datalist),dtype=int) npoints=0 diff --git a/gprpy/toolbox/splash.py b/gprpy/toolbox/splash.py index 52907a7..33d3f37 100644 --- a/gprpy/toolbox/splash.py +++ b/gprpy/toolbox/splash.py @@ -78,7 +78,7 @@ def showSplash(a,dir_path,widfac,highfac,fontfac): 'size': 13.5*fontfac #'size': 45.6 } - a.text(50,-12000,'Version 1.0.4',fontdict=fontver) + a.text(50,-12000,'Version 1.0.5',fontdict=fontver) # add UA logo filename1=os.path.join(dir_path,'toolbox','splashdat', diff --git a/setup.py b/setup.py index 375405a..3070a72 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setuptools.setup( name="gprpy", - version="1.0.4", + version="1.0.5", author="Alain Plattner", author_email="plattner@alumni.ethz.ch", description="GPRPy - open source ground penetrating radar processing and visualization",