Source code for xconf.detector
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This module describes X-ray detectors.
"""
__copyright__ = "Copyright (C) 2019 Florian Otte"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""
import xconf.misc.units as units
[docs]class Detector(object):
"""
Detector base class. A detector is described by *pixel_size* (also called
pitch in the case of 1D detectors) and the number of *pixels*.
"""
def __init__(self, pixel_size, pixels):
self.ps = pixel_size
self.pixels = pixels
def get_chip_size(self):
return self.ps * self.pixels
[docs]class Pilatus100K(Detector):
"""
Model the DECTRIS Pilatus 100K detector. Pixel size is 172um, number of
pixels is 487.
"""
def __init__(self):
Detector.__init__(self, units.Length(172, 'um'), 487)
[docs]class GreatEyes(Detector):
"""
Model the GreatEyes GE 2035 256 BI DD detector. Pixel size is 26um, number
of pixels is 1024.
"""
def __init__(self):
Detector.__init__(self, units.Length(26, 'um'), 1024)
[docs]class PSIGotthard(Detector):
"""
Model the PSI Gotthard detector. Pixel size is 50um, number
of pixels is 1024.
"""
def __init__(self):
Detector.__init__(self, units.Length(50, 'um'), 1280)
[docs]class PSIJungfrauModule(Detector):
"""
Model the PSI Jungfrau 500K module detector. Pixel size is 75um, number
of pixels is 1024.
"""
def __init__(self):
Detector.__init__(self, units.Length(75, 'um'), 1024)