A collection of methods for processing multi-simulation probe datasets.
More...
|
def | extract_k_values (mpdset, ka=1, kx_label='kx', k_size=5) |
|
def | plot_time_data (mpdset, kx, y_fun, probe_names=None, kx_range=None, t_range=None, window=None, beta=None, **kwargs) |
| Plot time data.
|
|
def | calc_spectra (mpdset, y_fun, probe_names=None, kx=None, t_range=None, window='Hanning', beta=14, tau=1, freq_units=None, zero_pad=0) |
| Calculate fft for all sims at specified probe.
|
|
def | average_spectra (spectra, avg_type='all', probe_name=None) |
| Averages spectra based on avg_type and returns single spectrum per kx.
|
|
def | plot_spectra (spectra, freqs, **kwargs) |
| Plot spectra calculated in self.calc_spectra.
|
|
def | plot_sim_bd (spectra, freqs, kx, freq_units=None, freq_min=None, freq_max=None, **kwargs) |
| Plot contour plot of spectra calculated in self.calc_spectra.
|
|
def | spectra_peaks (spectra, freqs, kx=None, prom_func=None, num_bands=10) |
| Finds peaks in spectra data.
|
|
def | find_sim_bands (sim_peaks, analytical_bands, freq_res, error_max) |
| Assembles simulation bands by comparing to analytical solution.
|
|
A collection of methods for processing multi-simulation probe datasets.
◆ average_spectra()
def warpy.post_processing.band_diagrams.simulation_1d.average_spectra |
( |
|
spectra, |
|
|
|
avg_type = 'all' , |
|
|
|
probe_name = None |
|
) |
| |
Averages spectra based on avg_type and returns single spectrum per kx.
- Parameters
-
spectra | Output from calc_spectra() {sim_name:{probe_name:{field_name:spectra}}} |
avg_type | Sting with name of averaging method type. |
◆ calc_spectra()
def warpy.post_processing.band_diagrams.simulation_1d.calc_spectra |
( |
|
mpdset, |
|
|
|
y_fun, |
|
|
|
probe_names = None , |
|
|
|
kx = None , |
|
|
|
t_range = None , |
|
|
|
window = 'Hanning' , |
|
|
|
beta = 14 , |
|
|
|
tau = 1 , |
|
|
|
freq_units = None , |
|
|
|
zero_pad = 0 |
|
) |
| |
Calculate fft for all sims at specified probe.
- Parameters
-
probe_name | String with probe file name. |
y_fun | What function to call for y values. |
kx | List of kx values to plot. If None plots all. |
t_range | List type object with min and max time value. Default None. |
window | String with windowing option for FFT. Default 'Hanning'. |
beta | Shaping function for Kaiser window. Default 14. |
tau | Simulation time unit |
freq_units | String with unit of frequency. Default None. |
zero_pad | Size of zero padding as percentage of array size, ex .5=50%. Default 0. |
◆ extract_k_values()
def warpy.post_processing.band_diagrams.simulation_1d.extract_k_values |
( |
|
mpdset, |
|
|
|
ka = 1 , |
|
|
|
kx_label = 'kx' , |
|
|
|
k_size = 5 |
|
) |
| |
- Parameters
-
mpdset | warpy.multi_probe_dataset object |
ka | Reference k value. |
kx_label | String that proceeds kx value in sim name. |
kx_size | Length of kx value in sim name. |
- Returns
- kx Dictionary {kx string: kx value}
◆ find_sim_bands()
def warpy.post_processing.band_diagrams.simulation_1d.find_sim_bands |
( |
|
sim_peaks, |
|
|
|
analytical_bands, |
|
|
|
freq_res, |
|
|
|
error_max |
|
) |
| |
Assembles simulation bands by comparing to analytical solution.
Simuation bands are assembled from peaks found in simulation frequency data. Simulatin bands are then compared to equivalent analytically calculated bands, if no close point is found, peak is looked for in adjacent bands. If no point is found in adjacent bands, the point is discared as an outlier.
Average error between simulation and analytical solution is calculated for each band.
- Parameters
-
sim_peaks | Output of find_peaks() |
analytical_bands | Output of Bands1D.bands |
error_max | |
◆ plot_sim_bd()
def warpy.post_processing.band_diagrams.simulation_1d.plot_sim_bd |
( |
|
spectra, |
|
|
|
freqs, |
|
|
|
kx, |
|
|
|
freq_units = None , |
|
|
|
freq_min = None , |
|
|
|
freq_max = None , |
|
|
** |
kwargs |
|
) |
| |
Plot contour plot of spectra calculated in self.calc_spectra.
- Parameters
-
spectra | Dictionary returned by self.calc_spectra(). {sim_name:spectra}. |
freqs | List of frequencies returned by self.calc_spectra(). |
kx | List of kx values to plot. If None plots all. |
t_range | List type object with min and max time value. Default None. |
freq_units | String with unit of frequency. Default None. |
◆ plot_spectra()
def warpy.post_processing.band_diagrams.simulation_1d.plot_spectra |
( |
|
spectra, |
|
|
|
freqs, |
|
|
** |
kwargs |
|
) |
| |
Plot spectra calculated in self.calc_spectra.
- Parameters
-
spectra | Dictionary of dictionaries returned by self.calc_spectra(). {sim_name:{label}:spectra}}. |
freqs | List of frequencies returned by self.calc_spectra(). |
kx | List of kx values to plot. If None plots all. |
t_range | List type object with min and max time value. Default None. |
freq_units | String with unit of frequency. Default None. |
◆ plot_time_data()
def warpy.post_processing.band_diagrams.simulation_1d.plot_time_data |
( |
|
mpdset, |
|
|
|
kx, |
|
|
|
y_fun, |
|
|
|
probe_names = None , |
|
|
|
kx_range = None , |
|
|
|
t_range = None , |
|
|
|
window = None , |
|
|
|
beta = None , |
|
|
** |
kwargs |
|
) |
| |
Plot time data.
- Parameters
-
mpdset | warpy.multi_probe_dataset object |
kx | Dictionary returned by get_kx_values() |
probe_names | List of probe names. If None plot all. |
y_fun | What function to call for y values. |
kx_range | |
t_range | |
window | String with windowing option for FFT. Default 'Hanning'. |
beta | Shaping function for Kaiser window. Default 14. |
**kwargs | Pyplot style keyword arguments |
◆ spectra_peaks()
def warpy.post_processing.band_diagrams.simulation_1d.spectra_peaks |
( |
|
spectra, |
|
|
|
freqs, |
|
|
|
kx = None , |
|
|
|
prom_func = None , |
|
|
|
num_bands = 10 |
|
) |
| |
Finds peaks in spectra data.
- Parameters
-
spectra | Dictionary returned by self.calc_spectra(). {sim_name:spectra}. |
freqs | List of frequencies returned by self.calc_spectra(). |
kx | List of kx values to plot. If None plots all. |
- Returns
- peaks
◆ except
warpy.post_processing.band_diagrams.simulation_1d.except : |
◆ try
warpy.post_processing.band_diagrams.simulation_1d.try : |