Skip to content

Commit

Permalink
updated makeDataCube to allow for more general profile length distrib…
Browse files Browse the repository at this point in the history
…ution
  • Loading branch information
AlainPlattner committed Aug 1, 2019
1 parent 38dc86d commit bb2ae0b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
22 changes: 16 additions & 6 deletions gprpy/makeDataCube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gprpy/toolbox/splash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit bb2ae0b

Please sign in to comment.