Skip to content

Commit adb823f

Browse files
author
Daniel Buscombe
committed
Sun Jan 21 14:10:53 MST 2018
1 parent 40040cb commit adb823f

File tree

9 files changed

+21
-12
lines changed

9 files changed

+21
-12
lines changed

PyHum/_pyhum_correct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ def correct(humfile, sonpath, maxW=1000, doplot=1, dofilt=0, correct_withwater=0
568568
print("Processing took "+ str(elapsed) + "seconds to analyse")
569569

570570
print("Done!")
571-
571+
print("===================================================")
572572

573573
# =========================================================
574574
def water_atten(H,f,c,pH,T,S):

PyHum/_pyhum_map.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
import PyHum.utils as humutils
7777
import pyresample
7878
#from scipy.ndimage import binary_dilation, binary_erosion, binary_fill_holes
79+
from skimage.restoration import denoise_tv_chambolle
7980

8081
try:
8182
from pykdtree.kdtree import KDTree
@@ -261,13 +262,13 @@ def map(humfile, sonpath, cs2cs_args = "epsg:26949", res = 99, mode=3, nn = 64,
261262
# dat_star = star_fp[p]
262263
# data_R = R_fp[p]
263264

264-
# e = esi; del esi
265-
# n = nsi; del nsi
266-
# t = theta; del theta
267-
# d = dist_tvg; del dist_tvg
268-
# dat_port = port_fp; del port_fp
269-
# dat_star = star_fp; del star_fp
270-
# data_R = R_fp; del R_fp
265+
# e = esi;# del esi
266+
# n = nsi; #del nsi
267+
# t = theta;# del theta
268+
# d = dist_tvg;# del dist_tvg
269+
# dat_port = port_fp;# del port_fp
270+
# dat_star = star_fp; #del star_fp
271+
# data_R = R_fp; #del R_fp
271272

272273
dx = np.arcsin(meta['c']/(1000*meta['t']*meta['f']))
273274
pix_m = meta['pix_m']*1.1
@@ -296,6 +297,7 @@ def map(humfile, sonpath, cs2cs_args = "epsg:26949", res = 99, mode=3, nn = 64,
296297
print("Processing took "+str(elapsed)+"seconds to analyse")
297298

298299
print("Done!")
300+
print("===================================================")
299301

300302

301303
# =========================================================
@@ -327,6 +329,8 @@ def make_map(e, n, t, d, dat_port, dat_star, data_R, pix_m, res, cs2cs_args, son
327329

328330
merge = merge.astype('float32')
329331

332+
merge = denoise_tv_chambolle(merge.copy(), weight=2, multichannel=False).astype('float32')
333+
330334
R = np.vstack((np.flipud(data_R),data_R))
331335
del data_R
332336
R = R[:np.shape(merge)[0],:np.shape(merge)[1]]

PyHum/_pyhum_map_texture.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ def map_texture(humfile, sonpath, cs2cs_args = "epsg:26949", res = 0.5, mode=3,
441441
print("Processing took "+str(elapsed)+"seconds to analyse")
442442

443443
print("Done!")
444+
print("===================================================")
444445

445446
# =========================================================
446447
def getclass_asc(sonpath, p):

PyHum/_pyhum_read.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,7 @@ def read(humfile, sonpath, cs2cs_args="epsg:26949", c=1450.0, draft=0.3, doplot=
847847
print("Processing took "+ str(elapsed) + "seconds to analyse")
848848

849849
print("Done!")
850+
print("===================================================")
850851

851852

852853
# =========================================================

PyHum/_pyhum_rmshadows.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ def rmshadows(humfile, sonpath, win=31, shadowmask=0, doplot=1, dissim=3, correl
549549
print("Processing took "+str(elapsed)+ "seconds to analyse")
550550

551551
print("Done!")
552+
print("===================================================")
552553

553554
# =========================================================
554555
def custom_save(figdirec,root):

PyHum/_pyhum_texture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def texture(humfile, sonpath, win=100, shift=10, doplot=1, density=50, numclasse
412412
print("Processing took "+ str(elapsed)+ "seconds to analyse")
413413

414414
print("Done!")
415-
415+
print("===================================================")
416416

417417
# =========================================================
418418
def get_srt(Z,ind,maxscale, notes, win): #, density):

PyHum/_pyhum_texture2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ def texture2(humfile, sonpath, win=10, doplot=1, numclasses=4):
362362
print("Processing took " +str(elapsed)+ "seconds to analyse")
363363

364364
print("Done!")
365+
print("===================================================")
365366

366367
# =========================================================
367368
def get_kclass(Sk, numclasses):

PyHum/test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,14 @@ def dotest():
112112
notes = 4 # Notes per octave (for wavelet analysis)
113113

114114
# for mapping
115-
res = 0.1 #99 # grid resolution in metres
115+
res = 0.05 #99 # grid resolution in metres
116116
# if res==99, the program will automatically calc res from the spatial res of the scans
117117
mode = 1 # gridding mode (simple nearest neighbour)
118118
#mode = 2 # gridding mode (inverse distance weighted nearest neighbour)
119119
#mode = 3 # gridding mode (gaussian weighted nearest neighbour)
120120
use_uncorrected = 0
121121

122+
scalemax=40
122123
nn = 64 #number of nearest neighbours for gridding (used if mode > 1)
123124
##influence = 1 #Radius of influence used in gridding. Cut off distance in meters
124125
numstdevs = 5 #Threshold number of standard deviations in sidescan intensity per grid cell up to which to accept
@@ -142,7 +143,7 @@ def dotest():
142143
PyHum.texture2(humfile, sonpath, win, doplot, numclasses)
143144

144145
## grid and map the scans
145-
PyHum.map(humfile, sonpath, cs2cs_args, res, mode, nn, numstdevs, use_uncorrected) #dowrite,
146+
PyHum.map(humfile, sonpath, cs2cs_args, res, mode, nn, numstdevs, use_uncorrected, scalemax)
146147

147148
## calculate and map the e1 and e2 acoustic coefficients from the downward-looking sonar
148149
PyHum.e1e2(humfile, sonpath, cs2cs_args, ph, temp, salinity, beam, transfreq, integ, numclusters, doplot)

PyHum/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ def make_kml(llcrnrlon, llcrnrlat, urcrnrlon, urcrnrlat,
695695
ground.draworder = draworder
696696
ground.visibility = kw.pop('visibility', 1)
697697
ground.name = kw.pop('name', 'overlay')
698-
ground.color = kw.pop('color', '9effffff') ##kw.pop('color', '9effffff')
698+
#ground.color = kw.pop('color', '9effffff') ##kw.pop('color', '9effffff')
699699

700700
ground.atomauthor = kw.pop('author', 'PyHum')
701701
ground.latlonbox.rotation = kw.pop('rotation', 0)

0 commit comments

Comments
 (0)