Skip to content

Commit

Permalink
change defaults and precision
Browse files Browse the repository at this point in the history
  • Loading branch information
glass-ships committed Feb 4, 2025
1 parent 3984762 commit fe9d197
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
19 changes: 11 additions & 8 deletions RefRed/interfaces/instrument_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,20 @@ def accept(self):


class InstrumentSettings(GlobalSettings):
"""Dataclass to store instrument geometry parameters. These are global options"""
"""Dataclass to store instrument geometry parameters. These are global options
Default values are determined by settings.json from lr_reduction
"""

# pydantic fields
apply_instrument_settings: bool = False
source_detector_distance: float = 0.0
sample_detector_distance: float = 0.0
num_x_pixels: int = 0
num_y_pixels: int = 0
pixel_width: float = 0.0
xi_reference: float = 0.0
s1_sample_distance: float = 0.0
source_detector_distance: float = 15.75
sample_detector_distance: float = 1.83
num_x_pixels: int = 256
num_y_pixels: int = 304
pixel_width: float = 0.70
xi_reference: float = 445
s1_sample_distance: float = 1.485

# class variable, translates fields to XML tag names, same names as the lr_reduction package
def to_xml(self, indent: str = "") -> str:
Expand Down
30 changes: 30 additions & 0 deletions RefRed/interfaces/instrument_settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,25 @@
<property name="maximum">
<double>1000000000.000000000000000</double>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="singleStep">
<double>0.1</double>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QDoubleSpinBox" name="pixel_width">
<property name="maximum">
<double>1000000000.000000000000000</double>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="singleStep">
<double>0.1</double>
</property>
</widget>
</item>
<item row="2" column="0">
Expand Down Expand Up @@ -129,6 +141,12 @@
<property name="maximum">
<double>1000000000.000000000000000</double>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="singleStep">
<double>0.1</double>
</property>
</widget>
</item>
<item row="1" column="0">
Expand All @@ -150,6 +168,12 @@
<property name="maximum">
<double>1000000000.000000000000000</double>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="singleStep">
<double>0.1</double>
</property>
</widget>
</item>
<item row="5" column="0">
Expand Down Expand Up @@ -224,6 +248,12 @@
<property name="maximum">
<double>1000000000.000000000000000</double>
</property>
<property name="decimals">
<number>3</number>
</property>
<property name="singleStep">
<double>0.1</double>
</property>
</widget>
</item>
<item row="0" column="2">
Expand Down

0 comments on commit fe9d197

Please sign in to comment.