nxs-analysis-tools 0.0.17__py3-none-any.whl → 0.0.18__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nxs-analysis-tools might be problematic. Click here for more details.
- _meta/__init__.py +1 -1
- nxs_analysis_tools/chess.py +27 -12
- nxs_analysis_tools/datareduction.py +12 -2
- {nxs_analysis_tools-0.0.17.dist-info → nxs_analysis_tools-0.0.18.dist-info}/METADATA +1 -1
- nxs_analysis_tools-0.0.18.dist-info/RECORD +10 -0
- nxs_analysis_tools-0.0.17.dist-info/RECORD +0 -10
- {nxs_analysis_tools-0.0.17.dist-info → nxs_analysis_tools-0.0.18.dist-info}/LICENSE +0 -0
- {nxs_analysis_tools-0.0.17.dist-info → nxs_analysis_tools-0.0.18.dist-info}/WHEEL +0 -0
- {nxs_analysis_tools-0.0.17.dist-info → nxs_analysis_tools-0.0.18.dist-info}/top_level.txt +0 -0
_meta/__init__.py
CHANGED
nxs_analysis_tools/chess.py
CHANGED
|
@@ -4,7 +4,6 @@ This module provides classes and functions for analyzing scattering datasets col
|
|
|
4
4
|
plotting linecuts.
|
|
5
5
|
'''
|
|
6
6
|
import os
|
|
7
|
-
from nexusformat.nexus import NXentry
|
|
8
7
|
import matplotlib.pyplot as plt
|
|
9
8
|
import matplotlib as mpl
|
|
10
9
|
|
|
@@ -19,7 +18,7 @@ class TempDependence():
|
|
|
19
18
|
'''
|
|
20
19
|
Initialize TempDependence class.
|
|
21
20
|
'''
|
|
22
|
-
self.datasets=
|
|
21
|
+
self.datasets={}
|
|
23
22
|
self.folder=None
|
|
24
23
|
self.temperatures=None
|
|
25
24
|
self.scissors=None
|
|
@@ -40,7 +39,7 @@ class TempDependence():
|
|
|
40
39
|
'''
|
|
41
40
|
Clear the datasets stored in the TempDependence instance.
|
|
42
41
|
'''
|
|
43
|
-
self.datasets=
|
|
42
|
+
self.datasets={}
|
|
44
43
|
|
|
45
44
|
def load_datasets(self, folder, file_ending='hkli.nxs', temperatures_list=None):
|
|
46
45
|
'''
|
|
@@ -72,25 +71,21 @@ class TempDependence():
|
|
|
72
71
|
self.temperatures = temperature_folders
|
|
73
72
|
|
|
74
73
|
if temperatures_list is not None:
|
|
75
|
-
|
|
76
|
-
else:
|
|
77
|
-
temperature_folders = self.temperatures
|
|
78
|
-
|
|
79
|
-
self.temperatures = temperature_folders
|
|
74
|
+
self.temperatures = [str(t) for t in temperatures_list]
|
|
80
75
|
|
|
81
76
|
# Load .nxs files
|
|
82
|
-
for temperature in
|
|
77
|
+
for temperature in self.temperatures:
|
|
83
78
|
for file in os.listdir(os.path.join(self.folder, temperature)):
|
|
84
79
|
if file.endswith(file_ending):
|
|
85
80
|
filepath = os.path.join(self.folder, temperature, file)
|
|
86
81
|
print('-----------------------------------------------')
|
|
87
82
|
print('Loading ' + temperature + ' K indexed .nxs files...')
|
|
88
83
|
print('Found ' + filepath)
|
|
89
|
-
self.datasets
|
|
84
|
+
self.datasets[temperature] = load_data(filepath)
|
|
90
85
|
|
|
91
86
|
self.scissors = [Scissors() for _ in range(len(self.datasets))]
|
|
92
87
|
|
|
93
|
-
for i,dataset in enumerate(self.datasets):
|
|
88
|
+
for i,dataset in enumerate(self.datasets.values()):
|
|
94
89
|
self.scissors[i].set_data(dataset)
|
|
95
90
|
|
|
96
91
|
def set_window(self, window):
|
|
@@ -168,7 +163,7 @@ class TempDependence():
|
|
|
168
163
|
for i, linecut in enumerate(self.linecuts):
|
|
169
164
|
x_data = linecut[linecut.axes[0]].nxdata
|
|
170
165
|
y_data = linecut[linecut.signal].nxdata + i*vertical_offset
|
|
171
|
-
ax.plot(x_data, y_data, color=cmap(i / len(self.linecuts)), label=
|
|
166
|
+
ax.plot(x_data, y_data, color=cmap(i / len(self.linecuts)), label=self.temperatures[i],
|
|
172
167
|
**kwargs)
|
|
173
168
|
|
|
174
169
|
xlabel_components = [self.linecuts[0].axes[0] if i == self.scissors[0].axis \
|
|
@@ -186,3 +181,23 @@ class TempDependence():
|
|
|
186
181
|
|
|
187
182
|
# Create a new legend with reversed order
|
|
188
183
|
plt.legend(handles, labels)
|
|
184
|
+
|
|
185
|
+
return fig,ax
|
|
186
|
+
|
|
187
|
+
def show_integration_window(self, temperature=None):
|
|
188
|
+
'''
|
|
189
|
+
Displays the integration window plot for a specific temperature or for all temperatures if
|
|
190
|
+
none is provided.
|
|
191
|
+
|
|
192
|
+
Parameters
|
|
193
|
+
----------
|
|
194
|
+
temperature : str, optional
|
|
195
|
+
The temperature at which to display the integration window plot. If provided, the plot
|
|
196
|
+
will be generated using the dataset corresponding to the specified temperature. If not
|
|
197
|
+
provided, the integration window plots will be generated for all available
|
|
198
|
+
temperatures.
|
|
199
|
+
'''
|
|
200
|
+
if temperature is not None:
|
|
201
|
+
self.scissors[0].show_integration_window(data=self.datasets[temperature])
|
|
202
|
+
else:
|
|
203
|
+
self.scissors[0].show_integration_window(data=self.datasets[self.temperatures[0]])
|
|
@@ -444,11 +444,21 @@ class Scissors():
|
|
|
444
444
|
|
|
445
445
|
return self.linecut
|
|
446
446
|
|
|
447
|
-
def show_integration_window(self, label=None, **kwargs):
|
|
447
|
+
def show_integration_window(self, data=None, label=None, **kwargs):
|
|
448
448
|
'''
|
|
449
449
|
Plots integration window highlighted on 2D heatmap full dataset.
|
|
450
|
+
|
|
451
|
+
Parameters
|
|
452
|
+
----------
|
|
453
|
+
data : array-like, optional
|
|
454
|
+
The 2D heatmap dataset to plot. If not provided, the dataset stored in `self.data` will be used.
|
|
455
|
+
label : str, optional
|
|
456
|
+
The label for the integration window plot.
|
|
457
|
+
**kwargs : keyword arguments, optional
|
|
458
|
+
Additional keyword arguments to customize the plot.
|
|
459
|
+
|
|
450
460
|
'''
|
|
451
|
-
data = self.data
|
|
461
|
+
data = self.data if data is None else data
|
|
452
462
|
axis = self.axis
|
|
453
463
|
center = self.center
|
|
454
464
|
window = self.window
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
_meta/__init__.py,sha256=4lwV6pfk3hMrZLgiaTqjWQUGRJkD7gAe9lPSfuZx2d4,343
|
|
2
|
+
nxs_analysis_tools/__init__.py,sha256=guRgN90Lv_DgQ-S7lKWLpFkglFvIJGoDcmQ_pjHVRw0,372
|
|
3
|
+
nxs_analysis_tools/chess.py,sha256=A3z1Uxw4pCblZMTWUAMOGU2fRrAMKs1479zIxSA2t4k,7520
|
|
4
|
+
nxs_analysis_tools/datareduction.py,sha256=vyufWH9HmjK_0saUvTVV5RpM2h9oLFoLPeB1UhRKuQ4,18581
|
|
5
|
+
nxs_analysis_tools/pairdistribution.py,sha256=b4ZvS37OjzTKw8TfRByYYglE__95vD5XoCZfK7b2JRg,3748
|
|
6
|
+
nxs_analysis_tools-0.0.18.dist-info/LICENSE,sha256=tdnoYVH1-ogW_5-gGs9bK-IkCamH1ATJqrdL37kWTHk,1102
|
|
7
|
+
nxs_analysis_tools-0.0.18.dist-info/METADATA,sha256=O6wRnMtqzQyMK_XU6JElfSLi9v6aRiCLfDKagO0Tu20,3844
|
|
8
|
+
nxs_analysis_tools-0.0.18.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
9
|
+
nxs_analysis_tools-0.0.18.dist-info/top_level.txt,sha256=8U000GNPzo6T6pOMjRdgOSO5heMzLMGjkxa1CDtyMHM,25
|
|
10
|
+
nxs_analysis_tools-0.0.18.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
_meta/__init__.py,sha256=9tfMxbWYPVflRmbX8HZvi1RSij8QccnuCOuEAGrQuVU,343
|
|
2
|
-
nxs_analysis_tools/__init__.py,sha256=guRgN90Lv_DgQ-S7lKWLpFkglFvIJGoDcmQ_pjHVRw0,372
|
|
3
|
-
nxs_analysis_tools/chess.py,sha256=zJm4pWOW9ZSf4qIS1oXRyrY-cGG2-1eKEfLfYDiir2Q,6800
|
|
4
|
-
nxs_analysis_tools/datareduction.py,sha256=-g0Y6ZuLMsMc6salMXRRj0Rw0Y2ORNQZpy_is9QDmbM,18153
|
|
5
|
-
nxs_analysis_tools/pairdistribution.py,sha256=b4ZvS37OjzTKw8TfRByYYglE__95vD5XoCZfK7b2JRg,3748
|
|
6
|
-
nxs_analysis_tools-0.0.17.dist-info/LICENSE,sha256=tdnoYVH1-ogW_5-gGs9bK-IkCamH1ATJqrdL37kWTHk,1102
|
|
7
|
-
nxs_analysis_tools-0.0.17.dist-info/METADATA,sha256=z2mdmM2xm6fl22MnHwoEflbkgZtu2nUnQkHmnr3DBYo,3844
|
|
8
|
-
nxs_analysis_tools-0.0.17.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
9
|
-
nxs_analysis_tools-0.0.17.dist-info/top_level.txt,sha256=8U000GNPzo6T6pOMjRdgOSO5heMzLMGjkxa1CDtyMHM,25
|
|
10
|
-
nxs_analysis_tools-0.0.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|