Ignore:
Timestamp:
Mar 30, 2010 5:56:04 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:
8d97277
Parents:
6e93a02
Message:

Updated the definition of SLD params according to new libigor functions

Location:
sansmodels/src/sans/models/c_extensions
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/c_extensions/cylinder.c

    rae3ce4e rf10063e  
    1818 */ 
    1919double cylinder_analytical_1D(CylinderParameters *pars, double q) { 
    20         double dp[5]; 
    21          
     20        double dp[6]; 
     21 
    2222        // Fill paramater array 
    2323        dp[0] = pars->scale; 
    2424        dp[1] = pars->radius; 
    2525        dp[2] = pars->length; 
    26         dp[3] = pars->contrast; 
    27         dp[4] = pars->background; 
    28          
     26        dp[3] = pars->sldCyl; 
     27        dp[4] = pars->sldSolv; 
     28        dp[5] = pars->background; 
     29 
    2930        // Call library function to evaluate model 
    30         return CylinderForm(dp, q);      
     31        return CylinderForm(dp, q); 
    3132} 
    3233 
     
    4142        q = sqrt(qx*qx+qy*qy); 
    4243    return cylinder_analytical_2D_scaled(pars, q, qx/q, qy/q); 
    43 }  
     44} 
    4445 
    4546 
     
    5354double cylinder_analytical_2D(CylinderParameters *pars, double q, double phi) { 
    5455    return cylinder_analytical_2D_scaled(pars, q, cos(phi), sin(phi)); 
    55 }  
    56          
     56} 
     57 
    5758/** 
    5859 * Function to evaluate 2D scattering function 
     
    6869        double alpha, vol, cos_val; 
    6970        double answer; 
    70          
     71 
    7172    // Cylinder orientation 
    7273    cyl_x = sin(pars->cyl_theta) * cos(pars->cyl_phi); 
    7374    cyl_y = sin(pars->cyl_theta) * sin(pars->cyl_phi); 
    7475    cyl_z = cos(pars->cyl_theta); 
    75       
     76 
    7677    // q vector 
    7778    q_z = 0; 
    78          
     79 
    7980    // Compute the angle btw vector q and the 
    8081    // axis of the cylinder 
    8182    cos_val = cyl_x*q_x + cyl_y*q_y + cyl_z*q_z; 
    82      
     83 
    8384    // The following test should always pass 
    8485    if (fabs(cos_val)>1.0) { 
     
    8687        return 0; 
    8788    } 
    88      
     89 
    8990    // Note: cos(alpha) = 0 and 1 will get an 
    9091    // undefined value from CylKernel 
    9192        alpha = acos( cos_val ); 
    92          
     93 
    9394        // Call the IGOR library function to get the kernel 
    9495        answer = CylKernel(q, pars->radius, pars->length/2.0, alpha) / sin(alpha); 
    95          
     96 
    9697        // Multiply by contrast^2 
    97         answer *= pars->contrast*pars->contrast; 
    98          
     98        answer *= (pars->sldCyl - pars->sldSolv)*(pars->sldCyl - pars->sldSolv); 
     99 
    99100        //normalize by cylinder volume 
    100101        //NOTE that for this (Fournet) definition of the integral, one must MULTIPLY by Vcyl 
    101102    vol = acos(-1.0) * pars->radius * pars->radius * pars->length; 
    102103        answer *= vol; 
    103          
     104 
    104105        //convert to [cm-1] 
    105106        answer *= 1.0e8; 
    106          
     107 
    107108        //Scale 
    108109        answer *= pars->scale; 
    109          
     110 
    110111        // add in the background 
    111112        answer += pars->background; 
    112          
     113 
    113114        return answer; 
    114115} 
    115      
     116 
  • sansmodels/src/sans/models/c_extensions/cylinder.h

    r27972c1d rf10063e  
    44 * [PYTHONCLASS] = CylinderModel 
    55 * [DISP_PARAMS] = radius, length, cyl_theta, cyl_phi 
    6    [DESCRIPTION] = <text> f(q)= 2*(scatter_sld - solvent_sld)*V*sin(qLcos(alpha/2)) 
     6   [DESCRIPTION] = <text> f(q)= 2*(sldCyl - sldSolv)*V*sin(qLcos(alpha/2)) 
    77                                /[qLcos(alpha/2)]*J1(qRsin(alpha/2))/[qRsin(alpha)] 
    88 
     
    3434    double length; 
    3535    /// Contrast [1/A^(2)] 
    36     //  [DEFAULT]=contrast=3.0e-6 [1/A^(2)] 
    37     double contrast; 
     36    //  [DEFAULT]=sldCyl=4.0e-6 [1/A^(2)] 
     37    double sldCyl; 
     38    /// sldCyl [1/A^(2)] 
     39    //  [DEFAULT]=sldSolv=1.0e-6 [1/A^(2)] 
     40    double sldSolv; 
    3841        /// Incoherent Background [1/cm] 0.00 
    3942        //  [DEFAULT]=background=0.0 [1/cm] 
  • sansmodels/src/sans/models/c_extensions/ellipsoid.c

    rdf4702f rf10063e  
    4444 */ 
    4545double ellipsoid_analytical_1D(EllipsoidParameters *pars, double q) { 
    46         double dp[5]; 
     46        double dp[6]; 
    4747 
    4848        dp[0] = pars->scale; 
    4949        dp[1] = pars->radius_a; 
    5050        dp[2] = pars->radius_b; 
    51         dp[3] = pars->contrast; 
    52         dp[4] = pars->background; 
     51        dp[3] = pars->sldEll; 
     52        dp[4] = pars->sldSolv; 
     53        dp[5] = pars->background; 
    5354 
    5455        return EllipsoidForm(dp, q); 
     
    117118 
    118119        // Multiply by contrast^2 
    119         answer *= pars->contrast*pars->contrast; 
     120        answer *= (pars->sldEll - pars->sldSolv) * (pars->sldEll - pars->sldSolv); 
    120121 
    121122        //normalize by cylinder volume 
  • sansmodels/src/sans/models/c_extensions/ellipsoid.h

    r27972c1d rf10063e  
    99 //[PYTHONCLASS] = EllipsoidModel 
    1010 //[DISP_PARAMS] = radius_a, radius_b, axis_theta, axis_phi 
    11  //[DESCRIPTION] = <text>"P(q.alpha)= scale*f(q)^(2)+ bkg, where f(q)= 3*(scatter_sld 
    12  //             - scatter_solvent)*V*[sin(q*r(Ra,Rb,alpha)) 
     11 //[DESCRIPTION] = <text>"P(q.alpha)= scale*f(q)^(2)+ bkg, where f(q)= 3*(sld_ell 
     12 //             - sld_solvent)*V*[sin(q*r(Ra,Rb,alpha)) 
    1313 //             -q*r*cos(qr(Ra,Rb,alpha))] 
    1414 //             /[qr(Ra,Rb,alpha)]^(3)" 
     
    1919 //             scatter_sld: SLD of the scatter 
    2020 //             solvent_sld: SLD of the solvent 
    21  //     contrast: SLD difference between scatter 
    22  //             and solvent 
     21 //     sldEll: SLD of ellipsoid 
     22 //             sldSolv: SLD of solvent 
    2323 //             V: volune of the Eliipsoid 
    2424 //             Ra: radius along the rotation axis 
     
    4646    double radius_b; 
    4747 
    48     /// Contrast [1/A^(2)] 
    49     //  [DEFAULT]=contrast=3.0e-6 [1/A^(2)] 
    50     double contrast; 
     48    /// sldEll [1/A^(2)] 
     49    //  [DEFAULT]=sldEll=4.0e-6 [1/A^(2)] 
     50    double sldEll; 
     51 
     52    /// sld of solvent [1/A^(2)] 
     53    //  [DEFAULT]=sldSolv=1.0e-6 [1/A^(2)] 
     54    double sldSolv; 
    5155 
    5256        /// Incoherent Background [1/cm] 
  • sansmodels/src/sans/models/c_extensions/elliptical_cylinder.c

    r975ec8e rf10063e  
    1717 */ 
    1818double elliptical_cylinder_analytical_1D(EllipticalCylinderParameters *pars, double q) { 
    19         double dp[6]; 
     19        double dp[7]; 
    2020 
    2121        // Fill paramater array 
     
    2424        dp[2] = pars->r_ratio; 
    2525        dp[3] = pars->length; 
    26         dp[4] = pars->contrast; 
    27         dp[5] = pars->background; 
     26        dp[4] = pars->sldCyl; 
     27        dp[5] = pars->sldSolv; 
     28        dp[6] = pars->background; 
    2829 
    2930        // Call library function to evaluate model 
     
    145146 
    146147        // Multiply by contrast^2 
    147         answer *= pars->contrast*pars->contrast; 
     148        answer *= (pars->sldCyl - pars->sldSolv) * (pars->sldCyl - pars->sldSolv); 
    148149 
    149150        //normalize by cylinder volume 
  • sansmodels/src/sans/models/c_extensions/elliptical_cylinder.h

    r27972c1d rf10063e  
    88r_ratio = the ratio of (r_major /r_minor >= 1) 
    99length = the length of the cylinder 
    10 contrast = SLD of solvent - SLD of the cylinder 
     10sldCyl = SLD of the cylinder 
     11sldSolv = SLD of solvent - 
    1112background = incoherent background 
    1213  *</text> 
     
    3132    //  [DEFAULT]=length=400.0 [A] 
    3233    double length; 
    33     /// Contrast [1/A^(2)] 
    34     //  [DEFAULT]=contrast=3.0e-6 [1/A^(2)] 
    35     double contrast; 
     34    /// SLD of cylinder [1/A^(2)] 
     35    //  [DEFAULT]=sldCyl=4.0e-6 [1/A^(2)] 
     36    double sldCyl; 
     37    /// SLD of solvent [1/A^(2)] 
     38    //  [DEFAULT]=sldSolv=1.0e-6 [1/A^(2)] 
     39    double sldSolv; 
    3640        /// Incoherent Background [1/cm] 0.000 
    3741        //  [DEFAULT]=background=0 [1/cm] 
  • sansmodels/src/sans/models/c_extensions/flexible_cylinder.c

    rea07075 rf10063e  
    1818 */ 
    1919double flexible_cylinder_analytical_1D(FlexibleCylinderParameters *pars, double q) { 
    20         double dp[6]; 
     20        double dp[7]; 
    2121 
    2222        // Fill paramater array 
     
    2525        dp[2] = pars->kuhn_length; 
    2626        dp[3] = pars->radius; 
    27         dp[4] = pars->contrast; 
    28         dp[5] = pars->background; 
     27        dp[4] = pars->sldCyl; 
     28        dp[5] = pars->sldSolv; 
     29        dp[6] = pars->background; 
    2930 
    3031        // Call library function to evaluate model 
  • sansmodels/src/sans/models/c_extensions/flexible_cylinder.h

    r27972c1d rf10063e  
    3131    //  [DEFAULT]=radius=20.0 [A] 
    3232    double radius; 
    33     /// Contrast [1/A^(2)] 
    34     //  [DEFAULT]=contrast=5.3e-6 [1/A^(2)] 
    35     double contrast; 
     33    /// SLD of cylinder [1/A^(2)] 
     34    //  [DEFAULT]=sldCyl=6.3e-6 [1/A^(2)] 
     35    double sldCyl; 
     36    /// SLD of solvent [1/A^(2)] 
     37    //  [DEFAULT]=sldSolv=1.0e-6 [1/A^(2)] 
     38    double sldSolv; 
    3639        /// Incoherent Background [1/cm] 
    3740        //  [DEFAULT]=background=0.0001 [1/cm] 
  • sansmodels/src/sans/models/c_extensions/hollow_cylinder.c

    re2afadf rf10063e  
    1717 */ 
    1818double hollow_cylinder_analytical_1D(HollowCylinderParameters *pars, double q) { 
    19         double dp[6]; 
     19        double dp[7]; 
    2020 
    2121        dp[0] = pars->scale; 
     
    2323        dp[2] = pars->radius; 
    2424        dp[3] = pars->length; 
    25         dp[4] = pars->contrast; 
    26         dp[5] = pars->background; 
     25        dp[4] = pars->sldCyl; 
     26        dp[5] = pars->sldSolv; 
     27        dp[6] = pars->background; 
    2728 
    2829        return HollowCylinder(dp, q); 
     
    8990        answer = HolCylKernel(q, pars->core_radius, pars->radius, pars->length, cos_val); 
    9091 
     92        // Multiply by contrast^2 
     93        answer *= (pars->sldCyl - pars->sldSolv)*(pars->sldCyl - pars->sldSolv); 
     94 
    9195        //normalize by cylinder volume 
    92         vol=acos(-1.0)*((pars->core_radius *pars->core_radius)-(pars->radius*pars->radius)) 
     96        vol=acos(-1.0)*((pars->radius*pars->radius)-(pars->core_radius *pars->core_radius)) 
    9397                        *(pars->length); 
    94         answer /= vol; 
     98        answer *= vol; 
    9599 
    96100        //convert to [cm-1] 
  • sansmodels/src/sans/models/c_extensions/hollow_cylinder.h

    r27972c1d rf10063e  
    1111 //                             radius = the radius of shell 
    1212 //                     length = the total length of the cylinder 
    13  //                             contrast = SLD of solvent - SLD of shell 
     13 //                             sldCyl = SLD of the shell 
     14 //                             sldSolv = SLD of the solvent 
    1415 //                             background = incoherent background 
    1516 //     </text> 
     
    3536    double length; 
    3637 
    37     /// Contrast  [1/A^(2)] 
    38     //  [DEFAULT]=contrast=5.3e-6 [1/A^(2)] 
    39     double contrast; 
     38    /// SLD_cylinder  [1/A^(2)] 
     39    //  [DEFAULT]=sldCyl=6.3e-6 [1/A^(2)] 
     40    double sldCyl; 
     41 
     42    /// SLD_solvent  [1/A^(2)] 
     43    //  [DEFAULT]=sldSolv=1.0e-6 [1/A^(2)] 
     44    double sldSolv; 
    4045 
    4146        /// Incoherent Background [1/cm] 
  • sansmodels/src/sans/models/c_extensions/lamellarPS.c

    rc1c29b6 rf10063e  
    1919LamellarPS_kernel(double dp[], double q) 
    2020{ 
    21         double scale,dd,del,contr,NN,Cp,bkg;            //local variables of coefficient wave 
     21        double scale,dd,del,sld_bi,sld_sol,contr,NN,Cp,bkg;             //local variables of coefficient wave 
    2222        double inten, qval,Pq,Sq,alpha,temp,t1,t2,t3,dQ; 
    2323        double Pi,Euler,dQDefault,fii; 
    2424        int ii,NNint; 
    2525        Euler = 0.5772156649;           // Euler's constant 
    26         dQDefault = 0.0;//0.0025;               //[=] 1/A, q-resolution, default value 
     26        dQDefault = 0.0;                //[=] 1/A, q-resolution, default value 
    2727        dQ = dQDefault; 
    2828 
     
    3333        dd = dp[1]; 
    3434        del = dp[2]; 
    35         contr = dp[3]; 
    36         NN = trunc(dp[4]);              //be sure that NN is an integer 
    37         Cp = dp[5]; 
    38         bkg = dp[6]; 
     35        sld_bi = dp[3]; 
     36        sld_sol = dp[4]; 
     37        NN = trunc(dp[5]);              //be sure that NN is an integer 
     38        Cp = dp[6]; 
     39        bkg = dp[7]; 
     40 
     41        contr = sld_bi - sld_sol; 
    3942 
    4043        Pq = 2.0*contr*contr/qval/qval*(1.0-cos(qval*del)); 
     
    7881 */ 
    7982double lamellarPS_analytical_1D(LamellarPSParameters *pars, double q) { 
    80         double dp[7]; 
     83        double dp[8]; 
    8184 
    8285        // Fill paramater array 
     
    8487        dp[1] = pars->spacing; 
    8588        dp[2] = pars->delta; 
    86         dp[3] = pars->contrast; 
    87         dp[4] = pars->n_plates; 
    88         dp[5] = pars->caille; 
    89         dp[6] = pars->background; 
     89        dp[3] = pars->sld_bi; 
     90        dp[4] = pars->sld_sol; 
     91        dp[5] = pars->n_plates; 
     92        dp[6] = pars->caille; 
     93        dp[7] = pars->background; 
    9094 
    9195        // Call library function to evaluate model 
  • sansmodels/src/sans/models/c_extensions/lamellarPS.h

    r27972c1d rf10063e  
    2121                *Parameters: spacing = repeat spacing, 
    2222                delta = bilayer thickness, 
    23                 contrast = SLD_solvent - SLD_bilayer 
     23                sld_bi = SLD_bilayer 
     24                sld_sol = SLD_solvent 
    2425                n_plate = # of Lamellar plates 
    2526                caille = Caille parameter (<0.8 or <1) 
     
    4142    //  [DEFAULT]=delta=30 [A] 
    4243    double delta; 
    43     /// Contrast [1/A^(2)] 
    44     //  [DEFAULT]=contrast=5.3e-6 [1/A^(2)] 
    45     double contrast; 
     44    /// SLD of bilayer [1/A^(2)] 
     45    //  [DEFAULT]=sld_bi=6.3e-6 [1/A^(2)] 
     46    double sld_bi; 
     47    /// SLD of solvent [1/A^(2)] 
     48    //  [DEFAULT]=sld_sol=1.0e-6 [1/A^(2)] 
     49    double sld_sol; 
    4650         /// Number of lamellar plates 
    4751    //  [DEFAULT]=n_plates=20 
  • sansmodels/src/sans/models/c_extensions/parallelepiped.c

    r8e36cdd rf10063e  
    1818 */ 
    1919double parallelepiped_analytical_1D(ParallelepipedParameters *pars, double q) { 
    20         double dp[6]; 
     20        double dp[7]; 
    2121 
    2222        // Fill paramater array 
     
    2525        dp[2] = pars->short_b; 
    2626        dp[3] = pars->long_c; 
    27         dp[4] = pars->contrast; 
    28         dp[5] = pars->background; 
     27        dp[4] = pars->sldPipe; 
     28        dp[5] = pars->sldSolv; 
     29        dp[6] = pars->background; 
    2930 
    3031        // Call library function to evaluate model 
     
    149150 
    150151        // Multiply by contrast^2 
    151         answer *= pars->contrast*pars->contrast; 
     152        answer *= (pars->sldPipe - pars->sldSolv) * (pars->sldPipe - pars->sldSolv); 
    152153 
    153154        //normalize by cylinder volume 
  • sansmodels/src/sans/models/c_extensions/parallelepiped.h

    r27972c1d rf10063e  
    1414                short_b: length of another short edge [A] 
    1515                long_c: length of long edge  of the parallelepiped [A] 
    16                 contrast: particle_sld - solvent_sld 
     16                sldPipe: Pipe_sld 
     17                sldSolv: solvent_sld 
    1718                background:Incoherent Background [1/cm] 
    1819                </text> 
     
    3536    //  [DEFAULT]=long_c=400 [A] 
    3637    double long_c; 
    37     /// Contrast [1/A^(2)] 
    38     //  [DEFAULT]=contrast=53e-7 [1/A^(2)] 
    39     double contrast; 
     38    /// SLD_Pipe [1/A^(2)] 
     39    //  [DEFAULT]=sldPipe=6.3e-6 [1/A^(2)] 
     40    double sldPipe; 
     41    /// sldSolv [1/A^(2)] 
     42    //  [DEFAULT]=sldSolv=1.0e-6 [1/A^(2)] 
     43    double sldSolv; 
    4044        /// Incoherent Background [1/cm] 
    4145        //  [DEFAULT]=background=0.0 [1/cm] 
  • sansmodels/src/sans/models/c_extensions/sphere.c

    rae3ce4e rf10063e  
    1717double sphere_analytical_1D(SphereParameters *pars, double q) { 
    1818        double dp[5]; 
    19          
     19 
    2020        dp[0] = pars->scale; 
    2121        dp[1] = pars->radius; 
    22         dp[2] = pars->contrast; 
    23         dp[3] = pars->background; 
    24          
     22        dp[2] = pars->sldSph; 
     23        dp[3] = pars->sldSolv; 
     24        dp[4] = pars->background; 
     25 
    2526        return SphereForm(dp, q); 
    2627} 
    27      
     28 
    2829/** 
    2930 * Function to evaluate 2D scattering function 
     
    3738 
    3839double sphere_analytical_2DXY(SphereParameters *pars, double qx, double qy){ 
    39         return sphere_analytical_1D(pars,sqrt(qx*qx+qy*qy));     
     40        return sphere_analytical_1D(pars,sqrt(qx*qx+qy*qy)); 
    4041} 
  • sansmodels/src/sans/models/c_extensions/sphere.h

    r27972c1d rf10063e  
    77 //[PYTHONCLASS] = SphereModel 
    88 //[DISP_PARAMS] = radius 
    9  //[DESCRIPTION] =<text>P(q)=(scale/V)*[3V(scatter_sld-solvent_sld)*(sin(qR)-qRcos(qR)) 
     9 //[DESCRIPTION] =<text>P(q)=(scale/V)*[3V(sldSph-sldSolv)*(sin(qR)-qRcos(qR)) 
    1010 //                                             /(qR)^3]^(2)+bkg 
    1111 // 
    1212 //                             bkg:background, R: radius of sphere 
    1313 //                             V:The volume of the scatter 
    14  //                             contrast:SLD difference between 
    15  //                             scatter and solvent 
    16  //                             scatter_sld: the SLD of the scatter 
    17  //                             solvent_sld: the SLD of the solvent 
     14 //                             sldSph: the SLD of the sphere 
     15 //                             sldSolv: the SLD of the solvent 
    1816 // 
    1917 //             </text> 
     
    3028    double radius; 
    3129 
    32     /// Contrast [1/A^(2)] 
    33     //  [DEFAULT]=contrast= 1.0e-6 [1/A^(2)] 
    34     double contrast; 
     30    /// sldSph [1/A^(2)] 
     31    //  [DEFAULT]=sldSph= 2.0e-6 [1/A^(2)] 
     32    double sldSph; 
     33 
     34    /// sldSolv [1/A^(2)] 
     35    //  [DEFAULT]=sldSolv= 1.0e-6 [1/A^(2)] 
     36    double sldSolv; 
    3537 
    3638        /// Incoherent Background [1/cm] 
  • sansmodels/src/sans/models/c_extensions/spheroid.c

    r975ec8e rf10063e  
    1010#include <stdlib.h> 
    1111 
    12  
    1312/** 
    1413 * Function to evaluate 1D scattering function 
     
    1817 */ 
    1918double spheroid_analytical_1D(SpheroidParameters *pars, double q) { 
    20         double dp[8]; 
     19        double dp[9]; 
    2120 
    2221        // Fill paramater array 
     
    2625        dp[3] = pars->equat_shell; 
    2726        dp[4] = pars->polar_shell; 
    28         dp[5] = pars->contrast; 
    29         dp[6] = pars->sld_solvent; 
    30         dp[7] = pars->background; 
     27        dp[5] = pars->sld_core; 
     28        dp[6] = pars->sld_shell; 
     29        dp[7] = pars->sld_solvent; 
     30        dp[8] = pars->background; 
    3131 
    3232        // Call library function to evaluate model 
    33         return ProlateForm(dp, q); 
     33        return OblateForm(dp, q); 
    3434} 
    3535 
     
    7373        double answer; 
    7474        double Pi = 4.0*atan(1.0); 
     75        double sldcs,sldss; 
    7576 
    7677    // ellipsoid orientation, the axis of the rotation is consistent with the ploar axis. 
     
    7879    cyl_y = sin(pars->axis_theta) * sin(pars->axis_phi); 
    7980    cyl_z = cos(pars->axis_theta); 
     81    //del sld 
     82    sldcs = pars->sld_core - pars->sld_shell; 
     83    sldss = pars->sld_shell- pars->sld_solvent; 
    8084 
    8185    // q vector 
     
    96100        alpha = acos( cos_val ); 
    97101 
    98         // Call the IGOR library function to get the kernel 
    99         answer = gfn4(cos_val,pars->equat_core,pars->polar_core,pars->equat_shell,pars->polar_shell,pars->contrast,pars->sld_solvent,q); 
    100  
     102        // Call the IGOR library function to get the kernel: MUST use gfn4 not gf2 because of the def of params. 
     103        answer = gfn4(cos_val,pars->equat_core,pars->polar_core,pars->equat_shell,pars->polar_shell,sldcs,sldss,q); 
     104        //It seems that it should be normalized somehow. How??? 
    101105 
    102106        //normalize by cylinder volume 
    103107        //NOTE that for this (Fournet) definition of the integral, one must MULTIPLY by Vcyl 
    104     vol = 4*Pi/3*pars->equat_shell*pars->equat_shell*pars->polar_shell; 
     108    vol = 4.0*Pi/3.0*pars->equat_shell*pars->equat_shell*pars->polar_shell; 
    105109        answer /= vol; 
    106110 
  • sansmodels/src/sans/models/c_extensions/spheroid.h

    r27972c1d rf10063e  
    1515                        equat_shell = equatorial radius of shell, 
    1616                        polar_shell = polar radius (revolution axis) of shell, 
    17                         contrast = SLD_core - SLD_shell 
     17                        sld_core = SLD_core 
     18                        sld_shell = SLD_shell 
    1819                        sld_solvent = SLD_solvent 
    1920                        background = Incoherent bkg 
     
    4546    //  [DEFAULT]=polar_shell=30.0 [A] 
    4647    double polar_shell; 
    47     ///  Scattering contrast [1/A^(2)] 
    48     //  [DEFAULT]=contrast=1.0e-6 [1/A^(2)] 
    49     double contrast; 
     48    ///  Core scattering length density [1/A^(2)] 
     49    //  [DEFAULT]=sld_core=2.0e-6 [1/A^(2)] 
     50    double sld_core; 
     51    ///  Shell scattering length density [1/A^(2)] 
     52    //  [DEFAULT]=sld_shell=1.0e-6 [1/A^(2)] 
     53    double sld_shell; 
    5054        /// Solvent scattering length density  [1/A^(2)] 
    5155    //  [DEFAULT]=sld_solvent=6.3e-6 [1/A^(2)] 
Note: See TracChangeset for help on using the changeset viewer.