Changeset 3657667 in sasview for calculatorview/src
- Timestamp:
- Jan 12, 2013 2:45:21 PM (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:
- 5917637
- Parents:
- 3540156
- Location:
- calculatorview/src/sans/perspectives/calculator
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
calculatorview/src/sans/perspectives/calculator/gen_scatter_panel.py
r3540156 r3657667 131 131 self.file_name = '' 132 132 self.time_text = None 133 self.orient_combo = None 133 134 self.omfreader = sans_gen.OMFReader() 134 135 self.sldreader = sans_gen.SLDReader() … … 290 291 self.parent.set_omfpanel_default_shap(self.default_shape) 291 292 self.parent.set_omfpanel_npts() 293 294 def _fill_orient_combo(self): 295 """ 296 Fill up the orientation combo box: used only for atomic structure 297 """ 298 orient_combo = wx.ComboBox(self, -1, size=(150, -1), 299 style=wx.CB_READONLY) 300 orient_combo.Append('Fixed orientation') 301 orient_combo.Append('No orientation ') 302 303 orient_combo.Bind(wx.EVT_COMBOBOX, self._on_orient_select) 304 orient_combo.SetSelection(0) 305 return orient_combo 306 307 def _on_orient_select(self, event): 308 """ 309 On selecting a orientation 310 """ 311 event.Skip() 312 cb = event.GetEventObject() 313 is_avg = cb.GetCurrentSelection() == 1 314 self.model.set_is_avg(is_avg) 292 315 293 316 def _layout_qrange(self): … … 339 362 self.est_time = '*Estimated Computation time : %s sec' 340 363 self.time_text = wx.StaticText(self, -1, self.est_time% str(2) ) 364 self.orient_combo = self._fill_orient_combo() 365 self.orient_combo.Show(False) 341 366 self.bt_compute = wx.Button(self, wx.NewId(),'Compute') 342 367 self.bt_compute.Bind(wx.EVT_BUTTON, self.on_compute) 343 368 self.bt_compute.SetToolTipString("Compute 2D Scattering Pattern.") 344 369 self.button_sizer.AddMany([(self.time_text , 0, wx.LEFT, 20), 345 (self.bt_compute, 0, wx.LEFT, 190)]) 370 (self.orient_combo , 0, wx.LEFT, 20), 371 (self.bt_compute, 0, wx.LEFT, 20)]) 346 372 347 373 def estimate_ctime(self): 348 374 """ 375 Calculation time estimation 349 376 """ 350 377 n_qbins = float(self.npt_ctl.GetValue()) … … 366 393 def _do_layout(self): 367 394 """ 368 395 Draw window content 369 396 """ 370 397 self._define_structure() … … 513 540 self.data_name_tcl.SetValue(str(filename)) 514 541 self.file_name = filename.split('.')[0] 542 self.orient_combo.SetSelection(0) 515 543 if self.ext in self.omfreader.ext: 516 544 gen = sans_gen.OMF2SLD() … … 526 554 else: 527 555 raise 556 self.orient_combo.Show(is_pdbdata) 557 self.button_sizer.Layout() 528 558 self._set_sld_data_helper(True) 529 559 except: … … 547 577 Set sld data helper 548 578 """ 579 is_avg = self.orient_combo.GetCurrentSelection() == 1 580 self.model.set_is_avg(is_avg) 549 581 self.model.set_sld_data(self.sld_data) 550 582 self.draw_button.Enable(self.sld_data!=None) … … 606 638 marker = ',' 607 639 m_size = 2 608 if output.pix_type != 'pixel':640 if output.pix_type == 'atom': 609 641 marker = 'o' 610 m_size = 2642 m_size = 3.5 611 643 pos_x = output.pos_x 612 644 pos_y = output.pos_y … … 614 646 sld_mx = output.sld_mx 615 647 sld_my = output.sld_my 616 sld_mz = output.sld_mz 648 sld_mz = output.sld_mz 649 pix_symbol = output.pix_symbol 617 650 618 651 sld_tot = (numpy.fabs(sld_mx) + numpy.fabs(sld_my) + … … 632 665 sld_my = sld_my[is_nonzero] 633 666 sld_mz = sld_mz[is_nonzero] 634 667 pix_symbol = output.pix_symbol[is_nonzero] 635 668 # Plot selective points in color 636 other_color = numpy.ones(len( output.pix_symbol), dtype='bool')669 other_color = numpy.ones(len(pix_symbol), dtype='bool') 637 670 for key in color_dic.keys(): 638 chosen_color = output.pix_symbol == key671 chosen_color = pix_symbol == key 639 672 if numpy.any(chosen_color): 640 673 other_color = other_color & (chosen_color != True) … … 1574 1607 """ 1575 1608 def __init__(self, parent=None, title="Generic Scattering Calculator", 1576 size=(PANEL_WIDTH * 1.3, PANEL_HEIGHT * 1.5 5), *args, **kwds):1609 size=(PANEL_WIDTH * 1.3, PANEL_HEIGHT * 1.57), *args, **kwds): 1577 1610 """ 1578 1611 Init -
calculatorview/src/sans/perspectives/calculator/media/gen_sans_help.html
rdbc01f2 r3657667 25 25 </p> 26 26 <br> 27 for β<sub>j</sub> ≠ 0 where v<sub>j</sub> is the volume of the j'th pixel. 27 for β<sub>j</sub> ≠ 0 where v<sub>j</sub> is the volume of the j'th pixel 28 (or the j'th natural atomic volume (= atomic mass/natural molar density/Abogadro number) 29 for the atomic structures given by a pdb file). 28 30 <br> 29 31 The scattering length density (SLD) of each pixel where the SLD is uniform, is a combination of the nuclear and magnetic SLDs
Note: See TracChangeset
for help on using the changeset viewer.