astromodels.functions.functions_1D.functions module

class astromodels.functions.functions_1D.functions.DiracDelta(**kwargs)[source]

Bases: Function1D

description :

return at zero_point

latex : $ value $

parameters :

value :

desc : Constant value initial value : 0

zero_point:

desc: value at which function is non-zero initial value : 0 fix : yes

evaluate(x, value, zero_point)[source]
static info()
class astromodels.functions.functions_1D.functions.Exponential_cutoff(**kwargs)[source]

Bases: Function1D

description :

An exponential cutoff

latex : $ K exp{(-x/xc)} $

parameters :

K :

desc : Normalization initial value : 1.0 fix : no is_normalization : True

xc :

desc : cutoff initial value : 100 min : 1

evaluate(x, K, xc)[source]
static info()
exception astromodels.functions.functions_1D.functions.GSLNotAvailable[source]

Bases: ImportWarning

class astromodels.functions.functions_1D.functions.GenericFunction(**kwargs)[source]

Bases: Function1D

description :

Return k*f(x)

latex : $ k $

parameters :

k :

desc : Constant value initial value : 1

evaluate(x, k)[source]
property function

Get/set function

get_function()[source]
static info()
set_function(f)[source]
to_dict(minimal=False)[source]
exception astromodels.functions.functions_1D.functions.InvalidUsageForFunction[source]

Bases: Exception

class astromodels.functions.functions_1D.functions.Log_parabola(**kwargs)[source]

Bases: Function1D

description :

A log-parabolic function. NOTE that we use the high-energy convention of using the natural log in place of the base-10 logarithm. This means that beta is a factor 1 / log10(e) larger than what returned by those software using the other convention.

latex : $ K left( frac{x}{piv} right)^{alpha -beta log{left( frac{x}{piv} right)}} $

parameters :

K :

desc : Normalization initial value : 1.0 is_normalization : True transformation : log10 min : 1e-30 max : 1e5

piv :

desc : Pivot (keep this fixed) initial value : 1 fix : yes

alpha :

desc : index initial value : -2.0

beta :

desc : curvature (positive is concave, negative is convex) initial value : 1.0

evaluate(x, K, piv, alpha, beta)[source]
static info()
property peak_energy

Returns the peak energy in the nuFnu spectrum

Returns:

peak energy in keV

exception astromodels.functions.functions_1D.functions.NaimaNotAvailable[source]

Bases: ImportWarning

class astromodels.functions.functions_1D.functions.Sin(**kwargs)[source]

Bases: Function1D

description :

A sinusodial function

latex : $ K~sin{(2pi f x + phi)} $

parameters :

K :

desc : Normalization initial value : 1 is_normalization : True

f :

desc : frequency initial value : 1.0 / (2 * np.pi) min : 0

phi :

desc : phase initial value : 0 min : -np.pi max : +np.pi unit: rad

tests :
  • { x : 0.0, function value: 0.0, tolerance: 1e-10}

  • { x : 1.5707963267948966, function value: 1.0, tolerance: 1e-10}

evaluate(x, K, f, phi)[source]
static info()
class astromodels.functions.functions_1D.functions.StepFunction(**kwargs)[source]

Bases: Function1D

description :

A function which is constant on the interval lower_bound - upper_bound and 0 outside the interval. The extremes of the interval are counted as part of the interval.

latex : $ f(x)=begin{cases}0 & x < text{lower_bound} \text{value} & text{lower_bound} le x le text{upper_bound} \ 0 & x > text{upper_bound} end{cases}$

parameters :

lower_bound :

desc : Lower bound for the interval initial value : 0

upper_bound :

desc : Upper bound for the interval initial value : 1

value :

desc : Value in the interval initial value : 1.0

tests :
  • { x : 0.5, function value: 1.0, tolerance: 1e-20}

  • { x : -0.5, function value: 0, tolerance: 1e-20}

evaluate(x, lower_bound, upper_bound, value)[source]
static info()
class astromodels.functions.functions_1D.functions.StepFunctionUpper(**kwargs)[source]

Bases: Function1D

description :

A function which is constant on the interval lower_bound - upper_bound and 0 outside the interval. The upper interval is open.

latex : $ f(x)=begin{cases}0 & x < text{lower_bound} \text{value} & text{lower_bound} le x le text{upper_bound} \ 0 & x > text{upper_bound} end{cases}$

parameters :

lower_bound :

desc : Lower bound for the interval initial value : 0 fix : yes

upper_bound :

desc : Upper bound for the interval initial value : 1 fix : yes

value :

desc : Value in the interval initial value : 1.0

tests :
  • { x : 0.5, function value: 1.0, tolerance: 1e-20}

  • { x : -0.5, function value: 0, tolerance: 1e-20}

evaluate(x, lower_bound, upper_bound, value)[source]
static info()