Changeset ac7be54 in sasview
- Timestamp:
- May 8, 2015 2:27:08 PM (10 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:
- 5e880fe1
- Parents:
- c22c5e3
- Location:
- src/sas
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/calculator/sas_gen.py
rb6627d9 rac7be54 197 197 """ 198 198 Evaluate a distribution of q-values. 199 * For 1D, a numpy array is expected as input: 200 evalDistribution(q) where q is a numpy array. 201 * For 2D, a list of numpy arrays are expected: 202 [qx_prime,qy_prime], where 1D arrays. 203 :param qdist: ndarray of scalar q-values or list [qx,qy] 204 where qx,qy are 1D ndarrays 199 200 :param qdist: ndarray of scalar q-values (for 1D) or list [qx,qy] 201 where qx,qy are 1D ndarrays (for 2D). 205 202 """ 206 203 if qdist.__class__.__name__ == 'list': … … 911 908 912 909 def set_sldms(self, sld_mx, sld_my, sld_mz): 913 """914 Sets ( |m|, m_theta, m_phi)910 r""" 911 Sets (\|m\|, m_theta, m_phi) 915 912 """ 916 913 if sld_mx.__class__.__name__ == 'float': -
src/sas/data_util/formatnum.py
r79492222 rac7be54 4 4 Format values and uncertainties nicely for printing. 5 5 6 :func:`format_uncertainty_pm` (v,err)produces the expanded format v +/- err.7 8 :func:`format_uncertainty_compact` (v,err)produces the compact format v(##),6 :func:`format_uncertainty_pm` produces the expanded format v +/- err. 7 8 :func:`format_uncertainty_compact` produces the compact format v(##), 9 9 where the number in parenthesis is the uncertainty in the last two digits of v. 10 10 11 :func:`format_uncertainty` (v,err)uses the compact format by default, but this11 :func:`format_uncertainty` uses the compact format by default, but this 12 12 can be changed to use the expanded +/- format by setting 13 13 format_uncertainty.compact to False. -
src/sas/data_util/uncertainty.py
r79492222 rac7be54 1 """ 2 3 Uncertainty propagation class, and log() and exp() functions. 1 r""" 2 Uncertainty propagation class for arithmetic, log and exp. 4 3 5 4 Based on scalars or numpy vectors, this class allows you to store and 6 5 manipulate values+uncertainties, with propagation of gaussian error for 7 addition, subtraction, multiplication, division, power, exp () and log().6 addition, subtraction, multiplication, division, power, exp and log. 8 7 9 8 Storage properties are determined by the numbers used to set the value … … 11 10 for inplace operations since numpy does not do automatic type conversion. 12 11 Normal operations can use mixed integer and floating point. In place 13 operations (a *= b, etc.)create at most one extra copy for each operation.14 c = a*b by contrastuses four intermediate vectors, so shouldn't be used12 operations such as *a \*= b* create at most one extra copy for each operation. 13 By contrast, *c = a\*b* uses four intermediate vectors, so shouldn't be used 15 14 for huge arrays. 16 15 """ -
src/sas/guiframe/gui_manager.py
r765e47c rac7be54 570 570 def on_batch_selection(self, event=None): 571 571 """ 572 :param event: contains parameter enable . when enable is set to True573 the application is in Batch mode574 else the application is default mode(single mode)572 :param event: contains parameter enable. When enable is set to True 573 the application is in Batch mode otherwise the application is 574 in Single mode. 575 575 """ 576 576 if event is not None: … … 2898 2898 2899 2899 :param name: window_name in AuiPaneInfo 2900 : 2900 :return: AuiPaneInfo of the name 2901 2901 """ 2902 2902 for panel in self.plot_panels.values(): -
src/sas/guiframe/gui_statusbar.py
r4342107f rac7be54 22 22 CONSOLE_WIDTH = 500 23 23 CONSOLE_HEIGHT = 300 24 FRAME_ICON = wx.Icon(GUIFRAME_ICON.FRAME_ICON_PATH, wx.BITMAP_TYPE_ICO)25 24 26 25 if sys.platform.count("win32") > 0: … … 186 185 except: 187 186 try: 187 FRAME_ICON = wx.Icon(GUIFRAME_ICON.FRAME_ICON_PATH, 188 wx.BITMAP_TYPE_ICO) 188 189 self.frame.SetIcon(FRAME_ICON) 189 190 except: -
src/sas/guiframe/local_perspectives/plotting/graphAppearance.py
rb5de88e rac7be54 5 5 Dialog for general graph appearance 6 6 7 8 /** 9 This software was developed by Institut Laue-Langevin as part of 10 Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 11 12 Copyright 2012 Institut Laue-Langevin 13 14 **/ 15 16 7 This software was developed by Institut Laue-Langevin as part of 8 Distributed Data Analysis of Neutron Scattering Experiments (DANSE). 9 10 Copyright 2012 Institut Laue-Langevin 17 11 """ 18 12 -
src/sas/guiframe/panel_base.py
r79492222 rac7be54 61 61 def on_batch_selection(self, event): 62 62 """ 63 :param event: contains parameter enable . when enable is set to True64 the application is in Batch mode65 else the application is default mode(single mode)63 :param event: contains parameter enable. When enable is set to True 64 the application is in Batch mode otherwise the application is 65 in Single mode. 66 66 """ 67 67 self.batch_on = event.enable … … 69 69 """ 70 70 return an xml node containing state of the panel 71 71 that guiframe can write to file 72 72 """ 73 73 return None -
src/sas/models/BEPolyelectrolyte.py
r79492222 rac7be54 1 """ 2 Provide F(x) = K*1/(4*pi*Lb*(alpha)^(2))*(q^(2)+k2)/(1+(r02)^(2))*(q^(2)+k2)\ 3 *(q^(2)-(12*h*C/b^(2))) 1 """ 4 2 BEPolyelectrolyte as a BaseComponent model 5 3 """ … … 12 10 Class that evaluates a BEPolyelectrolyte. 13 11 14 F(x) = K *1/(4*pi*Lb*(alpha)^(2))*(q^(2)+k2)/(1+(r02)^(2))*(q^(2)+k2)\15 *(q^(2)-(12*h*C/b^(2)))12 F(x) = K/(4 pi Lb (alpha)^(2)) (q^(2)+k2)/(1+(r02)^(2)) (q^(2)+k2)\ 13 (q^(2)-(12 h C/b^(2))) 16 14 17 The model has Eight parameters: 18 K = Constrast factor of the polymer 19 Lb = Bjerrum length 20 H = virial parameter 21 B = monomer length 22 Cs = Concentration of monovalent salt 23 alpha = ionazation degree 15 The model has Eight parameters:: 16 17 K = Constrast factor of the polymer 18 Lb = Bjerrum length 19 H = virial parameter 20 B = monomer length 21 Cs = Concentration of monovalent salt 22 alpha = ionazation degree 24 23 C = polymer molar concentration 25 24 bkd = background … … 75 74 """ 76 75 Evaluate 77 F(x) = K *1/(4*pi*Lb*(alpha)^(2))*(q^(2)+k2)/(1+(r02)^(2))78 *(q^(2)+k2)*(q^(2)-(12*h*C/b^(2)))76 F(x) = K 1/(4 pi Lb (alpha)^(2)) (q^(2)+k2)/(1+(r02)^(2)) 77 (q^(2)+k2) (q^(2)-(12 h C/b^(2))) 79 78 80 79 has 3 internal parameters : 81 The inverse Debye Length: K2 = 4 *pi*Lb*(2*Cs+alpha*C)82 r02 =1/alpha/Ca^(0.5) *(B/(48*pi*Lb)^(0.5))83 Ca = C*6.022136e-480 The inverse Debye Length: K2 = 4 pi Lb (2 Cs+alpha C) 81 r02 =1/alpha/Ca^(0.5) (B/(48 pi Lb)^(0.5)) 82 Ca = 6.022136e-4 C 84 83 """ 85 84 Ca = self.params['c'] * 6.022136e-4 -
src/sas/models/CoreMultiShellModel.py
r79492222 rac7be54 170 170 171 171 : return: (r, beta) where r is a list of radius of the transition points 172 beta is a list of the corresponding SLD values173 : Note: This works only for func_shell #= 2.172 beta is a list of the corresponding SLD values 173 : Note: This works only for func_shell num = 2. 174 174 """ 175 175 r = [] -
src/sas/models/GuinierPorodModel.py
r79492222 rac7be54 1 1 """ 2 I(q) = scale/q^s* exp ( - R_g^2 q^2 / (3-s) ) for q<= ql 3 = scale/q^m*exp((-ql^2*Rg^2)/(3-s))*ql^(m-s) for q>=ql 4 Guinier function as a BaseComponent model 2 Guinier function as a BaseComponent model 5 3 """ 6 4 from sas.models.BaseComponent import BaseComponent … … 11 9 Class that evaluates a GuinierPorod model. 12 10 13 I(q) = scale/q^s* exp ( - R_g^2 q^2 / (3-s) ) for q<= ql 14 = scale/q^m*exp((-ql^2*Rg^2)/(3-s))*ql^(m-s) for q>=ql 11 Calculate:: 12 13 I(q) = scale/q^s exp(-q^2 Rg^2 / (3-s) ) for q<= ql 14 I(q) = scale/q^m exp(-ql^2 Rg^2 / (3-s)) ql^(m-s) for q>=ql 15 15 """ 16 16 def __init__(self): -
src/sas/models/MultiplicationModel.py
r79492222 rac7be54 5 5 #from sas.models.pluginmodel import Model1DPlugin 6 6 class MultiplicationModel(BaseComponent): 7 """8 Use for P(Q) *S(Q); function call must be in the order of P(Q) and then S(Q):7 r""" 8 Use for P(Q)\*S(Q); function call must be in the order of P(Q) and then S(Q): 9 9 The model parameters are combined from both models, P(Q) and S(Q), except 1) 'effect_radius' of S(Q) 10 10 which will be calculated from P(Q) via calculate_ER(), … … 109 109 : return: (r, beta) where r is a list of radius of the transition points 110 110 beta is a list of the corresponding SLD values 111 : Note: This works only for func_shell #= 2 (exp function).111 : Note: This works only for func_shell num = 2 (exp function). 112 112 """ 113 113 try: -
src/sas/models/PeakGaussModel.py
r79492222 rac7be54 1 1 #!/usr/bin/env python 2 2 """ 3 Model describes a Gaussian shaped peak including a flat background 4 Provide F(q) = scale*exp( -1/2 *[(q-q0)/B]^2 )+ background 5 PeakGaussModel function as a BaseComponent model 3 PeakGaussModel function as a BaseComponent model 6 4 """ 7 5 … … 12 10 13 11 """ 14 Class that evaluates a gaussian shaped peak.12 Class that evaluates a gaussian shaped peak with a flat background. 15 13 16 F(q) = scale *exp( -1/2 *[(q-qo)/B]^2 )+ background14 F(q) = scale exp( -1/2 [(q-qo)/B]^2 )+ background 17 15 18 16 The model has three parameters: … … 56 54 def _PeakGauss(self, x): 57 55 """ 58 Evaluate F(x) = scale *exp( -1/2 *[(x-q0)/B]^2 )+ background56 Evaluate F(x) = scale exp( -1/2 [(x-q0)/B]^2 )+ background 59 57 60 58 """ -
src/sas/models/TwoPowerLawModel.py
r79492222 rac7be54 1 1 #!/usr/bin/env python 2 2 """ 3 Provide I(q) = A*pow(qval,-1.0*m1) for q<=qc4 =scale*pow(qval,-1.0*m2) for q>qc5 3 TwoPowerLaw function as a BaseComponent model 4 5 Calculate:: 6 7 I(q) = A pow(qval,-m1) for q<=qc 8 I(q) = scale pow(qval,-m2) for q>qc 6 9 """ 7 10 … … 14 17 Class that evaluates a TwoPowerLawModel. 15 18 16 I(q) = coef_A*pow(qval,-1.0*power1) for q<=qc 17 =C*pow(qval,-1.0*power2) for q>qc 18 where C=coef_A*pow(qc,-1.0*power1)/pow(qc,-1.0*power2). 19 Calculate:: 20 21 I(q) = coef_A pow(qval,-power1) for q<=qc 22 I(q) = C pow(qval,-power2) for q>qc 23 24 where C=coef_A pow(qc,-power1)/pow(qc,-power2). 19 25 20 26 List of default parameters: -
src/sas/perspectives/calculator/data_editor.py
r49ab5d7 rac7be54 53 53 """ 54 54 :param data: when not empty the class can 55 55 same information into a dat object 56 56 and post event containing the changed data object to some other frame 57 57 """ -
src/sas/perspectives/calculator/model_editor.py
r2d50115 rac7be54 89 89 will create a file that cannot be compiled. Should add the check to 90 90 the write method or to the on_modelx method. 91 - PDB:April 5, 2015 91 92 - PDB:April 5, 2015 92 93 """ 93 94 def __init__(self, parent=None, base=None, id=None, title='', -
src/sas/perspectives/fitting/fitpanel.py
racf8e4a5 rac7be54 298 298 299 299 :param m_dict: dictionnary made of model name as key and model class 300 as value300 as value 301 301 """ 302 302 self.model_list_box = dict -
src/sas/perspectives/fitting/fitproblem.py
r2f4b430 rac7be54 25 25 """ 26 26 :param flag: bool.When flag is 1 get the computer smear value. When 27 flag is 0 ingore smear value.27 flag is 0 ingore smear value. 28 28 """ 29 29 … … 76 76 def set_fit_data(self, data): 77 77 """ 78 79 id, if there was existing information about model, this information80 78 Store of list of data and create by create new fitproblem of each data 79 id, if there was existing information about model, this information 80 get copy to the new fitproblem 81 81 :param data: list of data selected 82 82 """ … … 202 202 """ 203 203 :param flag: bool.When flag is 1 get the computer smear value. When 204 flag is 0 ingore smear value.204 flag is 0 ingore smear value. 205 205 """ 206 206 self._smear_on = flag … … 346 346 """ 347 347 return data for the given fitproblem id 348 :param fid: is key representing a fitproblem. usually extract from data 349 id 348 :param fid: key representing a fitproblem, usually extract from data id 350 349 """ 351 350 if fid in self.iterkeys(): … … 531 530 """ 532 531 :param flag: bool.When flag is 1 get the computer smear value. When 533 flag is 0 ingore smear value.532 flag is 0 ingore smear value. 534 533 """ 535 534 self.smearer_enable = flag
Note: See TracChangeset
for help on using the changeset viewer.