WARPXM v1.10.0
Loading...
Searching...
No Matches
warpy.post_processing.band_diagrams.density_profiles.Density1D Class Reference

Density profile base class. More...

Inheritance diagram for warpy.post_processing.band_diagrams.density_profiles.Density1D:
warpy.post_processing.band_diagrams.density_profiles.Density1DArb warpy.post_processing.band_diagrams.density_profiles.Density1DBox warpy.post_processing.band_diagrams.density_profiles.Density1DDirichlet warpy.post_processing.band_diagrams.density_profiles.Density1DFourierArb warpy.post_processing.band_diagrams.density_profiles.Density1DSine

Detailed Description

Density profile base class.

Public Member Functions

def __init__ (self, x, **density_kwargs)
 Calculates initial density profile and it's attributes.
 
def calc_fourier_coeff (self, N=10)
 Calculate fourier coefficients of the density profile.
 
def plot_fourier_coeff (self, N=10)
 Plot fourier coefficents on bar graph.
 
def reconstruct (self)
 Calculates reconstruction of density profile using Fourier coeff.
 
def calc_error (self, ord=None)
 Uses numpy.linalg.norm() to calculate error norm of fourier approx.
 
def plot_reconstruction (self, N, ord=None)
 Plot set of reconstructions along with orginal profile.
 

Public Attributes

 x
 
 a
 
 n
 
 n_min
 
 n_max
 
 n_avg
 
 chi
 
 coeff
 
 n_recon
 
 N
 

Protected Member Functions

def _density_func (self, **density_kwargs)
 Populates density array with constant value.
 

Constructor & Destructor Documentation

◆ __init__()

def warpy.post_processing.band_diagrams.density_profiles.Density1D.__init__ (   self,
  x,
**  density_kwargs 
)

Calculates initial density profile and it's attributes.

Parameters
xList of x values.
**density_kwargsDicttionary of keyword arguments for _density_func()

Reimplemented in warpy.post_processing.band_diagrams.density_profiles.Density1DArb.

Member Function Documentation

◆ _density_func()

def warpy.post_processing.band_diagrams.density_profiles.Density1D._density_func (   self,
**  density_kwargs 
)
protected

◆ calc_error()

def warpy.post_processing.band_diagrams.density_profiles.Density1D.calc_error (   self,
  ord = None 
)

Uses numpy.linalg.norm() to calculate error norm of fourier approx.

Parameters
ordNorm order. See documentation for numpy.linalg.norm(). Default Frobenius.
Returns
Norm value

◆ calc_fourier_coeff()

def warpy.post_processing.band_diagrams.density_profiles.Density1D.calc_fourier_coeff (   self,
  N = 10 
)

Calculate fourier coefficients of the density profile.

Parameters
NNumber of coefficients to calculate. Defualt 10.
Returns
List of Fourier coefficients from -N to +N

◆ plot_fourier_coeff()

def warpy.post_processing.band_diagrams.density_profiles.Density1D.plot_fourier_coeff (   self,
  N = 10 
)

Plot fourier coefficents on bar graph.

Also calculates fourier coefficients of the density profile if not already calculated.

N Number of coefficients to calculate.

◆ plot_reconstruction()

def warpy.post_processing.band_diagrams.density_profiles.Density1D.plot_reconstruction (   self,
  N,
  ord = None 
)

Plot set of reconstructions along with orginal profile.

Parameters
NList of numbers of coefficients for Fourier series approximations

◆ reconstruct()

def warpy.post_processing.band_diagrams.density_profiles.Density1D.reconstruct (   self)

Calculates reconstruction of density profile using Fourier coeff.

Returns
Array of density values.

Member Data Documentation

◆ a

warpy.post_processing.band_diagrams.density_profiles.Density1D.a

◆ chi

warpy.post_processing.band_diagrams.density_profiles.Density1D.chi

◆ coeff

warpy.post_processing.band_diagrams.density_profiles.Density1D.coeff

◆ n

warpy.post_processing.band_diagrams.density_profiles.Density1D.n

◆ N

warpy.post_processing.band_diagrams.density_profiles.Density1D.N

◆ n_avg

warpy.post_processing.band_diagrams.density_profiles.Density1D.n_avg

◆ n_max

warpy.post_processing.band_diagrams.density_profiles.Density1D.n_max

◆ n_min

warpy.post_processing.band_diagrams.density_profiles.Density1D.n_min

◆ n_recon

warpy.post_processing.band_diagrams.density_profiles.Density1D.n_recon

◆ x

warpy.post_processing.band_diagrams.density_profiles.Density1D.x

The documentation for this class was generated from the following file: