The main entry points are `fit()` and `plot()`.
"""
def __init__(self, velocity_stream, param_format_string, N=400,
- residual_type='jensen-shannon', plot=True, use_cache=False):
+ manager=None, residual_type='jensen-shannon', plot=True,
+ use_cache=False):
self.experiment_histograms = self.read_force_histograms(velocity_stream)
self.param_format_string = param_format_string
self.residual_type = residual_type
self.N = N
+ self._manager = manager
self.plot = plot
self.sawsim_histogram = sawsim_histogram.SawsimHistogram(
use_cache=self.use_cache)
for velocity,experiment_hist in self.experiment_histograms.iteritems():
sawsim_hist = self.sawsim_histogram(
param_string=self.param_string(params, velocity), N=self.N,
- bin_edges=experiment_hist.bin_edges)
+ bin_edges=experiment_hist.bin_edges, manager=self._manager)
r = experiment_histogram.residual(
sawsim_hist, type=self.residual_type)
residual += r
velocity_file = args[0]
sawsim_histogram.CACHE_DIR = options.cache_dir
+ manager = get_manager(options.manager)()
hm = HistogramMatcher(
file(velocity_file, 'r'), param_format_string=options.param_format,
- N=options.N, residual_type=options.residual,
+ N=options.N, manager=manager, residual_type=options.residual,
plot=options.plot_residuals, use_cache=options.use_cache)
#hm.fit(initial_params)
hm.plot(param_ranges, logx=options.logx, logy=options.logy,