Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage orientation of detector #2001

Merged
merged 32 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
edc9e6a
Orientation enum for the different possibilities
kif Nov 21, 2023
588ea12
Orientation handling
kif Nov 21, 2023
40111f8
fix test
kif Nov 21, 2023
3682efc
propagate orientation
kif Nov 21, 2023
8ee15ae
Orientation from Dectris detector (by default)
kif Nov 21, 2023
e4b1cab
Update version number: this is PR is a big change
kif Nov 21, 2023
9b36f0e
propagate the orientation all over pyFAI code baase
kif Nov 21, 2023
9ddc20c
provide orientation value in addition to the name
kif Nov 21, 2023
be56102
typo
kif Nov 21, 2023
54ba377
The default orientation in pyFAI is "3"
kif Nov 22, 2023
5d9af22
typo
kif Nov 22, 2023
d11e441
typo
kif Nov 22, 2023
508c153
default orientation is 3
kif Nov 22, 2023
dff8865
Most tests are passing again ...
kif Nov 22, 2023
aff21ad
Fix instanciation test
kif Nov 23, 2023
3de2ada
fix a test (typo)
kif Nov 23, 2023
fef14aa
fix tests
kif Nov 23, 2023
bc0be18
Include non regression tests
kif Nov 23, 2023
25bf9dd
Revert detector orientation for dectris for now
kif Nov 23, 2023
e1d5f52
remove debug statement
kif Nov 23, 2023
40bfd07
Make orientation a property
kif Nov 23, 2023
ebe33e8
copy `_orientation` instead of `orientation`
kif Nov 23, 2023
ee163a4
Update src/pyFAI/detectors/_common.py
kif Nov 23, 2023
4bce579
Update src/pyFAI/detectors/_common.py
kif Nov 23, 2023
0dbd972
Update src/pyFAI/detectors/_dectris.py
kif Nov 23, 2023
abd5ac4
Update src/pyFAI/detectors/orientation.py
kif Nov 23, 2023
26fccfd
Update src/pyFAI/test/test_detector.py
kif Nov 23, 2023
7538d06
Update src/pyFAI/test/test_detector.py
kif Nov 23, 2023
f68cc43
Update src/pyFAI/test/test_detector.py
kif Nov 23, 2023
97b2fe3
typo
kif Nov 23, 2023
dc06fc4
Update src/pyFAI/detectors/_rayonix.py
kif Nov 23, 2023
5f563f4
orientation is now a property
kif Nov 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pyFAI/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
__authors__ = ["Jérôme Kieffer", "V. Valls"]
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "06/10/2023"
__date__ = "21/11/2023"
__status__ = "production"
__docformat__ = 'restructuredtext'
__all__ = ["date", "version_info", "strictversion", "hexversion", "debianversion",
Expand All @@ -61,7 +61,7 @@
"final": 15}

MAJOR = 2023
MINOR = 10
MINOR = 11
MICRO = 0
RELEV = "dev" # <16
SERIAL = 0 # <16
Expand Down
10 changes: 5 additions & 5 deletions src/pyFAI/azimuthalIntegrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
__contact__ = "[email protected]"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "04/10/2023"
__date__ = "21/11/2023"
__status__ = "stable"
__docformat__ = 'restructuredtext'

Expand Down Expand Up @@ -118,7 +118,7 @@ class AzimuthalIntegrator(Geometry):
def __init__(self, dist=1, poni1=0, poni2=0,
rot1=0, rot2=0, rot3=0,
pixel1=None, pixel2=None,
splineFile=None, detector=None, wavelength=None):
splineFile=None, detector=None, wavelength=None, orientation=0):
"""
:param dist: distance sample - detector plan (orthogonal distance, not along the beam), in meter.
:type dist: float
Expand Down Expand Up @@ -152,12 +152,12 @@ def __init__(self, dist=1, poni1=0, poni2=0,
description is deprecated. Prefer using the result of the detector
factory: ``pyFAI.detector_factory("eiger4m")``
:type detector: str or pyFAI.Detector
:param wavelength: Wave length used in meter
:type wavelength: float
:param float wavelength: Wave length used in meter
:param int orientation: orientation of the detector, see pyFAI.detectors.orientation.Orientation
"""
Geometry.__init__(self, dist, poni1, poni2,
rot1, rot2, rot3,
pixel1, pixel2, splineFile, detector, wavelength)
pixel1, pixel2, splineFile, detector, wavelength, orientation)

# mask, maskfile, darkcurrent and flatfield are properties pointing to
# self.detector now (16/06/2017)
Expand Down
56 changes: 28 additions & 28 deletions src/pyFAI/detectors/_adsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@
`web archive <https://web.archive.org/web/20150403133907/http://www.adsc-xray.com/>`_.
"""

__author__ = "Jerome Kieffer"
__author__ = "Jérôme Kieffer"
__contact__ = "[email protected]"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "07/09/2023"
__date__ = "22/11/2023"
__status__ = "production"

from collections import OrderedDict
from ._common import Detector
from ._common import Detector, Orientation

import logging
logger = logging.getLogger(__name__)
Expand All @@ -53,16 +52,17 @@ class _ADSC(Detector):
"""
MANUFACTURER = "ADSC"

def __init__(self, pixel1=51e-6, pixel2=51e-6, max_shape=None):
Detector.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape)
def __init__(self, pixel1=51e-6, pixel2=51e-6, max_shape=None, orientation=0):
Detector.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape, orientation=orientation)

def get_config(self):
"""Return the configuration with arguments to the constructor

:return: dict with param for serialization
"""
return OrderedDict((("pixel1", self._pixel1),
("pixel2", self._pixel2)))
return {"pixel1": self._pixel1,
"pixel2": self._pixel2,
"orientation": self.orientation or 3}


class ADSC_Q315(_ADSC):
Expand All @@ -78,8 +78,8 @@ class ADSC_Q315(_ADSC):
MAX_SHAPE = (6144, 6144)
aliases = ["Quantum 315"]

def __init__(self, pixel1=51e-6, pixel2=51e-6, max_shape=None):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape)
def __init__(self, pixel1=51e-6, pixel2=51e-6, max_shape=None, orientation=0):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape, orientation=orientation)


class ADSC_Q210(_ADSC):
Expand All @@ -95,8 +95,8 @@ class ADSC_Q210(_ADSC):
MAX_SHAPE = (4096, 4096)
aliases = ["Quantum 210"]

def __init__(self, pixel1=51e-6, pixel2=51e-6, max_shape=None):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape)
def __init__(self, pixel1=51e-6, pixel2=51e-6, max_shape=None, orientation=0):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape, orientation=orientation)


class ADSC_Q270(_ADSC):
Expand All @@ -112,8 +112,8 @@ class ADSC_Q270(_ADSC):
MAX_SHAPE = (4168, 4168)
aliases = ["Quantum 270"]

def __init__(self, pixel1=64.8e-6, pixel2=64.8e-6, max_shape=None):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape)
def __init__(self, pixel1=64.8e-6, pixel2=64.8e-6, max_shape=None, orientation=0):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape, orientation=orientation)


class ADSC_Q4(_ADSC):
Expand All @@ -129,8 +129,8 @@ class ADSC_Q4(_ADSC):
MAX_SHAPE = (2304, 2304)
aliases = ["Quantum 4"]

def __init__(self, pixel1=82e-6, pixel2=82e-6, max_shape=None):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape)
def __init__(self, pixel1=82e-6, pixel2=82e-6, max_shape=None, orientation=0):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape, orientation=orientation)


class HF_130K(_ADSC):
Expand All @@ -145,8 +145,8 @@ class HF_130K(_ADSC):
MAX_SHAPE = (256, 512)
aliases = ["HF-130k"]

def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape)
def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None, orientation=0):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape, orientation=orientation)


class HF_262k(_ADSC):
Expand All @@ -162,8 +162,8 @@ class HF_262k(_ADSC):
MAX_SHAPE = (512, 512)
aliases = ["HF-262k"]

def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape)
def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None, orientation=0):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape, orientation=orientation)


class HF_1M(_ADSC):
Expand All @@ -179,8 +179,8 @@ class HF_1M(_ADSC):
MAX_SHAPE = (1024, 1024)
aliases = ["HF-1M"]

def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape)
def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None, orientation=0):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape, orientation=orientation)


class HF_2M(_ADSC):
Expand All @@ -196,8 +196,8 @@ class HF_2M(_ADSC):
MAX_SHAPE = (1536, 1536)
aliases = ["HF-2.4M"]

def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape)
def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None, orientation=0):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape, orientation=orientation)


class HF_4M(_ADSC):
Expand All @@ -211,8 +211,8 @@ class HF_4M(_ADSC):
MAX_SHAPE = (2048, 2048)
aliases = ["HF-4M"]

def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape)
def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None, orientation=0):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape, orientation=orientation)


class HF_9M(_ADSC):
Expand All @@ -227,5 +227,5 @@ class HF_9M(_ADSC):
MAX_SHAPE = (3072, 3072)
aliases = ["HF-9.4M"]

def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape)
def __init__(self, pixel1=150e-6, pixel2=150e-6, max_shape=None, orientation=0):
_ADSC.__init__(self, pixel1=pixel1, pixel2=pixel2, max_shape=max_shape, orientation=orientation)
Loading