Skip to content

Commit bb2ae0b

Browse files
committed
updated makeDataCube to allow for more general profile length distribution
1 parent 38dc86d commit bb2ae0b

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

gprpy/makeDataCube.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,27 @@ def makeDataCube(datalist,outname,nx=50,ny=50,nz=50,smooth=None,nprofile=None,nd
104104
one big positive reflector instead of cancelling out.
105105
[default: False]
106106
'''
107-
108-
gpr=gp.gprpyProfile(datalist[0])
109107

110-
gpr,nprofile,ndepth = reduceSampling(gpr,nprofile,ndepth)
108+
109+
# Read all profiles to find out total data size
110+
totlen = 0
111+
totprof = 0
112+
for i in range(0,len(datalist)):
113+
gpr=gp.gprpyProfile(datalist[i])
114+
#gpr,nprofile,ndepth=reduceSampling(gpr,nprofile,ndepth)
115+
if gpr.data_pretopo is None:
116+
totlen = totlen + gpr.data.shape[0]*gpr.data.shape[1]
117+
totprof = totprof + gpr.data.shape[1]
118+
else:
119+
totlen = totlen + gpr.data_pretopo.shape[0]*gpr.data_pretopo.shape[1]
120+
totprof = totprof + gpr.data_pretopo.shape[1]
111121

112122
# Allocate memory based on nprofile and ndepth. May be overallocating
113-
allpoints = np.zeros((nprofile*ndepth*len(datalist),3))
114-
alldata = np.zeros(nprofile*ndepth*len(datalist))
123+
allpoints = np.zeros((totlen,3))
124+
alldata = np.zeros(totlen)
115125
datalength = np.zeros(len(datalist),dtype=int)
116126

117-
topopoints = 2*np.zeros((nprofile*len(datalist),3))
127+
topopoints = 2*np.zeros((totprof,3))
118128
topolength = np.zeros(len(datalist),dtype=int)
119129

120130
npoints=0

gprpy/toolbox/splash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def showSplash(a,dir_path,widfac,highfac,fontfac):
7878
'size': 13.5*fontfac
7979
#'size': 45.6
8080
}
81-
a.text(50,-12000,'Version 1.0.4',fontdict=fontver)
81+
a.text(50,-12000,'Version 1.0.5',fontdict=fontver)
8282

8383
# add UA logo
8484
filename1=os.path.join(dir_path,'toolbox','splashdat',

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setuptools.setup(
66
name="gprpy",
7-
version="1.0.4",
7+
version="1.0.5",
88
author="Alain Plattner",
99
author_email="plattner@alumni.ethz.ch",
1010
description="GPRPy - open source ground penetrating radar processing and visualization",

0 commit comments

Comments
 (0)