Changeset 855546d in sasview for calculatorview


Ignore:
Timestamp:
Jul 14, 2010 4:44:31 PM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
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
Message:

add minus sign to all imaginary part of sld

File:
1 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/perspectives/calculator/sld_panel.py

    r810f196 r855546d  
    55 
    66import wx 
     7import math 
    78import sys 
    89 
     
    117118        boxsizer2.SetMinSize((_STATICBOX_WIDTH,-1)) 
    118119         
    119         i_complex = '+ i' 
     120        i_complex = '- i' 
    120121        neutron_sld_txt = wx.StaticText(self, -1, 'Neutron SLD') 
    121122        self.neutron_sld_reel_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1)) 
     
    264265        """ 
    265266        Get an element and compute the corresponding SLD for a given formula 
     267         
    266268        :param element:  elements a string of existing atom 
     269         
    267270        """ 
    268271        myformula = formula(str(element)) 
     
    345348                            length = neutron_scattering(self.compound, 
    346349                                       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", 
    348351                                                     density=self.density, 
    349352                                            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",  
    351354                                                           density=self.density, 
    352355                                         molecule_formula=self.sld_formula) 
    353356                # set neutron sld values 
    354357                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)) 
    356359                # 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)) 
    359362                # 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)) 
    362365                # set incoherence and absorption 
    363366                self.neutron_inc_ctl.SetValue(format_number(incoh)) 
Note: See TracChangeset for help on using the changeset viewer.