Changes in / [1a30720:045b7eac] in sasview


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/calculator/slit_length_calculator.py

    rb699768 rbfba720  
    1616        # y data 
    1717        self.y = None 
    18         #default slit length 
     18        # default slit length 
    1919        self.slit_length = 0.0 
    2020 
     
    4242        """ 
    4343        # None data do nothing 
    44         if self.y == None or self.x == None: 
     44        if self.y is None or self.x is None: 
    4545            return 
    4646        # set local variable 
     
    5454        y_sum = 0.0 
    5555        y_max = 0.0 
    56         ind = 0.0 
     56        ind = 0 
    5757 
    5858        # sum 10 or more y values until getting max_y, 
     
    7070        # defaults 
    7171        y_half_d = 0.0 
    72         ind = 0.0 
     72        ind = 0 
    7373        # find indices where it crosses y = y_half. 
    7474        while True: 
     
    8181 
    8282        # y value and ind just before passed the spot of the half height 
    83         y_half_u = y[ind-1] 
     83        y_half_u = y[ind - 1] 
    8484 
    8585        # get corresponding x values 
    8686        x_half_d = x[ind] 
    87         x_half_u = x[ind-1] 
     87        x_half_u = x[ind - 1] 
    8888 
    8989        # calculate x at y = y_half using linear interpolation 
     
    9191            x_half = (x_half_d + x_half_u)/2.0 
    9292        else: 
    93             x_half = (x_half_u * (y_half - y_half_d)  \ 
    94                        + x_half_d * (y_half_u - y_half)) \ 
    95                         / (y_half_u - y_half_d) 
     93            x_half = ((x_half_u * (y_half - y_half_d) 
     94                       + x_half_d * (y_half_u - y_half)) 
     95                       / (y_half_u - y_half_d)) 
    9696 
    9797        # Our slit length is half width, so just give half beam value 
Note: See TracChangeset for help on using the changeset viewer.