DigitalGrainSize / pyDGS

Wavelet-based digital grain size analysis
MIT License
50 stars 16 forks source link

negative x values don't work #19

Closed dsilas closed 2 years ago

dsilas commented 2 years ago

Thank you for creating and maintaining this software.

In the latest code cloned from this repository as of June 27 2022, using the cloned conda env file, negative x values don't seem to work. This includes using either the run_dgs.py program with an -x arguement with a negative value, or calling dgs() from a python console with a negative x value on a single image. With a zero value or positive value the program works.

pyDGS/dgs.py:208: RuntimeWarning: divide by zero encountered in power
  r_v = (p*scales**x) / np.sum(p*scales**x) #volume-by-weight proportion

pyDGS/dgs.py:208: RuntimeWarning: invalid value encountered in multiply
  r_v = (p*scales**x) / np.sum(p*scales**x) #volume-by-weight proportion

The issue does not occur with the code download of pyDGS-4.0 from the releases section of the github page. when calling dgs() with the same test image and a negative x value from the python console.

dbuscombe-usgs commented 2 years ago

Sorry for the delay!! This is now fixed in the latest push