Changeset f867cd9 in sasview for DataLoader/extensions


Ignore:
Timestamp:
Dec 17, 2010 3:26:52 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:
7342634
Parents:
0d8c8d7
Message:

fixed the edge problem in Q(pinhole) smearer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DataLoader/extensions/smearer.cpp

    r65883cf rf867cd9  
    211211 
    212212                        // Compute the fraction of the Gaussian contributing 
    213                         // to the q bin between q_min and q_max 
    214                         double value =  erf( (q_max-q_j)/(sqrt(2.0)*width[j]) ); 
    215                 value -= erf( (q_min-q_j)/(sqrt(2.0)*width[j]) ); 
     213                        // to the q_j bin between q_jmin and q_jmax 
     214                        double value =  erf( (q_jmax-q)/(sqrt(2.0)*width[i]) ); 
     215                value -= erf( (q_jmin-q)/(sqrt(2.0)*width[i]) ); 
    216216                (*weights)[i*nbins+j] += value; 
    217217                } 
     
    273273 
    274274                for(int i=first_bin; i<=last_bin; i++){ 
     275                        // Skip if weight is less than 1e-04(this value is much smaller than 
     276                        // the weight at the 3*sigma distance 
     277                        // Will speed up a little bit... 
     278                        if ((*weights)[q_i*nbins+i] < 1.0e-004){ 
     279                                continue; 
     280                        } 
    275281                        sum += iq_in[i] * (*weights)[q_i*nbins+i]; 
    276282                        counts += (*weights)[q_i*nbins+i]; 
     
    279285                // Normalize counts 
    280286                iq_out[q_i] = (counts>0.0) ? sum/counts : 0; 
     287                //printf("\n iii=%g,%g ",iq_out[q_i], q_i); 
    281288        } 
    282289} 
Note: See TracChangeset for help on using the changeset viewer.