Changeset 855546d in sasview for calculatorview
- Timestamp:
- Jul 14, 2010 4:44:31 PM (14 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:
- 4e1c362
- Parents:
- f9353c3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
calculatorview/perspectives/calculator/sld_panel.py
r810f196 r855546d 5 5 6 6 import wx 7 import math 7 8 import sys 8 9 … … 117 118 boxsizer2.SetMinSize((_STATICBOX_WIDTH,-1)) 118 119 119 i_complex = ' +i'120 i_complex = '- i' 120 121 neutron_sld_txt = wx.StaticText(self, -1, 'Neutron SLD') 121 122 self.neutron_sld_reel_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) … … 264 265 """ 265 266 Get an element and compute the corresponding SLD for a given formula 267 266 268 :param element: elements a string of existing atom 269 267 270 """ 268 271 myformula = formula(str(element)) … … 345 348 length = neutron_scattering(self.compound, 346 349 self.density, self.wavelength) 347 Cu_reel, Cu_im = self.calculate_sld_helper(element="Cu",350 cu_real, cu_im = self.calculate_sld_helper(element="Cu", 348 351 density=self.density, 349 352 molecule_formula=self.sld_formula) 350 Mo_reel, Mo_im = self.calculate_sld_helper(element="Mo",353 mo_real, mo_im = self.calculate_sld_helper(element="Mo", 351 354 density=self.density, 352 355 molecule_formula=self.sld_formula) 353 356 # set neutron sld values 354 357 self.neutron_sld_reel_ctl.SetValue(format_number(sld_real * _SCALE)) 355 self.neutron_sld_im_ctl.SetValue(format_number( sld_im* _SCALE))358 self.neutron_sld_im_ctl.SetValue(format_number(math.fabs(sld_im) * _SCALE)) 356 359 # Compute the Cu SLD 357 self.cu_ka_sld_reel_ctl.SetValue(format_number( Cu_reel *_SCALE))358 self.cu_ka_sld_im_ctl.SetValue(format_number( Cu_im* _SCALE))360 self.cu_ka_sld_reel_ctl.SetValue(format_number(cu_real *_SCALE)) 361 self.cu_ka_sld_im_ctl.SetValue(format_number(math.fabs(cu_im )* _SCALE)) 359 362 # Compute the Mo SLD 360 self.mo_ka_sld_reel_ctl.SetValue(format_number( Mo_reel *_SCALE))361 self.mo_ka_sld_im_ctl.SetValue(format_number( Mo_im* _SCALE))363 self.mo_ka_sld_reel_ctl.SetValue(format_number(mo_real *_SCALE)) 364 self.mo_ka_sld_im_ctl.SetValue(format_number(math.fabs(mo_im)* _SCALE)) 362 365 # set incoherence and absorption 363 366 self.neutron_inc_ctl.SetValue(format_number(incoh))
Note: See TracChangeset
for help on using the changeset viewer.