Package ComboCode :: Package cc :: Package modeling :: Package profilers :: Module Temperature :: Class Temperature
[hide private]
[frames] | no frames]

Class Temperature

source code


An interface for a temperature profile and its derivative

Instance Methods [hide private]
 
__init__(self, r, func, dfunc=None, order=3, inner=0, inner_eps=0.5, *args, **kwargs)
Create an instance of the Temperature() class.
source code
 
setInnerEps(self, inner_eps)
Set the inner wind epsilon for the T law.
source code
array/float
__call__(self, r=None, warn=1, *args, **kwargs)
Evaluate the profile function at a coordinate point.
source code
array/float
eval(self, r=None, warn=1, inner_eps=None)
Evaluate the profile function at a coordinate point.
source code
array/float
diff(self, r=None, warn=1, inner_eps=None)
Evaluate the derivative of the profile function at a coordinate point.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, r, func, dfunc=None, order=3, inner=0, inner_eps=0.5, *args, **kwargs)
(Constructor)

source code 

Create an instance of the Temperature() class. Requires a radial grid and a temperature function.

The function can also be given as an interp1d object.

The optional args and kwargs give the additional arguments for the temperature function, which are ignored in case func is an interp1d object.

An additional option concerns the extrapolation to smaller radii, e.g. in the inner wind between the stellar surface and the dust condensation radius. In this case, the eval/diff methods will differ between inner wind (r<r0) and the rest of the wind (r>r0) in terms of evaluation.

At r>r0: The given func (or interpolator) is used. At r<r0: A Teps power law is used, for which 1 out of Tstar or epsilon can be defined. The default sets epsilon == 0.5 (the optically thin case), but inner_epsilon can be passed to the initialisation if needed. r0, T0 must be defined in kwargs either for the main wind's Teps law, or as an additional argument if a file is read.

r0 and T0 are usually passed as kwargs for the func. THey are used here explicitly for the inner wind power law. If they are not given, the defaults are used: r[0] and -- after T has been evaluated -- T[0]. In case the func is interp_file, r0 and T0 can still be passed as kwargs but they are then removed from the kwargs dict after extraction.

Parameters:
  • r (array) - The radial points (cm)
  • func (function) - The function that describes the temperature profile. Can be given as an interp1d object.
  • dfunc (function/interp1d object) - The function that describes the derivative of the profile with respect to r. Can be given as an interp1d object. If None, a generic central difference is taken and interpolated.

    (default: None)

  • order (int) - Order of the spline interpolation. Default is cubic.

    (default: 3)

  • inner (bool) - Applies a power law to the inner region, as a means of extrapolation. Off by default, but can be turned on. In this case, r0 is taken from kwargs, ie the r0 from the power law of the wind (if Teps is chosen), or as an additional keyword if a file is read.

    (default: 0)

  • inner_eps (float) - The exponent for the power law in the inner wind.

    (default: 0.5)

  • args (tuple) - Additional parameters passed to the functions when eval or diff are called.

    (default: [])

  • kwargs (dict) - Additional keywords passed to the functions when eval or diff are called.

    (default: {})

Overrides: object.__init__

setInnerEps(self, inner_eps)

source code 

Set the inner wind epsilon for the T law. Only relevant when self.inner is 1.

Changes the standard T law as well, in case inner eps is different from when the instance of the class was created.

Parameters:
  • inner_eps (float) - the epsilon of the inner wind power law.

__call__(self, r=None, warn=1, *args, **kwargs)
(Call operator)

source code 

Evaluate the profile function at a coordinate point.

r can be any value or array.

The default y-grid is returned if r is None.

Passes the call to eval. Additional keywords for the power law extrapolation can be passed this way as well.

Parameters:
  • r (array/float) - The primary coordinate point(s). If None, the default coordinate grid is used.

    (default: None)

  • warn (bool) - Warn when extrapolation occurs.

    (default: 1)

Returns: array/float
The profile evaluated at r
Overrides: cc.modeling.profilers.Profiler.Profiler.__call__

eval(self, r=None, warn=1, inner_eps=None)

source code 

Evaluate the profile function at a coordinate point.

r can be any value or array.

The default y-grid is returned if r is None and inner_eps is 0.5 (the default).

Parameters:
  • r (array/float) - The coordinate point(s). If None, the default coordinate grid is used.

    (default: None)

  • warn (bool) - Warn when extrapolation occurs.

    (default: 1)

  • inner_eps (float) - The exponent of the Teps power law inner wind extrapolation. If default, the inner_eps defined upon initialisation is used.

    (default: None)

Returns: array/float
The profile evaluated at r
Overrides: cc.modeling.profilers.Profiler.Profiler.eval

diff(self, r=None, warn=1, inner_eps=None)

source code 

Evaluate the derivative of the profile function at a coordinate point.

r can be any value or array.

The default y-grid is returned if r is None and inner_eps is 0.5 (the default).

Parameters:
  • r (array/float) - The coordinate point(s). If None, the default coordinate grid is used.

    (default: None)

  • warn (bool) - Warn when extrapolation occurs.

    (default: 1)

  • inner_eps (float) - The exponent of the Teps power law inner wind extrapolation. If default, the inner_eps defined upon initialisation is used.

    (default: None)

Returns: array/float
The derivative evaluated at r
Overrides: cc.modeling.profilers.Profiler.Profiler.diff