Lets make a QPO lightcurve. The smallest CARMA model that can do QPOs is the CARMA(2,q) model. Here's an example -


In [13]:
import math
import cmath
import numpy as np

import kali.carma

QPOTask = kali.carma.CARMATask(2,1)
dt = 0.1
Rho = np.array([complex(-1.0/100.0, (2.0*math.pi)/50.0), complex(-1.0/100.0, -(2.0*math.pi)/50.0), -1.0/10.0, 1.0])
Theta = kali.carma.coeffs(2, 1, Rho)
print Theta
QPOTask.check(Theta)
QPOTask.set(dt, Theta)
QPOLC = QPOTask.simulate(duration=2000.0)
QPOLC.plot()


[ 0.02        0.01589137  0.01566871  0.15668706]
Out[13]:

In [10]:
QPOTask.plotpsd()


Out[10]:

In [11]:
QPOTask.plotsf()


Out[11]:

Now lets do everything with a higher order model CARMA(4,1).


In [14]:
QPOTask2 = kali.carma.CARMATask(4,1)
dt = 0.1
Rho2 = np.array([complex(-1.0/100.0, (2.0*math.pi)/50.0), complex(-1.0/100.0, -(2.0*math.pi)/50.0), complex(-1.0/400.0, (2.0*math.pi)/250.0), complex(-1.0/400.0, -(2.0*math.pi)/250.0), -1.0/10.0, 1.0])
Theta2 = kali.carma.coeffs(4, 1, Rho2)
print Theta2
QPOTask2.check(Theta2)
QPOTask2.set(dt, Theta2)
QPOLC2 = QPOTask2.simulate(duration=2000.0)
QPOLC2.plot()


[  2.50000000e-02   1.66292717e-02   9.22149288e-05   1.01371774e-05
   3.69536622e-05   3.69536622e-04]
Out[14]:

In [15]:
QPOTask2.plotpsd()


Out[15]:

In [16]:
QPOTask2.plotsf()


Out[16]: