Skip to content

Commit 048db1a

Browse files
committed
merged into master
2 parents a48e121 + 3c14f1d commit 048db1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+15410
-8511
lines changed

arrays/EHTII.txt

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
BAJA -2352576.31173 -4940331.41122 3271508.49374 10000 #National Astronomical Observatory (Mexico)
14+
KAUAI -5547583.15126 -2073328.69989 2367861.8559 10000 #Kaua'i, Hawaii
15+
VLT 1946473.62308 -5467592.1824 -2642703.01185 10000 #VLT, Chile
16+
DRAK 4850818.24138 2718443.00852 -3120751.59707 10000 #Drakensberg, South Africa
17+
OVRO -2409598.8669 -4478350.4481 3838603.7849 10000 #Owens Valley Radio Observatory
18+
DomeA 268806 907474 -6290474 5000
19+
DomeC -904487 1375264 -6144761 5000
20+
NZ -4560904.128978 792576.8837 -4378122.61168394 10000 #South Alps, New Zealand
21+
NH 1446350.5 -4447924.8 4322287.5 10000 #New Hampshire
22+
#KEN 5077092.35557 3868758.28852 -16691.393515 10000 #Mount Kenya
23+
#BOL 2282100.27386 -5685901.71836 -1785763.38112 10000 #Chacaltaya Astrophysical Observatory, Bolivia
24+
#HAY 1492420.4965 -4457272.10037 4296891.72893 10000 #Haystack
25+
#LAS 1834168.6478 -5247347.9448 -3113005.9296 10000 #La Silla, Chile
26+
#GAM 5627251.83789 1632172.52014 2517405.60946 10000 #Gamsberg, Namibia
27+
#PIKES -1292058.67099 -4807190.10901 3981241.60693 10000 #Pikes Peak, Colorado
28+
#NCAR -1289782.8 -4722747.4 4077350.6 10000
29+
#VLA -1601201.2 -5042007.4 3554843.0 10000
30+
#FD -1319947.9 -5335818.5 3227439.0 10000
31+
#LOS -1452893.2 -4967509.5 3718718.4 10000
32+
#PT -1642372.5 -5014529.2 3575175.5 10000
33+
#HO 1492404.9 -4457277.3 4296891.7 10000
34+
#MH 574139.1 -4987066.0 3921656.9 10000

arrays/EHTII_345.txt

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#PDB 4523998.40 468045.240 4460309.760 2750
2+
PV 5088967.9000 -301681.6000 3825015.8000 2100
3+
SMT -1828796.200 -5054406.800 3427865.200 7500
4+
SMA -5464523.400 -2493147.080 2150611.750 7450
5+
LMT -768713.9637 -5988541.7982 2063275.9472 900
6+
ALMA 2225061.164 -5440057.37 -2481681.15 135
7+
SPT 0.01 0.01 -6359609.7 7500
8+
APEX 2225039.53 -5441197.63 -2479303.36 5250
9+
JCMT -5464584.68 -2493001.17 2150653.98 9000
10+
CARMA -2397431.300 -4482018.900 3843524.500 15000
11+
#KP -1995678.840 -5037317.697 3357328.025 15000
12+
GLT 1500692.0 -1191735.0 6066409.0 15000
13+
BAJA -2352576.31173 -4940331.41122 3271508.49374 15000 #National Astronomical Observatory (Mexico)
14+
KAUAI -5547583.15126 -2073328.69989 2367861.8559 15000 #Kaua'i, Hawaii
15+
VLT 1946473.62308 -5467592.1824 -2642703.01185 15000 #VLT, Chile
16+
DRAK 4850818.24138 2718443.00852 -3120751.59707 15000 #Drakensberg, South Africa
17+
#OVRO -2409598.8669 -4478350.4481 3838603.7849 15000 #Owens Valley Radio Observatory
18+
DomeA 268806 907474 -6290474 7500
19+
DomeC -904487 1375264 -6144761 7500
20+
NZ -4560904.128978 792576.8837 -4378122.61168394 15000 #South Alps, New Zealand
21+
NH 1446350.5 -4447924.8 4322287.5 15000 #New Hampshire
22+
#KEN 5077092.35557 3868758.28852 -16691.393515 15000 #Mount Kenya
23+
#BOL 2282100.27386 -5685901.71836 -1785763.38112 15000 #Chacaltaya Astrophysical Observatory, Bolivia
24+
#HAY 1492420.4965 -4457272.10037 4296891.72893 15000 #Haystack
25+
#LAS 1834168.6478 -5247347.9448 -3113005.9296 15000 #La Silla, Chile
26+
#GAM 5627251.83789 1632172.52014 2517405.60946 15000 #Gamsberg, Namibia
27+
#PIKES -1292058.67099 -4807190.10901 3981241.60693 15000 #Pikes Peak, Colorado
28+
#NCAR -1289782.8 -4722747.4 4077350.6 15000
29+
#VLA -1601201.2 -5042007.4 3554843.0 15000
30+
#FD -1319947.9 -5335818.5 3227439.0 15000
31+
#LOS -1452893.2 -4967509.5 3718718.4 15000
32+
#PT -1642372.5 -5014529.2 3575175.5 15000
33+
#HO 1492404.9 -4457277.3 4296891.7 15000
34+
#MH 574139.1 -4987066.0 3921656.9 15000

arrays/GMVA_86GHz.txt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#From: http://www3.mpifr-bonn.mpg.de/div/vlbi/globalmm/
2+
#NAME X Y Z SEFDR SEFDL FR_PAR_ANGLE FR_ELEV_ANGLE FR_OFFSET[d] DR_RE DR_IM DL_RE DL_IM
3+
FD -1324009.327 -5332181.955 3231962.395 2500 2500 1 0 0 0 0 0 0
4+
PT -1640953.938 -5014816.024 3575411.792 2500 2500 1 0 0 0 0 0 0
5+
LA -1449752.584 -4975298.576 3709123.846 2500 2500 1 0 0 0 0 0 0
6+
KP -1995678.840 -5037317.697 3357328.025 2500 2500 1 0 0 0 0 0 0
7+
MK -5464075.185 -2495248.106 2148297.365 2500 2500 1 0 0 0 0 0 0
8+
BR -2112065.206 -3705356.505 4726813.676 2500 2500 1 0 0 0 0 0 0
9+
NL -130872.499 -4762317.093 4226851.001 2500 2500 1 0 0 0 0 0 0
10+
OV -2409150.402 -4478573.118 3838617.339 2500 2500 1 0 0 0 0 0 0
11+
ALMA 2225037.1851 -5441199.1620 -2479303.4629 75 75 1 0 0 0 0 0 0
12+
GBT 882589.983 -4924873.024 3943728.983 250 250 1 0 0 0 0 0 0
13+
LMT -768713.9637 -5988541.7982 2063275.9472 1714 1714 1 -1 0 0 0 0 0
14+
PV 5088967.9000 -301681.6000 3825015.8000 1400 1400 1 -1 0 0 0 0 0
15+
YS 4848761.8046 -261484.1078 4123085.1096 1200 1200 1 0 0 0 0 0 0
16+
EB 4033947.2037 486990.8586 4900431.0373 1500 1500 1 0 0 0 0 0 0

docs/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
# The short X.Y version.
6767
version = u'0.1'
6868
# The full version, including alpha/beta/rc tags.
69-
release = u'0.1.0'
69+
release = u'0.1.1'
7070

7171
# The language for content autogenerated by Sphinx. Refer to documentation
7272
# for a list of supported languages.

docs/source/plotting.rst

+6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
Plotting
66
================
77

8+
.. automodule:: ehtim.plotting.summary_plots
9+
:members:
10+
811
.. automodule:: ehtim.plotting.comp_plots
912
:members:
1013

14+
.. automodule:: ehtim.plotting.comparisons
15+
:members:
16+
1117

ehtim/__init__.py

+36-28
Original file line numberDiff line numberDiff line change
@@ -8,53 +8,61 @@
88
"""
99
from __future__ import division
1010
from __future__ import print_function
11+
1112
from builtins import str
1213
from builtins import range
14+
from builtins import object
1315

14-
import warnings
15-
warnings.filterwarnings("ignore", message="numpy.dtype size changed, may indicate binary incompatibility.")
16-
17-
import ehtim.obsdata
16+
import ehtim.observing
17+
from ehtim.const_def import *
18+
from ehtim.imaging.imager_utils import imager_func
19+
import ehtim.imaging
20+
from ehtim.features import rex
21+
import ehtim.features
22+
from ehtim.plotting.summary_plots import *
23+
from ehtim.plotting.comparisons import *
24+
from ehtim.plotting.comp_plots import *
25+
from ehtim.plotting import comparisons
26+
from ehtim.plotting import comp_plots
27+
import ehtim.plotting
28+
from ehtim.calibrating.network_cal import network_cal as netcal
29+
from ehtim.calibrating.self_cal import self_cal as selfcal
30+
from ehtim.calibrating.pol_cal import *
31+
from ehtim.calibrating import pol_cal
32+
from ehtim.calibrating import network_cal
33+
from ehtim.calibrating import self_cal
34+
import ehtim.calibrating
35+
import ehtim.parloop
36+
import ehtim.caltable
37+
import ehtim.vex
1838
import ehtim.imager
39+
import ehtim.obsdata
1940
import ehtim.array
2041
import ehtim.movie
2142
import ehtim.image
22-
import ehtim.vex
23-
import ehtim.closure
24-
import ehtim.caltable
25-
import ehtim.parloop
2643

27-
from ehtim.imaging.imager_utils import imager_func
28-
from ehtim.calibrating import self_cal
29-
from ehtim.calibrating import network_cal
30-
from ehtim.calibrating import pol_cal
31-
from ehtim.plotting import comp_plots
32-
from ehtim.plotting import comparisons
33-
34-
from ehtim.plotting.comp_plots import *
35-
from ehtim.plotting.comparisons import *
36-
from ehtim.plotting.summary_plots import *
3744

38-
from ehtim.calibrating.pol_cal import *
39-
#from ehtim.calibrating.self_cal import *
40-
#from ehtim.calibrating.network_cal import *
41-
from ehtim.calibrating.self_cal import self_cal as selfcal
42-
from ehtim.calibrating.network_cal import network_cal as netcal
45+
import warnings
46+
warnings.filterwarnings(
47+
"ignore", message="numpy.dtype size changed, may indicate binary incompatibility.")
4348

44-
from ehtim.pipeline import Pipeline
45-
from ehtim.const_def import *
49+
# necessary to prevent hangs from astropy iers bug in astropy v 2.0.8
50+
#from astropy.utils import iers
51+
#iers.conf.auto_download = False
4652

4753
try:
4854
import pkg_resources
4955
version = pkg_resources.get_distribution("ehtim").version
50-
print("Welcome to eht-imaging! v ",version)
56+
print("Welcome to eht-imaging! v", version,'\n')
5157
except:
52-
print("Welcome to eht-imaging!")
58+
print("Welcome to eht-imaging!\n")
59+
5360

5461
def logo():
5562
for line in BHIMAGE:
5663
print(line)
5764

65+
5866
def eht():
59-
for line in EHTIMAGE:
67+
for line in EHTIMAGE:
6068
print(line)

ehtim/array.py

+42-33
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
# You should have received a copy of the GNU General Public License
1717
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818

19+
from __future__ import division
20+
from __future__ import print_function
21+
1922
from builtins import str
2023
from builtins import range
2124
from builtins import object
@@ -25,20 +28,22 @@
2528
import ehtim.observing.obs_simulate as simobs
2629
import ehtim.io.save
2730
import ehtim.io.load
31+
import ehtim.const_def as ehc
2832

29-
from ehtim.const_def import *
30-
from ehtim.observing.obs_helpers import *
31-
32-
###########################################################################################################################################
33+
###################################################################################################
3334
# Array object
34-
###########################################################################################################################################
35+
###################################################################################################
36+
37+
3538
class Array(object):
39+
3640
"""A VLBI array of telescopes with site locations, SEFDs, and other data.
3741
3842
Attributes:
3943
tarr (numpy.recarray): The array of telescope data with datatype DTARR
4044
tkey (dict): A dictionary of rows in the tarr for each site name
41-
ephem (dict): A dictionary of TLEs for each space antenna, Space antennas have x=y=z=0 in the tarr
45+
ephem (dict): A dictionary of TLEs for each space antenna,
46+
Space antennas have x=y=z=0 in the tarr
4247
"""
4348

4449
def __init__(self, tarr, ephem={}):
@@ -47,39 +52,40 @@ def __init__(self, tarr, ephem={}):
4752

4853
# check to see if ephemeris is correct
4954
for line in self.tarr:
50-
if np.any(np.isnan([line['x'],line['y'],line['z']])):
55+
if np.any(np.isnan([line['x'], line['y'], line['z']])):
5156
sitename = str(line['site'])
5257
try:
5358
elen = len(ephem[sitename])
5459
except NameError:
55-
raise Exception ('no ephemeris for site %s !' % sitename)
60+
raise Exception('no ephemeris for site %s !' % sitename)
5661
if elen != 3:
5762

58-
raise Exception ('wrong ephemeris format for site %s !' % sitename)
63+
raise Exception('wrong ephemeris format for site %s !' % sitename)
5964

6065
# Dictionary of array indices for site names
6166
self.tkey = {self.tarr[i]['site']: i for i in range(len(self.tarr))}
6267

6368
def listbls(self):
6469
"""List all baselines.
65-
70+
6671
Args:
67-
Returns:
72+
Returns:
6873
numpy.array : array of baselines
6974
"""
7075

7176
bls = []
7277
for i1 in sorted(self.tarr['site']):
7378
for i2 in sorted(self.tarr['site']):
74-
if not ([i1,i2] in bls) and not ([i2,i1] in bls) and i1 != i2:
75-
bls.append([i1,i2])
76-
77-
return np.array(bls)
79+
if not ([i1, i2] in bls) and not ([i2, i1] in bls) and i1 != i2:
80+
bls.append([i1, i2])
81+
bls = np.array(bls)
7882

79-
def obsdata(self, ra, dec, rf, bw, tint, tadv, tstart, tstop, mjd=MJD_DEFAULT, timetype='UTC',
80-
polrep='stokes', elevmin=ELEV_LOW, elevmax=ELEV_HIGH,
81-
tau=TAUDEF, fix_theta_GMST=False):
83+
return bls
8284

85+
def obsdata(self, ra, dec, rf, bw, tint, tadv, tstart, tstop,
86+
mjd=ehc.MJD_DEFAULT, timetype='UTC', polrep='stokes',
87+
elevmin=ehc.ELEV_LOW, elevmax=ehc.ELEV_HIGH,
88+
tau=ehc.TAUDEF, fix_theta_GMST=False):
8389
"""Generate u,v points and baseline uncertainties.
8490
8591
Args:
@@ -102,23 +108,23 @@ def obsdata(self, ra, dec, rf, bw, tint, tadv, tstart, tstop, mjd=MJD_DEFAULT, t
102108
"""
103109

104110
obsarr = simobs.make_uvpoints(self, ra, dec, rf, bw,
105-
tint, tadv, tstart, tstop,
106-
mjd=mjd, polrep=polrep, tau=tau,
107-
elevmin=elevmin, elevmax=elevmax,
108-
timetype=timetype, fix_theta_GMST = fix_theta_GMST)
111+
tint, tadv, tstart, tstop,
112+
mjd=mjd, polrep=polrep, tau=tau,
113+
elevmin=elevmin, elevmax=elevmax,
114+
timetype=timetype, fix_theta_GMST=fix_theta_GMST)
109115

110116
uniquetimes = np.sort(np.unique(obsarr['time']))
111-
scans = np.array([[time-0.5*tadv, time+0.5*tadv] for time in uniquetimes])
112-
source=str(ra) + ":" + str(dec)
113-
obs = ehtim.obsdata.Obsdata(ra, dec, rf, bw, obsarr, self.tarr,
117+
scans = np.array([[time - 0.5 * tadv, time + 0.5 * tadv] for time in uniquetimes])
118+
source = str(ra) + ":" + str(dec)
119+
obs = ehtim.obsdata.Obsdata(ra, dec, rf, bw, obsarr, self.tarr,
114120
source=source, mjd=mjd, timetype=timetype, polrep=polrep,
115-
ampcal=True, phasecal=True, opacitycal=True,
121+
ampcal=True, phasecal=True, opacitycal=True,
116122
dcal=True, frcal=True,
117123
scantable=scans)
118124
return obs
119125

120126
def make_subarray(self, sites):
121-
"""Make a subarray from the Array object array that only includes the sites listed in sites.
127+
"""Make a subarray from the Array object array that only includes the sites listed.
122128
123129
Args:
124130
sites (list) : list of sites in the subarray
@@ -127,22 +133,25 @@ def make_subarray(self, sites):
127133
"""
128134
all_sites = [t[0] for t in self.tarr]
129135
mask = np.array([t in sites for t in all_sites])
130-
return Array(self.tarr[mask],ephem=self.ephem)
136+
subarr = Array(self.tarr[mask], ephem=self.ephem)
137+
return subarr
131138

132139
def save_txt(self, fname):
133140
"""Save the array data in a text file.
134141
135142
Args:
136143
fname (str) : path to output array file
137144
"""
138-
ehtim.io.save.save_array_txt(self,fname)
145+
ehtim.io.save.save_array_txt(self, fname)
139146
return
140147

141-
###########################################################################################################################################
142-
#Array creation functions
143-
###########################################################################################################################################
148+
##########################################################################
149+
# Array creation functions
150+
##########################################################################
151+
152+
144153
def load_txt(fname, ephemdir='ephemeris'):
145-
"""Read an array from a text file.
154+
"""Read an array from a text file.
146155
Sites with x=y=z=0 are spacecraft, TLE ephemerides read from ephemdir.
147156
148157
Args:

ehtim/calibrating/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
from . import self_cal
1010
from . import network_cal
1111
from . import pol_cal
12+
from . import polgains_cal
1213

1314
from ..const_def import *

0 commit comments

Comments
 (0)