Changes in / [045b7eac:1a30720] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/calculator/slit_length_calculator.py
rbfba720 rb699768 16 16 # y data 17 17 self.y = None 18 # 18 #default slit length 19 19 self.slit_length = 0.0 20 20 … … 42 42 """ 43 43 # None data do nothing 44 if self.y is None or self.x isNone:44 if self.y == None or self.x == None: 45 45 return 46 46 # set local variable … … 54 54 y_sum = 0.0 55 55 y_max = 0.0 56 ind = 0 56 ind = 0.0 57 57 58 58 # sum 10 or more y values until getting max_y, … … 70 70 # defaults 71 71 y_half_d = 0.0 72 ind = 0 72 ind = 0.0 73 73 # find indices where it crosses y = y_half. 74 74 while True: … … 81 81 82 82 # 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] 84 84 85 85 # get corresponding x values 86 86 x_half_d = x[ind] 87 x_half_u = x[ind -1]87 x_half_u = x[ind-1] 88 88 89 89 # calculate x at y = y_half using linear interpolation … … 91 91 x_half = (x_half_d + x_half_u)/2.0 92 92 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) 96 96 97 97 # Our slit length is half width, so just give half beam value
Note: See TracChangeset
for help on using the changeset viewer.