idxLAA+= 1
            idxLAM+= 1
            idxLBA+= 1
            idxLBM+= 1
            idxLCA+= 1
            idxLCM+= 1
        # return V0 V+ V- 
        return[V0Ang,V0Mag,VpAng,VpMag,VnAng,VnMag,Vn_ubalance_seq,V0_ubalance_seq]
        
        
        
    
opts = { 'input_streams'  : ['upmu/switch_a6/L1ANG','upmu/switch_a6/L1MAG','upmu/switch_a6/L2ANG',
                            'upmu/switch_a6/L2MAG','upmu/switch_a6/L3ANG','upmu/switch_a6/L3MAG','upmu/grizzly_new/L1ANG'], \
         'input_uids'     : ['adf13e17-44b7-4ef6-ae3f-fde8a9152ab7','df64af25-a389-4be9-8061-f87c3616f286',
                             '4f56a8f1-f3ca-4684-930e-1b4d9955f72c','6e6ad513-ddd2-47fb-98c1-16e6477504fc',
                             '2c07ccef-20c5-4971-87cf-2c187ce5f722','bcf38098-0e16-46f2-a9fb-9ce481d7d55b',
                             'b4776088-2f85-4c75-90cd-7472a949a8fa'], \
         'start_date'     : '2014-12-03T00:00:00.000000', \
         'end_date'       : '2014-12-03T23:59:59.000000', \
         'output_streams' : ['VOLTAGE_ZERO_SEQ_ANG','VOLTAGE_ZERO_SEQ_MAG','VOLTAGE_POSITIVE_SEQ_ANG',
                             'VOLTAGE_POSITIVE_SEQ_MAG','VOLTAGE_NEGATIVE_SEQ_ANG','VOLTAGE_NEGATIVE_SEQ_MAG',
                             'VOLTAGE_UNBALANCE_NEG_SEQ','VOLTAGE_UNBALANCE_ZERO_SEQ'], \
         'output_units'   : ['Degree','V','Degree','V','Degree','V','Precent','Precent'], \
         'author'         : 'Refined Switch_a6', \
         'name'           : 'Sequence Components', \
         'version'        : 10, \
         'algorithm'      : compute }        
qdf.register(Distillate(), opts)
qdf.begin()
         # start date for input streams. Format must match: 'yyyy-mm-ddThh:mm:ss.ssssss'
         'start_date'     : '2014-10-06T00:00:00.000000',

         # end date for input streams. Format must match: 'yyyy-mm-ddThh:mm:ss.ssssss'
         'end_date'       : '2014-10-06T02:30:00.000000',

         # string names of output streams.
         'output_streams' : ['out1, out2, out3'],

         # List of units for each output stream
         'output_units'   : ['Unit', 'Unit', 'Unit'],

         # The programmer who wrote this distillate. First level directory name
         'author'         : 'CAB',

         # The name of the type algorithm implemented. Second level directory name
         'name'           : 'New Output Frequency',

         # The version of the code. Increment this to overwrite existing data from an older
         #   version of this code
         'version'        : 6,

         # Plaintext name of the function defined above. This passes a 'function reference'
         #   that can be called in another program
         'algorithm'      : algorithm }

# The following two lines instantiate the distillate class and begin begin the distillation
qdf.register(Distillate(),
             opts)  #instantiates an object with your parameters and algorithm
qdf.begin()  # enters the program and runs the distillation program
            continue
        if VpAng[idxVp].time < CpAng[idxCp].time:
            idxCp += 1
            continue

        # compute Total_dpf_pos_seq
        total = np.cos(np.radians(VpAng[idxVp].value - CpAng[idxCp].value))
        Total_dpf_pos_seq.append((VpAng[idxVp].time, total))

        idxVp += 1
        idxCp += 1
    ''' return Totalp_dpf_seq'''
    return [Total_dpf_pos_seq]




opts = { 'input_streams'  : ['Refined Grizzly/Sequence Components/VOLTAGE_POSITIVE_SEQ_ANG',
                             'Refined Grizzly/Sequence Components/CURRENT_POSITIVE_SEQ_ANG'], \
         'input_uids'     : ['b70fae9d-8275-4956-8fb0-cf42a2474c7c','f5e8010b-147c-4d9b-940c-57703f4d29e7'], \
         'start_date'     : '2014-12-03T00:00:00.000000', \
         'end_date'       : '2014-12-03T11:59:59.000000', \
         'output_streams' : ['TOTAL_DPF_POS_SEQ'], \
         'output_units'   : ['Precent'], \
         'author'         : 'Calculated Grizzly', \
         'name'           : 'Sequence Components', \
         'version'        : 17, \
         'algorithm'      : compute }
qdf.register(Distillate(), opts)
qdf.begin()
         # start date for input streams. Format must match: 'yyyy-mm-ddThh:mm:ss.ssssss'
         'start_date'     : '2014-10-06T00:00:00.000000',

         # end date for input streams. Format must match: 'yyyy-mm-ddThh:mm:ss.ssssss'
         'end_date'       : '2014-10-06T02:30:00.000000',

         # string names of output streams.
         'output_streams' : ['out1, out2, out3'],

         # List of units for each output stream
         'output_units'   : ['Unit', 'Unit', 'Unit'],

         # The programmer who wrote this distillate. First level directory name
         'author'         : 'CAB',

         # The name of the type algorithm implemented. Second level directory name
         'name'           : 'New Output Frequency',

         # The version of the code. Increment this to overwrite existing data from an older 
         #   version of this code
         'version'        : 6,

         # Plaintext name of the function defined above. This passes a 'function reference'
         #   that can be called in another program
         'algorithm'      : algorithm }

# The following two lines instantiate the distillate class and begin begin the distillation
qdf.register(Distillate(), opts) #instantiates an object with your parameters and algorithm
qdf.begin() # enters the program and runs the distillation program