Changeset a7107a6 in sasview


Ignore:
Timestamp:
Sep 26, 2010 9:53:21 AM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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:
65a8b34
Parents:
7381f34
Message:

cleaned-up a little bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/SphereExpShellModel.py

    ra1b2471 ra7107a6  
    139139        : return: (r, beta) where r is a list of radius of the transition points 
    140140                beta is a list of the corresponding SLD values  
    141         : Note: This works only for func_shell# = 2. 
    142141        """ 
    143142        # max_pts for each shells 
     
    157156            r0 = r[len(r)-1]             
    158157            r.append(r0) 
    159             exec "beta.append(self.params['sld_in_shell%s'% str(n)])" 
     158            beta.append(self.params['sld_in_shell%s'% str(n)]) 
    160159             
    161             exec "A = self.params['A_shell%s'% str(n)]" 
     160            A = self.params['A_shell%s'% str(n)] 
    162161            if A ==0: 
    163162                # Right side of each shells 
    164                 exec "r0 += self.params['thick_shell%s'% str(n)]" 
     163                r0 += self.params['thick_shell%s'% str(n)] 
    165164                r.append(r0) 
    166                 exec "beta.append(self.params['sld_in_shell%s'% str(n)])" 
     165                beta.append(self.params['sld_in_shell%s'% str(n)]) 
    167166            else: 
    168167                from math import exp 
     
    170169                for n_sub in range(0,max_pts): 
    171170                    # Right side of each sub_shells 
    172                     exec "rn += self.params['thick_shell%s'% str(n)]/10.0" 
     171                    rn += self.params['thick_shell%s'% str(n)]/10.0 
    173172                    r.append(rn) 
    174                     exec "slope = (self.params['sld_out_shell%s'% str(n)] \ 
     173                    slope = (self.params['sld_out_shell%s'% str(n)] \ 
    175174                                        -self.params['sld_in_shell%s'% str(n)]) \ 
    176                                         /(exp(self.params['A_shell%s'% str(n)])-1)" 
    177                     exec "const = (self.params['sld_in_shell%s'% str(n)]-slope)" 
    178                     exec "beta_n = slope*exp((self.params['A_shell%s'% str(n)]*(rn-r0) \ 
    179                                         /self.params['thick_shell%s'% str(n)])) + const" 
     175                                        /(exp(self.params['A_shell%s'% str(n)])-1) 
     176                    const = (self.params['sld_in_shell%s'% str(n)]-slope) 
     177                    beta_n = slope*exp((self.params['A_shell%s'% str(n)]*(rn-r0) \ 
     178                                        /self.params['thick_shell%s'% str(n)])) + const 
    180179                    beta.append(beta_n) 
    181180             
     
    246245         
    247246        : param x: input q-value (float or [float, float] as [r, theta]) 
    248         : return: (DAB value) 
     247        : return: (I value) 
    249248        """ 
    250249 
     
    256255         
    257256        : param x: input q-value (float or [float, float] as [qx, qy]) 
    258         : return: DAB value 
     257        : return: I value 
    259258        """   
    260259 
Note: See TracChangeset for help on using the changeset viewer.