BenthicSubstrateMapping / PyHum

Python code to read, display, export and analyse Humminbird sidescan sonar data
Other
68 stars 28 forks source link

PyHum TypeError: #61

Closed ryanhefley closed 5 years ago

ryanhefley commented 5 years ago

Traceback (most recent call last): File "W:\Ryan Hefley\HS_13_Ellis\April_5_2018\R00012.py", line 118, in my_func() File "W:\Ryan Hefley\HS_13_Ellis\April_5_2018\R00012.py", line 81, in my_func PyHum.correct(humfile, sonpath, maxW, doplot, dofilt, correct_withwater, ph, temp, salinity) TypeError: correct() takes exactly 10 arguments (9 given)

`# This program will allow you to take your humminbird readings with the associated files

with the file extensions of .DAT and .SON and convert them to graphs and raw numbers of river bed elevations

To use this program, simply change only the values that have comments with "*"

For example, if you HUMFILE (.DAT) FILE PATH HERE

Change the path or variable that is already there.

import PyHum

def my_func():

copy files over to somewhere read/writeable

general settings

humfile = "W:\Ryan Hefley\HS_13_Ellis\April_5_2018\R00012.DAT"#<-----HUMFILE (.DAT) FILE PATH HERE sonpath = "W:\Ryan Hefley\HS_13_Ellis\April_5_2018\R00012" #<-----FILE PATH FOR FOLDER POINTING TO SON PATH (.SON)

doplot = 1 #yes

reading specific settings

cs2cs_args = "epsg:3433" #<-----epsg:3433 STATEPLANE NORTH || epsg:3434 STATEPLANE SOUTH bedpick = 1 # auto bed pick c = 1450 # speed of sound fresh water t = 0.186 #<-----Length of transducer(meters) draft = 0.3 # draft in metres flip_lr = 1 # flip port and starboard model = 1199 #<-----Humminbird model calc_bearing = 1 #1=yes filt_bearing = 1 #1=yes chunk = '1' ##'d100' # distance, 100m

chunk = 'p1000' # pings, 1000

chunk = 'h10' # heading deviation, 10 deg

correction specific settings

maxW = 1000 # rms output wattage dofilt = 0 # 1 = apply a phase preserving filter (WARNING!! takes a very long time for large scans) correct_withwater = 0 # don't retain water column in radiometric correction (1 = retains water column for radiomatric corrections) ph = 7.0 # acidity on the pH scale temp = 15.0 #<-----*Water Temp(C) salinity = 0.0

for shadow removal

shadowmask = 0 # 0= automatic shadow removal, 1=manual win = 31 dissim=3 correl=0.2 contrast=6 energy=0.15 mn=4

for texture calcs

shift = 50 ##10 # pixel shift density =win/2 # win/2 numclasses = 8 #4 # number of discrete classes for contouring and k-means maxscale = 20 # Max scale as inverse fraction of data length (for wavelet analysis) notes = 4 # Notes per octave (for wavelet analysis)

for mapping

res = 0.1 #99 # grid resolution in metres

if res==99, the program will automatically calc res from the spatial res of the scans

mode = 1 # gridding mode (simple nearest neighbour)

mode = 2 # gridding mode (inverse distance weighted nearest neighbour)

mode = 3 # gridding mode (gaussian weighted nearest neighbour)

use_uncorrected = 0

nn = 64 #number of nearest neighbours for gridding (used if mode > 1)

influence = 1 #Radius of influence used in gridding. Cut off distance in meters

numstdevs = 5 #Threshold number of standard deviations in sidescan intensity per grid cell up to which to accept

for downward-looking echosounder echogram (e1-e2) analysis

beam = 20.0 transfreq = 200.0 # frequency (kHz) of downward looking echosounder integ = 5 numclusters = 3 # number of acoustic classes to group observations

read data in SON files into PyHum memory mapped format (.dat)

PyHum.read(humfile, sonpath, cs2cs_args, c, draft, doplot, t, bedpick, flip_lr, model, calc_bearing, filt_bearing, chunk) #cog

correct scans and remove water column

PyHum.correct(humfile, sonpath, maxW, doplot, dofilt, correct_withwater, ph, temp, salinity)

remove acoustic shadows (caused by distal acoustic attenuation or sound hitting shallows or shoreline)

PyHum.rmshadows(humfile, sonpath, win, shadowmask, doplot, dissim, correl, contrast, energy, mn)

win = 10 PyHum.texture2(humfile, sonpath, win, doplot, numclasses)

grid and map the scans

PyHum.map(humfile, sonpath, cs2cs_args, res, mode, nn, numstdevs, use_uncorrected) #dowrite,

calculate and map the e1 and e2 acoustic coefficients from the downward-looking sonar

PyHum.e1e2(humfile, sonpath, cs2cs_args, ph, temp, salinity, beam, transfreq, integ, numclusters, doplot)

res = 1 # grid resolution in metres numstdevs = 5

grid and map the texture lengthscale maps

PyHum.map_texture(humfile, sonpath, cs2cs_args, res, mode, nn, numstdevs)

res = 0

nn = 5 # noise threshold in dB W

noisefloor = 10 # noise threshold in dB W

weight = 1 ##based on grazing angle and inverse distance weighting

create mosaic out of all chunks with weighting according to distance from nadir, grazing angle, or both

PyHum.mosaic(humfile, sonpath, cs2cs_args, res, nn, noisefloor, weight)

win = 200 #100 # pixel window

Calculate texture lengthscale maps using the method of Buscombe et al. (2015)

PyHum.texture(humfile, sonpath, win, shift, doplot, density, numclasses, maxscale, notes)

Calculate texture lengthscale maps using the method of Buscombe et al. (2015)

implemented using the superpixel approach

PyHum.texture_slic(humfile, sonpath, doplot, numclasses, maxscale, notes)

if name == 'main': my_func()`