Package reflectometry :: Package reduction :: Module rebincor

Source Code for Module reflectometry.reduction.rebincor

 1  # This program is public domain 
 2  from numpy import inf 
 3   
 4  # Rebinning operations 
5 -class LinearBinning(object):
6 """ 7 Desired time binning for the dataset. 8 9 start (0 Angstrom) 10 stop (inf Angstrom) 11 step (0.1 Angstrom) 12 13 Note that the limit will automatically cut off at the time bin 14 boundaries, so can be infinite. 15 """ 16 start = 0 17 stop = inf 18 step = 0.1
19 - def __init__(self, start=0.,stop=inf,step=0.1):
20 self.start,self.step,self.stop = start,step,stop
21
22 - def __str__(self):
23 return "LinearBinning(start=%g,stop=%g,step=%g)"\ 24 %(self.start,self.stop,self.step)
25
26 -class LogBinning(object):
27 """ 28 Desired time binning for the dataset. 29 30 start (1 Angstrom) 31 stop (inf Angstrom) 32 step (1 %) 33 34 Note that the upper limit will automatically cut off at the maximum 35 time bin boundary, so it can be infinite. 36 """ 37 start = 1 38 stop = 10 39 step = 1
40 - def __init__(self, start=1.,stop=inf,step=1):
41 self.start,self.step,self.stop = start,step,stop
42
43 - def __str__(self):
44 return "LogBinning(start=%g,stop=%g,step=%g)"\ 45 %(self.start,self.stop,self.step)
46