Changeset 013adb7 in sasmodels for sasmodels/compare.py
- Timestamp:
- Dec 23, 2015 5:00:04 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 8b25ee1
- Parents:
- e21cc31
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
re21cc31 r013adb7 253 253 cutoff=cutoff) 254 254 255 def compare(opts ):255 def compare(opts, limits=None): 256 256 Nbase, Ncomp = opts['N1'], opts['N2'] 257 257 pars = opts['pars'] … … 292 292 view = opts['view'] 293 293 import matplotlib.pyplot as plt 294 if limits is None: 295 vmin, vmax = np.Inf, -np.Inf 296 if Nbase > 0: 297 vmin = min(vmin, min(base_value)) 298 vmax = max(vmax, max(base_value)) 299 if Ncomp > 0: 300 vmin = min(vmin, min(comp_value)) 301 vmax = max(vmax, max(comp_value)) 302 limits = vmin, vmax 303 294 304 if Nbase > 0: 295 305 if Ncomp > 0: plt.subplot(131) 296 plot_theory(data, base_value, view=view, plot_data=False )306 plot_theory(data, base_value, view=view, plot_data=False, limits=limits) 297 307 plt.title("%s t=%.1f ms"%(base.engine, base_time)) 298 308 #cbar_title = "log I" 299 309 if Ncomp > 0: 300 310 if Nbase > 0: plt.subplot(132) 301 plot_theory(data, comp_value, view=view, plot_data=False )311 plot_theory(data, comp_value, view=view, plot_data=False, limits=limits) 302 312 plt.title("%s t=%.1f ms"%(comp.engine,comp_time)) 303 313 #cbar_title = "log I" … … 327 337 if not opts['explore']: 328 338 plt.show() 339 340 return limits 329 341 330 342 def _print_stats(label, err): … … 626 638 v.range(*parameter_range(k, v.value)) 627 639 else: 628 for k, v in self.pars.items():640 for k, v in pars.items(): 629 641 v.range(*parameter_range(k, v.value)) 630 642 631 643 self.pars = pars 632 644 self.pd_types = pd_types 645 self.limits = None 633 646 634 647 def numpoints(self): … … 654 667 pars.update(self.pd_types) 655 668 self.opts['pars'] = pars 656 compare(self.opts) 669 limits = compare(self.opts, limits=self.limits) 670 if self.limits is None: 671 vmin, vmax = limits 672 vmax = 1.3*vmax 673 vmin = vmax*1e-7 674 self.limits = vmin, vmax 657 675 658 676
Note: See TracChangeset
for help on using the changeset viewer.