Ignore:
Timestamp:
Aug 4, 2009 1:20:01 PM (15 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:
8e91f01
Parents:
2cc633b
Message:

some corrections on dips-parameters and adding 2D cal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/c_models/lamellar.cpp

    r34c3020 r42f193a  
    3434LamellarModel :: LamellarModel() { 
    3535        scale      = Parameter(1.0); 
    36         delta     = Parameter(50.0, true); 
     36        delta     = Parameter(50.0); 
    3737        delta.set_min(0.0); 
    38         sigma    = Parameter(0.15, true); 
     38        sigma    = Parameter(0.15); 
     39        sigma.set_min(0.0); 
    3940        contrast   = Parameter(5.3e-6); 
    4041        background = Parameter(0.0); 
     
    5960        dp[4] = background(); 
    6061 
    61  
    62         // Get the dispersion points for the bilayer thickness(delta) 
    63         vector<WeightPoint> weights_delta; 
    64         delta.get_weights(weights_delta); 
    65  
    66         // Perform the computation, with all weight points 
    67         double sum = 0.0; 
    68         double norm = 0.0; 
    69  
    70         // Loop over semi axis A weight points 
    71         for(int i=0; i< (int)weights_delta.size(); i++) { 
    72                 dp[1] = weights_delta[i].value; 
    73                 sum += weights_delta[i].weight* LamellarFF(dp, q); 
    74                 norm += weights_delta[i].weight; 
    75                                  
    76         } 
    77         return sum/norm + background(); 
     62        return LamellarFF(dp, q); 
    7863} 
    7964 
     
    8671 
    8772double LamellarModel :: operator()(double qx, double qy) { 
    88         LamellarParameters dp; 
    89  
    90         // Fill parameter array for IGOR library 
    91         // Add the background after averaging 
    92         dp.scale = scale(); 
    93         dp.delta = delta(); 
    94         dp.sigma = sigma(); 
    95         dp.contrast = contrast(); 
    96         dp.background = background(); 
    97  
    98  
    99         // Get the dispersion points for the bilayer thickness(delta) 
    100         vector<WeightPoint> weights_delta; 
    101         delta.get_weights(weights_delta); 
    102  
    103         // Perform the computation, with all weight points 
    104         double sum = 0.0; 
    105         double norm = 0.0; 
    106  
    107         // Loop over detla  weight points 
    108         for(int i=0; i< (int)weights_delta.size(); i++) { 
    109                 dp.delta = weights_delta[i].value; 
    110                 sum += weights_delta[i].weight* lamellar_analytical_2DXY(&dp, qx, qy); 
    111                 norm += weights_delta[i].weight; 
    112                                  
    113         } 
    114         return sum/norm + background(); 
     73        double q = sqrt(qx*qx + qy*qy); 
     74        return (*this).operator()(q); 
    11575} 
    11676 
     
    12383 */ 
    12484double LamellarModel :: evaluate_rphi(double q, double phi) { 
    125         double qx = q*cos(phi); 
    126         double qy = q*sin(phi); 
    127         return (*this).operator()(qx, qy); 
     85        return (*this).operator()(q); 
    12886} 
Note: See TracChangeset for help on using the changeset viewer.