import numpy as np from aipy import dsp import RotMeasTools as RMT from pylab import * import pspec c = 0.3 #m/ns twopi = 2.*np.pi N = 512 fq = np.linspace(0.1,0.2,N) L2 = RMT.better_guess_l2(fq) Rms,W = RMT.RMTmat(fq) plot_me = np.zeros((N,N),dtype=np.complex) delays = np.fft.fftshift(np.fft.fftfreq(N,fq[1]-fq[0])) wgt = dsp.gen_window(N,window='blackman-harris') Rm0 = 5. for i,Rm in enumerate(Rms): QiUi = RMT.gen_rm_spec(fq,Rm+Rm0) plot_me[:,i] = np.fft.fftshift(np.fft.ifft(QiUi*wgt)) plot_me1 = plot_me*np.conjugate(plot_me) plot_me1 = plot_me1.real plot_me1 /= np.max(plot_me1) figure(0) imshow(10.*np.log10(plot_me1),aspect='auto',interpolation='nearest', extent=[delays[0],delays[-1],Rms[-1],Rms[0]], vmax=0,vmin=-100) ylabel('Rotation Measure [$m^{-2}$]')