Changeset dbc5dc9b in sasview for calculatorview/src/sans/perspectives/calculator
- Timestamp:
- Dec 21, 2012 10:37:59 AM (12 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- ab7e3a4
- Parents:
- 46be5e6
- Location:
- calculatorview/src/sans/perspectives/calculator
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
calculatorview/src/sans/perspectives/calculator/gen_scatter_panel.py
r46be5e6 rdbc5dc9b 39 39 from sans.perspectives.calculator.load_thread import GenReader 40 40 #import matplotlib.pyplot as plt 41 from mpl_toolkits.mplot3d import Axes3D42 41 from danse.common.plottools.arrow3d import Arrow3D 43 42 #from danse.common.plottools.toolbar import NavigationToolBar … … 141 140 self.omfreader = sans_gen.OMFReader() 142 141 self.sldreader = sans_gen.SLDReader() 142 self.pdbreader = sans_gen.PDBReader() 143 143 self.model = sans_gen.GenSAS() 144 144 self.param_dic = self.model.params … … 428 428 omf_type = self.omfreader.type 429 429 sld_type = self.sldreader.type 430 pdb_type = self.pdbreader.type 430 431 wildcard = [] 431 432 for type in sld_type: … … 433 434 for type in omf_type: 434 435 wildcard.append(type) 436 #for type in pdb_type: 437 # wildcard.append(type) 435 438 wildcard = '|'.join(wildcard) 436 439 dlg = wx.FileDialog(self, "Choose a file", location, … … 465 468 elif self.ext in self.sldreader.ext: 466 469 loader = self.sldreader 470 elif self.ext in self.pdbreader.ext: 471 loader = self.pdbreader 467 472 else: 468 473 loader = None … … 480 485 except: 481 486 self.ext = None 482 raise483 487 if self.parent.parent is None: 484 488 return … … 517 521 self.sld_data = gen.get_magsld() 518 522 elif self.ext in self.sldreader.ext: 523 self.sld_data = data 524 elif self.ext in self.pdbreader.ext: 519 525 self.sld_data = data 520 526 #omf_data = None … … 596 602 logging.error("PlotPanel could not import Axes3D") 597 603 raise 598 604 marker = ',' 605 m_size = 2 606 if output.pix_type != 'pixel': 607 marker = 'o' 608 m_size = 2 599 609 pos_x = output.pos_x 600 610 pos_y = output.pos_y … … 603 613 sld_my = output.sld_my 604 614 sld_mz = output.sld_mz 605 615 606 616 sld_tot = (numpy.fabs(sld_mx) + numpy.fabs(sld_my) + 607 617 numpy.fabs(sld_mz) + numpy.fabs(output.sld_n)) … … 609 619 is_zero = sld_tot == 0.0 610 620 if is_zero.any(): 611 ax.plot(pos_x[is_zero], pos_y[is_zero], pos_z[is_zero], ',', c="y", 612 alpha=0.5, markeredgecolor='y', markersize=3) 621 ax.plot(pos_x[is_zero], pos_y[is_zero], pos_z[is_zero], marker, 622 c="y", alpha=0.5, markeredgecolor='y', 623 markersize=m_size) 613 624 pos_x = pos_x[is_nonzero] 614 625 pos_y = pos_y[is_nonzero] … … 617 628 sld_my = sld_my[is_nonzero] 618 629 sld_mz = sld_mz[is_nonzero] 630 619 631 ax.plot(pos_x, pos_y, 620 pos_z, ',', c="k",621 alpha=0.5, markeredgecolor= 'k', markersize=3)632 pos_z, marker, c="k", 633 alpha=0.5, markeredgecolor="k", markersize=m_size) 622 634 623 635 if has_arrow and len(pos_x) > 0: … … 763 775 self.set_est_time() 764 776 except: 765 flag = _set_error(self, self.npt_ctl)777 flag = _set_error(self, self.npt_ctl) 766 778 try: 767 779 qmax_val = float(self.qmax_ctl.GetValue()) … … 1030 1042 """ 1031 1043 val = 1 1032 for lst in self.stepsize: 1033 val *= float(lst[1].GetValue()) 1044 if self.sld_data.pix_type == 'pixel': 1045 for lst in self.stepsize: 1046 val *= float(lst[1].GetValue()) 1034 1047 1035 1048 return numpy.fabs(val) … … 1365 1378 ctr_list[1].SetValue(format_number(mean_val, True)) 1366 1379 ctr_list[1].Enable(enable) 1380 ctr_list[2].SetLabel("[" + sld_data.sld_unit + "]") 1367 1381 break 1368 1382 … … 1450 1464 npts = -1 1451 1465 break 1452 npts *= int(n_val) 1466 if numpy.isfinite(n_val): 1467 npts *= int(n_val) 1453 1468 if npts > 0: 1454 1469 nop = self.set_npts_from_slddata() … … 1676 1691 return 1677 1692 self.sld_data = data 1678 1679 1693 enable = (not data==None) 1680 #print "main mx", data.sld_mx1681 1694 self._set_omfpanel_sld_data(self.sld_data) 1682 1695 self.omfpanel.bt_save.Enable(enable) … … 1815 1828 frame.Show(True) 1816 1829 except: 1817 raise1818 1830 frame.Destroy() 1819 1831 msg = 'Display Error\n' -
calculatorview/src/sans/perspectives/calculator/load_thread.py
r318b5bbb rdbc5dc9b 3 3 """ 4 4 import time 5 import wx 5 6 from data_util.calcthread import CalcThread 6 7 from sans.dataloader.loader import Loader
Note: See TracChangeset
for help on using the changeset viewer.