In [63]:
import tables
from plume.prediction import ZeroPredictor
from plume.error_estimation import WRMSE, sample_with_metropolis_hastings
import plume.error_estimation as eest
reload(eest)
Out[63]:
In [2]:
data = tables.open_file('../Data/test_5.0.h5')
with tables.open_file('../Data/test.0.h5') as f:
sources = f.root.sources.read()
In [8]:
from plume.client import TaskPlumeClient
client = TaskPlumeClient()
client.connect_to('127.0.0.1', 10000)
client.init('TaskPlumeSingleSourceGaussianDispersionDefaultControls')
client.reset_seed(142612519)
client.reset()
In [6]:
from plume.recorder import load_obj
import sys
sys.path.append('../plume')
gp = load_obj(data.root.gp)
In [64]:
conf = {
'area': [[-140, 140], [-140, 140], [-80, 0]],
'num_uniform_samples': 1000,
'num_source_samples': 4200,
'mh_stride': 10,
'proposal_std': 10
}
loc = eest.gen_probe_locations(client, conf)
In [66]:
eest.WRMSE()(ZeroPredictor(), loc, np.asarray(client.get_samples(loc)))
Out[66]:
In [67]:
eest.WRMSE()(gp, loc, np.asarray(client.get_samples(loc)))
Out[67]:
In [68]:
scatter(loc[:, 0], loc[:, 1])
Out[68]:
In [ ]: