def main(): datestr = get_datestr() logfn = 'autosweepslowchirp_%s.txt'%datestr logfile = open(logfn,'w') for power in powers: for txgain in txgains: datestr = get_datestr() temp = adr.get_temp() logentry = 'acquire %s %f %f %f %f %f'%(datestr,temp,txgain,power,delta_power,chop_freq) acquireboth(datestr,power,txgain) print logentry print>>logfile,logentry logfile.flush()
def main(): datestr = get_datestr() logfn = 'autosweepslowchirp_%s.txt' % datestr logfile = open(logfn, 'w') for vdc in vdcs: for txgain in txgains: datestr = get_datestr() acquireboth(datestr, vdc, txgain) temp = adr.get_temp() logentry = 'acquire %s %f %f %f' % (datestr, temp, txgain, vdc) print logentry print >> logfile, logentry logfile.flush()
datestr = now.strftime('%Y%m%d_%H%M%S') return datestr datestr = get_datestr() logfn = datestr + '_log.txt' logf = open(logfn, 'w') # Record variance in timestream with time and temperature of cold stage # Slowly change the cold stage temperature to measure the cold amp noise temp usrp = uhd.usrp.MultiUSRP("type=x300,addr=192.168.40.2") while True: t = time.time() temp = adr.get_temp() z = usrp.recv_num_samps(nt, freq, rate, channels, gain)[0] z = z[nt / 2:] z *= 32767 fs, psd = signal.welch(z, fs=rate * 1e-6, nperseg=1024, detrend='linear') fs = np.fft.fftshift(fs) psd = np.fft.fftshift(psd) ok = (fmin < np.abs(fs)) & (np.abs(fs) < fmax) meanpsd = np.sum(psd * ok) print t, temp, meanpsd print >> logf, t, temp, meanpsd logf.flush() sys.stdout.flush() time.sleep(10.)