Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/functional.py: 64%
28 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 18:48 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-10-31 18:48 +0000
1##################### generated by xml-casa (v2) from functional.xml ################
2##################### 310465241093cdcbf90ad6c88759384b ##############################
3from __future__ import absolute_import
4from .__casac__.functional import functional as _functional
6from .errors import create_error_string
7from .typecheck import CasaValidator as _validator
8_pc = _validator( )
9from .coercetype import coerce as _coerce
10_wrap_functional = lambda swig_object: functional(swig_object=swig_object)
12class functional:
13 _info_group_ = """scimath"""
14 _info_desc_ = """Functionals handling"""
15 ### self
16 def __init__(self, *args, **kwargs):
17 """Create a {tt functional} tool.
18 """
19 self._swigobj = kwargs.get('swig_object',None)
20 if self._swigobj is None:
21 self._swigobj = _functional()
23 def f(self, x=float(0)):
24 """Calculate the value of the functional.
25 """
26 return self._swigobj.f(x)
28 def ndim(self):
29 """Return the number of dimensions.
30 """
31 return self._swigobj.ndim()
33 def done(self):
34 """Free the functional's resources.
35 """
36 return self._swigobj.done()
38 def gaussian1d(self, amplitude=float(1), center=float(0), fwhm=float(1)):
39 """Create a 1-dimensional Gaussian with the specified amplitude, fwhm, and
40 center.
41 """
42 return _wrap_functional(swig_object=self._swigobj.gaussian1d(amplitude, center, fwhm))
44 def gaussian2d(self, amplitude=float(1), center=[ float(-1) ], fwhm=[ float(-1) ], pa=''):
45 """Create a 2-dimensional Gaussian with the specified amplitude, fwhms, and
46 center. The created functional has method {em f} to
47 calculate the function value at a series of {em x, y} values, or the
48 value.
49 """
50 return _wrap_functional(swig_object=self._swigobj.gaussian2d(amplitude, center, fwhm, pa))
52 def polynomial(self, coefficients=[ float(0) ]):
53 """Create a 1-dimensional polynomial function with the specified coefficents.
54 """
55 return _wrap_functional(swig_object=self._swigobj.polynomial(coefficients))
57 def powerlogpoly(self, coefficients=[ float(0) ]):
58 """Create a 1-dimensional power log polynomial function with the specified coefficents.
59 """
60 return _wrap_functional(swig_object=self._swigobj.powerlogpoly(coefficients))