Example #1
0
def main():
    lobj = lyra.lyra('2011/08/09')
    lobj.download()
    lobj.load()
    #lobj.plot()

    # 300 seconds worth of data summed up into 4 second bins
    s = lyra.subthensum(lobj,'2011/08/09 08:30',3600,binsize = 4.0)

    channel = lyra.channel(s,4)

    analyse = lyra_gi.lyra_gi(channel.data, channel.dt)
    analyse.dj = 0.125
    analyse.neupert()
    plt.figure(1)
    plt.plot(channel.time,channel.data)
    
    lyra_deriv = analyse.wave.real[0,:]
    plt.figure(2)
    plt.plot(channel.time,lyra_deriv)
    plt.xlabel = 'time (s)'
    plt.ylabel = 'time derivative of LYRA flux'
    
    def zzz(u,t,Clyra,lyra_deriv): #defines the system of odes
        return (lyra_deriv-Clyra*u) #the derivatives of u
    
    Clyra = 1.0
    u0 = 1.0
    hxr = odeint(zzz,u0,channel.time,args=(Clyra,lyra_deriv))
    
    plt.figure(3)
    plt.plot(channel.time,hxr)
    plt.xlabel = 'time (s)'
    plt.ylabel = 'recovered hard x-ray flux'
Example #2
0
"""
Test code that makes use of the lyra and kPyWavelet code.
"""
import lyra,lyra_gi
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
import scipy

lobj = lyra.lyra('2011/08/09')
lobj.download()
lobj.load()

# 300 seconds worth of data summed up into 4 second bins
s = lyra.sub(lobj,'2011/08/09 08:30',600)

channel = lyra.channel(s,4)

analyse = lyra_gi.lyra_gi(channel.data, channel.dt)
analyse.dj = 0.125
analyse.neupert()
plt.figure(1)
plt.plot(channel.time,channel.data)

this = 20
print 'Smoothing scale = ',analyse.scale[this]
lyra_deriv = analyse.wave.real[this,:]
plt.figure(2)
plt.plot(channel.time,lyra_deriv)
plt.xlabel = 'time (s)'
plt.ylabel = 'time derivative of LYRA flux'
Example #3
0
"""
Test code that makes use of the lyra and kPyWavelet code.
"""
import lyra
import kPyWavelet as wvt
#import matplotlib.pyplot as plt
import pylab
import numpy as np
lobj = lyra.lyra('2011/06/29')
lobj.download()
lobj.load()

#ss = lyra.subthensum(lyra,'2011/06/29 20:00',300,binsize = 4.0)

# get 300 seconds worth of data
s = lyra.sub(lobj,'2011/06/29 20:00',300)



choose = 4
units = s.data.columns[choose].name + ' ('+s.data.columns[choose].unit+')'

ch = s.data.field(choose)[:]
title =  s.data.columns[choose].name + ' ('+s.data.columns[choose].unit+')' + str(lobj.tstart) + ' - ' + str(lobj.tend)
label = 'normalized'
xlabel = s.data.columns[0].name + ' ('+s.data.columns[0].unit+')'

avg1, avg2 = (2, 8)                  # Range of periods to average
slevel = 0.95                        # Significance level

std = ch.std()                      # Standard deviation