Package reflectometry :: Package reduction :: Module reverse

Source Code for Module reflectometry.reduction.reverse

 1  """ 
 2  Some machines allow the sample to be rotated by 180 
 3  degrees, reversing the usual sense of the angles. 
 4   
 5  We provide two corrections, one which reverses the usual sense of the 
 6  angles, and the other which assumes that all reflection is from the 
 7  top of the film and there is no back reflectivity. 
 8   
 9  ReverseCorrection 
10  FrontCorrection 
11  """ 
12   
13  from reflectometry.reduction.correction import Correction 
14   
15 -class ReverseCorrection(Correction):
16 """ 17 Reverse the sense of the reflection angles, making positive angles 18 negative and vice versa 19 """
20 - def apply(self,data):
21 data.sample.angle_x = -data.sample.angle_x 22 data.detector.angle_x = -data.detector.angle_x
23 - def __str__(self): return "ReverseCorrection()"
24
25 -class FrontCorrection(Correction):
26 """ 27 Assume all reflection is off the top surface, reversing the sense 28 of negative angles. 29 """
30 - def apply(self,data):
31 data.sample.angle_x = abs(data.sample.angle_x) 32 data.detector.angle_x = abs(data.detector.angle_x)
33 - def __str__(self): return "FrontCorrection()"
34