import matplotlib.pyplot as plt

import time
import Lorentzian_fit as LF
from qinfer.expdesign import ExperimentDesigner
import os
import logging

log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)

model = T1Model()
prior = UniformDistribution([0, 100])
N_particles=100000
updater = SMCUpdater(model, N_particles, prior, resampler=LiuWestResampler(0.98),zero_weight_policy='reset')
designer=ExperimentDesigner(updater,opt_algo=1)

#Set the value of T1 to Learn, pick 1 value from prior 
#true_model=prior.sample()
true_model=np.array([6.8], dtype=model.expparams_dtype)

performance_dtype = [
    ('expparams', 'float'),
    ('sim_outcome', 'float'),
    ('est_mean', 'float'),
    ('covariance', 'float'),
    
]

#NMR EXPERIMENT Initialization*******************************
#going to normalize Mo max of 1. 
import numpy as np
import matplotlib.pyplot as plt
from qinfer.expdesign import ExperimentDesigner
import logging

log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)

model = T1Model()
prior = UniformDistribution(np.array([0, 10]))
N_particles = 1000000
updater = SMCUpdater(
        model, N_particles, prior, resampler=LiuWestResampler(),
        zero_weight_policy='reset'
)
designer = ExperimentDesigner(updater, opt_algo=1)

# Set the value of T1 to Learn, pick 1 value from prior
true_model = prior.sample()
# true_model=np.array([11.032], dtype=model.expparams_dtype)

performance_dtype = [
    ('expparams', 'float'),
    ('sim_outcome', 'float'),
    ('est_mean', 'float'),
]

# NMR EXPERIMENT Initialization*******************************
# going to normalize Mo max of 1.
# model.Mo=float(raw_input('Please enter Mo: '))
# dummy=float(raw_input('Waiting for Mo: '))