Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MutliStageResponse bug #30

Closed
dylanmikesell opened this issue Mar 25, 2020 · 2 comments
Closed

MutliStageResponse bug #30

dylanmikesell opened this issue Mar 25, 2020 · 2 comments

Comments

@dylanmikesell
Copy link

Here is a minimum working example of a bug related to the input SeisData channel and where or not it has a normal PZResp or a multistage response.

using SeisIO, SeisNoise

fs      = 20. # [Hz] resample frequency
cc_len  = 1800 # [s]
cc_step = 450 # [s]

S1 = get_data("FDSN", "TA.I02A..BHZ", src="IRIS", s=string("2007-04-16"), t=6000, msr=true)
S2 = get_data("FDSN", "TA.I02A..BHZ", src="IRIS", s=string("2007-04-16"), t=6000)

process_raw!(S1,fs)
process_raw!(S2,fs)

R = RawData.([S1,S2], cc_len, cc_step)

The results error is related to an inability to convert object types. It would be nice if RawData() could handle either.

MethodError: Cannot convert an object of type MultiStageResp to an object of type PZResp
Closest candidates are:
convert(::Type{T}, !Matched::LazyJSON.PropertyDicts.PropertyDict) where T at /Users/dmikesell/.julia/packages/LazyJSON/nTpJx/src/PropertyDicts.jl:61
convert(::Type{T}, !Matched::LazyJSON.Object) where T at /Users/dmikesell/.julia/packages/LazyJSON/nTpJx/src/AbstractDict.jl:82
convert(::Type{S}, !Matched::T) where {S, T<:(Union{CategoricalArrays.CategoricalString{R}, CategoricalArrays.CategoricalValue{T,R} where T} where R)} at /Users/dmikesell/.julia/packages/CategoricalArrays/dmrjI/src/value.jl:103
...
RawData(::SeisData, ::Int64, ::Int64) at RawData.jl:84
_broadcast_getindex at broadcast.jl:630 [inlined]
getindex at broadcast.jl:563 [inlined]
copy(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Tuple{Base.OneTo{Int64}},Type{RawData},Tuple{Array{SeisData,1},Int64,Int64}}) at broadcast.jl:853
materialize(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,Type{RawData},Tuple{Array{SeisData,1},Int64,Int64}}) at broadcast.jl:819
top-level scope at SeisIO_msr_dump.jl:13

@tclements
Copy link
Collaborator

This should be fixed on the master branch now. I added support for MultiStageResp in RawData, FFTData and CorrData. Let me know if you have any problems.

@tclements
Copy link
Collaborator

This is fixed in the newest release. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants