astromodels.functions.functions_2D module

class astromodels.functions.functions_2D.Asymm_Gaussian_on_sphere(**kwargs)[source]

Bases: Function2D

description :

A bidimensional Gaussian function on a sphere (in spherical coordinates)

see https://en.wikipedia.org/wiki/Gaussian_function#Two-dimensional_Gaussian_function

parameters :

lon0 :

desc : Longitude of the center of the source initial value : 0.0 min : 0.0 max : 360.0

lat0 :

desc : Latitude of the center of the source initial value : 0.0 min : -90.0 max : 90.0

a :

desc : Standard deviation of the Gaussian distribution (major axis) initial value : 10 min : 0 max : 20

e :

desc : Excentricity of Gaussian ellipse initial value : 0.9 min : 0 max : 1

theta :

desc : inclination of major axis to a line of constant latitude initial value : 10. min : -90.0 max : 90.0

evaluate(x, y, lon0, lat0, a, e, theta)[source]
get_boundaries()[source]

Returns the boundaries of this function. By default there is no boundary, but subclasses can override this.

Returns:

a tuple of tuples containing the boundaries for each coordinate (ra_min, ra_max), (dec_min, dec_max)

get_total_spatial_integral(z=None)[source]

Returns the total integral (for 2D functions) or the integral over the spatial components (for 3D functions). needs to be implemented in subclasses.

Returns:

an array of values of the integral (same dimension as z).

static info()
class astromodels.functions.functions_2D.Disk_on_sphere(**kwargs)[source]

Bases: Function2D

description :

A bidimensional disk/tophat function on a sphere (in spherical coordinates)

latex : $$ f(vec{x}) = left(frac{180}{pi}right)^2 frac{1}{pi~({rm radius})^2} ~left{begin{matrix} 1 & {rm if}& {rm | vec{x} - vec{x}_0| le {rm radius}} \ 0 & {rm if}& {rm | vec{x} - vec{x}_0| > {rm radius}} end{matrix}right. $$

parameters :

lon0 :

desc : Longitude of the center of the source initial value : 0.0 min : 0.0 max : 360.0

lat0 :

desc : Latitude of the center of the source initial value : 0.0 min : -90.0 max : 90.0

radius :

desc : Radius of the disk initial value : 15 min : 0 max : 20

evaluate(x, y, lon0, lat0, radius)[source]
get_boundaries()[source]

Returns the boundaries of this function. By default there is no boundary, but subclasses can override this.

Returns:

a tuple of tuples containing the boundaries for each coordinate (ra_min, ra_max), (dec_min, dec_max)

get_total_spatial_integral(z=None)[source]

Returns the total integral (for 2D functions) or the integral over the spatial components (for 3D functions). needs to be implemented in subclasses.

Returns:

an array of values of the integral (same dimension as z).

static info()
class astromodels.functions.functions_2D.Ellipse_on_sphere(**kwargs)[source]

Bases: Function2D

description :

An ellipse function on a sphere (in spherical coordinates)

latex : $$ f(vec{x}) = left(frac{180}{pi}right)^2 frac{1}{pi~ a b} ~left{begin{matrix} 1 & {rm if}& {rm | vec{x} - vec{x}_{f1}| + | vec{x} - vec{x}_{f2}| le {rm 2a}} \ 0 & {rm if}& {rm | vec{x} - vec{x}_{f1}| + | vec{x} - vec{x}_{f2}| > {rm 2a}} end{matrix}right. $$

parameters :

lon0 :

desc : Longitude of the center of the source initial value : 0.0 min : 0.0 max : 360.0

lat0 :

desc : Latitude of the center of the source initial value : 0.0 min : -90.0 max : 90.0

a :

desc : semimajor axis of the ellipse initial value : 15. min : 0 max : 20

e :

desc : eccentricity of ellipse initial value : 0.9 min : 0 max : 1

theta :

desc : inclination of semimajoraxis to a line of constant latitude initial value : 0.0 min : -90.0 max : 90.0

calc_focal_pts(lon0, lat0, a, b, theta)[source]
evaluate(x, y, lon0, lat0, a, e, theta)[source]
focal_pts = False
get_boundaries()[source]

Returns the boundaries of this function. By default there is no boundary, but subclasses can override this.

Returns:

a tuple of tuples containing the boundaries for each coordinate (ra_min, ra_max), (dec_min, dec_max)

get_total_spatial_integral(z=None)[source]

Returns the total integral (for 2D functions) or the integral over the spatial components (for 3D functions). needs to be implemented in subclasses.

Returns:

an array of values of the integral (same dimension as z).

static info()
lat1 = None
lat2 = None
lon1 = None
lon2 = None
class astromodels.functions.functions_2D.Gaussian_on_sphere(**kwargs)[source]

Bases: Function2D

description :

A bidimensional Gaussian function on a sphere (in spherical coordinates)

latex : $$ f(vec{x}) = left(frac{180^circ}{pi}right)^2 frac{1}{2pi sqrt{det{Sigma}}} , {rm exp}left( -frac{1}{2} (vec{x}-vec{x}_0)^intercal cdot Sigma^{-1}cdot (vec{x}-vec{x}_0)right) \ vec{x}_0 = ({rm RA}_0,{rm Dec}_0)\ Lambda = left( begin{array}{cc} sigma^2 & 0 \ 0 & sigma^2 (1-e^2) end{array}right) \ U = left( begin{array}{cc} cos theta & -sin theta \ sin theta & cos theta end{array}right) \Sigma = ULambda U^intercal $$

parameters :

lon0 :

desc : Longitude of the center of the source initial value : 0.0 min : 0.0 max : 360.0

lat0 :

desc : Latitude of the center of the source initial value : 0.0 min : -90.0 max : 90.0

sigma :

desc : Standard deviation of the Gaussian distribution initial value : 10 min : 0 max : 20

evaluate(x, y, lon0, lat0, sigma)[source]
get_boundaries()[source]

Returns the boundaries of this function. By default there is no boundary, but subclasses can override this.

Returns:

a tuple of tuples containing the boundaries for each coordinate (ra_min, ra_max), (dec_min, dec_max)

get_total_spatial_integral(z=None)[source]

Returns the total integral (for 2D functions) or the integral over the spatial components (for 3D functions). needs to be implemented in subclasses.

Returns:

an array of values of the integral (same dimension as z).

static info()
class astromodels.functions.functions_2D.Latitude_galactic_diffuse(**kwargs)[source]

Bases: Function2D

description :

A Gaussian distribution in Galactic latitude around the Galactic plane

latex : $ K exp{left( frac{-b^2}{2 sigma_b^2} right)} $

parameters :

K :

desc : normalization initial value : 1

sigma_b :

desc : Sigma for initial value : 1

l_min :

desc : min Longtitude initial value : 10

l_max :

desc : max Longtitude initial value : 30

evaluate(x, y, K, sigma_b, l_min, l_max)[source]
get_boundaries()[source]

Returns the boundaries of this function. By default there is no boundary, but subclasses can override this.

Returns:

a tuple of tuples containing the boundaries for each coordinate (ra_min, ra_max), (dec_min, dec_max)

get_total_spatial_integral(z=None)[source]

Returns the total integral (for 2D functions) or the integral over the spatial components (for 3D functions). needs to be implemented in subclasses.

Returns:

an array of values of the integral (same dimension as z).

static info()
set_frame(new_frame)[source]

Set a new frame for the coordinates (the default is ICRS J2000)

Parameters:

new_frame – a coordinate frame from astropy

Returns:

(none)

class astromodels.functions.functions_2D.Power_law_on_sphere(**kwargs)[source]

Bases: Function2D

description :

A power law function on a sphere (in spherical coordinates)

latex : $$ f(vec{x}) = left(frac{180}{pi}right)^{-1.*index} left{begin{matrix} 0.05^{index} & {rm if} & ||vec{x}-vec{x}_0|| le 0.05\ ||vec{x}-vec{x}_0||^{index} & {rm if} & 0.05 < ||vec{x}-vec{x}_0|| le maxr \ 0 & {rm if} & ||vec{x}-vec{x}_0||>maxrend{matrix}right. $$

parameters :

lon0 :

desc : Longitude of the center of the source initial value : 0.0 min : 0.0 max : 360.0

lat0 :

desc : Latitude of the center of the source initial value : 0.0 min : -90.0 max : 90.0

index :

desc : power law index initial value : -2.0 min : -5.0 max : -1.0

maxr :

desc : max radius initial value : 20. fix : yes

minr :

desc : radius below which the PL is approximated as a constant initial value : 0.05 fix : yes

evaluate(x, y, lon0, lat0, index, maxr, minr)[source]
get_boundaries()[source]

Returns the boundaries of this function. By default there is no boundary, but subclasses can override this.

Returns:

a tuple of tuples containing the boundaries for each coordinate (ra_min, ra_max), (dec_min, dec_max)

get_total_spatial_integral(z=None)[source]

Returns the total integral (for 2D functions) or the integral over the spatial components (for 3D functions). needs to be implemented in subclasses.

Returns:

an array of values of the integral (same dimension as z).

static info()
class astromodels.functions.functions_2D.SpatialTemplate_2D(**kwargs)[source]

Bases: Function2D

description :

User input Spatial Template. Expected to be normalized to 1/sr

latex : $ hi $

parameters :

K :

desc : normalization initial value : 1 fix : yes

hash :

desc: hash of model map [needed for memoization] initial value: 1 fix: yes

ihdu:

desc: header unit index of fits file initial value: 0 fix: True min: 0

properties:
fits_file:

desc: fits file to load defer: True function: _load_file

frame:

desc: coordinate frame initial value: icrs allowed values: - icrs - galactic - fk5 - fk4 - fk4_no_e

evaluate(x, y, K, hash, ihdu)[source]
get_boundaries()[source]

Returns the boundaries of this function. By default there is no boundary, but subclasses can override this.

Returns:

a tuple of tuples containing the boundaries for each coordinate (ra_min, ra_max), (dec_min, dec_max)

get_total_spatial_integral(z=None)[source]

Returns the total integral (for 2D functions) or the integral over the spatial components (for 3D functions). needs to be implemented in subclasses.

Returns:

an array of values of the integral (same dimension as z).

static info()