Esempio n. 1
0
parser.add_argument('--fmax','-u',dest='fmax',
                    help=('upper frequency in GHz'))
parser.add_argument('--output','-o',dest='output',
                    help=('name of output file'))

args=parser.parse_args()
znot=args.znot
snot=args.snot
isant=args.isant
ftype=args.filetype
if isant=="True":
    isant=True
else:
    isant=False
if not("s1p" in znot or 'z1p' in znot or "txt" in znot):
    znot=float(znot)
g=gd.GainData()
g.read_files(snot,ftype,float(args.fmin),float(args.fmax))
zout=g.get_impedance(znot,isant=isant)
fout=g.fAxis
f=open(args.output,'wb')
f.write(('! Touchstone file spoofed by extract_impedance.py \n'
         '! Z11=%s \n'
         '! S11=%s \n'
         '! Tree Item\n'
         '# MHZ Z RI R 1 \n')%(znot,snot))
for chan in range(fout.shape[0]):
    f.write('%.5f\t%.5f\t%.5f\n'%(fout[chan],zout[chan].real,zout[chan].imag))
f.close()

    for Outer_Diameter in Outer_Diameter_List:

        #fileNameTimeTraceCST='../Results/Sinuous_Antenna/TimeDomain_0.65-30-325-MP9.txt'
        #fileNameS11CST='../Results/Sinuous_Antenna/S11_0.65-30-325-MP9'
        fileNameTimeTraceCST = '/Users/JianshuLi/Documents/Miracle/Research/Cosmology/21cm Cosmology/Results/Sinuous_Antenna/TimeDomain_0.%i-%i-%i.txt' % (
            Growth_Rate, Inner_Diameter, Outer_Diameter)
        fileNameS11CST = '/Users/JianshuLi/Documents/Miracle/Research/Cosmology/21cm Cosmology/Results/Sinuous_Antenna/S11_0.%i-%i-%i' % (
            Growth_Rate, Inner_Diameter, Outer_Diameter)
        #fileNameS11VNA='../reflectometry/RichBradley_GreenBank/TallCylinderGapOverDish_S11_Greenbank_RichBradley.d1'

        FLOW = 0.05
        FHIGH = 0.25

        gainData_timeTrace = gainData.GainData(
            fileNameTimeTraceCST,
            fileType='CST_TimeTrace',
            fMin=FLOW,
            fMax=FHIGH,
            comment='s11 derived from cst time domain data')
        gainData_cst = gainData.GainData(
            fileNameS11CST,
            fileType='CST_S11',
            fMin=FLOW,
            fMax=FHIGH,
            comment='s11 obtained directly from cst')
        #gainData_vna=gainData.GainData(fileNameS11VNA,
        #							   fileType='VNAHP_S11',
        #							   fMin=FLOW,fMax=FHIGH,
        #							   comment='s11 obtained from richs vna measurement')

        print gainData_cst.gainFrequency.shape
Esempio n. 3
0
import numpy as n
import matplotlib.pyplot as p
import gainData as gainData

fileNameTimeTraceCST = '../cst/TallCylinderGapFeedOnly/TallCylinderGapFeedOnly_TerminalExcitation_timetrace.txt'
fileNameS11VNA = '../reflectometry/RichBradley_GreenBank/TallCylinderGap_S11_Greenbank_RichBradley.d1'
fileNameS11CST = '../cst/TallCylinderGapFeedOnly/TallCylinderGapFeedOnly_S11'

FLOW = 0.1
FHIGH = 0.2

gainData_timeTrace = gainData.GainData(
    fileNameTimeTraceCST,
    fileType='CST_TimeTrace',
    fMin=FLOW,
    fMax=FHIGH,
    comment='s11 derived from cst time domain data',
    filterNegative=True)
gainData_cst = gainData.GainData(fileNameS11CST,
                                 fileType='CST_S11',
                                 fMin=FLOW,
                                 fMax=FHIGH,
                                 comment='s11 obtained directly from cst',
                                 filterNegative=True)
gainData_vna = gainData.GainData(
    fileNameS11VNA,
    fileType='VNAHP_S11',
    fMin=FLOW,
    fMax=FHIGH,
    comment='s11 obtained from richs vna measurement',
    filterNegative=True)