Changeset 5f65636 in sasview for sansmodels/src/sans/models


Ignore:
Timestamp:
Feb 10, 2012 12:33:06 PM (13 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:
ccb7363
Parents:
664c5a7
Message:

fixed minor bug with zero dq

File:
1 edited

Legend:

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

    r2b440504 r5f65636  
    500500    # Length of the width 
    501501    length = len(width) 
    502     width_low = math.fabs(width[0]) 
     502    width_low = math.fabs(width[0])    
    503503    width_high = math.fabs(width[length -1]) 
    504      
     504    nbins_low = 0.0  
     505    nbins_high = 0.0 
    505506    # Compare width(dQ) to the data bin size and take smaller one as the bin  
    506507    # size of the extrapolation; this will correct some weird behavior  
     
    522523    # Number of q points required below the 1st data point in order to extend 
    523524    # them 3 times of the width (std) 
    524     nbins_low = math.ceil(3.0 * width_low / bin_size_low) 
     525    if width_low > 0.0: 
     526        nbins_low = math.ceil(3.0 * width_low / bin_size_low) 
    525527    # Number of q points required above the last data point 
    526     nbins_high = math.ceil(3.0 * width_high / (bin_size_high)) 
     528    if width_high > 0.0: 
     529        nbins_high = math.ceil(3.0 * width_high / bin_size_high) 
    527530    # Make null q points         
    528531    extra_low = numpy.zeros(nbins_low) 
Note: See TracChangeset for help on using the changeset viewer.