Changeset 9c79c32 in sasmodels


Ignore:
Timestamp:
Jan 6, 2016 9:20:31 PM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
74667d3
Parents:
8b25ee1
Message:

use cos(theta) scaling on theta polydispersity to match sasview; allow kernels to return NaN to ignore invalid parameter values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernel_template.c

    re3a9733 r9c79c32  
    204204 
    205205      const double scattering = Iqxy(qxi, qyi, IQXY_PARAMETERS); 
     206      if (!isnan(scattering)) { // if scattering is bad, exclude it from sum 
    206207      //if (scattering >= 0.0) { // scattering cannot be negative 
    207208        // TODO: use correct angle for spherical correction 
     
    214215      #if defined(IQXY_HAS_THETA) // && 0 
    215216        const double spherical_correction 
    216           = (Ntheta>1 ? fabs(cos(M_PI_180*phi))*M_PI_2:1.0); 
     217          = (Ntheta>1 ? fabs(cos(M_PI_180*theta))*M_PI_2:1.0); 
    217218        const double next = spherical_correction * weight * scattering; 
    218219      #else 
     
    233234      #endif 
    234235        norm_vol += vol_weight; 
    235       //} 
     236      } 
    236237      //else { printf("exclude qx,qy,I:%%g,%%g,%%g\n",qi,scattering); } 
    237238    } 
Note: See TracChangeset for help on using the changeset viewer.