ComplexSpiralParam

Complex spiral parameters.

Attributes:

Name Type Description
amplitude0 float

The absolute amplitude of the spiral.

frequency float

The frequency of the spiral.

phi0 float

The phase of the spiral.

tau float

The time constant of the spiral.

offset_amp float

The amplitude offset of the spiral.

offset_phase float

The phase offset of the spiral.

More attributes:

  • offset (complex): Calculates the complex offset based on the amplitude and phase offsets.
  • amplitude (complex): Calculates the complex amplitude based on the initial amplitude and phase.
  • rate (float): Calculates the rate of decay of the spiral.
  • omega (float): Calculates the angular frequency of the spiral.
Source code in ffit/funcs/complex_spiral.py
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
@dataclass(frozen=True)
class ComplexSpiralParam(ParamDataclass):
    """Complex spiral parameters.

    Attributes:
        amplitude0 (float):
            The absolute amplitude of the spiral.
        frequency (float):
            The frequency of the spiral.
        phi0 (float):
            The phase of the spiral.
        tau (float):
            The time constant of the spiral.
        offset_amp (float):
            The amplitude offset of the spiral.
        offset_phase (float):
            The phase offset of the spiral.

    More attributes:

    - offset (complex):
            Calculates the complex offset based on the amplitude and phase offsets.
    - amplitude (complex):
            Calculates the complex amplitude based on the initial amplitude and phase.
    - rate (float):
            Calculates the rate of decay of the spiral.
    - omega (float):
            Calculates the angular frequency of the spiral.
    """

    amplitude0: float
    frequency: float
    phi0: float
    tau: float
    offset_amp: float
    offset_phase: float
    std: "_t.Optional[ComplexSpiralParam]" = None

    @property
    def offset(self):
        return self.offset_amp * np.exp(1j * self.offset_phase)

    @property
    def amplitude(self):
        return self.amplitude0 * np.exp(1j * self.phi0)

    @property
    def rate(self):
        return -1 / self.tau

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