boiling_flow.parameter_estimation#
Functions#
Functions:
|
Set L0 to the length of the aperture [m]. |
|
Estimate the spatial PSD of the input data using Welch's method. |
|
Calculates the Von Karman PSD terms which exclude r0. |
|
Calculate the best-fit r0 to the spatial PSD of the measured data. |
|
Estimate r0 to fit the isotropic Von Karman PSD (i.e., with gamma0=1) to the spatial PSD of the measured data. |
|
Estimate r0 and gamma0 to fit the anisotropic Von Karman PSD and structure function to the measured data's spatial PSD and structure function (respectively). |
Estimate the spatial cross-correlation of the input data with some time-lag. |
|
|
Find the location of the maximum of the spatial cross-correlation estimate. |
|
Estimate the flow velocity components by averaging over multiple time-lags. |
|
Estimate the flow correlation parameter alpha given the flow velocity estimates (vx, vy). |
|
Estimate the boiling flow parameters (L0, r0, vx, vy, alpha) from training data. |
- boiling_flow.parameter_estimation.calculate_von_karman_psd_terms(fx, fy, L0, gamma0)[source]#
Calculates the Von Karman PSD terms which exclude r0.
- Parameters:
fx (ndarray) – numpy array containing the frequency grid values with respect to the x-axis
fy (ndarray) – numpy array containing the frequency grid values with respect to the y-axis
L0 (float) – outer scale [m]
gamma0 (float) – anisotropy parameter
- Returns:
von_karman_psd (ndarray) – numpy 2-D array of shape (N, N) containing the anisotropic Von Karman PSD terms
- boiling_flow.parameter_estimation.estimate_alpha(input_data, v_x, v_y, frequency_mask=None)[source]#
Estimate the flow correlation parameter alpha given the flow velocity estimates (vx, vy).
- Parameters:
input_data (ndarray) – numpy 3-D array of shape (num_time_steps, N, N) containing the input data
v_x (float) – flow velocity component with respect to the x-axis [pixels per time-step]
v_y (float) – flow velocity component with respect to the y-axis [pixels per time-step]
frequency_mask (ndarray, optional) – [Default=None] numpy boolean 2-D of shape (N, N) specifying which frequency bins to include in the least-squares problem
If set to None, the function includes all frequency bins.
- Returns:
alpha (float) – the estimated flow correlation parameter in the range [0, 1]
- boiling_flow.parameter_estimation.estimate_boiling_flow_parameters(training_data, delta, frequency_bin_cutoff=2, mask=None, mode='anisotropic')[source]#
Estimate the boiling flow parameters (L0, r0, vx, vy, alpha) from training data. Adapted from [3].
- Parameters:
training_data (ndarray) – numpy 3-D array of shape (num_time_steps, M, N) containing the training data
delta (float) – grid sampling [m]
frequency_bin_cutoff (int, optional) – [Default=2] cut-off frequency bin index for frequency mask
mask (ndarray, optional) – [Default=None] numpy boolean 2-D of shape (M, N) specifying which pixels to use
If set to None, all pixels are used.
mode (string, optional) – [Default=’anisotropic’] the decision to estimate parameters for either isotropic or anisotropic phase screens (if not ‘anisotropic’, should be ‘isotropic’).
- Returns:
L0 (float) – the outer scale estimate [m]
r0 (float) – the Fried coherence length estimate [m]
gamma0 (float) – the anisotropy parameter estimate
v_x (float) – the flow velocity estimate with respect to the x-axis
v_y (float) – the flow velocity estimate with respect to the y-axis
alpha (float) – the flow correlation parameter estimate in the range [0, 1]
- boiling_flow.parameter_estimation.estimate_flow_velocities(input_data, initial_time_lag=1, min_snr=10.0, num_sigma=5)[source]#
Estimate the flow velocity components by averaging over multiple time-lags.
- Parameters:
input_data (ndarray) – numpy 3-D array of shape (num_time_steps, N, N) containing the input data
initial_time_lag (int, optional) – [Default=1] the initial time lag to use for the cross-correlation estimate
min_snr (float, optional) – [Default=10.0] the minimum SNR to enforce for the max cross-correlation estimate
num_sigma (int, optional) – [Default=5] the standard deviation confidence to enforce for the max cross-correlation estimate
- Returns:
v_x_est (float) – the flow velocity estimate with respect to the x-axis
v_y_est (float) – the flow velocity estimate with respect to the y-axis
- boiling_flow.parameter_estimation.estimate_outer_scale(aperture_shape, delta)[source]#
Set L0 to the length of the aperture [m].
- Parameters:
aperture_shape (tuple) – shape of the aperture [pixels]
delta (float) – grid sampling [m]
- Returns:
L0_est (float) – the estimated L0 [m]
- boiling_flow.parameter_estimation.estimate_r0(input_data, delta, L0, frequency_mask=None)[source]#
Estimate r0 to fit the isotropic Von Karman PSD (i.e., with gamma0=1) to the spatial PSD of the measured data.
- Parameters:
input_data (ndarray) – numpy 3-D array of shape (num_time_steps, N, N) containing the input data
delta (float) – grid sampling [m]
L0 (float) – outer scale [m]
frequency_mask (ndarray, optional) – [Default=None] numpy boolean 2-D array indicating which frequencies to average over
If set to None, all frequencies except the center (zero) frequency bins are used.
- Returns:
r0_est (float) – the best-fit of r0 to the spatial PSD of the measured data
- boiling_flow.parameter_estimation.estimate_r0_and_gamma0(input_data, delta, L0, frequency_mask=None)[source]#
Estimate r0 and gamma0 to fit the anisotropic Von Karman PSD and structure function to the measured data’s spatial PSD and structure function (respectively).
- Parameters:
input_data (ndarray) – numpy 3-D array of shape (num_time_steps, N, N) containing the input data
delta (float) – grid sampling [m]
L0 (float) – outer scale [m]
frequency_mask (ndarray, optional) – [Default=None] numpy boolean 2-D array indicating which frequencies to average over
If set to None, all frequencies except the center (zero) frequency bins are used.
- Returns:
r0_est (float) – the estimate of r0 gamma0_est (float) – the estimate of gamma0
- boiling_flow.parameter_estimation.estimate_spatial_cross_correlation(input_data, time_lag)[source]#
Estimate the spatial cross-correlation of the input data with some time-lag.
- Parameters:
input_data (ndarray) – numpy 3-D array of shape (num_time_steps, N, N) containing the input data
time_lag (int) – the time-lag to use for the cross-correlation
- Returns:
spatial_cross_correlation (ndarray) – numpy 2-D array of shape (2N-1, 2N-1) containing the spatial cross-correlation estimate
- boiling_flow.parameter_estimation.estimate_spatial_psd(input_data, sampling_frequency)[source]#
Estimate the spatial PSD of the input data using Welch’s method.
- Parameters:
input_data (ndarray) – numpy 3-D array of shape (num_time_steps, N, N) containing the input data
sampling_frequency (float) – sampling frequency of the input data
- Returns:
psd_estimate (ndarray) – numpy 2-D array of shape (N, N) containing the spatial PSD estimate
- boiling_flow.parameter_estimation.fit_r0_from_spatial_psd(spatial_psd_estimate, fx, fy, L0, gamma0=1.0)[source]#
Calculate the best-fit r0 to the spatial PSD of the measured data.
- Parameters:
spatial_psd_estimate (ndarray) – numpy 2-D array of shape (N, N) containing the spatial PSD estimate of the measured data
fx (ndarray) – numpy array containing the frequency grid values with respect to the x-axis
fy (ndarray) – numpy array containing the frequency grid values with respect to the y-axis
L0 (float) – outer scale [m]
gamma0 (float, optional) – [Default=1.0] anisotropy parameter
- Returns:
r0_est (float) – the best-fit of r0 to the spatial PSD of the measured data
- boiling_flow.parameter_estimation.maximize_cross_correlation(input_data, time_lag)[source]#
Find the location of the maximum of the spatial cross-correlation estimate. Refine the estimate using parabolic interpolation. Estimate the flow velocity components by dividing by the time-lag.
- Parameters:
input_data (ndarray) – numpy 3-D array of shape (num_time_steps, N, N) containing the input data
time_lag (int) – the time-lag to use for the cross-correlation
- Returns:
v_x_est (float) – the flow velocity estimate with respect to the x-axis
v_y_est (float) – the flow velocity estimate with respect to the y-axis
max_correlation (float) – the maximum cross-correlation
Disclaimer: Approved for public release; distribution is unlimited. Public Affairs release approval # AFRL-2025-5580.