nxs-analysis-tools 0.0.40__tar.gz → 0.0.42__tar.gz
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.
- {nxs_analysis_tools-0.0.40/src/nxs_analysis_tools.egg-info → nxs_analysis_tools-0.0.42}/PKG-INFO +2 -2
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/pyproject.toml +1 -1
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/_meta/__init__.py +1 -1
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools/chess.py +6 -1
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools/datareduction.py +6 -4
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools/pairdistribution.py +24 -20
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42/src/nxs_analysis_tools.egg-info}/PKG-INFO +2 -2
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/LICENSE +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/MANIFEST.in +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/README.md +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/setup.cfg +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/setup.py +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools/__init__.py +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools/fitting.py +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools.egg-info/SOURCES.txt +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools.egg-info/dependency_links.txt +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools.egg-info/requires.txt +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools.egg-info/top_level.txt +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/tests/test_chess.py +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/tests/test_chess_fitting.py +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/tests/test_datareduction.py +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/tests/test_fitting.py +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/tests/test_lmfit.py +0 -0
- {nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/tests/test_pairdistribution.py +0 -0
{nxs_analysis_tools-0.0.40/src/nxs_analysis_tools.egg-info → nxs_analysis_tools-0.0.42}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: nxs-analysis-tools
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.42
|
|
4
4
|
Summary: Reduce and transform nexus format (.nxs) scattering data.
|
|
5
5
|
Author-email: "Steven J. Gomez Alvarado" <stevenjgomez@ucsb.edu>
|
|
6
6
|
License: MIT License
|
|
@@ -8,6 +8,7 @@ import re
|
|
|
8
8
|
|
|
9
9
|
import matplotlib.pyplot as plt
|
|
10
10
|
import matplotlib as mpl
|
|
11
|
+
import pandas as pd
|
|
11
12
|
import numpy as np
|
|
12
13
|
from IPython.display import display, Markdown
|
|
13
14
|
from nxs_analysis_tools import load_data, Scissors
|
|
@@ -190,8 +191,12 @@ class TempDependence:
|
|
|
190
191
|
|
|
191
192
|
# Convert all temperatures to int temporarily to sort temperatures list before loading
|
|
192
193
|
self.temperatures = [int(t) for t in self.temperatures]
|
|
193
|
-
|
|
194
|
+
|
|
195
|
+
loading_template = pd.DataFrame({'temperature': self.temperatures, 'filename': items_to_load})
|
|
196
|
+
loading_template = loading_template.sort_values(by='temperature')
|
|
197
|
+
self.temperatures = loading_template['temperature']
|
|
194
198
|
self.temperatures = [str(t) for t in self.temperatures]
|
|
199
|
+
items_to_load = loading_template['filename'].to_list()
|
|
195
200
|
|
|
196
201
|
for i, item in enumerate(items_to_load):
|
|
197
202
|
path = os.path.join(self.sample_directory, item)
|
{nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools/datareduction.py
RENAMED
|
@@ -787,7 +787,8 @@ def rotate_data(data, lattice_angle, rotation_angle, rotation_axis, printout=Fal
|
|
|
787
787
|
|
|
788
788
|
p = Padder(sliced_data)
|
|
789
789
|
padding = tuple(len(sliced_data[axis]) for axis in sliced_data.axes)
|
|
790
|
-
counts = p.pad(padding)
|
|
790
|
+
counts = p.pad(padding)
|
|
791
|
+
counts = p.padded[p.padded.signal]
|
|
791
792
|
|
|
792
793
|
counts_skewed = ndimage.affine_transform(counts,
|
|
793
794
|
t.inverted().get_matrix()[:2, :2],
|
|
@@ -848,7 +849,7 @@ def rotate_data(data, lattice_angle, rotation_angle, rotation_axis, printout=Fal
|
|
|
848
849
|
elif rotation_axis == 2:
|
|
849
850
|
output_array[:, :, i] = counts_unpadded
|
|
850
851
|
print('\nDone.')
|
|
851
|
-
return NXdata(NXfield(output_array, name=
|
|
852
|
+
return NXdata(NXfield(output_array, name=p.padded.signal),
|
|
852
853
|
(data[data.axes[0]], data[data.axes[1]], data[data.axes[2]]))
|
|
853
854
|
|
|
854
855
|
|
|
@@ -884,7 +885,8 @@ def rotate_data2D(data, lattice_angle, rotation_angle):
|
|
|
884
885
|
|
|
885
886
|
p = Padder(data)
|
|
886
887
|
padding = tuple(len(data[axis]) for axis in data.axes)
|
|
887
|
-
counts = p.pad(padding)
|
|
888
|
+
counts = p.pad(padding)
|
|
889
|
+
counts = p.padded[p.padded.signal]
|
|
888
890
|
|
|
889
891
|
counts_skewed = ndimage.affine_transform(counts,
|
|
890
892
|
t.inverted().get_matrix()[:2, :2],
|
|
@@ -937,7 +939,7 @@ def rotate_data2D(data, lattice_angle, rotation_angle):
|
|
|
937
939
|
counts_unpadded = p.unpad(counts_unskewed)
|
|
938
940
|
|
|
939
941
|
print('\nDone.')
|
|
940
|
-
return NXdata(NXfield(counts_unpadded, name=
|
|
942
|
+
return NXdata(NXfield(counts_unpadded, name=p.padded.signal),
|
|
941
943
|
(data[data.axes[0]], data[data.axes[1]]))
|
|
942
944
|
|
|
943
945
|
|
{nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools/pairdistribution.py
RENAMED
|
@@ -1140,7 +1140,7 @@ class Interpolator:
|
|
|
1140
1140
|
self.tapered = self.interpolated * self.window
|
|
1141
1141
|
|
|
1142
1142
|
|
|
1143
|
-
def fourier_transform_nxdata(data):
|
|
1143
|
+
def fourier_transform_nxdata(data, is_2d=False):
|
|
1144
1144
|
"""
|
|
1145
1145
|
Perform a 3D Fourier Transform on the given NXdata object.
|
|
1146
1146
|
|
|
@@ -1156,6 +1156,10 @@ def fourier_transform_nxdata(data):
|
|
|
1156
1156
|
include the `signal` field for the data and `axes` fields
|
|
1157
1157
|
specifying the coordinate axes.
|
|
1158
1158
|
|
|
1159
|
+
is_2d : bool
|
|
1160
|
+
If true, skip FFT on out-of-plane direction and only do FFT
|
|
1161
|
+
on axes 0 and 1. Default False.
|
|
1162
|
+
|
|
1159
1163
|
Returns
|
|
1160
1164
|
-------
|
|
1161
1165
|
NXdata
|
|
@@ -1163,16 +1167,13 @@ def fourier_transform_nxdata(data):
|
|
|
1163
1167
|
result includes:
|
|
1164
1168
|
|
|
1165
1169
|
- `dPDF`: The transformed data array.
|
|
1166
|
-
- `x`, `y`, `z`: Arrays representing the
|
|
1170
|
+
- `x`, `y`, `z`: Arrays representing the real-space components along each axis.
|
|
1167
1171
|
|
|
1168
1172
|
Notes
|
|
1169
1173
|
-----
|
|
1170
|
-
- The FFT is performed in two stages: first along the last dimension of
|
|
1171
|
-
|
|
1172
|
-
- The
|
|
1173
|
-
Transform.
|
|
1174
|
-
- The output frequency components are computed based on the step sizes
|
|
1175
|
-
of the original data axes.
|
|
1174
|
+
- The FFT is performed in two stages: first along the last dimension of the input array and then along the first two dimensions.
|
|
1175
|
+
- The function uses `pyfftw` for efficient computation of the Fourier Transform.
|
|
1176
|
+
- The output frequency components are computed based on the step sizes of the original data axes.
|
|
1176
1177
|
|
|
1177
1178
|
"""
|
|
1178
1179
|
start = time.time()
|
|
@@ -1181,7 +1182,9 @@ def fourier_transform_nxdata(data):
|
|
|
1181
1182
|
padded = data[data.signal].nxdata
|
|
1182
1183
|
|
|
1183
1184
|
fft_array = np.zeros(padded.shape)
|
|
1185
|
+
|
|
1184
1186
|
print("FFT on axes 1,2")
|
|
1187
|
+
|
|
1185
1188
|
for k in range(0, padded.shape[2]):
|
|
1186
1189
|
fft_array[:, :, k] = np.real(
|
|
1187
1190
|
np.fft.fftshift(
|
|
@@ -1190,17 +1193,18 @@ def fourier_transform_nxdata(data):
|
|
|
1190
1193
|
)
|
|
1191
1194
|
print(f'k={k} ', end='\r')
|
|
1192
1195
|
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
for
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
np.
|
|
1200
|
-
|
|
1201
|
-
|
|
1196
|
+
if not is_2d:
|
|
1197
|
+
print("FFT on axis 3")
|
|
1198
|
+
for i in range(0, padded.shape[0]):
|
|
1199
|
+
for j in range(0, padded.shape[1]):
|
|
1200
|
+
f_slice = fft_array[i, j, :]
|
|
1201
|
+
print(f'i={i} ', end='\r')
|
|
1202
|
+
fft_array[i, j, :] = np.real(
|
|
1203
|
+
np.fft.fftshift(
|
|
1204
|
+
pyfftw.interfaces.numpy_fft.ifftn(np.fft.fftshift(f_slice),
|
|
1205
|
+
planner_effort='FFTW_MEASURE')
|
|
1206
|
+
)
|
|
1202
1207
|
)
|
|
1203
|
-
)
|
|
1204
1208
|
|
|
1205
1209
|
end = time.time()
|
|
1206
1210
|
print("FFT complete.")
|
|
@@ -1520,7 +1524,7 @@ class DeltaPDF:
|
|
|
1520
1524
|
"""
|
|
1521
1525
|
self.padded = self.padder.pad(padding)
|
|
1522
1526
|
|
|
1523
|
-
def perform_fft(self):
|
|
1527
|
+
def perform_fft(self, is_2d=False):
|
|
1524
1528
|
"""
|
|
1525
1529
|
Perform a 3D Fourier Transform on the padded data.
|
|
1526
1530
|
|
|
@@ -1548,4 +1552,4 @@ class DeltaPDF:
|
|
|
1548
1552
|
|
|
1549
1553
|
|
|
1550
1554
|
"""
|
|
1551
|
-
self.fft = fourier_transform_nxdata(self.padded)
|
|
1555
|
+
self.fft = fourier_transform_nxdata(self.padded, is_2d=is_2d)
|
{nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42/src/nxs_analysis_tools.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: nxs-analysis-tools
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.42
|
|
4
4
|
Summary: Reduce and transform nexus format (.nxs) scattering data.
|
|
5
5
|
Author-email: "Steven J. Gomez Alvarado" <stevenjgomez@ucsb.edu>
|
|
6
6
|
License: MIT License
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{nxs_analysis_tools-0.0.40 → nxs_analysis_tools-0.0.42}/src/nxs_analysis_tools.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|