Changeset 339ce67 in sasview for sansmodels/src/sans


Ignore:
Timestamp:
Oct 12, 2010 4:22:08 PM (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:
20f00bed
Parents:
aaad3098
Message:

added some models and tests

Location:
sansmodels/src/sans/models
Files:
11 added
22 edited

Legend:

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

    r35aface r339ce67  
    3737    List of default parameters: 
    3838         scale           = 1.0  
    39          rad_core        = 60.0 [A] 
    40          sld_core        = 6.4e-006 [1/A^(2)] 
     39         rad_core0       = 60.0 [A] 
     40         sld_core0       = 6.4e-006 [1/A^(2)] 
    4141         thick_shell1    = 10.0 [A] 
    4242         sld_shell1      = 1e-006 [1/A^(2)] 
     
    6464        self.description =""" Calculates the scattering intensity from a core-4 shell structure. 
    6565                scale = scale factor * volume fraction 
    66                 rad_core: the radius of the core 
    67                 sld_core: the SLD of the core 
     66                rad_core0: the radius of the core 
     67                sld_core0: the SLD of the core 
    6868                thick_shelli: the thickness of the i'th shell from the core 
    6969                sld_shelli: the SLD of the i'th shell from the core 
     
    7474        self.details = {} 
    7575        self.details['scale'] = ['', None, None] 
    76         self.details['rad_core'] = ['[A]', None, None] 
    77         self.details['sld_core'] = ['[1/A^(2)]', None, None] 
     76        self.details['rad_core0'] = ['[A]', None, None] 
     77        self.details['sld_core0'] = ['[1/A^(2)]', None, None] 
    7878        self.details['thick_shell1'] = ['[A]', None, None] 
    7979        self.details['sld_shell1'] = ['[1/A^(2)]', None, None] 
     
    8888 
    8989        ## fittable parameters 
    90         self.fixed=['thick_shell4.width', 'thick_shell1.width', 'thick_shell2.width', 'thick_shell3.width', 'rad_core.width'] 
     90        self.fixed=['thick_shell4.width', 'thick_shell1.width', 'thick_shell2.width', 'thick_shell3.width', 'rad_core0.width'] 
    9191         
    9292        ## non-fittable parameters 
  • sansmodels/src/sans/models/CoreMultiShellModel.py

    r35aface r339ce67  
    33from sans.models.CoreFourShellModel import CoreFourShellModel 
    44import copy 
    5 max_nshells = 4 
     5max_nshells = 5 
    66class CoreMultiShellModel(BaseComponent): 
    77    """ 
     
    4242        self._set_fixed_params()   
    4343         
    44         ## functional multiplicity of the model 
    45         self.multiplicity = 5 
     44        ## functional multiplicity info of the model 
     45        # [int(maximum no. of functionality),"str(Titl), 
     46        # [str(name of function0),...], [str(x-asix name of sld),...]] 
     47        self.multiplicity_info = [max_nshells,"No. of Shells:",[],['Radius']] 
     48 
    4649        ## parameters with orientation: can be removed since there is no orientational params 
    4750        for item in self.model.orientation_params: 
     
    9194            nshell = 0 
    9295            if name.split('_')[0] == 'thick' or name.split('_')[0] == 'sld': 
    93                 if name.split('_')[1] == 'solv' or name.split('_')[1] == 'core': 
     96                if name.split('_')[1] == 'solv' or name.split('_')[1] == 'core0': 
    9497                    self.params[name]= value 
    9598                    continue 
     
    146149        # for core at r=0 
    147150        r.append(0) 
    148         beta.append(self.params['sld_core']) 
     151        beta.append(self.params['sld_core0']) 
    149152        # for core at r=rad_core 
    150         r.append(self.params['rad_core']) 
    151         beta.append(self.params['sld_core']) 
     153        r.append(self.params['rad_core0']) 
     154        beta.append(self.params['sld_core0']) 
    152155         
    153156        # for shells 
  • sansmodels/src/sans/models/OnionModel.py

    r35aface r339ce67  
    3838         n_shells        = 1.0  
    3939         scale           = 1.0  
    40          rad_core        = 200.0 [A] 
    41          sld_core        = 1e-006 [1/A^(2)] 
     40         rad_core0       = 200.0 [A] 
     41         sld_core0       = 1e-006 [1/A^(2)] 
    4242         sld_solv        = 6.4e-006 [1/A^(2)] 
    4343         background      = 0.0 [1/cm] 
     
    122122                 
    123123                background:background, 
    124                 rad_core: radius of sphere(core) 
     124                rad_core0: radius of sphere(core) 
    125125                thick_shell#:the thickness of the shell# 
    126                 sld_core: the SLD of the sphere 
     126                sld_core0: the SLD of the sphere 
    127127                sld_solv: the SLD of the solvent 
    128128                sld_shell: the SLD of the shell# 
     
    133133        self.details['n_shells'] = ['', None, None] 
    134134        self.details['scale'] = ['', None, None] 
    135         self.details['rad_core'] = ['[A]', None, None] 
    136         self.details['sld_core'] = ['[1/A^(2)]', None, None] 
     135        self.details['rad_core0'] = ['[A]', None, None] 
     136        self.details['sld_core0'] = ['[1/A^(2)]', None, None] 
    137137        self.details['sld_solv'] = ['[1/A^(2)]', None, None] 
    138138        self.details['background'] = ['[1/cm]', None, None] 
     
    189189 
    190190        ## fittable parameters 
    191         self.fixed=['rad_core.width', 'thick_shell1.width', 'thick_shell2.width', 'thick_shell3.width', 'thick_shell4.width', 'thick_shell5.width', 'thick_shell6.width', 'thick_shell7.width', 'thick_shell8.width', 'thick_shell9.width', 'thick_shell10.width'] 
     191        self.fixed=['rad_core0.width', 'thick_shell1.width', 'thick_shell2.width', 'thick_shell3.width', 'thick_shell4.width', 'thick_shell5.width', 'thick_shell6.width', 'thick_shell7.width', 'thick_shell8.width', 'thick_shell9.width', 'thick_shell10.width'] 
    192192         
    193193        ## non-fittable parameters 
  • sansmodels/src/sans/models/RPA10Model.py

    r35aface r339ce67  
    4646         
    4747        ## functional multiplicity of the model 
    48         self.multiplicity = max_case_n 
     48        self.multiplicity_info = [max_case_n,"Case No.:",["C/D Binary Mixture of Homopolymers", 
     49                                                         "C-D Diblock Copolymer", 
     50                                                         "B/C/D Ternary Mixture of Homopolymers", 
     51                                                         "B/C-D Mixture of Homopolymer B and Diblock Copolymer C-D", 
     52                                                         "B-C-D Triblock Copolymer", 
     53                                                         "A/B/C/D Quaternary Mixture of Homopolymers", 
     54                                                         "A/B/C-D Mixture of Homopolymer A/B and Diblock C-D", 
     55                                                         "A/B-C-D Mixture of Homopolymer A and triblock B-C-D", 
     56                                                         "A-B/C-D Mixture of Diblock Copolymer A-B and Diblock C-D", 
     57                                                         "A-B-C-D Four-block Copolymer"], 
     58                                                         []] 
    4959     
    5060    def _clone(self, obj): 
  • sansmodels/src/sans/models/ReflModel.py

    r35aface r339ce67  
    8383         func_inter9     = 0.0  
    8484         func_inter10    = 0.0  
     85         sldIM_flat1     = 0.0  
     86         sldIM_flat2     = 0.0  
     87         sldIM_flat3     = 0.0  
     88         sldIM_flat4     = 0.0  
     89         sldIM_flat5     = 0.0  
     90         sldIM_flat6     = 0.0  
     91         sldIM_flat7     = 0.0  
     92         sldIM_flat8     = 0.0  
     93         sldIM_flat9     = 0.0  
     94         sldIM_flat10    = 0.0  
     95         sldIM_sub0      = 0.0  
     96         sldIM_medium    = 0.0  
    8597 
    8698    """ 
     
    169181        self.details['func_inter9'] = ['', None, None] 
    170182        self.details['func_inter10'] = ['', None, None] 
     183        self.details['sldIM_flat1'] = ['', None, None] 
     184        self.details['sldIM_flat2'] = ['', None, None] 
     185        self.details['sldIM_flat3'] = ['', None, None] 
     186        self.details['sldIM_flat4'] = ['', None, None] 
     187        self.details['sldIM_flat5'] = ['', None, None] 
     188        self.details['sldIM_flat6'] = ['', None, None] 
     189        self.details['sldIM_flat7'] = ['', None, None] 
     190        self.details['sldIM_flat8'] = ['', None, None] 
     191        self.details['sldIM_flat9'] = ['', None, None] 
     192        self.details['sldIM_flat10'] = ['', None, None] 
     193        self.details['sldIM_sub0'] = ['', None, None] 
     194        self.details['sldIM_medium'] = ['', None, None] 
    171195 
    172196        ## fittable parameters 
  • sansmodels/src/sans/models/ReflectivityModel.py

    r35aface r339ce67  
    4949        self.model.params['n_layers'] = self.n_layers 
    5050         
    51         ## functional multiplicity of the model 
    52         self.multiplicity = max_nshells 
     51        ## functional multiplicity info of the model 
     52        # [int(maximum no. of functionality),"str(Titl), 
     53        # [str(name of function0),...], [str(x-asix name of sld),...]] 
     54        self.multiplicity_info = [max_nshells,"No. of Layers:",[],['Depth']] 
     55 
    5356     
    5457    def _clone(self, obj): 
     
    8487            n = 0 
    8588            pos = len(name.split('_'))-1 
    86             if name.split('_')[0] == 'func': 
     89            if name.split('_')[0] == 'sldIM': 
     90                continue 
     91            elif name.split('_')[0] == 'func': 
    8792                n= -1 
    8893                while n<self.n_layers: 
     
    141146                    if key.split('_')[1] == 'flat%s' % str(nshell+1): 
    142147                        try: 
    143                             value = self.model.params['sld_medium'] 
     148                            if key.split('_')[0] == 'sld': 
     149                                value = self.model.params['sld_medium'] 
     150                            elif key.split('_')[0] == 'sldIM': 
     151                                value = self.model.params['sldIM_medium'] 
    144152                            self.model.setParam(key, value) 
    145153                        except: pass 
  • sansmodels/src/sans/models/SphereExpShellModel.py

    rfbae881 r339ce67  
    3939        self._set_fixed_params()   
    4040        self.model.params['n_shells'] = self.n_shells 
     41        ## functional multiplicity info of the model 
     42        # [int(maximum no. of functionality),"str(Titl), 
     43        # [str(name of function0),...], [str(x-asix name of sld),...]] 
     44        self.multiplicity_info = [max_nshells,"No. of Shells:",[],['Radius']] 
     45 
    4146        ## parameters with orientation: can be removed since there is no orientational params 
    4247        for item in self.model.orientation_params: 
     
    146151        # for core at r=0 
    147152        r.append(0) 
    148         beta.append(self.params['sld_core']) 
     153        beta.append(self.params['sld_core0']) 
    149154        # for core at r=rad_core 
    150         r.append(self.params['rad_core']) 
    151         beta.append(self.params['sld_core']) 
     155        r.append(self.params['rad_core0']) 
     156        beta.append(self.params['sld_core0']) 
    152157         
    153158        # for shells 
  • sansmodels/src/sans/models/c_extensions/corefourshell.c

    rc724ccd r339ce67  
    1818 
    1919        dp[0] = pars->scale; 
    20         dp[1] = pars->rad_core; 
    21         dp[2] = pars->sld_core; 
     20        dp[1] = pars->rad_core0; 
     21        dp[2] = pars->sld_core0; 
    2222        dp[3] = pars->thick_shell1; 
    2323        dp[4] = pars->sld_shell1; 
  • sansmodels/src/sans/models/c_extensions/corefourshell.h

    rc724ccd r339ce67  
    66 */ 
    77 //[PYTHONCLASS] = CoreFourShellModel 
    8  //[DISP_PARAMS] = rad_core, thick_shell1,thick_shell2,thick_shell3,thick_shell4 
     8 //[DISP_PARAMS] = rad_core0, thick_shell1,thick_shell2,thick_shell3,thick_shell4 
    99 //[DESCRIPTION] =<text> Calculates the scattering intensity from a core-4 shell structure. 
    1010 //                     scale = scale factor * volume fraction 
    11  //                             rad_core: the radius of the core 
    12  //                             sld_core: the SLD of the core 
     11 //                             rad_core0: the radius of the core 
     12 //                             sld_core0: the SLD of the core 
    1313 //                             thick_shelli: the thickness of the i'th shell from the core 
    1414 //                             sld_shelli: the SLD of the i'th shell from the core 
     
    1616 //                             background: incoherent background 
    1717 //             </text> 
    18  //[FIXED]=<text>  thick_shell4.width; thick_shell1.width;thick_shell2.width;thick_shell3.width;rad_core.width </text> 
     18 //[FIXED]=<text>  thick_shell4.width; thick_shell1.width;thick_shell2.width;thick_shell3.width;rad_core0.width </text> 
    1919 //[ORIENTATION_PARAMS]= <text> </text> 
    2020 
     
    2424    double scale; 
    2525 
    26     /// Radius of the core [A] 
    27     //  [DEFAULT]=rad_core=60. [A] 
    28     double rad_core; 
     26    /// Radius of the core0 [A] 
     27    //  [DEFAULT]=rad_core0=60. [A] 
     28    double rad_core0; 
    2929 
    30     /// sld of core [1/A^(2)] 
    31     //  [DEFAULT]=sld_core= 6.4e-6 [1/A^(2)] 
    32     double sld_core; 
     30    /// sld of core0 [1/A^(2)] 
     31    //  [DEFAULT]=sld_core0= 6.4e-6 [1/A^(2)] 
     32    double sld_core0; 
    3333 
    3434    /// thickness of the shell1 [A] 
  • sansmodels/src/sans/models/c_extensions/fcc.c

    rd5b6a9d r339ce67  
    6565        double answer; 
    6666        double Pi = 4.0*atan(1.0); 
    67         double aa, Da, qDa_2, latticeScale, Zq, Fkq, Fkq_2; 
     67        double aa, Da, qDa_2, latticeScale, Zq, Fkq, Fkq_2,contrast; 
    6868 
    6969        double dp[5]; 
     
    7777        Da = pars->d_factor*aa; 
    7878        qDa_2 = pow(q*Da,2.0); 
     79        contrast = pars->sldSph - pars->sldSolv; 
    7980 
    8081        latticeScale = 4.0*(4.0/3.0)*Pi*(dp[1]*dp[1]*dp[1])/pow(aa*sqrt(2.0),3.0); 
     
    133134 
    134135        // Use SphereForm directly from libigor 
    135         answer = SphereForm(dp,q)*Zq; 
     136        answer = SphereForm_Paracrystal(pars->radius,contrast,q)*Zq; 
    136137 
    137138        //consider scales 
  • sansmodels/src/sans/models/c_extensions/onion.c

    ra1b2471 r339ce67  
    1111        int n = dp[0]; 
    1212        double scale = dp[1]; 
    13         double rad_core = dp[2]; 
    14         double sld_core = dp[3]; 
     13        double rad_core0 = dp[2]; 
     14        double sld_core0 = dp[3]; 
    1515        double sld_solv = dp[4]; 
    1616        double background = dp[5]; 
     
    3030                fun_type[i] = dp[i+45]; 
    3131        } 
    32         sld_out[0] = sld_core; 
     32        sld_out[0] = sld_core0; 
    3333        sld_out[n+1] = sld_solv; 
    34         sld_in[0] = sld_core; 
     34        sld_in[0] = sld_core0; 
    3535        sld_in[n+1] = sld_solv; 
    36         thick[0] = rad_core; 
     36        thick[0] = rad_core0; 
    3737        thick[n+1] = 1e+10; 
    3838        A[0] = 0.0; 
     
    6969                                        } 
    7070                                        else{ 
    71                                                 slope[i] = (sld_out[i]-sld_in[i])/(exp(A[i])-1); 
     71                                                slope[i] = (sld_out[i]-sld_in[i])/(exp(A[i])-1.0); 
    7272                                        } 
    7373                    for (j=0; j<2; j++){ 
     
    174174        dp[0] = pars->n_shells; 
    175175        dp[1] = pars->scale; 
    176         dp[2] = pars->rad_core; 
    177         dp[3] = pars->sld_core; 
     176        dp[2] = pars->rad_core0; 
     177        dp[3] = pars->sld_core0; 
    178178        dp[4] = pars->sld_solv; 
    179179        dp[5] = pars->background; 
  • sansmodels/src/sans/models/c_extensions/onion.h

    r7381f34 r339ce67  
    66 */ 
    77 //[PYTHONCLASS] = OnionModel 
    8  //[DISP_PARAMS] = rad_core, thick_shell1,thick_shell2,thick_shell3,thick_shell4, thick_shell5,thick_shell6,thick_shell7,thick_shell8,thick_shell9,thick_shell10 
     8 //[DISP_PARAMS] = rad_core0, thick_shell1,thick_shell2,thick_shell3,thick_shell4, thick_shell5,thick_shell6,thick_shell7,thick_shell8,thick_shell9,thick_shell10 
    99 //[DESCRIPTION] =<text>Form factor of mutishells normalized by the volume. Here each shell is described 
    1010 //                                              by an exponential function; 
     
    2424 // 
    2525 //                             background:background, 
    26  //                             rad_core: radius of sphere(core) 
     26 //                             rad_core0: radius of sphere(core) 
    2727 //                             thick_shell#:the thickness of the shell# 
    28  //                             sld_core: the SLD of the sphere 
     28 //                             sld_core0: the SLD of the sphere 
    2929 //                             sld_solv: the SLD of the solvent 
    3030 //                             sld_shell: the SLD of the shell# 
    3131 //                             A_shell#: the coefficient in the exponential function 
    3232 //             </text> 
    33  //[FIXED]=  <text>rad_core.width;thick_shell1.width;thick_shell2.width;thick_shell3.width;thick_shell4.width;thick_shell5.width;thick_shell6.width;thick_shell7.width;thick_shell8.width;thick_shell9.width;thick_shell10.width</text> 
     33 //[FIXED]=  <text>rad_core0.width;thick_shell1.width;thick_shell2.width;thick_shell3.width;thick_shell4.width;thick_shell5.width;thick_shell6.width;thick_shell7.width;thick_shell8.width;thick_shell9.width;thick_shell10.width</text> 
    3434 //[ORIENTATION_PARAMS]= <text> </text> 
    3535 
     
    4242        double scale; 
    4343    /// Radius of sphere [A] 
    44     //  [DEFAULT]=rad_core=200.0 [A] 
    45         double rad_core; 
     44    //  [DEFAULT]=rad_core0=200.0 [A] 
     45        double rad_core0; 
    4646        ///     sld_core [1/A^(2)] 
    47         //  [DEFAULT]=sld_core= 1.0e-6 [1/A^(2)] 
    48         double sld_core; 
     47        //  [DEFAULT]=sld_core0= 1.0e-6 [1/A^(2)] 
     48        double sld_core0; 
    4949        ///     sld_solv [1/A^(2)] 
    5050        //  [DEFAULT]=sld_solv= 6.4e-6 [1/A^(2)] 
  • sansmodels/src/sans/models/c_extensions/refl.c

    r35aface r339ce67  
    268268        double background = dp[6]; 
    269269 
    270         double sld[n+2],sld_nul[n+2],thick_inter[n+2],thick[n+2],total_thick; 
     270        double sld[n+2],sld_im[n+2],thick_inter[n+2],thick[n+2],total_thick; 
    271271        fun_type[0] = dp[3]; 
    272272        for (i =1; i<=n; i++){ 
     
    275275                thick[i] = dp[i+26]; 
    276276                fun_type[i] = dp[i+36]; 
     277                sld_im[i] = dp[i+46]; 
    277278 
    278279                total_thick += thick[i] + thick_inter[i]; 
     
    280281        sld[0] = sld_sub; 
    281282        sld[n+1] = sld_super; 
     283        sld_im[0] = fabs(dp[0+56]); 
     284        sld_im[n+1] = fabs(dp[1+56]); 
    282285        thick[0] = total_thick/5.0; 
    283286        thick[n+1] = total_thick/5.0; 
     
    287290        double nsl=21.0; //nsl = Num_sub_layer:  MUST ODD number in double //no other number works now 
    288291        int n_s, floor_nsl; 
    289     double sld_i,dz,phi,R,ko2; 
     292    double sld_i,sldim_i,dz,phi,R,ko2; 
    290293    double sign,erfunc; 
    291294    double pi; 
     
    300303        //Checking if floor is available. 
    301304        //no imaginary sld inputs in this function yet 
    302     n_sub=cassign(1.0-sld_sub*pow(lamda,2.0)/(2.0*pi),0.0); 
    303     n_sup=cassign(1.0-sld_super*pow(lamda,2.0)/(2.0*pi),0.0); 
     305    n_sub=cassign(1.0-sld_sub*pow(lamda,2.0)/(2.0*pi),pow(lamda,2.0)/(2.0*pi)*sld_im[0]); 
     306    n_sup=cassign(1.0-sld_super*pow(lamda,2.0)/(2.0*pi),pow(lamda,2.0)/(2.0*pi)*sld_im[n+1]); 
    304307    ko2 = pow(2.0*pi/lamda,2.0); 
    305308 
     
    323326                                        dz = thick[i]; 
    324327                                        sld_i = sld[i]; 
     328                                        sldim_i = sld_im[i]; 
    325329                                } 
    326330                                else{ 
    327331                                        dz = thick_inter[i-1]/nsl; 
    328                                         sld_i = interfunc(fun_type[i-1],nsl, n_s, sld[i-1], sld[i]); 
     332                                        if (sld[i-1] == sld[i]){ 
     333                                                sld_i = sld[i]; 
     334                                        } 
     335                                        else{ 
     336                                                sld_i = interfunc(fun_type[i-1],nsl, n_s, sld[i-1], sld[i]); 
     337                                        } 
     338                                        if (sld_im[i-1] == sld_im[i]){ 
     339                                                sldim_i = sld_im[i]; 
     340                                        } 
     341                                        else{ 
     342                                                sldim_i = interfunc(fun_type[i-1],nsl, n_s, sld_im[i-1], sld_im[i]); 
     343                                        } 
    329344                                } 
    330                                 nn = cassign(1.0-sld_i*pow(lamda,2.0)/(2.0*pi),0.0); 
     345                                nn = cassign(1.0-sld_i*pow(lamda,2.0)/(2.0*pi),pow(lamda,2.0)/(2.0*pi)*sldim_i); 
    331346                                nn2=cmult(nn,nn); 
    332347 
     
    366381 */ 
    367382double refl_analytical_1D(ReflParameters *pars, double q) { 
    368         double dp[47]; 
     383        double dp[59]; 
    369384 
    370385        dp[0] = pars->n_layers; 
     
    420435        dp[46] = pars->func_inter10; 
    421436 
     437        dp[47] = pars->sldIM_flat1; 
     438        dp[48] = pars->sldIM_flat2; 
     439        dp[49] = pars->sldIM_flat3; 
     440        dp[50] = pars->sldIM_flat4; 
     441        dp[51] = pars->sldIM_flat5; 
     442        dp[52] = pars->sldIM_flat6; 
     443        dp[53] = pars->sldIM_flat7; 
     444        dp[54] = pars->sldIM_flat8; 
     445        dp[55] = pars->sldIM_flat9; 
     446        dp[56] = pars->sldIM_flat10; 
     447 
     448        dp[57] = pars->sldIM_sub0; 
     449        dp[58] = pars->sldIM_medium; 
     450 
    422451        return re_kernel(dp, q); 
    423452} 
  • sansmodels/src/sans/models/c_extensions/refl.h

    r35aface r339ce67  
    142142    double func_inter10; 
    143143 
     144    //  [DEFAULT]=sldIM_flat1=0 
     145    double sldIM_flat1; 
     146    //  [DEFAULT]=sldIM_flat2=0 
     147    double sldIM_flat2; 
     148    //  [DEFAULT]=sldIM_flat3=0 
     149    double sldIM_flat3; 
     150    //  [DEFAULT]=sldIM_flat4=0 
     151    double sldIM_flat4; 
     152    //  [DEFAULT]=sldIM_flat5=0 
     153    double sldIM_flat5; 
     154    //  [DEFAULT]=sldIM_flat6=0 
     155    double sldIM_flat6; 
     156    //  [DEFAULT]=sldIM_flat7=0 
     157    double sldIM_flat7; 
     158    //  [DEFAULT]=sldIM_flat8=0 
     159    double sldIM_flat8; 
     160    //  [DEFAULT]=sldIM_flat9=0 
     161    double sldIM_flat9; 
     162    //  [DEFAULT]=sldIM_flat10=0 
     163    double sldIM_flat10; 
     164    //  [DEFAULT]=sldIM_sub0=0 
     165    double sldIM_sub0; 
     166    //  [DEFAULT]=sldIM_medium=0 
     167    double sldIM_medium; 
    144168 
    145169} ReflParameters; 
  • sansmodels/src/sans/models/c_models/CCoreFourShellModel.cpp

    r35aface r339ce67  
    9797        PyDict_SetItemString(self->params,"thick_shell2",Py_BuildValue("d",10.000000000000)); 
    9898        PyDict_SetItemString(self->params,"sld_shell1",Py_BuildValue("d",0.000001000000)); 
    99         PyDict_SetItemString(self->params,"rad_core",Py_BuildValue("d",60.000000000000)); 
    100         PyDict_SetItemString(self->params,"sld_core",Py_BuildValue("d",0.000006400000)); 
     99        PyDict_SetItemString(self->params,"thick_shell3",Py_BuildValue("d",10.000000000000)); 
     100        PyDict_SetItemString(self->params,"sld_core0",Py_BuildValue("d",0.000006400000)); 
    101101        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.001000000000)); 
    102         PyDict_SetItemString(self->params,"thick_shell3",Py_BuildValue("d",10.000000000000)); 
     102        PyDict_SetItemString(self->params,"rad_core0",Py_BuildValue("d",60.000000000000)); 
    103103        PyDict_SetItemString(self->params,"sld_solv",Py_BuildValue("d",0.000006400000)); 
    104104        PyDict_SetItemString(self->params,"sld_shell3",Py_BuildValue("d",0.000003000000)); 
     
    107107        PyObject * disp_dict; 
    108108        disp_dict = PyDict_New(); 
    109         self->model->rad_core.dispersion->accept_as_source(visitor, self->model->rad_core.dispersion, disp_dict); 
    110         PyDict_SetItemString(self->dispersion, "rad_core", disp_dict); 
     109        self->model->rad_core0.dispersion->accept_as_source(visitor, self->model->rad_core0.dispersion, disp_dict); 
     110        PyDict_SetItemString(self->dispersion, "rad_core0", disp_dict); 
    111111        disp_dict = PyDict_New(); 
    112112        self->model->thick_shell1.dispersion->accept_as_source(visitor, self->model->thick_shell1.dispersion, disp_dict); 
     
    257257    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 
    258258    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 
    259     self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") ); 
    260     self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") ); 
     259    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     260    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 
    261261    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    262     self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     262    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 
    263263    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 
    264264    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); 
     
    266266    PyObject* disp_dict; 
    267267    DispersionVisitor* visitor = new DispersionVisitor(); 
    268     disp_dict = PyDict_GetItemString(self->dispersion, "rad_core"); 
    269     self->model->rad_core.dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict); 
     268    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 
     269    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 
    270270    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 
    271271    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); 
     
    345345    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 
    346346    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 
    347     self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") ); 
    348     self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") ); 
     347    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     348    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 
    349349    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    350     self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     350    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 
    351351    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 
    352352    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); 
     
    354354    PyObject* disp_dict; 
    355355    DispersionVisitor* visitor = new DispersionVisitor(); 
    356     disp_dict = PyDict_GetItemString(self->dispersion, "rad_core"); 
    357     self->model->rad_core.dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict); 
     356    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 
     357    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 
    358358    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 
    359359    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); 
     
    420420    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 
    421421    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 
    422     self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") ); 
    423     self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") ); 
     422    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     423    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 
    424424    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    425     self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     425    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 
    426426    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 
    427427    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); 
     
    429429    PyObject* disp_dict; 
    430430    DispersionVisitor* visitor = new DispersionVisitor(); 
    431     disp_dict = PyDict_GetItemString(self->dispersion, "rad_core"); 
    432     self->model->rad_core.dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict); 
     431    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 
     432    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 
    433433    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 
    434434    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); 
     
    464464    self->model->thick_shell2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell2") ); 
    465465    self->model->sld_shell1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell1") ); 
    466     self->model->rad_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core") ); 
    467     self->model->sld_core = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core") ); 
     466    self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     467    self->model->sld_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_core0") ); 
    468468    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    469     self->model->thick_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_shell3") ); 
     469    self->model->rad_core0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "rad_core0") ); 
    470470    self->model->sld_solv = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_solv") ); 
    471471    self->model->sld_shell3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_shell3") ); 
     
    473473    PyObject* disp_dict; 
    474474    DispersionVisitor* visitor = new DispersionVisitor(); 
    475     disp_dict = PyDict_GetItemString(self->dispersion, "rad_core"); 
    476     self->model->rad_core.dispersion->accept_as_destination(visitor, self->model->rad_core.dispersion, disp_dict); 
     475    disp_dict = PyDict_GetItemString(self->dispersion, "rad_core0"); 
     476    self->model->rad_core0.dispersion->accept_as_destination(visitor, self->model->rad_core0.dispersion, disp_dict); 
    477477    disp_dict = PyDict_GetItemString(self->dispersion, "thick_shell1"); 
    478478    self->model->thick_shell1.dispersion->accept_as_destination(visitor, self->model->thick_shell1.dispersion, disp_dict); 
     
    538538        // Ugliness necessary to go from python to C 
    539539            // TODO: refactor this 
    540     if (!strcmp(par_name, "rad_core")) { 
    541         self->model->rad_core.dispersion = dispersion; 
     540    if (!strcmp(par_name, "rad_core0")) { 
     541        self->model->rad_core0.dispersion = dispersion; 
    542542    } else    if (!strcmp(par_name, "thick_shell1")) { 
    543543        self->model->thick_shell1.dispersion = dispersion; 
  • sansmodels/src/sans/models/c_models/CReflModel.cpp

    r35aface r339ce67  
    9090         
    9191        // Initialize parameter dictionary 
     92        PyDict_SetItemString(self->params,"sldIM_flat4",Py_BuildValue("d",0.000000000000)); 
    9293        PyDict_SetItemString(self->params,"thick_flat8",Py_BuildValue("d",100.000000000000)); 
    9394        PyDict_SetItemString(self->params,"thick_flat9",Py_BuildValue("d",100.000000000000)); 
     95        PyDict_SetItemString(self->params,"sldIM_flat7",Py_BuildValue("d",0.000000000000)); 
     96        PyDict_SetItemString(self->params,"sldIM_flat10",Py_BuildValue("d",0.000000000000)); 
     97        PyDict_SetItemString(self->params,"sldIM_flat5",Py_BuildValue("d",0.000000000000)); 
    9498        PyDict_SetItemString(self->params,"thick_flat1",Py_BuildValue("d",10.000000000000)); 
    9599        PyDict_SetItemString(self->params,"thick_flat3",Py_BuildValue("d",100.000000000000)); 
     
    109113        PyDict_SetItemString(self->params,"thick_inter8",Py_BuildValue("d",1.000000000000)); 
    110114        PyDict_SetItemString(self->params,"thick_inter9",Py_BuildValue("d",1.000000000000)); 
     115        PyDict_SetItemString(self->params,"sldIM_flat1",Py_BuildValue("d",0.000000000000)); 
    111116        PyDict_SetItemString(self->params,"scale",Py_BuildValue("d",1.000000000000)); 
     117        PyDict_SetItemString(self->params,"sldIM_flat2",Py_BuildValue("d",0.000000000000)); 
    112118        PyDict_SetItemString(self->params,"func_inter9",Py_BuildValue("d",0.000000000000)); 
    113119        PyDict_SetItemString(self->params,"thick_inter10",Py_BuildValue("d",1.000000000000)); 
     120        PyDict_SetItemString(self->params,"sldIM_flat3",Py_BuildValue("d",0.000000000000)); 
    114121        PyDict_SetItemString(self->params,"func_inter8",Py_BuildValue("d",0.000000000000)); 
    115122        PyDict_SetItemString(self->params,"thick_flat2",Py_BuildValue("d",100.000000000000)); 
     
    129136        PyDict_SetItemString(self->params,"sld_flat2",Py_BuildValue("d",0.000003500000)); 
    130137        PyDict_SetItemString(self->params,"sld_flat3",Py_BuildValue("d",0.000004000000)); 
     138        PyDict_SetItemString(self->params,"sldIM_flat8",Py_BuildValue("d",0.000000000000)); 
    131139        PyDict_SetItemString(self->params,"sld_flat8",Py_BuildValue("d",0.000003500000)); 
    132140        PyDict_SetItemString(self->params,"sld_flat9",Py_BuildValue("d",0.000004000000)); 
     141        PyDict_SetItemString(self->params,"sldIM_flat9",Py_BuildValue("d",0.000000000000)); 
    133142        PyDict_SetItemString(self->params,"background",Py_BuildValue("d",0.000000000000)); 
    134143        PyDict_SetItemString(self->params,"func_inter1",Py_BuildValue("d",0.000000000000)); 
     144        PyDict_SetItemString(self->params,"sldIM_sub0",Py_BuildValue("d",0.000000000000)); 
     145        PyDict_SetItemString(self->params,"sldIM_medium",Py_BuildValue("d",0.000000000000)); 
    135146        PyDict_SetItemString(self->params,"sld_flat10",Py_BuildValue("d",0.000003500000)); 
    136147        PyDict_SetItemString(self->params,"thick_inter0",Py_BuildValue("d",1.000000000000)); 
     148        PyDict_SetItemString(self->params,"sldIM_flat6",Py_BuildValue("d",0.000000000000)); 
    137149        PyDict_SetItemString(self->params,"func_inter4",Py_BuildValue("d",0.000000000000)); 
    138150        PyDict_SetItemString(self->params,"func_inter10",Py_BuildValue("d",0.000000000000)); 
     
    272284         
    273285            // Reader parameter dictionary 
     286    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 
    274287    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 
    275288    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 
     289    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 
     290    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 
     291    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 
    276292    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 
    277293    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); 
     
    291307    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 
    292308    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 
     309    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 
    293310    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     311    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 
    294312    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 
    295313    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 
     314    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 
    296315    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 
    297316    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); 
     
    311330    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 
    312331    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 
     332    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 
    313333    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 
    314334    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 
     335    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 
    315336    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    316337    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 
     338    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 
     339    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 
    317340    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 
    318341    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 
     342    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 
    319343    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 
    320344    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); 
     
    386410         
    387411            // Reader parameter dictionary 
     412    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 
    388413    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 
    389414    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 
     415    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 
     416    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 
     417    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 
    390418    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 
    391419    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); 
     
    405433    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 
    406434    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 
     435    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 
    407436    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     437    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 
    408438    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 
    409439    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 
     440    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 
    410441    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 
    411442    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); 
     
    425456    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 
    426457    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 
     458    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 
    427459    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 
    428460    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 
     461    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 
    429462    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    430463    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 
     464    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 
     465    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 
    431466    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 
    432467    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 
     468    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 
    433469    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 
    434470    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); 
     
    487523         
    488524            // Reader parameter dictionary 
     525    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 
    489526    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 
    490527    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 
     528    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 
     529    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 
     530    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 
    491531    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 
    492532    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); 
     
    506546    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 
    507547    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 
     548    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 
    508549    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     550    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 
    509551    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 
    510552    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 
     553    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 
    511554    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 
    512555    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); 
     
    526569    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 
    527570    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 
     571    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 
    528572    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 
    529573    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 
     574    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 
    530575    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    531576    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 
     577    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 
     578    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 
    532579    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 
    533580    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 
     581    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 
    534582    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 
    535583    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); 
     
    557605         
    558606            // Reader parameter dictionary 
     607    self->model->sldIM_flat4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat4") ); 
    559608    self->model->thick_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat8") ); 
    560609    self->model->thick_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat9") ); 
     610    self->model->sldIM_flat7 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat7") ); 
     611    self->model->sldIM_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat10") ); 
     612    self->model->sldIM_flat5 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat5") ); 
    561613    self->model->thick_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat1") ); 
    562614    self->model->thick_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat3") ); 
     
    576628    self->model->thick_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter8") ); 
    577629    self->model->thick_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter9") ); 
     630    self->model->sldIM_flat1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat1") ); 
    578631    self->model->scale = PyFloat_AsDouble( PyDict_GetItemString(self->params, "scale") ); 
     632    self->model->sldIM_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat2") ); 
    579633    self->model->func_inter9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter9") ); 
    580634    self->model->thick_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter10") ); 
     635    self->model->sldIM_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat3") ); 
    581636    self->model->func_inter8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter8") ); 
    582637    self->model->thick_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_flat2") ); 
     
    596651    self->model->sld_flat2 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat2") ); 
    597652    self->model->sld_flat3 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat3") ); 
     653    self->model->sldIM_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat8") ); 
    598654    self->model->sld_flat8 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat8") ); 
    599655    self->model->sld_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat9") ); 
     656    self->model->sldIM_flat9 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat9") ); 
    600657    self->model->background = PyFloat_AsDouble( PyDict_GetItemString(self->params, "background") ); 
    601658    self->model->func_inter1 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter1") ); 
     659    self->model->sldIM_sub0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_sub0") ); 
     660    self->model->sldIM_medium = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_medium") ); 
    602661    self->model->sld_flat10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sld_flat10") ); 
    603662    self->model->thick_inter0 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "thick_inter0") ); 
     663    self->model->sldIM_flat6 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "sldIM_flat6") ); 
    604664    self->model->func_inter4 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter4") ); 
    605665    self->model->func_inter10 = PyFloat_AsDouble( PyDict_GetItemString(self->params, "func_inter10") ); 
  • sansmodels/src/sans/models/c_models/corefourshell.cpp

    rc724ccd r339ce67  
    3333CoreFourShellModel :: CoreFourShellModel() { 
    3434        scale      = Parameter(1.0); 
    35         rad_core     = Parameter(60.0, true); 
    36         rad_core.set_min(0.0); 
    37         sld_core   = Parameter(6.4e-6); 
     35        rad_core0     = Parameter(60.0, true); 
     36        rad_core0.set_min(0.0); 
     37        sld_core0   = Parameter(6.4e-6); 
    3838        thick_shell1     = Parameter(10.0, true); 
    3939        thick_shell1.set_min(0.0); 
     
    6464        // Add the background after averaging 
    6565        dp[0] = scale(); 
    66         dp[1] = rad_core(); 
    67         dp[2] = sld_core(); 
     66        dp[1] = rad_core0(); 
     67        dp[2] = sld_core0(); 
    6868        dp[3] = thick_shell1(); 
    6969        dp[4] = sld_shell1(); 
     
    7979        // Get the dispersion points for the radius 
    8080        vector<WeightPoint> weights_rad; 
    81         rad_core.get_weights(weights_rad); 
     81        rad_core0.get_weights(weights_rad); 
    8282 
    8383        // Get the dispersion points for the thick 1 
     
    167167 
    168168        dp.scale = scale(); 
    169         dp.rad_core = rad_core(); 
    170         dp.sld_core = sld_core(); 
     169        dp.rad_core0 = rad_core0(); 
     170        dp.sld_core0 = sld_core0(); 
    171171        dp.thick_shell1 = thick_shell1(); 
    172172        dp.sld_shell1 = sld_shell1(); 
     
    182182        // Get the dispersion points for the radius 
    183183        vector<WeightPoint> weights_rad; 
    184         rad_core.get_weights(weights_rad); 
     184        rad_core0.get_weights(weights_rad); 
    185185 
    186186        // Get the dispersion points for the thick 1 
     
    207207        // Loop over radius weight points 
    208208        for(int i=0; i<weights_rad.size(); i++) { 
    209                 dp.rad_core = weights_rad[i].value; 
     209                dp.rad_core0 = weights_rad[i].value; 
    210210                // Loop over radius weight points 
    211211                for(int j=0; j<weights_s1.size(); j++) { 
     
    222222                                                //Un-normalize FourShell by volume 
    223223                                                sum += weights_rad[i].weight*weights_s1[j].weight*weights_s2[k].weight*weights_s3[l].weight*weights_s4[m].weight 
    224                                                         * (dp.rad_core+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4); 
     224                                                        * (dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4); 
    225225                                                norm += weights_rad[i].weight*weights_s1[j].weight*weights_s2[k].weight*weights_s3[l].weight*weights_s4[m].weight; 
    226226                                        } 
     
    234234        else{ 
    235235                //return normal value 
    236                 rad_out = dp.rad_core+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4;} 
     236                rad_out = dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4;} 
    237237 
    238238        return rad_out; 
  • sansmodels/src/sans/models/c_models/models.hh

    rd5b6a9d r339ce67  
    4949}; 
    5050 
     51class BarBellModel{ 
     52public: 
     53        // Model parameters 
     54        Parameter scale; 
     55        Parameter rad_bar; 
     56        Parameter len_bar; 
     57        Parameter rad_bell; 
     58        Parameter sld_barbell; 
     59        Parameter sld_solv; 
     60        Parameter background; 
     61        Parameter theta; 
     62        Parameter phi; 
     63 
     64        // Constructor 
     65        BarBellModel(); 
     66 
     67        // Operators to get I(Q) 
     68        double operator()(double q); 
     69        double operator()(double qx, double qy); 
     70        double calculate_ER(); 
     71        double evaluate_rphi(double q, double phi); 
     72}; 
     73 
     74class CappedCylinderModel{ 
     75public: 
     76        // Model parameters 
     77        Parameter scale; 
     78        Parameter rad_cyl; 
     79        Parameter len_cyl; 
     80        Parameter rad_cap; 
     81        Parameter sld_capcyl; 
     82        Parameter sld_solv; 
     83        Parameter background; 
     84        Parameter theta; 
     85        Parameter phi; 
     86 
     87        // Constructor 
     88        CappedCylinderModel(); 
     89 
     90        // Operators to get I(Q) 
     91        double operator()(double q); 
     92        double operator()(double qx, double qy); 
     93        double calculate_ER(); 
     94        double evaluate_rphi(double q, double phi); 
     95}; 
     96 
     97 
    5198class ParallelepipedModel{ 
    5299public: 
     
    80127        Parameter n_shells; 
    81128        Parameter scale; 
    82         Parameter rad_core; 
    83         Parameter sld_core; 
     129        Parameter rad_core0; 
     130        Parameter sld_core0; 
    84131        Parameter sld_solv; 
    85132        Parameter background; 
     
    256303        Parameter func_inter10; 
    257304 
     305        Parameter sldIM_flat1; 
     306        Parameter sldIM_flat2; 
     307        Parameter sldIM_flat3; 
     308        Parameter sldIM_flat4; 
     309        Parameter sldIM_flat5; 
     310        Parameter sldIM_flat6; 
     311        Parameter sldIM_flat7; 
     312        Parameter sldIM_flat8; 
     313        Parameter sldIM_flat9; 
     314        Parameter sldIM_flat10; 
     315 
     316        Parameter sldIM_sub0; 
     317        Parameter sldIM_medium; 
     318 
    258319        // Constructor 
    259320        ReflModel(); 
     
    511572        // Model parameters 
    512573        Parameter scale; 
    513         Parameter rad_core; 
    514         Parameter sld_core; 
     574        Parameter rad_core0; 
     575        Parameter sld_core0; 
    515576        Parameter thick_shell1; 
    516577        Parameter sld_shell1; 
  • sansmodels/src/sans/models/c_models/onion.cpp

    re096270 r339ce67  
    3333        n_shells = Parameter(1.0); 
    3434        scale = Parameter(1.0); 
    35         rad_core = Parameter(200.0); 
    36         sld_core = Parameter(1e-06); 
     35        rad_core0 = Parameter(200.0); 
     36        sld_core0 = Parameter(1e-06); 
    3737        sld_solv = Parameter(6.4e-06); 
    3838    background = Parameter(0.0); 
     
    112112        dp[0] = n_shells(); 
    113113        dp[1] = scale(); 
    114         dp[2] = rad_core(); 
    115         dp[3] = sld_core(); 
     114        dp[2] = rad_core0(); 
     115        dp[3] = sld_core0(); 
    116116        dp[4] = sld_solv(); 
    117117        dp[5] = 0.0; 
     
    175175        // Get the dispersion points for the radius 
    176176        vector<WeightPoint> weights_rad; 
    177         rad_core.get_weights(weights_rad); 
     177        rad_core0.get_weights(weights_rad); 
    178178 
    179179        // Get the dispersion points for the thick 1 
     
    313313double OnionModel :: calculate_ER() { 
    314314        OnionParameters dp; 
    315         dp.rad_core = rad_core(); 
     315        dp.rad_core0 = rad_core0(); 
    316316        dp.thick_shell1 = thick_shell1(); 
    317317        dp.thick_shell2 = thick_shell2(); 
     
    333333        // Get the dispersion points for the radius 
    334334        vector<WeightPoint> weights_rad; 
    335         rad_core.get_weights(weights_rad); 
     335        rad_core0.get_weights(weights_rad); 
    336336 
    337337        // Get the dispersion points for the thick 1 
     
    376376        // Loop over radius weight points 
    377377        for(int i=0; i<weights_rad.size(); i++) { 
    378                 dp.rad_core = weights_rad[i].value; 
     378                dp.rad_core0 = weights_rad[i].value; 
    379379                // Loop over radius weight points 
    380380                for(int j=0; j<weights_s1.size(); j++) { 
     
    411411                                                                                                        *weights_s5[n].weight*weights_s6[o].weight*weights_s7[p].weight*weights_s8[t].weight 
    412412                                                                                                        *weights_s9[r].weight*weights_s10[s].weight 
    413                                                                                                         * (dp.rad_core+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4+dp.thick_shell5 
     413                                                                                                        * (dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4+dp.thick_shell5 
    414414                                                                                                                        +dp.thick_shell6+dp.thick_shell7+dp.thick_shell8+dp.thick_shell9+dp.thick_shell10); 
    415415                                                                                                norm += weights_rad[i].weight*weights_s1[j].weight*weights_s2[k].weight*weights_s3[l].weight 
     
    433433        else{ 
    434434                //return normal value 
    435                 rad_out = dp.rad_core+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4 
     435                rad_out = dp.rad_core0+dp.thick_shell1+dp.thick_shell2+dp.thick_shell3+dp.thick_shell4 
    436436                                        +dp.thick_shell5+dp.thick_shell6+dp.thick_shell7+dp.thick_shell8+dp.thick_shell9+dp.thick_shell10;} 
    437437        return rad_out; 
  • sansmodels/src/sans/models/c_models/refl.cpp

    r35aface r339ce67  
    6767    func_inter10 = Parameter(0); 
    6868 
     69    sldIM_flat1 = Parameter(0); 
     70    sldIM_flat2 = Parameter(0); 
     71    sldIM_flat3 = Parameter(0); 
     72    sldIM_flat4 = Parameter(0); 
     73    sldIM_flat5 = Parameter(0); 
     74    sldIM_flat6 = Parameter(0); 
     75    sldIM_flat7 = Parameter(0); 
     76    sldIM_flat8 = Parameter(0); 
     77    sldIM_flat9 = Parameter(0); 
     78    sldIM_flat10 = Parameter(0); 
     79 
     80    sldIM_sub0 = Parameter(0); 
     81    sldIM_medium = Parameter(0); 
    6982} 
    7083 
     
    7588 */ 
    7689double ReflModel :: operator()(double q) { 
    77         double dp[47]; 
     90        double dp[59]; 
    7891        // Fill parameter array for IGOR library 
    7992        // Add the background after averaging 
     
    130143        dp[46] = func_inter10(); 
    131144 
     145        dp[47] = sldIM_flat1(); 
     146        dp[48] = sldIM_flat2(); 
     147        dp[49] = sldIM_flat3(); 
     148        dp[50] = sldIM_flat4(); 
     149        dp[51] = sldIM_flat5(); 
     150        dp[52] = sldIM_flat6(); 
     151        dp[53] = sldIM_flat7(); 
     152        dp[54] = sldIM_flat8(); 
     153        dp[55] = sldIM_flat9(); 
     154        dp[56] = sldIM_flat10(); 
     155 
     156        dp[57] = sldIM_sub0(); 
     157        dp[58] = sldIM_medium(); 
     158 
    132159        // Get the dispersion points for the radius 
    133160        //vector<WeightPoint> weights_thick; 
  • sansmodels/src/sans/models/test/utest_extra_models.py

    r35aface r339ce67  
    11""" 
    2     Unit tests for extra models,PolymerexclVolume, RPA10Model 
     2Unit tests for extra models,PolymerexclVolume, RPA10Model 
     3The reference values are calculated on IGOR/NIST package(Oct.,2010) 
     4@author: JHJ Cho / UTK 
    35""" 
    46import unittest 
    57class TestPolymerExclVolume(unittest.TestCase): 
    68    """ 
    7         Unit tests for PolymerexclVolume (non-shape) function 
     9    Unit tests for PolymerexclVolume (non-shape) function 
    810    """ 
    911    def setUp(self): 
     
    1719        self.assertAlmostEqual(self.model.runXY(0.41959), 0.000261302, 6) 
    1820         
    19 class TestPolymerExclVolume(unittest.TestCase): 
     21class TestRPA10Case(unittest.TestCase): 
    2022    """ 
    21         Unit tests for RPA10Model (non-shape) function 
     23    Unit tests for RPA10Model (non-shape) function 
    2224    """ 
    2325    def setUp(self): 
     
    8385        # case 9 
    8486        self.assertAlmostEqual(self.model9.run(0.001), 0.00839376, 6) 
    85         self.assertAlmostEqual(self.model9.runXY(0.414955), 0.00305777, 6)         
     87        self.assertAlmostEqual(self.model9.runXY(0.414955), 0.00305777, 6)   
     88               
     89class TestBarBell(unittest.TestCase): 
     90    """ 
     91    Unit tests for BarBell function 
     92    """ 
     93    def setUp(self): 
     94        from sans.models.BarBellModel import BarBellModel 
     95        self.model= BarBellModel() 
    8696         
     97    def test1D(self):           
     98        # the values are from Igor pro calculation     
     99        self.assertAlmostEqual(self.model.run(0.001), 2864.7, 1) 
     100        self.assertAlmostEqual(self.model.run(0.215268), 0.526351, 4) 
     101        self.assertAlmostEqual(self.model.runXY(0.414467), 0.0685892, 6) 
     102 
     103class TestCappedCylinder(unittest.TestCase): 
     104    """ 
     105    Unit tests for CappedCylinder function 
     106    """ 
     107    def setUp(self): 
     108        from sans.models.CappedCylinderModel import CappedCylinderModel 
     109        self.model= CappedCylinderModel() 
     110         
     111    def test1D(self):           
     112        # the values are from Igor pro calculation   
     113        # the different digits are due to precision of q values   
     114        self.assertAlmostEqual(self.model.run(0.001), 1424.72, 2) 
     115        self.assertAlmostEqual(self.model.run(0.215268), 0.360736, 4) 
     116        self.assertAlmostEqual(self.model.runXY(0.414467), 0.110283, 5) 
     117 
     118class TestLamellarParaCrystal(unittest.TestCase): 
     119    """ 
     120    Unit tests for LamellarParaCystal function 
     121    """ 
     122    def setUp(self): 
     123        from sans.models.LamellarPCrystalModel import LamellarPCrystalModel 
     124        self.model= LamellarPCrystalModel() 
     125         
     126    def test1D(self):     
     127        self.model.setParam("pd_spacing", 0.2)       
     128        # the values are from Igor pro calculation   
     129        # the different digits are due to precision of q values   
     130        self.assertAlmostEqual(self.model.run(0.001), 21829.3, 1) 
     131        self.assertAlmostEqual(self.model.run(0.215268), 0.00487686, 6) 
     132        self.assertAlmostEqual(self.model.runXY(0.414467), 0.00062029, 6) 
     133 
     134 
     135class TestSCParaCrystal(unittest.TestCase): 
     136    """ 
     137    Unit tests for Simple Cubic ParaCrystal Model function 
     138    """ 
     139    def setUp(self): 
     140        from sans.models.SCCrystalModel import SCCrystalModel 
     141        self.model= SCCrystalModel() 
     142         
     143    def test1D(self):         
     144        # the values are from Igor pro calculation   
     145        # the different digits are due to precision of q values   
     146        self.assertAlmostEqual(self.model.run(0.001), 10.3038, 4) 
     147        self.assertAlmostEqual(self.model.run(0.215268), 0.00714905, 6) 
     148        self.assertAlmostEqual(self.model.runXY(0.414467), 0.000313289, 6) 
     149 
     150class TestFCParaCrystal(unittest.TestCase): 
     151    """ 
     152    Unit tests for Face Centered Cubic ParaCrystal Model function 
     153    """ 
     154    def setUp(self): 
     155        from sans.models.FCCrystalModel import FCCrystalModel 
     156        self.model= FCCrystalModel() 
     157         
     158    def test1D(self):        
     159        self.model.setParam("d_factor", 0.05)   
     160        # the values are from Igor pro calculation   
     161        # the different digits are due to precision of q values   
     162        self.assertAlmostEqual(self.model.run(0.001), 0.121017, 6) 
     163        self.assertAlmostEqual(self.model.run(0.215268), 0.0107218, 6) 
     164        self.assertAlmostEqual(self.model.runXY(0.414467), 0.000443282, 6) 
     165 
     166class TestBCParaCrystal(unittest.TestCase): 
     167    """ 
     168    Unit tests for Body Centered Cubic ParaCrystal Model function 
     169    """ 
     170    def setUp(self): 
     171        from sans.models.BCCrystalModel import BCCrystalModel 
     172        self.model= BCCrystalModel() 
     173         
     174    def test1D(self):         
     175        # the values are from Igor pro calculation   
     176        # the different digits are due to precision of q values   
     177        self.assertAlmostEqual(self.model.run(0.001), 1.77267, 4) 
     178        self.assertAlmostEqual(self.model.run(0.215268), 0.00927739, 6) 
     179        self.assertAlmostEqual(self.model.runXY(0.414467), 0.000406973, 6) 
     180                                                         
    87181if __name__ == '__main__': 
    88182    unittest.main() 
  • sansmodels/src/sans/models/test/utest_model_sphereexpshell.py

    r1e7de38 r339ce67  
    4242        # model3: set param values as same as the model2 
    4343        self.model3.setParam("background", 0.0) 
    44         self.model3.setParam("rad_core", 200.0) 
     44        self.model3.setParam("rad_core0", 200.0) 
    4545        self.model3.setParam("scale", 1.0) 
    46         self.model3.setParam("sld_core", 1.0e-006) 
     46        self.model3.setParam("sld_core0", 1.0e-006) 
    4747        self.model3.setParam("sld_shell1", 1.7e-006) 
    4848        self.model3.setParam("sld_solv", 6.4e-006) 
     
    7272        # model: set param values as same as the model2 
    7373        self.model.setParam("background", 0.0) 
    74         self.model.setParam("rad_core", 100.0) 
     74        self.model.setParam("rad_core0", 100.0) 
    7575        self.model.setParam("scale", 1.0) 
    76         self.model.setParam("sld_core", 6.36e-006) 
     76        self.model.setParam("sld_core0", 6.36e-006) 
    7777        self.model.setParam("sld_in_shell1", 5e-007) 
    7878        self.model.setParam("sld_solv", 6.36e-006) 
     
    8080        # model2: set param values as same as the model2 
    8181        self.model2.setParam("background", 0.0) 
    82         self.model2.setParam("rad_core", 100.0) 
     82        self.model2.setParam("rad_core0", 100.0) 
    8383        self.model2.setParam("scale", 1.0) 
    84         self.model2.setParam("sld_core", 6.36e-006) 
     84        self.model2.setParam("sld_core0", 6.36e-006) 
    8585        self.model2.setParam("sld_in_shell1", 5e-007) 
    8686        self.model2.setParam("sld_solv", 6.36e-006) 
Note: See TracChangeset for help on using the changeset viewer.