JuliaSeismo / SeisNoise.jl

Ambient Noise Cross-Correlation in Julia
MIT License
55 stars 18 forks source link

whiten! does not accept ComplexF64 data #68

Closed tclements closed 3 years ago

tclements commented 3 years ago

Error found by @xtyangpsp: whiten! accepts only ComplexF32 data and not ComplexF64. MWE:

using SeisNoise 
A = rand(ComplexF64,100,10);
whiten!(A,1.,2.,10.,50)
ERROR: MethodError: no method matching whiten!(::Array{Complex{Float64},2}, ::Float64, ::Float64, ::Float64, ::Int64)
Closest candidates are:
  whiten!(::AbstractArray{Complex{Float32},N} where N, ::Real, ::Real, ::Real, ::Int64; pad) at /home/timclements/.julia/packages/SeisNoise/Bosrn/src/correlation.jl:168
  whiten!(::FFTData, ::Real, ::Real; pad) at /home/timclements/.julia/packages/SeisNoise/Bosrn/src/correlation.jl:221
  whiten!(::RawData, ::Real, ::Real; pad) at /home/timclements/.julia/packages/SeisNoise/Bosrn/src/correlation.jl:245
  ...
Stacktrace:
 [1] top-level scope at REPL[4]:1

Need to rewrite whiten! kernel to accept Complex{T} where T <: AbstractFloat.