Beispiel #1
0
from SSINS import SS
from SSINS import Catalog_Plot as cp
import numpy as np

inpath = '/Volumes/Faramir/uvfits'
obslist = ['1061313128', '1061312640', '1066742016']
outpath = '/Users/mikewilensky/General/Hist_Compare_Big_Legend'
read_kwargs = {'ant_str': 'cross'}

for obs in obslist:
    ss = SS(inpath='%s/%s.uvfits' % (inpath, obs),
            obs=obs,
            outpath=outpath,
            read_kwargs=read_kwargs,
            bad_time_indices=[0, -1, -2, -3])
    ss.VDH_prepare(fit_hist=True, bins='auto')
    ss.VDH.errors[0] *= 4
    cp.VDH_plot(ss.VDH,
                leg_size='xx-large',
                xscale='linear',
                ylim=[0.1, 10 * np.amax(ss.VDH.counts[0])])
    del ss
Beispiel #2
0
from SSINS import SS, INS
import numpy as np
import scipy.stats
import matplotlib.pyplot as plt

ss = SS(obs='1061312272',
        outpath='/Users/mike_e_dubs/576',
        inpath='/Users/mike_e_dubs/MWA/Data/uvfits/1061313128.uvfits',
        bad_time_indices=[0, -1, -2, -3],
        read_kwargs={'ant_str': 'cross'})
ss.VDH_prepare(bins='auto', fit_hist=True)
N = ss.UV.data_array.size
bins = ss.VDH.bins[0]
centers = bins[:-1] + 0.5 * np.diff(bins)
mu = np.mean(ss.UV.data_array)
var = np.var(ss.UV.data_array)
r_scale = np.sqrt(0.5 * np.mean(ss.UV.data_array**2))
norm = scipy.stats.norm
rayleigh = scipy.stats.rayleigh
gauss_fit = N * (norm.cdf(bins[1:], loc=mu, scale=np.sqrt(var)) -
                 norm.cdf(bins[:-1], loc=mu, scale=np.sqrt(var)))
rayleigh_fit = N * (rayleigh.cdf(bins[1:], scale=r_scale) -
                    rayleigh.cdf(bins[:-1], scale=r_scale))

fig, ax = plt.subplots(figsize=(14, 8))
ax.plot(centers, ss.VDH.counts[0], drawstyle='steps-mid', label='Background')
ax.errorbar(centers,
            ss.VDH.fits[0],
            yerr=3 * ss.VDH.errors[0],
            drawstyle='steps-mid',
            label='Rayleigh Mixture Fit')
Beispiel #3
0
UV6.phase(5.03706309897,.598912483314)

for x in inpath5:
    	UVtemp.read(x, ant_str = 'cross')
    	UVtemp.object_name = 'same'
    	if not UVtemp.phase_center_dec == .598912483314 or not UVtemp.phase_center_ra == 5.03706309897:
        	UVtemp.unphase_to_drift()
        	UVtemp.phase(5.03706309897,.598912483314)
    	UV6 = UV6 + UVtemp

UV = UV2 + UV3 + UV4 + UV5 + UV6

print UV.Nbls
print UV.Ntimes
print UV.Nblts
print 'the buck stop here'

ss = SS(obs=obs, outpath=outpath, UV = UV, diff= True)

ss.INS_prepare()
print 'Marker 1'
ss.VDH_prepare()
print 'Marker 2'
ss.INS.save()
ss.VDH.save()

cp.INS_plot(ss.INS, ms_vmax=5, ms_vmin=-5)
print 'Marker 3'
cp.VDH_plot(ss.VDH, xscale = 'linear')