ptiede / Comrade.jl

MIT License
43 stars 8 forks source link

Pigeons deserialization of NFFT does not work #316

Closed dominic-chang closed 8 months ago

dominic-chang commented 9 months ago

Deserialization of Pigeons.jl checkpoints with NFFT plans causes a segmentation fault upon visibility evaluations. This can be fixed by dispatching off the Serialization.deserialize function and reconstructing the FFT plan.

using Serialization
using Comrade

function Serialization.deserialize(s::AbstractSerializer, type::Type{<:Comrade.NUFTCache{<:Comrade.ObservedNUFT,P,M,PI,I}}) where {P,M,PI,I}

    alg = Serialization.deserialize(s)
    _ = Serialization.deserialize(s)
    phase = Serialization.deserialize(s)
    pulse = Serialization.deserialize(s)
    img = Serialization.deserialize(s)

    newplan = Comrade.plan_nuft(alg, img)
    return Comrade.NUFTCache(alg, newplan, phase, pulse, img)
end
ptiede commented 8 months ago

Fixed in VLBISkyModels