From 553d887fcdc4909b48732d032f2ffe577bf462d9 Mon Sep 17 00:00:00 2001 From: Brianna Major Date: Mon, 6 Feb 2023 11:01:14 -0500 Subject: [PATCH 1/2] Add support for the BBXRD instrument Signed-off-by: Brianna Major --- hexrd/ui/llnl_import_tool_dialog.py | 9 +++++---- hexrd/ui/resources/ui/llnl_import_tool_dialog.ui | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hexrd/ui/llnl_import_tool_dialog.py b/hexrd/ui/llnl_import_tool_dialog.py index b5639309e..9ff081d79 100644 --- a/hexrd/ui/llnl_import_tool_dialog.py +++ b/hexrd/ui/llnl_import_tool_dialog.py @@ -60,7 +60,7 @@ def __init__(self, cmap=None, parent=None): self.setup_connections() def setup_connections(self): - self.ui.instruments.currentIndexChanged.connect( + self.ui.instruments.currentTextChanged.connect( self.instrument_selected) self.ui.load.clicked.connect(self.load_images) self.ui.detectors.currentIndexChanged.connect(self.detector_selected) @@ -139,14 +139,13 @@ def load_config(self): self.ui.config_file_label.setText(os.path.basename(self.config_file)) self.ui.config_file_label.setToolTip(self.config_file) - def instrument_selected(self, idx): + def instrument_selected(self, instrument): if HexrdConfig().show_beam_marker: HexrdConfig().show_beam_marker = False self.detectors.clear() self.detector_defaults.clear() - instruments = {1: 'TARDIS', 2: 'PXRDIP'} - self.instrument = instruments.get(idx, None) + self.instrument = instrument if self.instrument is None: self.import_in_progress = False @@ -186,6 +185,8 @@ def load_instrument_config(self): temp = tempfile.NamedTemporaryFile(delete=False, suffix='.hexrd') self.config_file = temp.name HexrdConfig().save_instrument_config(self.config_file) + if self.ui.instruments.currentIndex() == 0: # No instrument selected + return fname = f'default_{self.instrument.lower()}_config.yml' with resource_loader.resource_path( hexrd.ui.resources.calibration, fname) as f: diff --git a/hexrd/ui/resources/ui/llnl_import_tool_dialog.ui b/hexrd/ui/resources/ui/llnl_import_tool_dialog.ui index 7f224bf0d..da6f6271d 100644 --- a/hexrd/ui/resources/ui/llnl_import_tool_dialog.ui +++ b/hexrd/ui/resources/ui/llnl_import_tool_dialog.ui @@ -81,6 +81,11 @@ PXRDIP + + + BBXRD + + From 40121768905f6c43dd0ddd569c58f75d8b641189 Mon Sep 17 00:00:00 2001 From: Brianna Major Date: Mon, 6 Feb 2023 11:06:56 -0500 Subject: [PATCH 2/2] Add default BBXRD config file Signed-off-by: Brianna Major --- .../calibration/default_bbxrd_config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 hexrd/ui/resources/calibration/default_bbxrd_config.yml diff --git a/hexrd/ui/resources/calibration/default_bbxrd_config.yml b/hexrd/ui/resources/calibration/default_bbxrd_config.yml new file mode 100644 index 000000000..5d78f7ae4 --- /dev/null +++ b/hexrd/ui/resources/calibration/default_bbxrd_config.yml @@ -0,0 +1,15 @@ +beam: + energy: 10.2505 + vector: {azimuth: 90.0, polar_angle: 67.0} +detectors: + default: + pixels: + columns: 11000 + rows: 3000 + size: [0.025, 0.025] + transform: + tilt: [0.0, 0.0, 0.0] + translation: [0.0, 0.0, 0.0] +oscillation_stage: + chi: 0.0 + translation: [0.0, 0.0, 0.0]