hdulist.close() hdulist = fits.open(fg_clean_infile) fg_cc_skyvis_lag = hdulist[ 'CLEAN NOISELESS DELAY SPECTRA REAL'].data + 1j * hdulist[ 'CLEAN NOISELESS DELAY SPECTRA IMAG'].data fg_cc_skyvis_lag_res = hdulist[ 'CLEAN NOISELESS DELAY SPECTRA RESIDUALS REAL'].data + 1j * hdulist[ 'CLEAN NOISELESS DELAY SPECTRA RESIDUALS IMAG'].data hdulist.close() geor_cc_skyvis_lag += geor_cc_skyvis_lag_res fg_cc_skyvis_lag += fg_cc_skyvis_lag_res geor_cc_skyvis_lag = DSP.downsampler(geor_cc_skyvis_lag, 1.0 * clean_lags.size / ia.lags.size, axis=1) fg_cc_skyvis_lag = DSP.downsampler(fg_cc_skyvis_lag, 1.0 * clean_lags.size / ia.lags.size, axis=1) fg_cc_skyvis_lag_res = DSP.downsampler(fg_cc_skyvis_lag_res, 1.0 * clean_lags.size / ia.lags.size, axis=1) clean_lags_orig = NP.copy(clean_lags) clean_lags = DSP.downsampler(clean_lags, 1.0 * clean_lags.size / ia.lags.size, axis=-1) clean_lags = clean_lags.ravel() delaymat = DLY.delay_envelope(bl, pc_dircos, units='mks')
dec_obs = intrfrmtr.latitude + NP.zeros(n_snaps) for i in xrange(n_snaps): intrfrmtr.observe(str(lst_obs[i]), Tsys, bpass, [ha_obs[i], dec_obs[i]], skymod, t_snap, roi_radius=30.0, lst=lst_obs[i]) intrfrmtr.delay_transform() lags = intrfrmtr.lags vis_lag = intrfrmtr.vis_lag if oversampling_factor > 1.0: lags = DSP.downsampler(intrfrmtr.lags, oversampling_factor) vis_lag = DSP.downsampler(intrfrmtr.vis_lag, oversampling_factor) noise_info = intrfrmtr.band_averaged_noise_estimate(filter_method='hpf') fig = PLT.figure(figsize=(14, 14)) ax1 = fig.add_subplot(211) # fig, (ax1, ax2) = PLT.subplots(2,1,figsize=(14,12)) ax1.set_xlabel(r'$\eta$ [$\mu$s]', fontsize=18) ax1.set_ylabel('Amplitude [Jy Hz]', fontsize=18) ax1.set_title('Delay Spectrum', fontsize=18, weight='semibold') ax1.set_yscale('log') ax1.set_xlim(1e6 * NP.amin(lags) - 1.0, 1e6 * NP.amax(lags) + 1.0) ax1.set_ylim(0.5 * NP.amin(NP.abs(intrfrmtr.vis_lag)), 2.0 * NP.amax(NP.abs(intrfrmtr.vis_lag))) l1, = ax1.plot([], [], 'g+', markersize=10)
hdulist = fits.open(geor_clean_infile) clean_lags = hdulist['SPECTRAL INFO'].data['lag'] geor_cc_skyvis_lag = hdulist['CLEAN NOISELESS DELAY SPECTRA REAL'].data + 1j * hdulist['CLEAN NOISELESS DELAY SPECTRA IMAG'].data geor_cc_skyvis_lag_res = hdulist['CLEAN NOISELESS DELAY SPECTRA RESIDUALS REAL'].data + 1j * hdulist['CLEAN NOISELESS DELAY SPECTRA RESIDUALS IMAG'].data hdulist.close() hdulist = fits.open(fg_clean_infile) fg_cc_skyvis_lag = hdulist['CLEAN NOISELESS DELAY SPECTRA REAL'].data + 1j * hdulist['CLEAN NOISELESS DELAY SPECTRA IMAG'].data fg_cc_skyvis_lag_res = hdulist['CLEAN NOISELESS DELAY SPECTRA RESIDUALS REAL'].data + 1j * hdulist['CLEAN NOISELESS DELAY SPECTRA RESIDUALS IMAG'].data hdulist.close() geor_cc_skyvis_lag += geor_cc_skyvis_lag_res fg_cc_skyvis_lag += fg_cc_skyvis_lag_res geor_cc_skyvis_lag = DSP.downsampler(geor_cc_skyvis_lag, 1.0*clean_lags.size/ia.lags.size, axis=1) fg_cc_skyvis_lag = DSP.downsampler(fg_cc_skyvis_lag, 1.0*clean_lags.size/ia.lags.size, axis=1) fg_cc_skyvis_lag_res = DSP.downsampler(fg_cc_skyvis_lag_res, 1.0*clean_lags.size/ia.lags.size, axis=1) clean_lags_orig = NP.copy(clean_lags) clean_lags = DSP.downsampler(clean_lags, 1.0*clean_lags.size/ia.lags.size, axis=-1) clean_lags = clean_lags.ravel() delaymat = DLY.delay_envelope(bl, pc_dircos, units='mks') min_delay = -delaymat[0,:,1]-delaymat[0,:,0] max_delay = delaymat[0,:,0]-delaymat[0,:,1] clags = clean_lags.reshape(1,-1) min_delay = min_delay.reshape(-1,1) max_delay = max_delay.reshape(-1,1) thermal_noise_window = NP.abs(clags) >= max_abs_delay*1e-6 thermal_noise_window = NP.repeat(thermal_noise_window, bl.shape[0], axis=0)
dsm_cc_vis_lag = dsm_cc_vis_lag + dsm_ccres csm_cc_skyvis[simdata_neg_bl_orientation_ind,:,:] = csm_cc_skyvis[simdata_neg_bl_orientation_ind,:,:].conj() csm_cc_skyvis_res[simdata_neg_bl_orientation_ind,:,:] = csm_cc_skyvis_res[simdata_neg_bl_orientation_ind,:,:].conj() csm_cc_vis[simdata_neg_bl_orientation_ind,:,:] = csm_cc_vis[simdata_neg_bl_orientation_ind,:,:].conj() csm_cc_vis_res[simdata_neg_bl_orientation_ind,:,:] = csm_cc_vis_res[simdata_neg_bl_orientation_ind,:,:].conj() csm_cc_skyvis_lag = NP.fft.fftshift(NP.fft.ifft(csm_cc_skyvis, axis=1),axes=1) * csm_cc_skyvis.shape[1] * freq_resolution csm_ccres_sky = NP.fft.fftshift(NP.fft.ifft(csm_cc_skyvis_res, axis=1),axes=1) * csm_cc_skyvis.shape[1] * freq_resolution csm_cc_skyvis_lag = csm_cc_skyvis_lag + csm_ccres_sky csm_cc_vis_lag = NP.fft.fftshift(NP.fft.ifft(csm_cc_vis, axis=1),axes=1) * csm_cc_vis.shape[1] * freq_resolution csm_ccres = NP.fft.fftshift(NP.fft.ifft(csm_cc_vis_res, axis=1),axes=1) * csm_cc_vis.shape[1] * freq_resolution csm_cc_vis_lag = csm_cc_vis_lag + csm_ccres asm_cc_skyvis_lag = DSP.downsampler(asm_cc_skyvis_lag, 1.0*clean_lags.size/ia.lags.size, axis=1) asm_cc_vis_lag = DSP.downsampler(asm_cc_vis_lag, 1.0*clean_lags.size/ia.lags.size, axis=1) dsm_cc_skyvis_lag = DSP.downsampler(dsm_cc_skyvis_lag, 1.0*clean_lags.size/ia.lags.size, axis=1) dsm_cc_vis_lag = DSP.downsampler(dsm_cc_vis_lag, 1.0*clean_lags.size/ia.lags.size, axis=1) csm_cc_skyvis_lag = DSP.downsampler(csm_cc_skyvis_lag, 1.0*clean_lags.size/ia.lags.size, axis=1) csm_cc_vis_lag = DSP.downsampler(csm_cc_vis_lag, 1.0*clean_lags.size/ia.lags.size, axis=1) clean_lags = DSP.downsampler(clean_lags, 1.0*clean_lags.size/ia.lags.size, axis=-1) clean_lags = clean_lags.ravel() vis_noise_lag = NP.copy(ia.vis_noise_lag) vis_noise_lag = vis_noise_lag[truncated_ref_bl_ind,:,:] asm_cc_skyvis_lag = asm_cc_skyvis_lag[truncated_ref_bl_ind,:,:] asm_cc_vis_lag = asm_cc_vis_lag[truncated_ref_bl_ind,:,:] csm_cc_skyvis_lag = csm_cc_skyvis_lag[truncated_ref_bl_ind,:,:] csm_cc_vis_lag = csm_cc_vis_lag[truncated_ref_bl_ind,:,:] dsm_cc_skyvis_lag = dsm_cc_skyvis_lag[truncated_ref_bl_ind,:,:]
latitude=-26.701, A_eff=A_eff, freq_scale='GHz') obs_mode = 'drift' Tsys = 440.0 # in Kelvin t_snap = 60.0 # in seconds t_obs = 0.5 * 3600.0 # in seconds pointing_init = [0.0, intrfrmtr.latitude] lst_init = 0.0 * 15.0 # in degrees intrfrmtr.observing_run(pointing_init, skymod, t_snap, t_obs, chans, bpass, Tsys, lst_init, mode=obs_mode, freq_scale='GHz') intrfrmtr.delay_transform() lags = intrfrmtr.lags vis_lag = intrfrmtr.vis_lag if oversampling_factor > 1.0: lags = DSP.downsampler(intrfrmtr.lags, oversampling_factor) vis_lag = DSP.downsampler(intrfrmtr.vis_lag, oversampling_factor) band_avg_noise_info = intrfrmtr.band_averaged_noise_estimate(filter_method='hpf') freq_diff_noise = intrfrmtr.freq_differenced_noise_estimate() intrfrmtr.save('/data3/t_nithyanandan/project_MWA/MWA_interferometer_'+obs_mode, verbose=True, tabtype='BinTableHDU', overwrite=True) fig = PLT.figure(figsize=(14,14)) ax1 = fig.add_subplot(211) # fig, (ax1, ax2) = PLT.subplots(2,1,figsize=(14,12)) ax1.set_xlabel(r'$\eta$ [$\mu$s]', fontsize=18) ax1.set_ylabel('Amplitude [Jy Hz]', fontsize=18) ax1.set_title('Delay Spectrum', fontsize=18, weight='semibold') ax1.set_yscale('log') ax1.set_xlim(1e6*NP.amin(lags)-1.0, 1e6*NP.amax(lags)+1.0)