dttrugman / GrowClust3D.jl

Julia-based implementation of GrowClust relative earthquake relocation.
GNU General Public License v3.0
46 stars 7 forks source link

MethodError during relocation #3

Closed FinniganIK closed 1 year ago

FinniganIK commented 1 year ago

Kia ora,

I'm getting the following MethodError when GrowClust3D starts the relocation estimates. The test and example runs work perfectly fine (both single processor and multiprocessing) and there are no errors when it's reading the various datafiles, so I'm not really sure where this error could be coming from, any help greatly appreciated!

Starting relocation estimates, nthread=1
[Progress tracked on Thread 1 only.]

Thread 1: starting bootstrap iteration: 0/0
Thread 1: Initializing xcorr data and event pairs...
Done, elapsed time = 3.021468687
ERROR: LoadError: TaskFailedException
Stacktrace:
 [1] wait
   @ ./task.jl:345 [inlined]
 [2] threading_run(fun::var"#37#threadsfor_fun#7"{var"#37#threadsfor_fun#5#8"{UnitRange{Int64}}}, static::Bool)
   @ Base.Threads ./threadingconstructs.jl:38
 [3] macro expansion
   @ ./threadingconstructs.jl:89 [inlined]
 [4] top-level scope
   @ ./timing.jl:263

    nested task error: MethodError: no method matching (::Interpolations.Extrapolation{Float32, 3, Interpolations.ScaledInterpolation{Float32, 3, Interpolations.BSplineInterpolation{Float32, 3, Array{Float32, 3}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}, Base.OneTo{Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Flat{Nothing}, Interpolations.Line{Nothing}}}})(::Float64, ::Float64)
    Use square brackets [] for indexing an Array.
    Closest candidates are:
      (::Interpolations.Extrapolation{T, N})(::Number...) where {T, N} at ~/.julia/packages/Interpolations/jPlKV/src/extrapolation/extrapolation.jl:45
      (::Interpolations.Extrapolation{T, N})(::Union{Number, AbstractVector}...) where {T, N} at ~/.julia/packages/Interpolations/jPlKV/src/extrapolation/extrapolation.jl:54
    Stacktrace:
     [1] difclust1(qX0::Float64, qY0::Float64, qZ0::Float64, tdif::Vector{Float32}, itab::Vector{Int16}, sX::Vector{Float64}, sY::Vector{Float64}, qX1::Vector{Float64}, qY1::Vector{Float64}, qZ1::Vector{Float64}, qT1::Vector{Float32}, qX2::Vector{Float64}, qY2::Vector{Float64}, qZ2::Vector{Float64}, qT2::Vector{Float32}, ttTABs::Vector{Interpolations.Extrapolation{Float32, 3, Interpolations.ScaledInterpolation{Float32, 3, Interpolations.BSplineInterpolation{Float32, 3, Array{Float32, 3}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}, Base.OneTo{Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Flat{Nothing}, Interpolations.Line{Nothing}}}}}, boxwid::Float64, nit::Int64)
       @ GrowClust3D ~/.julia/packages/GrowClust3D/nnMkn/src/relocation1D.jl:183
     [2] clustertree(pqix1::Vector{Int32}, pqix2::Vector{Int32}, ixx1::Vector{Int32}, ixx2::Vector{Int32}, tdif::Vector{Float32}, sX::Vector{Float64}, sY::Vector{Float64}, itab::Vector{Int16}, qXs::Vector{Float64}, qYs::Vector{Float64}, qZs::Vector{Float64}, ttTABs::Vector{Interpolations.Extrapolation{Float32, 3, Interpolations.ScaledInterpolation{Float32, 3, Interpolations.BSplineInterpolation{Float32, 3, Array{Float32, 3}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}, Base.OneTo{Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Flat{Nothing}, Interpolations.Line{Nothing}}}}}, nit::Int64, boxwid::Float64, irelonorm::Int64, rmsmax::Float32, rmedmax::Float32, distmax::Float64, distmax2::Float64, hshiftmax::Float64, vshiftmax::Float64, torgdifmax::Float32, nupdate::Int64, maxlink::Int64)
       @ GrowClust3D ~/.julia/packages/GrowClust3D/nnMkn/src/relocation1D.jl:653
     [3] macro expansion
       @ /Volumes/GeoPhysics_07/users-data/illslef1/CatalogueTVZ/KawerauTest/Relocating/run_growclust3D.jl:342 [inlined]
     [4] macro expansion
       @ ./timing.jl:383 [inlined]
     [5] macro expansion
       @ /Volumes/GeoPhysics_07/users-data/illslef1/CatalogueTVZ/KawerauTest/Relocating/run_growclust3D.jl:303 [inlined]
     [6] (::var"#37#threadsfor_fun#7"{var"#37#threadsfor_fun#5#8"{UnitRange{Int64}}})(tid::Int64; onethread::Bool)
       @ Main ./threadingconstructs.jl:84
     [7] #37#threadsfor_fun
       @ ./threadingconstructs.jl:51 [inlined]
     [8] (::Base.Threads.var"#1#2"{var"#37#threadsfor_fun#7"{var"#37#threadsfor_fun#5#8"{UnitRange{Int64}}}, Int64})()
       @ Base.Threads ./threadingconstructs.jl:30
in expression starting at /Volumes/GeoPhysics_07/users-data/illslef1/CatalogueTVZ/KawerauTest/Relocating/run_growclust3D.jl:296
dttrugman commented 1 year ago

Hi Finn,

This is an interesting error, something I haven’t come across before. It might be due to a simple issue in the input file and dataset: remember you need to have your travel time tables encompass the most distant station, and the shallowest and deepest earthquakes.

It’s also possible that there is some issue with an old or new version of the Interpolations package that I’m not aware of. In that case, the easiest way to resolve this is if I can get ahold of your input files and run scripts to see if they work on my machine where the packages are correct as I envision them.

Daniel

Daniel Trugman (he/him/his) Assistant Professor Nevada Seismological Laboratory University of Nevada, Reno


From: Finn Illsley-Kemp @.> Sent: Thursday, April 20, 2023 10:47:09 PM To: dttrugman/GrowClust3D.jl @.> Cc: Subscribed @.***> Subject: [dttrugman/GrowClust3D.jl] MethodError during relocation (Issue #3)

Kia ora,

I'm getting the following MethodError when GrowClust3D starts the relocation estimates. The test and example runs work perfectly fine (both single processor and multiprocessing) and there are no errors when it's reading the various datafiles, so I'm not really sure where this error could be coming from, any help greatly appreciated!

Starting relocation estimates, nthread=1

[Progress tracked on Thread 1 only.]

Thread 1: starting bootstrap iteration: 0/0

Thread 1: Initializing xcorr data and event pairs...

Done, elapsed time = 3.021468687

ERROR: LoadError: TaskFailedException

Stacktrace:

[1] wait

@ ./task.jl:345 [inlined]

[2] threading_run(fun::var"#37#threadsfor_fun#7"{var"#37#threadsfor_fun#5#8"{UnitRange{Int64}}}, static::Bool)

@ Base.Threads ./threadingconstructs.jl:38

[3] macro expansion

@ ./threadingconstructs.jl:89 [inlined]

[4] top-level scope

@ ./timing.jl:263

nested task error: MethodError: no method matching (::Interpolations.Extrapolation{Float32, 3, Interpolations.ScaledInterpolation{Float32, 3, Interpolations.BSplineInterpolation{Float32, 3, Array{Float32, 3}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}, Base.OneTo{Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Flat{Nothing}, Interpolations.Line{Nothing}}}})(::Float64, ::Float64)

Use square brackets [] for indexing an Array.

Closest candidates are:

  (::Interpolations.Extrapolation{T, N})(::Number...) where {T, N} at ~/.julia/packages/Interpolations/jPlKV/src/extrapolation/extrapolation.jl:45

  (::Interpolations.Extrapolation{T, N})(::Union{Number, AbstractVector}...) where {T, N} at ~/.julia/packages/Interpolations/jPlKV/src/extrapolation/extrapolation.jl:54

Stacktrace:

 [1] difclust1(qX0::Float64, qY0::Float64, qZ0::Float64, tdif::Vector{Float32}, itab::Vector{Int16}, sX::Vector{Float64}, sY::Vector{Float64}, qX1::Vector{Float64}, qY1::Vector{Float64}, qZ1::Vector{Float64}, qT1::Vector{Float32}, qX2::Vector{Float64}, qY2::Vector{Float64}, qZ2::Vector{Float64}, qT2::Vector{Float32}, ttTABs::Vector{Interpolations.Extrapolation{Float32, 3, Interpolations.ScaledInterpolation{Float32, 3, Interpolations.BSplineInterpolation{Float32, 3, Array{Float32, 3}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}, Base.OneTo{Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Flat{Nothing}, Interpolations.Line{Nothing}}}}}, boxwid::Float64, nit::Int64)

   @ GrowClust3D ~/.julia/packages/GrowClust3D/nnMkn/src/relocation1D.jl:183

 [2] clustertree(pqix1::Vector{Int32}, pqix2::Vector{Int32}, ixx1::Vector{Int32}, ixx2::Vector{Int32}, tdif::Vector{Float32}, sX::Vector{Float64}, sY::Vector{Float64}, itab::Vector{Int16}, qXs::Vector{Float64}, qYs::Vector{Float64}, qZs::Vector{Float64}, ttTABs::Vector{Interpolations.Extrapolation{Float32, 3, Interpolations.ScaledInterpolation{Float32, 3, Interpolations.BSplineInterpolation{Float32, 3, Array{Float32, 3}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}, Base.OneTo{Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}}, Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}}, Tuple{Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Line{Nothing}, Interpolations.Line{Nothing}}, Tuple{Interpolations.Flat{Nothing}, Interpolations.Line{Nothing}}}}}, nit::Int64, boxwid::Float64, irelonorm::Int64, rmsmax::Float32, rmedmax::Float32, distmax::Float64, distmax2::Float64, hshiftmax::Float64, vshiftmax::Float64, torgdifmax::Float32, nupdate::Int64, maxlink::Int64)

   @ GrowClust3D ~/.julia/packages/GrowClust3D/nnMkn/src/relocation1D.jl:653

 [3] macro expansion

   @ /Volumes/GeoPhysics_07/users-data/illslef1/CatalogueTVZ/KawerauTest/Relocating/run_growclust3D.jl:342 [inlined]

 [4] macro expansion

   @ ./timing.jl:383 [inlined]

 [5] macro expansion

   @ /Volumes/GeoPhysics_07/users-data/illslef1/CatalogueTVZ/KawerauTest/Relocating/run_growclust3D.jl:303 [inlined]

 [6] (::var"#37#threadsfor_fun#7"{var"#37#threadsfor_fun#5#8"{UnitRange{Int64}}})(tid::Int64; onethread::Bool)

   @ Main ./threadingconstructs.jl:84

 [7] #37#threadsfor_fun

   @ ./threadingconstructs.jl:51 [inlined]

 [8] (::Base.Threads.var"#1#2"{var"#37#threadsfor_fun#7"{var"#37#threadsfor_fun#5#8"{UnitRange{Int64}}}, Int64})()

   @ Base.Threads ./threadingconstructs.jl:30

in expression starting at /Volumes/GeoPhysics_07/users-data/illslef1/CatalogueTVZ/KawerauTest/Relocating/run_growclust3D.jl:296

— Reply to this email directly, view it on GitHubhttps://github.com/dttrugman/GrowClust3D.jl/issues/3, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACAMVEG6DRRD5K6PJXXQT2TXCHYK3ANCNFSM6AAAAAAXGJDNHM. You are receiving this because you are subscribed to this thread.Message ID: @.***>

FinniganIK commented 1 year ago

I think it must be an issue with the NonLinLoc travel time tables. I've just run it succesfully in trace mode (with the same travel time parameters)

It's odd though as I'm pretty sure the NonLinLoc travel time tables did encompass all stations and earthquakes

dttrugman commented 1 year ago

Got it, thanks for the update. It could be that the travel time tables themselves were fine but there was something inconsistent in the input file that made it so they were not read into the program properly. Hard to say without more experimentation.

Daniel Trugman (he/him/his) Assistant Professor Nevada Seismological Laboratory University of Nevada, Reno

From: Finn Illsley-Kemp @.> Date: Wednesday, April 26, 2023 at 4:41 PM To: dttrugman/GrowClust3D.jl @.> Cc: Daniel Trugman @.>, Comment @.> Subject: Re: [dttrugman/GrowClust3D.jl] MethodError during relocation (Issue #3)

I think it must be an issue with the NonLinLoc travel time tables. I've just run it succesfully in trace mode (with the same travel time parameters)

It's odd though as I'm pretty sure the NonLinLoc travel time tables did encompass all stations and earthquakes

— Reply to this email directly, view it on GitHubhttps://github.com/dttrugman/GrowClust3D.jl/issues/3#issuecomment-1524208238, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACAMVEB2TMC7EIQWYNP3CJ3XDGXDVANCNFSM6AAAAAAXGJDNHM. You are receiving this because you commented.Message ID: @.***>

FinniganIK commented 1 year ago

Hey Daniel, I've just realised it was my silly mistake that was throwing this error up. I hadn't defined tt_ymin or tt_ymax in the .inp file. It all works fine now

dttrugman commented 1 year ago

Great, thanks for letting me know!

Daniel Trugman (he/him/his) Assistant Professor Nevada Seismological Laboratory University of Nevada, Reno


From: Finn Illsley-Kemp @.> Sent: Tuesday, May 16, 2023 6:01:45 PM To: dttrugman/GrowClust3D.jl @.> Cc: Daniel Trugman @.>; Comment @.> Subject: Re: [dttrugman/GrowClust3D.jl] MethodError during relocation (Issue #3)

[EXTERNAL EMAIL]

Hey Daniel, I've just realised it was my silly mistake that was throwing this error up. I hadn't defined tt_ymin or tt_ymax in the .inp file. It all works fine now

— Reply to this email directly, view it on GitHubhttps://github.com/dttrugman/GrowClust3D.jl/issues/3#issuecomment-1550540004, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACAMVEH5JP34JSUBT5XYDRTXGQPPTANCNFSM6AAAAAAXGJDNHM. You are receiving this because you commented.Message ID: @.***>

This email originated outside of the University of Nevada, Reno. Do not click on links or attachments unless you recognize the sender and know the content is safe. Report suspicious emails to the Office of Information Technology (OIT) at @.***