human
What is a the Python code you requested given the following:
I am working on the file "RM.ipynb".
The first task is:
Next we define a class that we will mainly use to hold data about our pumping sequence. The information in these objects will be used to visualize the spectrum and wavefunctions of bulk and edge localized states.
Can you write Python code for it?
assistant
#Here is the Python code you requested.

class pumpdata:
    '''
    A class that holds information on spectrum and wavefunctions
    of a pump sequence performed on a finite lattice model.
    Default values are tailored to the control freak sequence.
    '''
    def __init__(self,L=10,numLoc=1,norm_treshold=0.99,func=uvwCF,**kwargs):
        '''
        Initialization function. The default values are set in such a way that they correspond
        to the control freak sequence.
        '''
        
        
        self.L=L         
        self.dat=[]             # We will collect the data to be
        self.vecdat=[]          # plotted in these arrays.
        self.lefty=[]
        self.righty=[]
        self.lefty=[]
        self.righty=[]
        
        tlim=kwargs.get('edge_tlim',(0,1)) # We can use this to restrict classification 
                                           #  of left and right localized states in time 
        for t in tran[:,0]:
            u,v,w=func(t)         # obtain u(t),v(t) and w(t)
            H=H_RM_reals(L,u,v,w) # 
            eigdat=eigh(H);       # for a given t here we calculate the eigensystem (values and vectors)
            if tlim[0]<t<tlim[1]:
                # for the interesting time intervall we look for states localized to the edge
                for i in range(2*L):
                    if sum((array(eigdat[1][0::2,i])**2+array(eigdat[1][1::2,i])**2)[0:2*numLoc:2])>norm_treshold:
                        self.lefty=append(self.lefty,[[t,eigdat[0][i]]]);
                    if sum((array(eigdat[1][0::2,i])**2+array(eigdat[1][1::2,i])**2)[:L-2*numLoc:-2])>norm_treshold:
                        self.righty=append(self.righty,[[t,eigdat[0][i]]]);

            self.dat=append(self.dat,eigdat[0]);
            self.vecdat=append(self.vecdat,eigdat[1]);
    
        self.dat=reshape(self.dat,[len(tran[:,0]),2*L]);          # rewraping the data
        self.vecdat=reshape(self.vecdat,[len(tran[:,0]),2*L,2*L]) # to be more digestable