BenthicSubstrateMapping / PyHum

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

Fixed an indexing error in correct's remove_water function. #67

Closed mbenson182 closed 5 years ago

mbenson182 commented 5 years ago

When running the dotest() script, I was receiving errors like this one:

Traceback (most recent call last): File "", line 1, in File "/home/bensomt1/miniconda2/envs/pyhum/lib/python2.7/site-packages/PyHum/test.py", line 138, in dotest PyHum.correct(humfile, sonpath, maxW, doplot, dofilt, correct_withwater, ph, temp, salinity, dconcfile) File "/home/bensomt1/miniconda2/envs/pyhum/lib/python2.7/site-packages/PyHum/_pyhum_correct.py", line 314, in correct Zt, R, A = remove_water(star_fp, bed, shape_star, dep_m, pix_m, 1, maxW) File "/home/bensomt1/miniconda2/envs/pyhum/lib/python2.7/site-packages/PyHum/_pyhum_correct.py", line 705, in remove_water a[:,k] = d[k]/yvec ValueError: could not broadcast input array from shape (1479,1) into shape (1479)

on lines 705 and 709 of _pyhum_correct.py. As far as I know, this indexing change should fix these errors (at the very least, the test script now gets through this part without throwing an error - I cannot confirm whether it's a complete fix, as I'm having other issues which I'll submit an Issue for shortly).