From 0e4800224474621add55fe93c36d9d5823ae0650 Mon Sep 17 00:00:00 2001 From: Paul Tiede Date: Tue, 17 Dec 2024 23:02:03 -0500 Subject: [PATCH] Allow Comrade to work with new Pyehtim version --- ext/ComradePyehtimExt.jl | 6 ++++++ test/Project.toml | 1 - test/test_util.jl | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/ComradePyehtimExt.jl b/ext/ComradePyehtimExt.jl index b3064968..90063c9b 100644 --- a/ext/ComradePyehtimExt.jl +++ b/ext/ComradePyehtimExt.jl @@ -15,6 +15,12 @@ function build_arrayconfig(obs) bw = get_bw(obsc) angles = get_fr_angles(obsc) tarr = StructArray(Pyehtim.get_arraytable(obsc)) + + # This is because sometimes eht-imaging sets the scans to nothing + # and sometimes it fills it with junk + if length(obsc.scans) <= 1 + obsc.add_scans() + end scans = StructArray(get_scantable(obsc)) bw = get_bw(obsc) elevation = StructArray(angles[1]) diff --git a/test/Project.toml b/test/Project.toml index b4519898..4259d1c3 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -37,4 +37,3 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" TransformVariables = "84d833dd-6860-57f9-a1a7-6da5db126cff" VLBIImagePriors = "b1ba175b-8447-452c-b961-7db2d6f7a029" VLBISkyModels = "d6343c73-7174-4e0f-bb64-562643efbeca" -Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" diff --git a/test/test_util.jl b/test/test_util.jl index cf60e055..ae916459 100644 --- a/test/test_util.jl +++ b/test/test_util.jl @@ -8,6 +8,7 @@ function load_data() joinpath(@__DIR__, "../examples/Data/array.txt"), polrep="circ" ) + obspol.add_scans() m = ehtim.model.Model() m = m.add_gauss(1.0, μas2rad(40.0), μas2rad(20.0), π/3, 0.0, 0.0)