Skip to content

CosParam

Cos function parameters.


amplitude (float):
    The amplitude.
frequency (float):
    The frequency in 1/[x] units.
phi0 (float):
    The phase inside cos.
offset (float):
    The global offset.

Additional attributes:

omega (float):
    The angular frequency.
Source code in ffit/funcs/cos.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@dataclass(frozen=True)
class CosParam(ParamDataclass):
    """Cos function parameters.

    Attributes:
    -----------------
        amplitude (float):
            The amplitude.
        frequency (float):
            The frequency in 1/[x] units.
        phi0 (float):
            The phase inside cos.
        offset (float):
            The global offset.

    Additional attributes:
    -----------------
        omega (float):
            The angular frequency.

    """

    amplitude: float
    frequency: float
    phi0: float
    offset: float
    std: "_t.Optional[CosParam]" = None

    @property
    def omega(self):
        return 2 * np.pi * self.frequency