JohnWStockwellJr / SeisUnix

The CWP/SU: Seismic Un*x Package - a free open seismic processing, research, and educational software package. Please seek distribution gzipped tar files at https://wiki.Seismic-Unix.org not the Github version.
https://wiki.Seismic-Unix.org
Other
266 stars 123 forks source link

Algorithm error on RMS calculation #143

Closed pablombarros closed 1 year ago

pablombarros commented 1 year ago

sumax's algorithm to calculate RMS has a logical mistake where it actually doesn't consider the whole file or trace to calculate the RMS. This can be shown by:

# suspike creates a vector [0,1,0,0], with rms=sqrt(1/4)=0.5
$ suspike nt=4 ntr=1 nspk=1 ix1=1 it1=2 offset=0 | sumax mode=rms verbose=1 
Using native byte order SU data format w/o XDR.
1 0.000000e+00
global rms = 0.000000e+00

I created a pull request that fixes this calculation on #142. Please review