Skip to content

Commit

Permalink
Merge pull request #153 from achael/dev
Browse files Browse the repository at this point in the history
merged dev into main for 1.2.4
achael authored May 5, 2022
2 parents 7a4dffb + f110027 commit 6b1bcb9
Showing 37 changed files with 1,364 additions and 931 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
FROM continuumio/miniconda2
FROM continuumio/miniconda3

# install gcc and common build dependencies
RUN apt-get update \
&& apt-get install -y \
build-essential \
pylint

WORKDIR /eht-imaging

COPY . .
COPY environment.yml environment.yml

# install dependencies and fix tkinter error
# https://stackoverflow.com/questions/37604289/tkinter-tclerror-no-display-name-and-no-display-environment-variable
RUN conda install -y -c conda-forge pynfft \
&& pip install -r requirements.txt \
&& echo "backend: Agg" >> /opt/conda/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc
RUN conda env create --name eht-imaging --file environment.yml
RUN echo 'conda activate eht-imaging' >> ~/.bashrc
#RUN echo "backend: Agg" >> /opt/conda/lib/python3.9/site-packages/matplotlib/mpl-data/matplotlibrc

WORKDIR /eht-imaging
COPY . .
11 changes: 0 additions & 11 deletions arrays/EHT2017_ISS.txt

This file was deleted.

12 changes: 6 additions & 6 deletions arrays/EHT2017_m87.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#NAME X Y Z SEFDR SEFDL FR_PAR_ANGLE FR_ELEV_ANGLE FR_OFFSET[d] DR_RE DR_IM DL_RE DL_IM
PV 5088967.9000 -301681.6000 3825015.8000 3600 3600 1 -1 0 0 0 0 0
#NAME X Y Z SEFDR SEFDL FR_PAR_ANGLE FR_ELEV_ANGLE FR_OFFSET[d] DR_RE DR_IM DL_RE DL_IM
PV 5088967.9000 -301681.6000 3825015.8000 3600 3600 1 -1 0 0 0 0 0
SMT -1828796.200 -5054406.800 3427865.200 14400 14400 1 1 0 0 0 0 0
SMA -5464523.400 -2493147.080 2150611.750 5600 6500 1 -1 45 0 0 0 0
SMA -5464523.400 -2493147.080 2150611.750 5600 6500 1 -1 45 0 0 0 0
LMT -768713.9637 -5988541.7982 2063275.9472 3600 3600 1 -1 0 0 0 0 0
ALMA 2225061.164 -5440057.37 -2481681.15 70 70 1 0 0 0 0 0 0
ALMA 2225061.164 -5440057.37 -2481681.15 70 70 1 0 0 0 0 0 0
SPT 0.01 0.01 -6359609.7 16900 16900 1 0 0 0 0 0 0
APEX 2225039.53 -5441197.63 -2479303.36 4900 4900 1 1 0 0 0 0 0
JCMT -5464584.68 -2493001.17 2150653.98 10000 10000 1 0 0 0 0 0 0
APEX 2225039.53 -5441197.63 -2479303.36 4900 4900 1 1 0 0 0 0 0
JCMT -5464584.68 -2493001.17 2150653.98 10000 10000 1 0 0 0 0 0 0
13 changes: 0 additions & 13 deletions arrays/EHT2019.txt

This file was deleted.

34 changes: 13 additions & 21 deletions arrays/EHT2025.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
PDB 4523998.40 468045.240 4460309.760 1500
PV 5088967.9000 -301681.6000 3825015.8000 1400
SMT -1828796.200 -5054406.800 3427865.200 5000
SMA -5464523.400 -2493147.080 2150611.750 4900
LMT -768713.9637 -5988541.7982 2063275.9472 600
ALMA 2225061.164 -5440057.37 -2481681.15 90
SPT 0.01 0.01 -6359609.7 5000
APEX 2225039.53 -5441197.63 -2479303.36 3500
JCMT -5464584.68 -2493001.17 2150653.98 6000
CARMA -2397431.300 -4482018.900 3843524.500 10000
KP -1995678.840 -5037317.697 3357328.025 10000
GLT 1500692.0 -1191735.0 6066409.0 10000
HAY 1492420.4965 -4457272.10037 4296891.72893 2500 #Haystack
PIKES -1292058.67099 -4807190.10901 3981241.60693 10000 #Pikes Peak, Colorado
BAJA -2352576.31173 -4940331.41122 3271508.49374 10000 #National Astronomical Observatory (Mexico)
GAM 5627251.83789 1632172.52014 2517405.60946 10000 #Gamsberg, Namibia
KAUAI -5547583.15126 -2073328.69989 2367861.8559 10000 #Kaua'i, Hawaii
KEN 5077092.35557 3868758.28852 -16691.393515 10000 #Mount Kenya
BOL 2282100.27386 -5685901.71836 -1785763.38112 10000 #Chacaltaya Astrophysical Observatory, Bolivia
VLT 1946473.62308 -5467592.1824 -2642703.01185 10000 #VLT, Chile
DRAK 4850818.24138 2718443.00852 -3120751.59707 10000 #Drakensberg, South Africa
#NAME X Y Z SEFDR SEFDL FR_PAR_ANGLE FR_ELEV_ANGLE FR_OFFSET[d] DR_RE DR_IM DL_RE DL_IM
PDB 4523998.40 468045.240 4460309.760 1500 1500 0 0 0 0 0 0 0
PV 5088967.9000 -301681.6000 3825015.8000 1400 1400 1 -1 0 0 0 0 0
SMT -1828796.200 -5054406.800 3427865.200 5000 5000 1 1 0 0.012 0.106 -0.007 0.093
SMA -5464523.400 -2493147.080 2150611.750 4900 4900 1 -1 45 0.022 0.009 0.008 0.010
LMT -768713.9637 -5988541.7982 2063275.9472 600 600 1 -1 0 0 0 0 0
ALMA 2225061.164 -5440057.37 -2481681.15 90 90 1 0 0 0 0 0 0
SPT 0.01 0.01 -6359609.7 5000 5000 1 0 0 0 0 0 0
APEX 2225039.53 -5441197.63 -2479303.36 3500 3500 1 1 0 0 0 0 0
JCMT -5464584.68 -2493001.17 2150653.98 6000 6000 1 0 0 0 0 0 0
CARMA -2397431.300 -4482018.900 3843524.500 10000 10000 0 0 0 0 0 0 0
KP -1995678.840 -5037317.697 3357328.025 10000 10000 0 0 0 0 0 0 0
GLT 1500692.0 -1191735.0 6066409.0 10000 10000 0 0 0 0 0 0 0
34 changes: 0 additions & 34 deletions arrays/EHTII_345.txt

This file was deleted.

11 changes: 0 additions & 11 deletions arrays/EHTwISS.txt

This file was deleted.

11 changes: 0 additions & 11 deletions arrays/EHTwKP.txt

This file was deleted.

14 changes: 13 additions & 1 deletion ehtim/calibrating/self_cal.py
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@
import ehtim.obsdata
import ehtim.parloop as parloop
from . import cal_helpers as calh
from ehtim.observing.obs_simulate import add_jones_and_noise
import ehtim.observing.obs_helpers as obsh
import ehtim.const_def as ehc

@@ -49,7 +50,8 @@
def self_cal(obs, im, sites=[], method="both", pol='I', minimizer_method='BFGS',
pad_amp=0., gain_tol=.2, solution_interval=0.0, scan_solutions=False,
ttype='direct', fft_pad_factor=2, caltable=False,
debias=True, copy_closure_tables=True,
debias=True, apply_dterms=False,
copy_closure_tables=True,
processes=-1, show_solution=False, msgtype='bar'):
"""Self-calibrate a dataset to an image.
@@ -78,6 +80,7 @@ def self_cal(obs, im, sites=[], method="both", pol='I', minimizer_method='BFGS',
fft_pad_factor (float): zero pad the image to fft_pad_factor * image size in FFT
debias (bool): If True, debias the amplitudes
apply_dterms (bool): if True, apply dterms (in obs.tarr) to clean data before calibrating
show_solution (bool): if True, display the solution as it is calculated
msgtype (str): type of progress message to be printed, default is 'bar'
@@ -107,6 +110,15 @@ def self_cal(obs, im, sites=[], method="both", pol='I', minimizer_method='BFGS',
print("Computing the Model Visibilities with " + ttype + " Fourier Transform...")
obs_clean = im.observe_same_nonoise(obs, ttype=ttype, fft_pad_factor=fft_pad_factor)

# apply dterms
# TODO check!
if apply_dterms:
print("Applying dterms in obs.tarr to clean visibilities before selfcal!")
obsdata_dterms = add_jones_and_noise(obs_clean,
add_th_noise=False, ampcal=True, phasecal=True, opacitycal=True,
dcal=False, frcal=True, dterm_offset=0.0)
obs_clean.data = obsdata_dterms

# Partition the list of observed visibilities into scans
scans = obs.tlist(t_gather=solution_interval, scan_gather=scan_solutions)
scans_cal = copy.copy(scans)
7 changes: 6 additions & 1 deletion ehtim/caltable.py
Original file line number Diff line number Diff line change
@@ -689,7 +689,12 @@ def load_caltable(obs, datadir, sqrt_gains=False):
try:
data = np.loadtxt(filename, dtype=bytes).astype(str)
except IOError:
continue
try:
filename = datadir + site + '.txt'
data = np.loadtxt(filename, dtype=bytes).astype(str)
except IOError:
continue


datatable = []

Loading

0 comments on commit 6b1bcb9

Please sign in to comment.