def simSuite(taus=[2.0],harms=[3],periods=[1.5e-3],snrs=[10], maxfun = 5): np.random.seed(42) # seed the random number generator - Dan - 2012-11-18 for tau in taus: for harm in harms: for period in periods: for snr in snrs: prof = makeProfile(harm) ht = makeht(tau, nlag=2048) CS = initSim(ht,prof,ref_freq=1/period,bw=1.0,noise=snr,source = ('tau_%.1f_nharm_%d_period_%.2f_snr_%.3f' % (tau,harm,period*1000.,snr))) CS.initProfile() CS.pp_meas = CS.pp_ref.copy() CS.pp_ref = prof CS.ph_ref = pycyc.phase2harm(CS.pp_ref) CS.ph_ref = pycyc.normalize_profile(CS.ph_ref) CS.ph_ref[0] = 0 CS.s0 = CS.ph_ref.copy() CS.plotdir = '.' CS.pharm = harm CS.tau = tau CS.noise = snr CS.loop(make_plots=False,maxfun=maxfun) CS.noise = snr CS.saveState(os.path.join(CS.plotdir,'cs_' + CS.source + '.pkl')) pycyc.plotSimulation(CS)
def simSuite(taus=[2.0], harms=[3], periods=[1.5e-3], snrs=[10], maxfun=5): np.random.seed(42) # seed the random number generator - Dan - 2012-11-18 for tau in taus: for harm in harms: for period in periods: for snr in snrs: prof = makeProfile(harm) ht = makeht(tau, nlag=2048) CS = initSim( ht, prof, ref_freq=1 / period, bw=1.0, noise=snr, source=('tau_%.1f_nharm_%d_period_%.2f_snr_%.3f' % (tau, harm, period * 1000., snr))) CS.initProfile() CS.pp_meas = CS.pp_ref.copy() CS.pp_ref = prof CS.ph_ref = pycyc.phase2harm(CS.pp_ref) CS.ph_ref = pycyc.normalize_profile(CS.ph_ref) CS.ph_ref[0] = 0 CS.s0 = CS.ph_ref.copy() CS.plotdir = '.' CS.pharm = harm CS.tau = tau CS.noise = snr CS.loop(make_plots=False, maxfun=maxfun) CS.noise = snr CS.saveState( os.path.join(CS.plotdir, 'cs_' + CS.source + '.pkl')) pycyc.plotSimulation(CS)
def simSuite(taus=[2.0,10.0,100.0],harms=[3,10],periods=[1.5e-3,4e-3,10e-3],snrs=[10,100], maxfun = 100): for tau in taus: for harm in harms: for period in periods: for snr in snrs: prof = makeProfile(harm) ht = makeht(tau, nlag=2048) CS = initSim(ht,prof,ref_freq=1/period,bw=1.0,noise=snr,source = ('tau_%.1f_nharm_%d_period_%.2f_snr_%.3f' % (tau,harm,period*1000.,snr))) CS.initProfile() CS.pp_meas = CS.pp_ref.copy() CS.pp_ref = prof CS.ph_ref = pycyc.phase2harm(CS.pp_ref) CS.ph_ref = pycyc.normalize_profile(CS.ph_ref) CS.ph_ref[0] = 0 CS.s0 = CS.ph_ref.copy() CS.plotdir = '/home/gjones/workspace/pycyc/simsuite' CS.pharm = harm CS.tau = tau CS.noise = snr CS.loop(make_plots=False,maxfun=maxfun) CS.noise = snr CS.saveState(os.path.join(CS.plotdir,'cs_' + CS.source + '.pkl')) pycyc.plotSimulation(CS)
def replotSims(simdir = '.'): sims = glob.glob(os.path.join(simdir, 'cs_*.pkl')) for sim in sims: cs = pycyc.loadCyclicSolver(sim) pycyc.plotSimulation(cs)
def replotSims(simdir='.'): sims = glob.glob(os.path.join(simdir, 'cs_*.pkl')) for sim in sims: cs = pycyc.loadCyclicSolver(sim) pycyc.plotSimulation(cs)
def replotSims(simdir = '/home/gjones/workspace/pycyc/simsuite'): sims = glob.glob(os.path.join(simdir, 'cs_*.pkl')) for sim in sims: cs = pycyc.loadCyclicSolver(sim) pycyc.plotSimulation(cs)