After updating SeisIO to the latest version (to use the functionality of removing responses), I can't open my old SeisData object stored in jld2 file. It seems there is some compatibility issue after the new update. Here are the errors:
`┌ Warning: saved type PZResp is missing field a0 in workspace type; reconstructing
└ @ JLD2 ~/.julia/packages/JLD2/KjBIK/src/data.jl:402
ERROR: MethodError: Cannot convert
an object of type getfield(JLD2.ReconstructedTypes, Symbol("##PZResp#363")) to an object of type InstrumentResponse
Closest candidates are:
convert(::Type{T}, ::T) where T at essentials.jl:154
Stacktrace:
[1] jlconvert at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/data.jl:675 [inlined]
[2] macro expansion at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/dataio.jl:70 [inlined]
[3] macro expansion at ./simdloop.jl:73 [inlined]
[4] read_array!(::Array{InstrumentResponse,1}, ::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadRepresentation{InstrumentResponse,JLD2.RelOffset}) at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/dataio.jl:68
[5] read_array(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadDataspace, ::JLD2.ReadRepresentation{InstrumentResponse,JLD2.RelOffset}, ::Int64, ::UInt16, ::JLD2.RelOffset, ::Array{JLD2.ReadAttribute,1}) at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/datasets.jl:323
[6] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadRepresentation{Any,JLD2.RelOffset}, ::Array{JLD2.ReadAttribute,1}) at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/datasets.jl:198
[7] macro expansion at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/datasets.jl:156 [inlined]
[8] macro expansion at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/datatypes.jl:76 [inlined]
[9] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadDataspace, ::UInt8, ::Int64, ::Int64, ::Int64, ::UInt16, ::JLD2.RelOffset, ::Array{JLD2.ReadAttribute,1}) at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/datasets.jl:152
[10] load_dataset(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.RelOffset) at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/datasets.jl:92
[11] jlconvert at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/data.jl:674 [inlined]
[12] macro expansion at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/data.jl:1285 [inlined]
[13] jlconvert(::JLD2.ReadRepresentation{SeisData,JLD2.OnDiskRepresentation{(0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104),Tuple{Int64,Array{String,1},Array{String,1},Array{InstrumentPosition,1},Array{Float64,1},Array{Float64,1},Array{InstrumentResponse,1},Array{String,1},Array{String,1},Array{Dict{String,Any},1},Array{Array{String,1},1},Array{Array{Int64,2},1},Array{Union{Array{Float32,1}, Array{Float64,1}},1},Array{Sockets.TCPSocket,1}},Tuple{Int64,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset}}()}, ::JLD2.JLDFile{JLD2.MmapIO}, ::Ptr{Nothing}, ::JLD2.RelOffset) at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/data.jl:1232
[14] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadRepresentation{SeisData,JLD2.OnDiskRepresentation{(0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104),Tuple{Int64,Array{String,1},Array{String,1},Array{InstrumentPosition,1},Array{Float64,1},Array{Float64,1},Array{InstrumentResponse,1},Array{String,1},Array{String,1},Array{Dict{String,Any},1},Array{Array{String,1},1},Array{Array{Int64,2},1},Array{Union{Array{Float32,1}, Array{Float64,1}},1},Array{Sockets.TCPSocket,1}},Tuple{Int64,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset,JLD2.RelOffset}}()}, ::Array{JLD2.ReadAttribute,1}) at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/dataio.jl:37
[15] read_data(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.ReadDataspace, ::UInt8, ::Int64, ::Int64, ::Int64, ::UInt16, ::JLD2.RelOffset, ::Array{JLD2.ReadAttribute,1}) at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/datasets.jl:149
[16] load_dataset(::JLD2.JLDFile{JLD2.MmapIO}, ::JLD2.RelOffset) at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/datasets.jl:92
[17] getindex(::JLD2.Group{JLD2.JLDFile{JLD2.MmapIO}}, ::String) at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/groups.jl:108
[18] getindex(::JLD2.JLDFile{JLD2.MmapIO}, ::String) at /Users/xiaotaoyang/.julia/packages/JLD2/KjBIK/src/JLD2.jl:330
[19] top-level scope at none:0
`
You can recreate the errors with the following lines:
using SeisIO, JLD2
f=jldopen("cascadiaRMEQtestdatawithgap.jld2")
S=f["2011.314/7D.J34A..HHZ"]
Here I attached the data file for your test.
cascadiaRMEQtestdatawithgap.jld2.zip
Thanks,
Xiaotao