ROBelgium / MSNoise

A Python Package for Monitoring Seismic Velocity Changes using Ambient Seismic Noise | http://www.msnoise.org
European Union Public License 1.1
172 stars 82 forks source link

Update move2obspy.py #292

Closed Alexnavi44 closed 9 months ago

ThomasLecocq commented 1 year ago

references to #291

ThomasLecocq commented 1 year ago

thanks @Alexnavi44 : why not using fft[i] as out , so that would work "inplace" ? something like: (I don't think we need to convert to abs for 0, as -0 and +0 are the same in python here I think:)

elif whiten_type == "HANN":
    np.divide(fft[i], np.abs(fft[i]), out=fft[i], where=fft[i]!=0)
    fft[i][:porte1] *= 0.0
ThomasLecocq commented 9 months ago

done in https://github.com/ROBelgium/MSNoise/commit/e7cf4140a2363a12d19442cfd8587654c837cfe4 and https://github.com/ROBelgium/MSNoise/commit/81325cc7eb785f0e7da286ab292b1354c21a5d6d