Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "0.11.26"
[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
AstroLib = "c7932e45-9af1-51e7-9da9-f004cd3a462b"
AstroTime = "c61b5328-d09d-5e37-a9a8-0eb41c39009c"
Expand All @@ -30,6 +31,7 @@ PolarizedTypes = "d3c5d4cd-a8ee-40d6-aac7-e34df5a20044"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
ReactantCore = "a3311ec8-5e00-46d5-b541-4f83e724a433"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Expand All @@ -53,6 +55,7 @@ Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
Pigeons = "0eb8d820-af6a-4919-95ae-11206f830c31"
Pyehtim = "3d61700d-6e5b-419a-8e22-9c066cf00468"
Reactant = "3c362404-f566-11ee-1572-e11a4b42c853"
VLBIFiles = "c1ebf4c8-f9d4-409a-8daf-7009448f4e6e"

[extensions]
Expand All @@ -63,9 +66,11 @@ ComradeMakieExt = "Makie"
ComradeOptimizationExt = "Optimization"
ComradePigeonsExt = "Pigeons"
ComradePyehtimExt = "Pyehtim"
ComradeReactantExt = "Reactant"
ComradeVLBIFilesExt = "VLBIFiles"

[compat]
Adapt = "4"
AbstractMCMC = "3, 4, 5"
Accessors = "0.1"
AdvancedHMC = "0.6, 0.7, 0.8"
Expand All @@ -76,7 +81,7 @@ ChainRulesCore = "1"
ComradeBase = "0.9.13"
DelimitedFiles = "1"
DensityInterface = "0.4"
DimensionalData = "0.29 - 0.29.24, ^0.29.26, 0.30"
DimensionalData = "0.30"
Distributions = "0.25"
DocStringExtensions = "0.8, 0.9"
Dynesty = "0.4"
Expand All @@ -92,9 +97,11 @@ Optimization = "5"
PaddedViews = "0.5"
ParameterHandling = "0.4, 0.5"
Pigeons = "0.4, 0.5"
PolarizedTypes = "0.1.0 - 0.1.3"
PolarizedTypes = "0.1"
PrettyTables = "3"
Pyehtim = "0.2"
Reactant = "0.2"
ReactantCore = "0.1"
RecipesBase = "1"
Reexport = "1"
SpecialFunctions = "0.10, 1, 2"
Expand All @@ -105,8 +112,8 @@ StructArrays = "0.5,0.6, 0.7"
Tables = "1"
TransformVariables = "^0.8.19"
VLBIFiles = "0.4.16"
VLBIImagePriors = "0.10.8"
VLBILikelihoods = "^0.2.6"
VLBIImagePriors = "^0.10.9"
VLBILikelihoods = "0.3.0"
VLBISkyModels = "^0.6.24"
julia = "1.10"

Expand All @@ -119,8 +126,9 @@ Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
Pigeons = "0eb8d820-af6a-4919-95ae-11206f830c31"
Pyehtim = "3d61700d-6e5b-419a-8e22-9c066cf00468"
Reactant = "3c362404-f566-11ee-1572-e11a4b42c853"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
VLBIFiles = "c1ebf4c8-f9d4-409a-8daf-7009448f4e6e"

[targets]
test = ["Test", "AdvancedHMC", "Dynesty", "Enzyme", "Makie", "Optimization", "Pigeons", "Pyehtim", "VLBIFiles"]
test = ["Test", "AdvancedHMC", "Dynesty", "Enzyme", "Makie", "Optimization", "Pigeons", "Pyehtim", "VLBIFiles", "Reactant"]
18 changes: 9 additions & 9 deletions docs/src/benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ function model(θ, p)
return ring + g
end
prior = (
rad = Uniform(10.0, 30.0),
wid = Uniform(1.0, 10.0),
a = Uniform(-0.5, 0.5), b = Uniform(-0.5, 0.5),
f = Uniform(0.0, 1.0),
sig = Uniform((1.0), (60.0)),
asy = Uniform(0.0, 0.9),
pa = Uniform(0.0, 1π),
x = Uniform(-(80.0), (80.0)),
y = Uniform(-(80.0), (80.0))
rad = VLBIUniform(10.0, 30.0),
wid = VLBIUniform(1.0, 10.0),
a = VLBIUniform(-0.5, 0.5), b = VLBIUniform(-0.5, 0.5),
f = VLBIUniform(0.0, 1.0),
sig = VLBIUniform((1.0), (60.0)),
asy = VLBIUniform(0.0, 0.9),
pa = VLBIUniform(0.0, 1π),
x = VLBIUniform(-(80.0), (80.0)),
y = VLBIUniform(-(80.0), (80.0))
)
# Now form the posterior
skym = SkyModel(model, prior, imagepixels(μas2rad(150.0), μas2rad(150.0), 128, 128))
Expand Down
4 changes: 2 additions & 2 deletions docs/src/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const beginner = [
{
href: "beginner/LoadingData",
src: "../vis.png",
caption: "Loading Data with Pyehtim",
desc: "How to load data using standard eht-imaging in Julia."
caption: "Loading Data with VLBIFiles",
desc: "How to load data into the Comrade format"
},
{
href: "beginner/GeometricModeling",
Expand Down
8 changes: 4 additions & 4 deletions examples/advanced/FitPS/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ using Distributions
# arguments and are in scope inside both the prior expressions and the body.
@sky function sky(grid; mimg, pl, cprior, ρmax)
c ~ cprior
ρs ~ ntuple(Returns(Uniform(0.01, ρmax)), 3)
σimg ~ Exponential(2.0)
fb ~ Uniform(0.0, 1.0)
ρs ~ ntuple(Returns(VLBIUniform(0.01, ρmax)), 3)
σimg ~ VLBIExponential(2.0)
fb ~ VLBIUniform(0.0, 1.0)
## Apply the GMRF fluctuations to the image
x = genfield(StationaryRandomField(MarkovPS(ρs), pl), c)
x .= σimg .* x
Expand Down Expand Up @@ -123,7 +123,7 @@ skym = sky(grid; mimg, pl, cprior, ρmax = max(size(grid)...))
# Since we are fitting closures we do not need to include an instrument model, since
# the closure likelihood is approximately independent of gains in the high SNR limit.
using Enzyme
post = VLBIPosterior(skym, dlcamp, dcphase)
post = VLBIPosterior(skym, dlcamp, dcphase);

# ## Reconstructing the Image

Expand Down
16 changes: 9 additions & 7 deletions examples/advanced/Hibi/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ using VLBIImagePriors
using Distributions
@sky function sky(grid; ftot, cprior)
c ~ cprior
σimg ~ truncated(Normal(0.0, 0.5); lower = 0.0)
r ~ Uniform(μas2rad(10.0), μas2rad(40.0))
ain ~ Uniform(1.0, 20.0)
aout ~ Uniform(1.0, 20.0)
σimg ~ VLBITruncated(VLBIGaussian(0.0, 0.5); lower = 0.0)
r ~ VLBIUniform(μas2rad(10.0), μas2rad(40.0))
ain ~ VLBIUniform(1.0, 20.0)
aout ~ VLBIUniform(1.0, 20.0)
## Form the image model
mb = RingTemplate(RadialDblPower(ain, aout), AzimuthalUniform())
mr = modify(mb, Stretch(r))
Expand All @@ -97,11 +97,13 @@ end
# - Gain amplitudes which are typically known to 10-20%, except for LMT, which has amplitudes closer to 50-100%.
# - Gain phases which are more difficult to constrain and can shift rapidly.

fgain(x) = exp(x.lg + 1im * x.gp)
using VLBIImagePriors
using Distributions
fgain(x) = exp(complex(x.lg, x.gp))
G = SingleStokesGain(fgain)

intpr = (
lg = ArrayPrior(IIDSitePrior(ScanSeg(), Normal(0.0, 0.2)); LM = IIDSitePrior(ScanSeg(), Normal(0.0, 1.0))),
lg = ArrayPrior(IIDSitePrior(ScanSeg(), VLBIGaussian(0.0, 0.2)); LM = IIDSitePrior(ScanSeg(), VLBIGaussian(0.0, 1.0))),
gp = ArrayPrior(IIDSitePrior(ScanSeg(), DiagonalVonMises(0.0, inv(π^2))); refant = SEFDReference(0.0)),
)
intmodel = InstrumentModel(G, intpr)
Expand All @@ -123,7 +125,7 @@ skym = sky(g; ftot = 1.1, cprior)
# This is everything we need to specify our posterior distribution, which our is the main
# object of interest in image reconstructions when using Bayesian inference.
using Enzyme
post = VLBIPosterior(skym, intmodel, dvis)
post = VLBIPosterior(skym, intmodel, dvis);

# We can sample from the prior to see what the model looks like
using DisplayAs #hide
Expand Down
32 changes: 32 additions & 0 deletions examples/advanced/NeuralFields/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[deps]
AdvancedHMC = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Comrade = "99d987ce-9a1e-4df8-bc0b-1ea019aa547b"
DisplayAs = "0b91fe84-8a4c-11e9-3e1d-67c38462b6d6"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
Lux = "b2108857-7c20-44ae-9111-449ecde12c47"
NonuniformFFTs = "cd96f58b-6017-4a02-bb9e-f4d81626177f"
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Pyehtim = "3d61700d-6e5b-419a-8e22-9c066cf00468"
Reactant = "3c362404-f566-11ee-1572-e11a4b42c853"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
VLBIFiles = "c1ebf4c8-f9d4-409a-8daf-7009448f4e6e"
VLBIImagePriors = "b1ba175b-8447-452c-b961-7db2d6f7a029"
VLBILikelihoods = "90db92cd-0007-4c0a-8e51-dbf0782ce592"
VLBISkyModels = "d6343c73-7174-4e0f-bb64-562643efbeca"

[compat]
CairoMakie = "0.15"
DisplayAs = "0.1"
Distributions = "0.25"
Optimisers = "0.4"
Pkg = "1"
Pyehtim = "0.2"
Reactant = "0.2"
StableRNGs = "1"
VLBIImagePriors = "0.10"
Loading
Loading