Commit 0db7965b authored by Philipp Arras's avatar Philipp Arras
Browse files

Renaming

parent 13063a09
# VLBI Resolve: VLBI Imaging with information field theory
# VLBI Resolve: Dynamic VLBI Imaging with information field theory
This repository belongs to the paper FIXME.
......@@ -19,6 +19,7 @@ python3 reconstruction.py disk
```
In order to run the tests you need pytest. Then run:
```
pytest-3 test.py
```
......@@ -16,15 +16,14 @@
# Jakob Knollmueller
import nifty6 as ift
import util as vres
import src as vlbi
ift.fft.set_nthreads(1)
eps = 1e-7
npix = 128
dt = 6 # hours
fov = 256*vres.MUAS2RAD # RAD
fov = 256*vlbi.MUAS2RAD # RAD
doms = ift.RGSpace(2*(npix,), 2*(fov/npix,))
npixt = 7*24//dt
......@@ -66,5 +65,5 @@ logsky_lo = FA_lo.adjoint @ (FA_hi + FA_lo)
logsky_hi = FA_hi.adjoint @ (FA_hi - FA_lo)
logsky_mf = (logsky_hi + logsky_lo) @ (logsky_1 + logsky_2)
sky_movie_mf = vres.normalize(logsky_mf.target) @ logsky_mf.exp()
sky_movie_mf = vlbi.normalize(logsky_mf.target) @ logsky_mf.exp()
pspec_movie = cfm.normalized_amplitudes
......@@ -25,8 +25,8 @@ from operator import add
import numpy as np
import nifty6 as ift
import util as vres
from config import doms, dt, eps, npixt
import src as vlbi
from config import doms, dt, npixt
from config import sky_movie_mf as sky
from config import startt
......@@ -41,33 +41,33 @@ if __name__ == '__main__':
# Build data model
lh, active_inds = [], []
for freq in vres.data.FREQS:
rawd = vres.combined_data(path, [freq], identify_short_baselines=['APAA', 'SMJC'])
for ii, dd in enumerate(vres.time_binning(rawd, dt, startt, npixt*dt)):
for freq in vlbi.data.FREQS:
rawd = vlbi.combined_data(path, [freq], identify_short_baselines=['APAA', 'SMJC'])
for ii, dd in enumerate(vlbi.time_binning(rawd, dt, startt, npixt*dt)):
if len(dd) == 0:
continue
ind = str(ii) + "_" + freq
active_inds.append(ind)
v2ph, icovph = vres.Visibilities2ClosurePhases(dd)
v2ampl, icovampl = vres.Visibilities2ClosureAmplitudes(dd)
R = vres.RadioResponse(doms, dd['uv'], eps).ducktape(ind)
v2ph, icovph = vlbi.Visibilities2ClosurePhases(dd)
v2ampl, icovampl = vlbi.Visibilities2ClosureAmplitudes(dd)
R = vlbi.RadioResponse(doms, dd['uv'], 1e-7).ducktape(ind)
vis = ift.makeField(R.target, dd['vis'])
ll_ph = ift.GaussianEnergy(v2ph(vis), icovph) @ v2ph
ll_ampl = ift.GaussianEnergy(v2ampl(vis), icovampl) @ v2ampl
lh.append((ll_ph + ll_ampl) @ R)
lh = reduce(add, lh) @ vres.DomainTuple2MultiField(sky.target, active_inds)
pb = vres.gaussian_profile(sky.target['hi'][1], 50*vres.MUAS2RAD)
lh = reduce(add, lh) @ vlbi.DomainTuple2MultiField(sky.target, active_inds)
pb = vlbi.gaussian_profile(sky.target['hi'][1], 50*vlbi.MUAS2RAD)
pb = ift.ContractionOperator(sky.target['hi'], 0).adjoint(pb)
pb = ift.makeOp(ift.MultiField.from_dict({'hi': pb, 'lo': pb}))
# Plot prior samples
for ii in range(4):
pp = ift.from_random('normal', sky.domain)
vres.save_state(sky, pp, pre, f'prior{ii}', [])
vlbi.save_state(sky, pp, pre, f'prior{ii}', [])
# Minimization
pos = 0.1*ift.from_random('normal', sky.domain)
vres.save_state(sky, pos, pre, 'initial', [])
vlbi.save_state(sky, pos, pre, 'initial', [])
for ii in range(30):
if ii < 10:
N_samples = 1
......@@ -97,4 +97,4 @@ if __name__ == '__main__':
minimizer = ift.NewtonCG(ift.AbsDeltaEnergyController(**dct))
KL, _ = minimizer(KL)
pos = KL.position
vres.save_state(sky, pos, pre, ii, KL.samples)
vlbi.save_state(sky, pos, pre, ii, KL.samples)
......@@ -20,7 +20,7 @@ import numpy as np
import pytest
import nifty6 as ift
import util as eht
import src as eht
pmp = pytest.mark.parametrize
cb = [[], ['APAA', 'SMJC']]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment