Skip to content

Commit eb33d15

Browse files
authored
Merge pull request #32 from sezelt/issue31
Remove auto-reshape for Arina data
2 parents 0732ffa + 59ba133 commit eb33d15

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/py4D_browser/menu_actions.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,9 @@ def load_data_arina(self):
3131
filename = self.show_file_dialog()
3232
dataset = read_arina(filename)
3333

34-
# Try to reshape the data to be square
35-
N_patterns = dataset.data.shape[1]
36-
Nxy = np.sqrt(N_patterns)
37-
if np.abs(Nxy - np.round(Nxy)) <= 1e-10:
38-
Nxy = int(Nxy)
39-
dataset.data = dataset.data.reshape(
40-
Nxy, Nxy, dataset.data.shape[2], dataset.data.shape[3]
41-
)
42-
else:
43-
self.statusBar().showMessage(
44-
f"The scan appears to not be square! Found {N_patterns} patterns", 5_000
45-
)
34+
# Warn if the data is not square
35+
if dataset.data.shape[1] == 1:
36+
self.statusBar().showMessage(f"Arina data was loaded as 3D, please reshape...")
4637

4738
self.datacube = dataset
4839
self.diffraction_scale_bar.pixel_size = self.datacube.calibration.get_Q_pixel_size()

0 commit comments

Comments
 (0)