Ejemplo n.º 1
0
def distance(x = None):
    '''Read or set the detector distance'''
    ts = DeviceProxy('i11-ma-cx1/dt/dtc_ccd.1-mt_ts')
    
    if x == None:
        return ts.position
    
    ts.position = x
Ejemplo n.º 2
0
def detectorPosition(x = None):
    '''Read or set the detector position'''
    ts = DeviceProxy('i11-ma-cx1/dt/dtc_ccd.1-mt_ts')
    tx = DeviceProxy('i11-ma-cx1/dt/dtc_ccd.1-mt_tx')
    tz = DeviceProxy('i11-ma-cx1/dt/dtc_ccd.1-mt_tz')
    
    if x == None:
        return ts.position, tx.position, tz.position
        
    ts.position, tx.position, tz.position = x
Ejemplo n.º 3
0
def resolution(x = None):
    '''Read or set the resolution'''
    
    ts = DeviceProxy('i11-ma-cx1/dt/dtc_ccd.1-mt_ts')
    
    diameter = 315. # detector diameter in mm
    radius = diameter / 2.
    distance = ts.position
    wavelen = wavelength()
    
    if x == None:
        theta = math.atan(radius / distance)
        resolution = 0.5 * wavelen / math.sin(theta / 2.)
        return resolution
    
    theta = math.asin(wavelen / 2. / x)
    distance = radius / math.tan(2. * theta)
    ts.position = distance