Commit e2a561df authored by Philipp Arras's avatar Philipp Arras
Browse files

Initial commit

parents
# never store the git version file
*.fff
*.ttt
*.fits
*.h5
*.mp4
*.npy
*.pickle
git_version.py
# custom
*.txt
setup.cfg
.idea
.DS_Store
*.pyc
*.html
.document
.svn/
*.csv
.pytest_cache/
*.png
*.h5
*.pk
*.mp4
*.bbl
*.blg
*.pdf
*_latexmk
*.gif
auto/
*.gz
*.bcf
*.xml
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
# from https://github.com/github/gitignore/blob/master/Python.gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.c
*.o
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/build/
docs/source/mod
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# dotenv
.env
# virtualenv
venv/
ENV/
# Spyder project settings
.spyderproject
# Rope project settings
.ropeproject
This diff is collapsed.
FROM python:3.6-buster
ENV MPLBACKEND agg
WORKDIR /eht
# VLBI Resolve: VLBI Imaging with information field theory
This repository belongs to the paper FIXME.
# Installation
Make sure that you have a python version >= 3.6. Then install the python packages scipy, matplotlib, nifty and nifty_gridder.
```
pip3 install --user "scipy>=1.4" matplotlib git+https://gitlab.mpcdf.mpg.de/ift/nifty@bb1069ae91a0bca50af3ec49d6c6c5957424e9ae git+https://gitlab.mpcdf.mpg.de/ift/nifty_gridder.git@f1540b9cca161e1aa32aa3cd09a592b3dac5f16b
```
With the following commands start a reconstruction of your favourite example.
```
python3 reconstruction.py blobs
python3 reconstruction.py crescent
python3 reconstruction.py disk
```
In order to run the tests you need pytest. Then run:
```
pytest-3 test.py
```
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2019 Max-Planck-Society
import os
import nifty6 as ift
import util as vres
oversampling_factor = 2
nthreads = int(os.getenv('OMP_NUM_THREADS', 1))
ift.fft.set_nthreads(nthreads)
eps = 1e-7
npix = 128
dt = 6 # hours
fov = 256*vres.MUAS2RAD
if dt is not None:
dt = int(dt)
_fm, _fs, _flm, _fls = 1.5, 1., 0.3, 0.001
_am, _as, _lm, _ls = 0.01, 0.001, -1.5, 0.5
if npix is not None and dt is not None:
npix = int(npix)
doms = ift.RGSpace(2*(npix,), 2*(fov/npix,))
npixt = 7*24//dt
startt = 0
domt = ift.RGSpace(npixt, dt)
dom = ift.makeDomain((domt, doms))
print('Sky domain:')
print(dom)
domt_zeropadded = ift.RGSpace(int(oversampling_factor*npixt), dt)
cfm = ift.CorrelatedFieldMaker.make(0.2, 1e-1, '')
cfm.add_fluctuations(domt_zeropadded,
fluctuations_mean=.2,
fluctuations_stddev=1.,
flexibility_mean=0.1,
flexibility_stddev=0.001,
asperity_mean=0.01,
asperity_stddev=0.001,
loglogavgslope_mean=-4,
loglogavgslope_stddev=0.5,
prefix='time')
cfm.add_fluctuations(doms,
fluctuations_mean=cfm.moment_slice_to_average(_fm),
fluctuations_stddev=_fs,
flexibility_mean=_flm,
flexibility_stddev=_fls,
asperity_mean=_am,
asperity_stddev=_as,
loglogavgslope_mean=_lm,
loglogavgslope_stddev=_ls,
prefix='space')
logsky = cfm.finalize(prior_info=0)
FA_lo = ift.FieldAdapter(logsky.target, 'lo')
FA_hi = ift.FieldAdapter(logsky.target, 'hi')
xi_hi = ift.FieldAdapter(logsky.domain['xi'], 'xi_hi')
id_hi = ift.FieldAdapter(logsky.domain['xi'], 'xi').adjoint @ xi_hi
xi_lo = ift.FieldAdapter(logsky.domain['xi'], 'xi_lo')
id_lo = ift.FieldAdapter(logsky.domain['xi'], 'xi').adjoint @ xi_lo
expected_difference = 1e-2
logsky_1 = (FA_hi.adjoint @ logsky).partial_insert(id_hi)
logsky_2 = (FA_lo.adjoint
@ logsky).partial_insert(id_lo).scale(expected_difference)
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()
pspec_movie = cfm.normalized_amplitudes
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
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