BOSlib 0.0.3__py3-none-any.whl → 0.0.4__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.
- BOSlib/__init__.py +1 -1
- BOSlib/shift.py +29 -16
- {BOSlib-0.0.3.dist-info → BOSlib-0.0.4.dist-info}/METADATA +1 -1
- {BOSlib-0.0.3.dist-info → BOSlib-0.0.4.dist-info}/RECORD +7 -7
- {BOSlib-0.0.3.dist-info → BOSlib-0.0.4.dist-info}/LICENSE +0 -0
- {BOSlib-0.0.3.dist-info → BOSlib-0.0.4.dist-info}/WHEEL +0 -0
- {BOSlib-0.0.3.dist-info → BOSlib-0.0.4.dist-info}/top_level.txt +0 -0
BOSlib/__init__.py
CHANGED
BOSlib/shift.py
CHANGED
@@ -129,25 +129,38 @@ def SP_BOS(ref_array : np.ndarray, exp_array : np.ndarray, binarization : str ="
|
|
129
129
|
|
130
130
|
return diff_comp
|
131
131
|
|
132
|
-
def S_BOS(ref_array: np.ndarray, exp_array: np.ndarray,
|
132
|
+
def S_BOS(ref_array: np.ndarray, exp_array: np.ndarray,freq_sample_row : int = 0):
|
133
133
|
"""
|
134
|
-
Compute
|
135
|
-
between reference and experimental
|
136
|
-
Oriented Schlieren (BOS) process.
|
134
|
+
Compute a 1D BOS displacement field by estimating phase differences
|
135
|
+
between reference and experimental stripe signals.
|
137
136
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
137
|
+
This function first identifies the dominant stripe frequency via FFT
|
138
|
+
from a representative row (`freq_sample_area`) of `ref_array`. Then for
|
139
|
+
each column signal it:
|
140
|
+
1. Bandpass-filters around the base frequency.
|
141
|
+
2. Normalizes amplitude and applies a sine-based phase correction.
|
142
|
+
3. Calculates the local phase difference via lowpass filtered
|
143
|
+
sine/cosine products.
|
144
|
+
4. Converts phase shifts to physical displacement values.
|
145
|
+
|
146
|
+
Parameters
|
147
|
+
----------
|
148
|
+
ref_array : np.ndarray, shape (M, N)
|
149
|
+
Reference image signals, with M samples (rows) and N separate
|
150
|
+
stripe‐signal columns.
|
151
|
+
exp_array : np.ndarray, shape (M, N)
|
152
|
+
Experimental image signals matching the dimensions of `ref_array`.
|
153
|
+
freq_sample_row : int
|
154
|
+
Row index in `ref_array` used to detect the dominant stripe frequency
|
155
|
+
for filtering and phase calculation.
|
144
156
|
|
145
|
-
Returns
|
146
|
-
|
147
|
-
delta_h : np.ndarray
|
148
|
-
|
157
|
+
Returns
|
158
|
+
-------
|
159
|
+
delta_h : np.ndarray, shape (M, N)
|
160
|
+
Displacement field (Δh) computed from the phase differences between
|
161
|
+
each column of `ref_array` and `exp_array`. Units are cycles/(2π·f),
|
162
|
+
where f is the dominant stripe frequency.
|
149
163
|
"""
|
150
|
-
|
151
164
|
def freq_finder(sig):
|
152
165
|
"""
|
153
166
|
Identify the dominant frequency in the signal using the FFT.
|
@@ -338,7 +351,7 @@ def S_BOS(ref_array: np.ndarray, exp_array: np.ndarray,freq_sample_area):
|
|
338
351
|
return phase_calculate(separate_sig_ref, separate_sig_exp, f1)
|
339
352
|
|
340
353
|
# Determine the dominant frequency from a representative column (column 100) of the reference array
|
341
|
-
f1 = freq_finder(ref_array[
|
354
|
+
f1 = freq_finder(ref_array[:,freq_sample_row])
|
342
355
|
# Initialize a 2D array to store phase differences for each column
|
343
356
|
phi_2D = np.zeros([ref_array.shape[0], ref_array.shape[1]]).astype("float64")
|
344
357
|
|
@@ -1,13 +1,13 @@
|
|
1
|
-
BOSlib/__init__.py,sha256=
|
1
|
+
BOSlib/__init__.py,sha256=00N8-Ti4_R4lmLuqi08jwokhPvlvudBQXpHRZveEtds,225
|
2
2
|
BOSlib/culculate_refractiveindex.py,sha256=v-yIZEtsJchOjO7RFIR3XU4mCYdmbGxKjar03OC5MsA,3421
|
3
3
|
BOSlib/evaluation.py,sha256=Ipf5TUXFRuVlwILucJRyqZRazS02Wb7QQ6okXw-P4Vs,12809
|
4
4
|
BOSlib/reconstruction.py,sha256=qBxid-wJfsyTfKK1EWa6NejxJ7lHA1HEeIRV6743k98,6545
|
5
5
|
BOSlib/reconstruction_utils.py,sha256=hoJQ9crumwdLvmOkIpWasADi2H3-3272P3QPhTrcWu8,1809
|
6
|
-
BOSlib/shift.py,sha256=
|
6
|
+
BOSlib/shift.py,sha256=fa0QxJXuBUELOmLLT2dB_uNaWMU5oxeTI0ZScZx5c5c,14877
|
7
7
|
BOSlib/shift_utils.py,sha256=XZ7cwKWV6gkPBcWDkhgU34fRNt1nxAFJNZqC42NIqbk,9397
|
8
8
|
BOSlib/utils.py,sha256=ceuHxQmvIsx6z2iudQC9j3SVpQ0m9myTBXuWf6C1eMs,6934
|
9
|
-
BOSlib-0.0.
|
10
|
-
BOSlib-0.0.
|
11
|
-
BOSlib-0.0.
|
12
|
-
BOSlib-0.0.
|
13
|
-
BOSlib-0.0.
|
9
|
+
BOSlib-0.0.4.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
10
|
+
BOSlib-0.0.4.dist-info/METADATA,sha256=beniVbiXOpdcT5iQgI4Lh6l9Xe6wFH46-2hLDq6ffYI,3458
|
11
|
+
BOSlib-0.0.4.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
12
|
+
BOSlib-0.0.4.dist-info/top_level.txt,sha256=ZLqE8iduIk6Ng-LYGvz_faKu-yW4JJwjJpOsXDfBo14,7
|
13
|
+
BOSlib-0.0.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|