Skip to content

Commit 6b1bcb9

Browse files
authored
Merge pull request #153 from achael/dev
merged dev into main for 1.2.4
2 parents 7a4dffb + f110027 commit 6b1bcb9

37 files changed

+1364
-931
lines changed

Dockerfile

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
FROM continuumio/miniconda2
1+
FROM continuumio/miniconda3
22

33
# install gcc and common build dependencies
44
RUN apt-get update \
55
&& apt-get install -y \
66
build-essential \
77
pylint
88

9-
WORKDIR /eht-imaging
10-
11-
COPY . .
9+
COPY environment.yml environment.yml
1210

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

arrays/EHT2017_ISS.txt

-11
This file was deleted.

arrays/EHT2017_m87.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#NAME X Y Z SEFDR SEFDL FR_PAR_ANGLE FR_ELEV_ANGLE FR_OFFSET[d] DR_RE DR_IM DL_RE DL_IM
2-
PV 5088967.9000 -301681.6000 3825015.8000 3600 3600 1 -1 0 0 0 0 0
1+
#NAME X Y Z SEFDR SEFDL FR_PAR_ANGLE FR_ELEV_ANGLE FR_OFFSET[d] DR_RE DR_IM DL_RE DL_IM
2+
PV 5088967.9000 -301681.6000 3825015.8000 3600 3600 1 -1 0 0 0 0 0
33
SMT -1828796.200 -5054406.800 3427865.200 14400 14400 1 1 0 0 0 0 0
4-
SMA -5464523.400 -2493147.080 2150611.750 5600 6500 1 -1 45 0 0 0 0
4+
SMA -5464523.400 -2493147.080 2150611.750 5600 6500 1 -1 45 0 0 0 0
55
LMT -768713.9637 -5988541.7982 2063275.9472 3600 3600 1 -1 0 0 0 0 0
6-
ALMA 2225061.164 -5440057.37 -2481681.15 70 70 1 0 0 0 0 0 0
6+
ALMA 2225061.164 -5440057.37 -2481681.15 70 70 1 0 0 0 0 0 0
77
SPT 0.01 0.01 -6359609.7 16900 16900 1 0 0 0 0 0 0
8-
APEX 2225039.53 -5441197.63 -2479303.36 4900 4900 1 1 0 0 0 0 0
9-
JCMT -5464584.68 -2493001.17 2150653.98 10000 10000 1 0 0 0 0 0 0
8+
APEX 2225039.53 -5441197.63 -2479303.36 4900 4900 1 1 0 0 0 0 0
9+
JCMT -5464584.68 -2493001.17 2150653.98 10000 10000 1 0 0 0 0 0 0

arrays/EHT2019.txt

-13
This file was deleted.

arrays/EHT2025.txt

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

arrays/EHTII_345.txt

-34
This file was deleted.

arrays/EHTwISS.txt

-11
This file was deleted.

arrays/EHTwKP.txt

-11
This file was deleted.

ehtim/calibrating/self_cal.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import ehtim.obsdata
3434
import ehtim.parloop as parloop
3535
from . import cal_helpers as calh
36+
from ehtim.observing.obs_simulate import add_jones_and_noise
3637
import ehtim.observing.obs_helpers as obsh
3738
import ehtim.const_def as ehc
3839

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

113+
# apply dterms
114+
# TODO check!
115+
if apply_dterms:
116+
print("Applying dterms in obs.tarr to clean visibilities before selfcal!")
117+
obsdata_dterms = add_jones_and_noise(obs_clean,
118+
add_th_noise=False, ampcal=True, phasecal=True, opacitycal=True,
119+
dcal=False, frcal=True, dterm_offset=0.0)
120+
obs_clean.data = obsdata_dterms
121+
110122
# Partition the list of observed visibilities into scans
111123
scans = obs.tlist(t_gather=solution_interval, scan_gather=scan_solutions)
112124
scans_cal = copy.copy(scans)

ehtim/caltable.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,12 @@ def load_caltable(obs, datadir, sqrt_gains=False):
689689
try:
690690
data = np.loadtxt(filename, dtype=bytes).astype(str)
691691
except IOError:
692-
continue
692+
try:
693+
filename = datadir + site + '.txt'
694+
data = np.loadtxt(filename, dtype=bytes).astype(str)
695+
except IOError:
696+
continue
697+
693698

694699
datatable = []
695700

0 commit comments

Comments
 (0)