nxs-analysis-tools 0.0.40__py3-none-any.whl → 0.0.41__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/pairdistribution.py +24 -20
- {nxs_analysis_tools-0.0.40.dist-info → nxs_analysis_tools-0.0.41.dist-info}/METADATA +1 -1
- nxs_analysis_tools-0.0.41.dist-info/RECORD +11 -0
- nxs_analysis_tools-0.0.40.dist-info/RECORD +0 -11
- {nxs_analysis_tools-0.0.40.dist-info → nxs_analysis_tools-0.0.41.dist-info}/LICENSE +0 -0
- {nxs_analysis_tools-0.0.40.dist-info → nxs_analysis_tools-0.0.41.dist-info}/WHEEL +0 -0
- {nxs_analysis_tools-0.0.40.dist-info → nxs_analysis_tools-0.0.41.dist-info}/top_level.txt +0 -0
_meta/__init__.py
CHANGED
|
@@ -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)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
_meta/__init__.py,sha256=QYocreoqhGDlovbW3V-ZkRa8aQqrIW5H9WvyI9XueaY,352
|
|
2
|
+
nxs_analysis_tools/__init__.py,sha256=bxbTLpIcKasH3fuRZOvJ9zeu7IBBju82mOTgUV4ZqHE,530
|
|
3
|
+
nxs_analysis_tools/chess.py,sha256=GUW08BcDUGD88MPZCl4yJTQp4hwd9tVNTJN_afNSUUo,24339
|
|
4
|
+
nxs_analysis_tools/datareduction.py,sha256=e__mBGZIpJ-_-Dr6-T9hJURJazFnBy3PoWfwRxOra4U,41848
|
|
5
|
+
nxs_analysis_tools/fitting.py,sha256=vPx75lKvm5pWOGBtRtff8k6J5dA6kRk3EJyzxCH5Tyk,8809
|
|
6
|
+
nxs_analysis_tools/pairdistribution.py,sha256=bO-Ljst8eD5wmeq6oH8ylhHqaUyu2CvARznDupCygWQ,58245
|
|
7
|
+
nxs_analysis_tools-0.0.41.dist-info/LICENSE,sha256=tdnoYVH1-ogW_5-gGs9bK-IkCamH1ATJqrdL37kWTHk,1102
|
|
8
|
+
nxs_analysis_tools-0.0.41.dist-info/METADATA,sha256=2O7IvBuaAp_R_uXlwn-oZctEpIKGFlESR8gRAj_TP_U,3895
|
|
9
|
+
nxs_analysis_tools-0.0.41.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
10
|
+
nxs_analysis_tools-0.0.41.dist-info/top_level.txt,sha256=8U000GNPzo6T6pOMjRdgOSO5heMzLMGjkxa1CDtyMHM,25
|
|
11
|
+
nxs_analysis_tools-0.0.41.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
_meta/__init__.py,sha256=cgRdSYbkbQq7Gw011aNLk8NLfCZBtPjp2VfhtL5KeeE,352
|
|
2
|
-
nxs_analysis_tools/__init__.py,sha256=bxbTLpIcKasH3fuRZOvJ9zeu7IBBju82mOTgUV4ZqHE,530
|
|
3
|
-
nxs_analysis_tools/chess.py,sha256=GUW08BcDUGD88MPZCl4yJTQp4hwd9tVNTJN_afNSUUo,24339
|
|
4
|
-
nxs_analysis_tools/datareduction.py,sha256=e__mBGZIpJ-_-Dr6-T9hJURJazFnBy3PoWfwRxOra4U,41848
|
|
5
|
-
nxs_analysis_tools/fitting.py,sha256=vPx75lKvm5pWOGBtRtff8k6J5dA6kRk3EJyzxCH5Tyk,8809
|
|
6
|
-
nxs_analysis_tools/pairdistribution.py,sha256=AtjllbbakFyo3MnGH18rvr6-h3ONopxXEmZK4F3VzMI,58023
|
|
7
|
-
nxs_analysis_tools-0.0.40.dist-info/LICENSE,sha256=tdnoYVH1-ogW_5-gGs9bK-IkCamH1ATJqrdL37kWTHk,1102
|
|
8
|
-
nxs_analysis_tools-0.0.40.dist-info/METADATA,sha256=H9FqaRexBO4zxSFcunsIieblI5jhUtosugg4sZVCMFU,3895
|
|
9
|
-
nxs_analysis_tools-0.0.40.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
10
|
-
nxs_analysis_tools-0.0.40.dist-info/top_level.txt,sha256=8U000GNPzo6T6pOMjRdgOSO5heMzLMGjkxa1CDtyMHM,25
|
|
11
|
-
nxs_analysis_tools-0.0.40.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|