KingProjectedAnalytic1D

class astropy.modeling.functional_models.KingProjectedAnalytic1D(amplitude=1, r_core=1, r_tide=2, **kwargs)[source]

Bases: astropy.modeling.Fittable1DModel

Projected (surface density) analytic King Model.

Parameters
amplitudefloat

Amplitude or scaling factor.

r_corefloat

Core radius (f(r_c) ~ 0.5 f_0)

r_tidefloat

Tidal radius.

Other Parameters
fixeda dict, optional

A dictionary {parameter_name: boolean} of parameters to not be varied during fitting. True means the parameter is held fixed. Alternatively the fixed property of a parameter may be used.

tieddict, optional

A dictionary {parameter_name: callable} of parameters which are linked to some other parameter. The dictionary values are callables providing the linking relationship. Alternatively the tied property of a parameter may be used.

boundsdict, optional

A dictionary {parameter_name: value} of lower and upper bounds of parameters. Keys are parameter names. Values are a list or a tuple of length 2 giving the desired range for the parameter. Alternatively, the min and max properties of a parameter may be used.

eqconslist, optional

A list of functions of length n such that eqcons[j](x0,*args) == 0.0 in a successfully optimized problem.

ineqconslist, optional

A list of functions of length n such that ieqcons[j](x0,*args) >= 0.0 is a successfully optimized problem.

Notes

This model approximates a King model with an analytic function. The derivation of this equation can be found in King ‘62 (equation 14). This is just an approximation of the full model and the parameters derived from this model should be taken with caution. It usually works for models with a concentration (c = log10(r_t/r_c) paramter < 2.

Model formula:

\[f(x) = A r_c^2 \left(\frac{1}{\sqrt{(x^2 + r_c^2)}} - \frac{1}{\sqrt{(r_t^2 + r_c^2)}}\right)^2\]

References

Rc606295f1bc9-1

http://articles.adsabs.harvard.edu/pdf/1962AJ…..67..471K

Examples

import numpy as np
from astropy.modeling.models import KingProjectedAnalytic1D
import matplotlib.pyplot as plt

plt.figure()
rt_list = [1, 2, 5, 10, 20]
for rt in rt_list:
    r = np.linspace(0.1, rt, 100)

    mod = KingProjectedAnalytic1D(amplitude = 1, r_core = 1., r_tide = rt)
    sig = mod(r)

    plt.loglog(r, sig/sig[0], label='c ~ {:0.2f}'.format(mod.concentration))

plt.xlabel("r")
plt.ylabel(r"$\sigma/\sigma_0$")
plt.legend()
plt.show()

(png, svg, pdf)

../_images/astropy-modeling-functional_models-KingProjectedAnalytic1D-1.png

Attributes Summary

amplitude

concentration

Concentration parameter of the king model

input_units

This property is used to indicate what units or sets of units the evaluate method expects, and returns a dictionary mapping inputs to units (or None if any units are accepted).

param_names

r_core

r_tide

Methods Summary

evaluate(x, amplitude, r_core, r_tide)

Analytic King model function.

fit_deriv(x, amplitude, r_core, r_tide)

Analytic King model function derivatives.

Attributes Documentation

amplitude = Parameter('amplitude', value=1.0, bounds=(1.1754943508222875e-38, None))
concentration

Concentration parameter of the king model

input_units

This property is used to indicate what units or sets of units the evaluate method expects, and returns a dictionary mapping inputs to units (or None if any units are accepted).

Model sub-classes can also use function annotations in evaluate to indicate valid input units, in which case this property should not be overridden since it will return the input units based on the annotations.

param_names = ('amplitude', 'r_core', 'r_tide')
r_core = Parameter('r_core', value=1.0, bounds=(1.1754943508222875e-38, None))
r_tide = Parameter('r_tide', value=2.0, bounds=(1.1754943508222875e-38, None))

Methods Documentation

static evaluate(x, amplitude, r_core, r_tide)[source]

Analytic King model function.

static fit_deriv(x, amplitude, r_core, r_tide)[source]

Analytic King model function derivatives.