Skip to content

geometry

Models for geometry and geometry optimization Tasks.

Classes:

Name Description
OptimizeAgBhGeometryExhaustiveParameters

Parameter model for the OptimizeAgBhGeometryExhaustive Task. Used to optimize detector distance and beam center after acquiring Ag Behenate data.

OptimizeAgBhGeometryExhaustiveParameters

Bases: TaskParameters

TaskParameter model for OptimizeAgBhGeometryExhaustive Task.

This Task does geometry optimization of detector distance and beam center based on a powder image produced from acquiring a run of Ag Behenate.

Source code in lute/io/models/geometry.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
class OptimizeAgBhGeometryExhaustiveParameters(TaskParameters):
    """TaskParameter model for OptimizeAgBhGeometryExhaustive Task.

    This Task does geometry optimization of detector distance and beam center
    based on a powder image produced from acquiring a run of Ag Behenate.
    """

    _find_smd_path = validate_smd_path("powder")

    detname: str = Field(description="Name of the detector to optimize geometry for.")

    powder: str = Field(
        "", description="Path to the powder image, or file containing it."
    )

    geom_out_dir: str = Field(
        "", description="Directory to write new geometry files to."
    )

    mask: Optional[str] = Field(
        None, description="Path to a detector mask, or file containing it."
    )

    n_peaks: int = Field(4, description="")

    n_iterations: int = Field(
        5, description="Number of optimization iterations. Per MPI rank."
    )

    threshold: float = Field(
        1e6,
        description=(
            "Pixels in the powder image with an intensity above this threshold "
            "are set to 0."
        ),
    )

    dx: Tuple[float, float, int] = Field(
        (-6, 6, 5),
        description=(
            "Defines the search radius for beam center x position as offsets from "
            "the image center. Format: (left, right, num_steps). In units of pixels."
        ),
    )

    dy: Tuple[float, float, int] = Field(
        (-6, 6, 5),
        description=(
            "Defines the search radius for beam center y position as offsets from "
            "the image center. Format: (up, down, num_steps). In units of pixels."
        ),
    )

    center_guess: Optional[Tuple[float, float]] = Field(
        None, description=("Provide an optional starting guess for the beam center.")
    )

    distance_guess: Optional[float] = Field(
        None,
        description="Provide an optional starting guess for the detector distance (mm).",
    )