WARPXM v1.10.0
Loading...
Searching...
No Matches
warpy.post_processing.band_diagrams.simulation_1d Namespace Reference

A collection of methods for processing multi-simulation probe datasets. More...

Functions

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.
 

Variables

 try :
 
 except :
 

Detailed Description

A collection of methods for processing multi-simulation probe datasets.

Function Documentation

◆ 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
spectraOutput from calc_spectra() {sim_name:{probe_name:{field_name:spectra}}}
avg_typeSting 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_nameString with probe file name.
y_funWhat function to call for y values.
kxList of kx values to plot. If None plots all.
t_rangeList type object with min and max time value. Default None.
windowString with windowing option for FFT. Default 'Hanning'.
betaShaping function for Kaiser window. Default 14.
tauSimulation time unit
freq_unitsString with unit of frequency. Default None.
zero_padSize 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
mpdsetwarpy.multi_probe_dataset object
kaReference k value.
kx_labelString that proceeds kx value in sim name.
kx_sizeLength 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_peaksOutput of find_peaks()
analytical_bandsOutput 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
spectraDictionary returned by self.calc_spectra(). {sim_name:spectra}.
freqsList of frequencies returned by self.calc_spectra().
kxList of kx values to plot. If None plots all.
t_rangeList type object with min and max time value. Default None.
freq_unitsString 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
spectraDictionary of dictionaries returned by self.calc_spectra(). {sim_name:{label}:spectra}}.
freqsList of frequencies returned by self.calc_spectra().
kxList of kx values to plot. If None plots all.
t_rangeList type object with min and max time value. Default None.
freq_unitsString 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
mpdsetwarpy.multi_probe_dataset object
kxDictionary returned by get_kx_values()
probe_namesList of probe names. If None plot all.
y_funWhat function to call for y values.
kx_range
t_range
windowString with windowing option for FFT. Default 'Hanning'.
betaShaping function for Kaiser window. Default 14.
**kwargsPyplot 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
spectraDictionary returned by self.calc_spectra(). {sim_name:spectra}.
freqsList of frequencies returned by self.calc_spectra().
kxList of kx values to plot. If None plots all.
Returns
peaks

Variable Documentation

◆ except

warpy.post_processing.band_diagrams.simulation_1d.except :

◆ try

warpy.post_processing.band_diagrams.simulation_1d.try :