import numpy as np from gainData import AntennaBalunMeasurement as ABM from gainData import AntennaDiffMeasurement as ADM from gainData import GainData as GD import matplotlib.pyplot as plt #load measurements hybrid_coupler_A = ABM() hybrid_coupler_B = ABM() cambridge_balun = ABM() no_balun = ADM() hybrid_coupler_A.read_files('../Rooftop_Antenna_Measurements_August_10th/', '_hybrid_A_port_A_antenna_', '../hybrid_coupler_A_Sierra/A_', '_', 'ANRITSU_CSV', '1', '3', '4', 0.05, 0.25) hybrid_coupler_B.read_files('../Rooftop_Antenna_Measurements_August_10th/', '_hybrid_B_port_A_antenna_', '../hybrid_coupler_B/1', '_', 'ANRITSU_CSV', '1', '3', '4', 0.05, 0.25) cambridge_balun.read_files('../Rooftop_Antenna_Measurements_August_10th/', '_cambridge_balun_N_antenna_0_', '../Cambridge_Balun_Measurements_N/', '_', 'ANRITSU_CSV', '1', '2', '3', 0.05, 0.25) no_balun.read_files('../Rooftop_Antenna_Measurements_August_10th/', '_no_balun_antenna_', 'ANRITSU_CSV', 0.05, 0.25) simulation = GD() simulation.read_files( '../Rooftop_Antenna_Measurements_August_10th/Simulation/simulation_s11_rooftop',
'1','3','4',0.05,0.25) measurements.append(hc) elif 'B' in balun: hc=ABM() hc.read_files(prefix,postfix, '../hybrid_coupler_B/1','','ANRITSU_CSV', '1','3','4',0.05,0.25) measurements.append(hc) elif 'C' in balun: hc=ABM() hc.read_files(data,'_cambridge_balun_N_antenna_0','', '../Cambridge_Balun_Measurements_N/','','ANRITSU_CSV', '1','2','3',0.05,0.25) measurements.append(hc) elif 'N' in balun: nb=ADM() nb.read_files(data,'ANRITSU_CSV',0.05,0.25) measurements.append(nb) else: print('No valid balun option provided. Exiting...') exit() if simfile: simulation=GD() simulation.read_files(simfile,'CST_S11',fMin=0.05,fMax=0.25) simulations.append(simulation)
db_s11 = 10. * np.log10(np.abs(balunmeas.antenna_gain_frequency)) db_s11_ucorr = 10. * np.log10( np.abs(balunmeas.antenna_raw.gainFrequency)) pha_s11 = np.angle(balunmeas.antenna_gain_frequency) pha_s11_ucorr = np.angle(balunmeas.antenna_raw.gainFrequency) x = balunmeas.fAxis elif domain == 'delay': db_s11 = 10. * np.log10(np.abs(balunmeas.antenna_gain_delay)) db_s11_ucorr = 10. * np.log10( np.abs(balunmeas.antenna_raw.gainDelay)) pha_s11 = np.angle(balunmeas.antenna_gain_delay) pha_s11_ucorr = np.angle(balunmeas.antenna_raw.gainDelay) x = balunmeas.tAxis elif meastype == 'differential': no_balun = ADM() no_balun.read_files(prefix, postfix, filetype, fmin, fmax) if domain == 'freq': db_s11 = 10. * np.log10(np.abs(no_balun.antenna_gain_frequency)) pha_s11 = np.angle(no_balun.antenna_gain_frequency) x = no_balun.fAxis elif domain == 'delay': db_s11 = 10. * np.log10(np.abs(no_balun.antenna_gain_delay)) pha_s11 = np.angle(no_balun.antenna_gain_delay) ax1.plot(x, db_s11, linestyle=ls, color=color, lw=int(lw), label=label) ax2.plot(x, pha_s11, linestyle=ls, color=color, lw=int(lw), label=label) ax1.grid() fig1.set_size_inches(10, 6) if domain == 'freq': ax1.set_xlabel('frequency (GHz)')
db_s11 = 10. * np.log10(np.abs(balunmeas.antenna_gain_frequency)) db_s11_ucorr = 10. * np.log10( np.abs(balunmeas.antenna_raw.gainFrequency)) pha_s11 = np.angle(balunmeas.antenna_gain_frequency) pha_s11_ucorr = np.angle(balunmeas.antenna_raw.gainFrequency) x = balunmeas.fAxis elif domain == 'delay': db_s11 = 10. * np.log10(np.abs(balunmeas.antenna_gain_delay)) db_s11_ucorr = 10. * np.log10( np.abs(balunmeas.antenna_raw.gainDelay)) pha_s11 = np.angle(balunmeas.antenna_gain_delay) pha_s11_ucorr = np.angle(balunmeas.antenna_raw.gainDelay) x = balunmeas.tAxis elif meastype == 'differential': no_balun = ADM() no_balun.read_files(prefix, postfix, filetype, fmin, fmax, changeZ=changez, z0=zi, z1=zf) if domain == 'freq': db_s11 = 10. * np.log10(np.abs(no_balun.antenna_gain_frequency)) pha_s11 = np.angle(no_balun.antenna_gain_frequency) x = no_balun.fAxis elif domain == 'delay': db_s11 = 10. * np.log10(np.abs(no_balun.antenna_gain_delay)) pha_s11 = np.angle(no_balun.antenna_gain_delay)
import numpy as np from gainData import AntennaBalunMeasurement as ABM from gainData import AntennaDiffMeasurement as ADM from gainData import GainData as GD import matplotlib.pyplot as plt #load measurements hybrid_coupler_A=ABM() hybrid_coupler_B=ABM() cambridge_balun=ABM() no_balun=ADM() hybrid_coupler_A.read_files('../August29thFeedOnlySinuous/','_a_', '../hybrid_coupler_A_Sierra/A_','_','ANRITSU_CSV', '1','3','4',0.05,0.25) hybrid_coupler_B.read_files('../August29thFeedOnlySinuous/','_b_', '../hybrid_coupler_B/1','_','ANRITSU_CSV', '1','3','4',0.05,0.25) #cambridge_balun.read_files('../GreenBankMeasurements_FeedOnly_August_28th_2017/','_30-175-0.8-230-0.99-50-C-', # '../Cambridge_Balun_Measurements_N/','_','ANRITSU_CSV', # '1','2','3',0.05,0.25) no_balun.read_files('../August29thFeedOnlySinuous/','_no_','ANRITSU_CSV',0.05,0.25) simulation=GD() simulation.read_files('../Rooftop_Antenna_Measurements_August_10th/Simulation/simulation_s11_rooftop','CST_S11',fMin=0.05,fMax=0.25) simulation.gainFrequency=simulation.gainFrequency #load Jianshu's data ''' impedance_sim_amp=np.loadtxt(('../Rooftop_Antenna_Measurements_August_10th/'