In [1]:
import os
os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE'
import h5py
import hdf5plugin
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import matplotlib.patches as mpatches
import matplotlib.gridspec as gridspec
import numpy as np
from pyuvdata import UVCal, UVData, UVFlag
import pyuvdata
import os
import sys
import glob
import uvtools as uvt
from astropy.time import Time
from astropy.coordinates import EarthLocation, SkyCoord, AltAz, Angle
import pandas
import warnings 
import copy
from hera_notebook_templates import utils
import hera_qm
from hera_mc import cm_hookup
import h5py
import importlib
from scipy import stats
import scipy
import pandas as pd
from IPython.display import display, HTML
#warnings.filterwarnings('ignore')

%matplotlib inline
%config InlineBackend.figure_format = 'retina'
In [2]:
#get data location
JD = os.environ['JULIANDATE']
data_path = os.environ['DATA_PATH']
nb_outdir = os.environ['NB_OUTDIR']
utc = Time(JD, format='jd').datetime
print(f'JD = {JD}')
print(f'Date = {utc.month}-{utc.day}-{utc.year}')
print(f'data_path = "{data_path}"')
JD = 2459824
Date = 9-1-2022
data_path = "/mnt/sn1/2459824"
In [3]:
# Load in data
HHfiles, difffiles, uvdx, uvdy = utils.load_data_ds(data_path,JD)
    
uvd = UVData()
uvd_diff = UVData()
uvd.read(HHfiles[0])
use_ants = [int(ant) for ant in uvd.get_ants()]
bls = [(ant, ant) for ant in use_ants]
uvd.read(HHfiles[::10], skip_bad_files=True, bls=bls)
uvd_diff.read(difffiles[::10], skip_bad_files=True, bls=bls)
lsts = uvd.lst_array

flagfile = glob.glob(os.path.join(HHfiles[0].split('zen')[0],'zen.{}*total_stage_1_threshold_flags.h5'.format(JD)))
uvf = UVFlag()
uvf.read(flagfile)
bls = [(ant, ant) for ant in uvd.get_ants()]
times_uvf = np.unique(uvf.time_array)
times_uvd = np.unique(uvd.time_array)
idx_times = [np.where(time_uvd == times_uvf)[0][0] for time_uvd in times_uvd]
uvd.flag_array[:,0,:,:] = np.repeat(uvf.flag_array[idx_times], len(bls), axis=0)
1862 sum files found between JDs 2459824.25315 and 2459824.66945
1862 diff files found between JDs 2459824.25315 and 2459824.66945
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Input In [3], in <cell line: 19>()
     17 times_uvf = np.unique(uvf.time_array)
     18 times_uvd = np.unique(uvd.time_array)
---> 19 idx_times = [np.where(time_uvd == times_uvf)[0][0] for time_uvd in times_uvd]
     20 uvd.flag_array[:,0,:,:] = np.repeat(uvf.flag_array[idx_times], len(bls), axis=0)

Input In [3], in <listcomp>(.0)
     17 times_uvf = np.unique(uvf.time_array)
     18 times_uvd = np.unique(uvd.time_array)
---> 19 idx_times = [np.where(time_uvd == times_uvf)[0][0] for time_uvd in times_uvd]
     20 uvd.flag_array[:,0,:,:] = np.repeat(uvf.flag_array[idx_times], len(bls), axis=0)

IndexError: index 0 is out of bounds for axis 0 with size 0

LST Coverage¶

Shows the LSTs (in hours) and JDs for which data is collected. Green represents data, red means no data.

In [4]:
utils.plot_lst_coverage(uvd)

Delay spectrum¶

Delay spectrum CLEANed using uvtools.dspec.high_pass_fourier_filter with 7th-order Blackman-Harris window function. Odd/even visibilities are used to remove noise bias.

In [5]:
_data_cleaned_sq, d_even, d_odd = utils.clean_ds(bls, uvd, uvd_diff, N_threads=14)

Waterfalls of delay spectra for autocorrelation¶

These plots show autocorrelation delay spectrum waterfalls of each antenna that is active and whose status qualifies for this notebook. For nn/ee polarization, the autocorrelation delay spectrum is normalized by the max of the delay spectrum. For ne polarization, the autocorrelation delay spectrum is normalized by max(sqrt(|nn| * |ee|)). ne and en are the same for autocorrelations, and thus only ne is shown here. The delay spectra are presented in dB with 10*log10($|\tilde{V}|$).

For each node, antennas are ordered by SNAP number, and within that by SNAP input number. The antenna number label color corresponds to the a priori status of that antenna.

nn polarization¶

In [6]:
utils.plot_wfds(uvd, _data_cleaned_sq, 0)

ee polarization¶

In [7]:
utils.plot_wfds(uvd, _data_cleaned_sq, 1)

ne polarization¶

In [8]:
utils.plot_wfds(uvd, _data_cleaned_sq, 2)

Analysis of 2700ns features in delay spectra¶

This plot shows the relative amplitude at 2700 ns feature. The relative amplitude is calculated in dB with the mean amplitude at 2500-3000 ns compared to the mean amplitude at 2000-2500 ns. Larger values of relative feature amplitude indicate higher probability of detecting the peak at 2700 ns. Antennas in the same node are grouped by the shaded region.

In [9]:
utils.plot_antFeatureMap_2700ns(uvd, _data_cleaned_sq, JD, pol='nn')
In [10]:
utils.plot_antFeatureMap_2700ns(uvd, _data_cleaned_sq, JD, pol='ee')

This plot shows a matrix representing the 2700ns feature correlation of each baseline. The color bar indicates the amplitude of 2700ns (mean amplitude of 2500-3000ns delay spectrum) in dB which is the same as that in the above plot.

In [11]:
# utils.CorrMatrix_2700ns(uvd, HHfiles, difffiles, flagfile, JD, N_threads=14)

Analysis of noise floor in delay spectra¶

This plot shows the ratio of delay spectrum to noise floor (averaged over 1000-4000ns). Near 1 indicates the delay spectrum reaches to the noise floor, which may mean good.

In [12]:
utils.plot_antFeatureMap_noise(uvd_diff, d_even, d_odd, JD, pol='nn')
In [13]:
utils.plot_antFeatureMap_noise(uvd_diff, d_even, d_odd, JD, pol='ee')
In [14]:
# get the ratio of delay spectum to noise for different freqeuncy bands and pols
ds_noise_ratio = utils.get_ds_noise_ratio(uvd, uvd_diff, bls)

nodes, antDict, inclNodes = utils.generate_nodeDict(uvd)
ants = uvd.get_ants()
# build dataframe
to_show = {'Ant': ants, 'Node': [int(antDict[ant]['node']) for ant in ants], 'Snap': [int(antDict[ant]['snapLocs'][0]) for ant in ants]}
df = pd.DataFrame(to_show)
 
cols_ratio = []
for key in ds_noise_ratio.keys():
    if(key[0] == 40):
        col = r'Full '
    else:
        col = r'{}-{} MHz '.format(key[0], key[1])
    col += key[2]
    df[col] = ds_noise_ratio[key]
    cols_ratio.append(col)
    

# sort by node number and then by antenna number within nodes
df.sort_values(['Node', 'Ant'], ascending=True)

ratio_cut = 3
# style dataframe
table = df.style.hide_index() \
          .applymap(lambda val: 'color: red' if val > ratio_cut else '', subset=cols_ratio) \
          .set_table_styles([dict(selector="th",props=[('max-width', f'70pt')])])

This table shows the ratio of the delay spectrum to the noise level from diff files for different frequency bands and pols. The ratio > 3 is colored in red

In [15]:
HTML(table.render())
Out[15]:
Ant Node Snap Full nn Full ee 50-85 MHz nn 50-85 MHz ee 120-155 MHz nn 120-155 MHz ee 155-190 MHz nn 155-190 MHz ee 190-225 MHz nn 190-225 MHz ee
3 1 2 nan nan nan nan nan nan nan nan nan nan
4 1 2 nan nan nan nan nan nan nan nan nan nan
5 1 2 nan nan nan nan nan nan nan nan nan nan
7 2 0 312.202099 330.622054 154.130766 206.505486 1541.186610 1662.890535 3.771099 4.786507 2.127188 4.719414
8 2 0 44.161417 45.960855 23.560671 39.941072 258.218598 228.810897 2.719129 78.471844 4.159693 83.099462
9 2 0 297.376518 360.123586 160.650995 223.748933 1596.413639 1874.815179 5.841885 4.341178 1.690646 2.099266
10 2 1 0.000000 0.000000 154.082426 154.543759 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
15 1 3 347.363399 356.257436 213.884393 238.625897 1760.420792 1972.357735 2.908669 3.291251 5.963083 5.427304
16 1 3 314.327111 345.470557 188.265482 270.216864 1610.788811 1871.702622 2.832439 3.330088 7.552473 3.251878
17 1 3 345.635633 350.445938 196.495794 224.942833 1676.943792 1796.923620 2.416503 2.444410 1.596643 1.938713
18 1 0 173.763724 233.339616 195.921959 147.630260 797.828004 1188.813260 1.811692 2.035323 1.516276 1.615938
19 2 1 0.000000 0.000000 241.963919 221.618834 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
20 2 1 0.000000 0.000000 181.030296 256.229606 0.000000 0.000000 2.545578 3.651857 1.655693 2.263965
21 2 2 0.000000 0.000000 164.919067 242.659252 0.000000 0.000000 4.140879 1.995267 1.661560 2.001694
27 1 0 605.219879 1380.287746 1827.957384 1181.180418 11.307929 22.172879 3.938092 1.992504 4.583710 1.658713
28 1 0 140.401806 255.599580 112.558865 123.885320 611.367779 1400.174601 1.879721 4.994736 1.667384 7.100086
29 1 1 348.186477 308.751745 195.955493 199.249679 1824.866881 1662.210342 3.827083 3.119593 4.131850 3.354266
30 1 1 344.732782 310.055021 392.411010 185.491944 1866.324885 1661.767394 5.101914 4.396094 2.931198 8.259846
31 2 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 2.620064 3.921006 0.000000 0.000000
32 2 2 0.000000 0.000000 159.625811 142.459234 1427.638139 1256.052800 6.564857 4.277554 3.095384 3.149551
33 2 3 243.536185 332.202540 172.088319 198.202804 1075.531268 1793.511146 1.814894 2.706629 1.316730 3.063909
36 3 3 359.755216 362.036343 815.562785 710.258852 1840.143213 1552.442557 6.650427 4.313360 1.439278 1.943728
37 3 1 350.445904 322.280811 167.516576 219.386996 1620.785840 1727.836198 3.881591 4.679242 1.921492 1.682272
38 3 1 310.012325 321.043340 167.459342 263.990743 1558.727919 1737.966344 3.712376 3.460080 1.409298 2.520220
40 4 1 326.486509 340.731032 213.684780 196.048631 1846.238760 1710.866830 2.732165 2.908026 1.653906 3.194920
41 4 3 365.522988 274.559006 221.112286 165.607525 1868.971879 1447.670154 2.670695 2.093333 1.290072 1.562073
42 4 0 335.178115 281.360930 208.077232 176.003887 1762.077235 1482.736035 2.691915 2.885094 1.996238 5.327840
45 5 0 366.800323 338.949950 258.610790 172.656650 1891.240644 1632.013660 4.136506 2.395903 2.779560 2.197628
46 5 0 334.511164 299.703994 205.990544 169.839934 1760.777102 1564.220573 2.848572 2.010011 1.666972 2.362144
50 3 3 333.884923 389.884320 618.172288 765.457713 1459.045491 1719.605472 6.725978 7.143349 1.554440 1.534231
51 3 2 357.067636 329.561727 168.476246 208.503767 1898.067209 1808.007658 4.767391 5.566021 1.327733 1.862331
52 3 3 424.322863 418.621923 631.705484 552.449754 1857.041022 1744.418991 3.460319 2.965967 1.525785 2.846887
53 3 2 348.167024 320.118894 229.508293 213.810763 1872.042353 1722.505217 3.202674 4.827230 2.632308 7.046242
54 4 0 292.764579 389.349771 187.891893 229.430555 1506.148593 2005.152585 2.674548 2.258982 2.499524 2.916472
55 4 2 267.262377 286.146714 171.502742 184.692203 1429.400773 1474.684673 2.853102 3.682848 2.299644 2.325521
56 4 1 264.839777 282.297867 142.772611 164.864831 1360.825763 1491.941778 2.938503 2.288897 1.988205 2.097618
57 4 3 279.193879 768.120674 170.629071 606.837822 1310.443521 4233.531248 2.803839 2.406978 1.691122 2.228964
65 3 0 373.755947 333.541471 179.696082 201.968892 2113.935873 1746.205465 5.270063 4.854162 1.567948 1.454246
66 3 0 347.653844 352.628492 200.503655 257.087258 1950.397175 1875.050612 3.696553 5.074939 1.881362 2.035040
67 3 0 356.105892 322.390765 215.496222 198.134374 1864.151149 1638.527898 3.369328 3.271539 1.593859 1.441028
68 3 1 409.023549 279.875831 431.100290 173.402182 2160.014283 1498.691591 2.495922 3.317429 1.853358 3.725901
69 4 1 325.944109 287.384384 190.003610 189.357429 1632.724986 1482.522791 2.884565 2.315416 1.727047 3.943760
70 4 2 305.418311 270.013506 173.948558 157.534081 1547.062894 1374.246537 4.812897 5.468424 3.189051 7.048771
71 4 2 322.725859 360.845974 174.598584 206.839849 1498.428129 1883.606313 2.912140 2.201839 1.512266 1.774251
72 4 0 252.217947 357.262820 168.153674 199.808299 1406.710292 1878.206215 3.809118 3.364505 4.078025 6.126063
73 5 0 259.639416 1222.445273 146.360470 528.242799 1368.423485 21.079569 2.494351 1.886924 3.149815 1.907588
81 7 0 231.904224 336.933639 121.839340 205.322001 1240.071897 1738.353065 6.814033 4.648474 17.006767 4.260094
82 7 0 356.017909 280.611002 188.353620 212.180985 1884.627711 1440.646465 3.741865 4.640830 2.044684 2.081902
83 7 0 233.581855 268.398680 127.145916 164.183333 1245.558172 1407.866424 4.329309 3.318024 2.351659 1.990954
84 8 3 363.789680 299.776684 239.833048 184.147836 1951.422501 1603.084623 5.086676 3.634409 5.109763 4.183825
85 8 0 338.406685 326.134690 187.543034 197.078207 1605.031900 1749.161910 2.658709 2.745040 2.382658 3.859576
86 8 0 302.125440 255.113946 167.822004 146.677172 1426.529388 1277.530192 4.660989 7.688049 7.281005 14.868824
87 8 2 367.880566 220.302133 223.645191 114.397474 1911.180789 1112.007707 2.869186 3.028355 1.591656 3.009570
88 9 0 65.606158 87.310462 30.942635 206.771533 323.083027 307.245704 2.612662 162.285824 1.822826 226.035468
90 9 0 393.682498 304.642655 253.549933 191.267992 1991.390133 1623.738341 2.466054 2.095828 2.391611 2.342513
91 9 1 60.737414 82.731271 28.844910 79.333613 320.941292 341.775718 2.595282 156.572891 2.400421 165.824550
92 10 0 180.863239 259.167350 282.009560 253.661563 937.165155 1279.841298 4.066696 3.723821 2.849653 2.737650
93 10 0 296.354430 361.283945 168.623591 192.853889 1532.802555 1920.064031 2.505762 2.023902 2.164675 7.976671
94 10 0 324.995449 315.404690 197.289077 204.401609 1741.350427 1828.390771 3.406092 4.132556 1.995732 12.082434
98 7 2 399.044479 294.558072 161.734681 163.293779 1975.719612 1429.562959 5.650526 5.307990 3.041454 1.510059
99 7 2 267.865458 273.736464 148.070612 145.108093 1441.678943 1333.198110 3.727375 4.929838 12.111115 10.097602
100 7 1 346.980160 338.833502 208.448199 198.434340 1914.144636 1623.179449 3.472228 2.301966 1.690283 1.751932
101 8 2 338.118818 252.668017 206.958707 147.716622 1703.947148 1338.316598 3.096820 3.375430 1.462033 7.675761
102 8 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
103 8 1 315.789354 317.763785 211.617269 179.853632 1508.813548 1721.890916 3.703693 2.315255 2.932565 1.657775
104 8 1 783.484247 323.116285 293.798239 180.902059 3199.644143 1614.951239 6.919352 1.669441 3.504519 1.363212
105 9 1 116.693615 197.251903 66.708590 91.825875 613.229593 908.775479 3.045091 2.551264 2.002816 2.285258
106 9 3 nan nan nan nan nan nan nan nan nan nan
107 9 0 81.331956 84.097376 44.216227 65.296467 439.912477 367.257668 7.260400 135.200274 35.744878 135.412389
108 9 1 289.561299 514.380059 150.328801 399.250306 1386.490512 2622.627981 2.695606 2.272736 1.586330 1.251085
109 10 1 364.902235 293.094906 214.032146 159.221845 1928.466362 1455.761292 2.644125 1.914933 1.444653 1.561263
110 10 1 271.071019 269.671356 156.544972 171.728605 1398.437158 1580.339903 2.890093 2.829189 1.720824 1.910345
111 10 1 272.777828 326.029440 151.741339 187.115107 1424.019928 1864.975867 2.877228 2.282525 1.457720 1.935252
112 10 2 284.020635 333.605698 168.056470 215.738477 1540.764758 1782.947573 2.246842 2.383018 1.504181 3.037170
116 7 2 351.776251 327.784802 210.931811 235.590099 1753.382173 1987.397867 4.630662 4.919459 2.536574 2.154649
117 7 3 217.805505 270.824986 158.016353 136.524435 1136.901950 1331.702827 3.965885 6.598240 2.309880 3.551854
118 7 3 522.879382 251.555712 165.312112 169.677208 9.718626 1313.042982 4.313562 3.326234 4.832498 2.962036
119 7 1 287.138009 187.337768 285.940575 101.258117 1567.464362 916.421985 3.398222 3.091365 3.486438 1.577772
120 8 1 638.101377 284.581825 1045.137692 208.361369 16.108108 1557.434182 10.951844 4.255224 33.437347 3.167843
121 8 3 384.292676 330.056898 226.551814 197.502270 1951.042982 1740.054176 5.485183 3.577545 4.266794 45.696775
122 8 2 284.204629 287.797586 150.143049 150.303336 1371.548329 1456.549004 3.367283 3.176839 2.947995 4.998602
123 8 3 325.640466 319.245722 203.599794 196.143921 1885.149866 1798.815459 2.968636 2.270681 1.997703 1.635514
125 9 3 nan nan nan nan nan nan nan nan nan nan
126 9 3 nan nan nan nan nan nan nan nan nan nan
127 10 2 347.381921 348.760464 205.576034 200.129619 1827.241863 1950.357990 5.119920 3.398408 4.032669 3.780194
128 10 2 287.157093 324.954671 152.961457 188.690457 1402.776149 1756.294400 2.361676 2.494087 1.785803 2.334212
129 10 3 273.093117 286.450634 156.112244 155.602041 1473.527762 1495.716608 2.745402 2.260447 1.293601 2.937885
130 10 3 348.917457 355.695953 256.355764 217.779983 1949.041539 1915.452141 3.248603 1.867830 2.327161 2.059625
135 12 2 339.069871 304.458243 121.206953 230.052739 1785.538260 1737.561546 3.545624 3.535541 2.543885 2.173121
136 12 2 315.495966 316.950909 207.252434 173.837497 1645.417788 1556.979751 4.988713 5.325518 1.950911 1.889123
137 7 3 81.216387 85.558603 39.666138 145.237415 416.874832 341.518757 2.509709 160.378382 2.027654 176.139099
138 7 1 300.633250 84.921282 164.767210 144.842017 1535.960573 377.872426 4.079869 101.343762 1.508142 107.116682
140 13 2 1516.833956 334.038868 263.682223 350.640091 25.293014 6.679362 5.579939 14.346743 9.805242 29.500125
141 13 2 555.809124 323.888167 359.940604 188.504862 2626.363068 1838.013452 49.163814 2.039224 57.033138 2.234530
142 13 2 2132.073424 237.801663 290.751552 130.864573 34.260648 1256.591150 3.464721 4.110910 4.614328 5.703885
143 14 2 284.292054 387.369855 159.262144 187.412134 1447.825249 1983.915145 2.840535 2.115823 1.374549 1.707414
144 14 3 289.407045 269.355442 155.302929 152.560578 1535.408249 1484.552607 3.291947 2.378532 2.805770 2.013136
145 14 3 838.160137 513.175972 842.884567 2888.956315 17.193806 12.139338 3.398049 1.792504 3.441797 1.985014
150 15 1 165.136417 1058.988925 1112.664614 187.311896 6.046608 18.823418 6.973420 21.163087 13.119177 42.853715
155 12 2 2288.387362 315.857638 454.438256 704.812196 36.698447 6.753274 3.500823 2.389311 4.402039 1.957264
156 12 3 342.179403 279.584061 160.986897 141.035283 1759.333853 1578.333040 2.654364 4.929216 1.995817 4.085682
157 12 3 243.914860 311.645909 178.929008 201.386060 1350.874269 1738.591773 2.701236 2.072432 1.747769 1.882868
158 12 3 314.329421 344.438886 187.048896 241.548716 1742.329635 1902.528867 3.377420 2.988853 3.323864 5.197243
160 13 3 1467.222332 195.106020 272.944407 2769.447641 25.979559 6.450457 4.892838 5.160215 3.998386 4.099375
161 13 0 302.048237 309.961347 152.299891 145.105780 1377.224407 1683.621319 4.089067 2.748368 5.533062 4.031245
162 13 0 309.206903 309.959901 123.133874 115.806062 1650.887519 1629.241979 2.718841 1.946132 1.399482 1.559061
163 14 2 339.800414 344.387115 152.110661 137.435015 1702.857220 1831.459284 3.125674 2.178066 1.607175 2.534363
164 14 2 349.379265 316.718581 231.029763 187.517350 1886.012399 1651.515059 2.807218 3.086063 1.612917 5.042564
165 14 0 379.448566 238.433517 740.390312 288.032256 1573.276340 999.213434 5.054504 7.362917 4.352734 8.412559
166 14 0 330.769930 392.410255 656.758284 714.058194 1471.976785 1554.403233 3.169647 2.735605 1.863973 1.982569
167 15 1 68.277446 88.725244 38.760116 66.248672 347.671840 451.041708 4.290918 2.768837 2.586902 1.748812
168 15 2 56.144427 93.276638 29.385910 40.517441 289.479740 464.011097 4.884795 5.678961 7.691956 5.787957
169 15 2 0.000000 0.000000 0.000000 0.000000 353.341507 300.223125 2.510525 5.873299 0.000000 0.000000
170 15 2 29.135014 20.380820 15.534602 18.473771 153.416964 98.752762 2.136719 4.649187 3.560037 8.603718
176 12 0 326.388085 344.087689 157.492641 174.622592 1687.154045 1563.454682 6.281004 4.464451 1.793798 1.499829
177 12 0 276.479204 275.958362 134.251293 170.630333 1376.908801 1501.962935 2.580268 3.461568 2.333339 2.196861
178 12 0 331.978945 348.970672 204.098398 223.854874 1825.033821 1858.750747 3.150003 2.760916 1.481044 1.540417
179 12 1 325.281661 334.648000 198.955719 190.156674 1795.019855 1725.063872 5.838538 3.005339 3.080164 4.545889
180 13 3 2493.677509 311.218158 235.800981 179.320370 2515.980175 1577.547285 3.854872 2.419405 3.667495 1.713425
181 13 3 93.134190 1719.894184 78.059407 1044.113693 495.676969 26.192686 2.527656 1.680869 2.498107 1.686295
182 13 0 185.213185 79.406915 109.241545 38.061575 1015.117768 413.015930 3.202938 3.550518 2.358780 4.476117
183 13 1 nan nan nan nan nan nan nan nan nan nan
184 14 0 401.450940 455.475433 601.006280 904.149836 1708.161786 1925.389261 2.713705 2.338439 1.753630 2.521227
185 14 1 346.385966 579.164012 219.787290 396.067162 1861.109467 3151.820044 2.878205 3.229744 1.630186 14.654666
186 14 1 396.622131 438.725484 231.543878 350.949371 2038.672570 2298.344084 3.013199 3.474825 1.561781 2.028574
187 14 1 288.168691 366.042133 169.791461 241.222209 1567.160725 1917.818120 4.610243 5.832726 4.228761 5.513788
189 15 3 354.136323 389.598500 237.310815 207.340769 1771.106143 1749.159266 2.461415 2.199809 1.454076 1.573933
190 15 3 73.955145 322.830690 689.155209 219.207919 4.232065 1822.881594 4.291486 3.403700 4.466166 6.321836
191 15 3 311.719048 339.949596 211.422879 196.894880 1718.389036 1759.197356 3.304284 2.415117 1.743077 1.655018
203 18 1 nan nan nan nan nan nan nan nan nan nan
205 19 0 1.596358 0.746091 3.609115 0.964311 9.233497 4.246204 0.034852 0.017836 0.026698 0.014063
206 19 0 1.073702 1.243446 0.674961 0.793355 6.235397 6.839107 0.020777 0.013145 0.016503 0.011445
207 19 1 0.877003 0.750293 1.288568 0.648994 5.086904 3.789683 0.016671 0.014021 0.012603 0.012640
220 18 2 nan nan nan nan nan nan nan nan nan nan
221 18 2 nan nan nan nan nan nan nan nan nan nan
222 18 2 nan nan nan nan nan nan nan nan nan nan
223 19 1 2.073621 1.201571 1.496142 1.612556 12.393773 6.932304 0.019556 0.014176 0.015874 0.012970
224 19 1 0.247753 0.235784 0.054158 0.047751 0.566360 0.493862 0.015401 0.006691 0.027027 0.012242
241 19 3 nan nan nan nan nan nan nan nan nan nan
242 19 3 nan nan nan nan nan nan nan nan nan nan
243 19 3 nan nan nan nan nan nan nan nan nan nan
320 3 2 957.308280 1046.857034 4930.563402 1677.061125 17.137830 16.680279 8.873852 8.962828 8.002944 9.821708
321 2 3 183.812499 174.477599 108.729162 115.702350 869.563068 774.697858 3.890275 2.491153 1.865500 2.219737
323 2 3 128.907343 341.571033 56.386777 219.558565 589.817217 1691.089187 2.575531 1.858365 1.702929 1.916189
324 4 3 179.277507 137.563067 136.340756 58.526952 848.107689 603.169875 3.189475 2.818461 1.721809 1.832072
329 12 1 176.816030 457.347439 102.934792 299.085305 939.410868 2347.883305 7.676214 3.134809 1.716733 4.850315
333 12 1 212.706135 355.709690 84.596904 407.845068 909.539594 1978.157548 5.995904 3.851609 1.549568 2.277189
In [16]:
csv_file = os.path.join(nb_outdir, 'ds_noise_ratio_{}.csv'.format(JD))
df.to_csv(csv_file, index=False)

Delay spectrum and autocorrelation plot per baseline per polarization for a given frequency (sub-)band¶

Left panel: time averaged delay spectum of autocorrelation in dB with 10*log10($|\tilde{V}|$) (blue) and noise from diff file representing the expected variance of the delay spectrum (red). The time-averaging is performed by 1. binning three time integrations of each even and odd visibility, 2. Fouier transform the binned even and odd visibilities, and 3. multiply the even and odd delay spectra at alternating time bin and average the squared delay spectrum along the time axis. This helps to reduce the noise bias. Both autocorrelation delay spectrum and diff delay spectrum are averaged in the same way

Right panel: time averaged autocorrelations w/o (orange) and w/ xRFI flags (blue). Flagged one is shifted from the unflagged one for clarity

In [17]:
utils.interactive_plots_dspec(bls, uvd, uvd_diff, JD)
In [ ]: