Ejemplo n.º 1
0
    def derive_illumination_per_orbit(self, integration_start):
        period = 1562180280 - 1562174640  #by observation
        num_orbit = int((self.et - integration_start) / period)
        #artificially created parameters
        self.params['X_illum'] = parameter('X_illum')
        self.params['Y_illum'] = parameter('Y_illum')
        self.params['Z_illum'] = parameter('Z_illum')

        cx_val = self.params['Cin_0'].Vals[::-1]
        cy_val = self.params['Cin_1'].Vals[::-1]
        cz_val = self.params['Cin_2'].Vals[::-1]
        cx_t = self.params['Cin_0'].Ts[::-1]
        cy_t = self.params['Cin_1'].Ts[::-1]
        cz_t = self.params['Cin_2'].Ts[::-1]

        rxv, rxt = piecewise_integrate(cx_val, cx_t, integration_start, period,
                                       num_orbit)
        ryv, ryt = piecewise_integrate(cy_val, cy_t, integration_start, period,
                                       num_orbit)
        rzv, rzt = piecewise_integrate(cz_val, cz_t, integration_start, period,
                                       num_orbit)

        nx, ny, nz = normalize(rxv, ryv, rzv)

        self.params['X_illum'].Ts = rxt
        self.params['X_illum'].Vals = nx

        self.params['X_illum'].sTs = []
        for t in rxt:
            self.params['X_illum'].sTs.append(
                time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t)))

        self.params['Y_illum'].Ts = ryt
        self.params['Y_illum'].Vals = ny
        self.params['Y_illum'].sTs = []
        for t in ryt:
            self.params['Y_illum'].sTs.append(
                time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t)))

        self.params['Z_illum'].Ts = rzt
        self.params['Z_illum'].Vals = nz
        self.params['Z_illum'].sTs = []
        for t in rzt:
            self.params['Z_illum'].sTs.append(
                time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t)))
Ejemplo n.º 2
0
    def __init__(self, dbname='CQT', start_time=None, end_time=None):

        self.dbname = dbname
        self.st = start_time
        self.et = end_time

        self.client = None
        self.db = None

        self.Ts_conditions = {}
        self.common_conditions = {}

        self.params = {}

        self.params['vbatt'] = parameter('vbatt')

        self.params['temp_0'] = parameter('temp', idx=0)

        self.params['temp_1'] = parameter('temp', idx=1)
        self.params['temp_2'] = parameter('temp', idx=2)

        self.params['temp_3'] = parameter('temp', idx=3)

        self.params['temp_4'] = parameter('temp', idx=4)
        self.params['temp_5'] = parameter('temp', idx=5)

        # Solar power input
        self.params['Vin_0'] = parameter('vboost', idx=0,
                                         node=2)  #node = 2 by default here
        self.params['Vin_1'] = parameter('vboost', idx=1, node=2)
        self.params['Vin_2'] = parameter('vboost', idx=2, node=2)
        self.params['Cin_0'] = parameter('curin', idx=0, node=2)
        self.params['Cin_1'] = parameter('curin', idx=1, node=2)
        self.params['Cin_2'] = parameter('curin', idx=2, node=2)

        # Power output
        self.params['V_obc'] = parameter('out_val', idx=0, node=2)
        self.params['V_radio'] = parameter('out_val', idx=3, node=2)
        self.params['V_payload'] = parameter('out_val', idx=5, node=2)
        self.params['C_obc'] = parameter('curout', idx=0, node=2)
        self.params['C_radio'] = parameter('curout', idx=3, node=2)
        self.params['C_payload'] = parameter('curout', idx=5, node=2)

        self.params['battmode'] = parameter('battmode')

        # Watchdog timers and bootcauses
        self.params['wdt_i2c'] = parameter('wdtI2cS')
        self.params['wdt_GND'] = parameter('wdtGndS')
        self.params['boot_cnt'] = parameter('cntBoot')
        self.params['cntWdtI2c'] = parameter('cntWdtI2c')
        self.params['cntwdtGND'] = parameter('cntWdtGnd')
        self.params['cntWdtCsp_0'] = parameter('cntWdtCsp', idx=0)
        self.params['cntWdtCsp_1'] = parameter('cntWdtCsp', idx=1)
        self.params['bootCause'] = parameter('bootcause')

        if self.st is not None:
            self.Ts_conditions['$gte'] = int(self.st)
        else:
            self.Ts_conditions['$gte'] = int(
                1452160013)  #GMT: Thursday, January 7, 2016 9:46:53 AM
        if self.et is not None:
            self.Ts_conditions['$lt'] = int(self.et)
Ejemplo n.º 3
0
    def __init__(self, dbname='CQT', start_time=None, end_time=None):

        self.dbname = dbname
        self.st = start_time
        self.et = end_time

        self.client = None
        self.db = None

        self.Ts_conditions = {}
        self.common_conditions = {}

        self.params = {}

        self.params['curGSSB1'] = parameter('curGSSB1')
        self.params['curGSSB2'] = parameter('curGSSB2')
        self.params['curflash'] = parameter('curFlash')
        self.params['curPWM'] = parameter('curPWM')
        self.params['temp_a'] = parameter('temp_a')
        self.params['temp_b'] = parameter('temp_b')
        self.params['pwrGSSB1'] = parameter('pwrGSSB1')
        self.params['pwrGSSB2'] = parameter('pwrGSSB2')
        self.params['pwrflash'] = parameter('pwrFlash')
        self.params['pwrPWM'] = parameter('pwrPWM')
        self.params['swload_count'] = parameter('swload_count')
        self.params['fs_mounted'] = parameter('fs_mounted')
        self.params['boot_count'] = parameter('boot_count')
        self.params['boot_cause'] = parameter('boot_cause')
        self.params['clock'] = parameter('clock')

        if self.st is not None:
            self.Ts_conditions['$gte'] = int(self.st)
        else:
            self.Ts_conditions['$gte'] = int(
                1452160013)  #GMT: Thursday, January 7, 2016 9:46:53 AM
        if self.et is not None:
            self.Ts_conditions['$lt'] = int(self.et)
Ejemplo n.º 4
0
    def __init__(self, dbname='CQT', start_time=None, end_time=None):

        self.dbname = dbname
        self.st = start_time
        self.et = end_time

        self.client = None
        self.db = None

        self.Ts_conditions = {}
        self.common_conditions = {}

        self.params = {}

        self.params['curGSSB1'] = parameter('curGSSB1',
                                            y_label="Current (mA)",
                                            p_title="GSSB1 current")
        self.params['curGSSB2'] = parameter('curGSSB2',
                                            y_label="Current (mA)",
                                            p_title="GSSB2 current")
        self.params['curflash'] = parameter('curFlash',
                                            y_label="Current (mA)",
                                            p_title="Flash current")
        self.params['curPWM'] = parameter('curPWM',
                                          y_label="Current (mA)",
                                          p_title="PWM current")
        self.params['temp_a'] = parameter('temp_a',
                                          y_label="Temperature (C)",
                                          p_title="OBC temperature A",
                                          n_factor=0.1)
        self.params['temp_b'] = parameter('temp_b',
                                          y_label="Temperature (C)",
                                          p_title="OBC temperature B",
                                          n_factor=0.1)
        self.params['pwrGSSB1'] = parameter('pwrGSSB1',
                                            y_label="Enable",
                                            p_title="GSSB1 power")
        self.params['pwrGSSB2'] = parameter('pwrGSSB2',
                                            y_label="Enable",
                                            p_title="GSSB2 power")
        self.params['pwrflash'] = parameter('pwrFlash',
                                            y_label="Enable",
                                            p_title="Flash power")
        self.params['pwrPWM'] = parameter('pwrPWM',
                                          y_label="Enable",
                                          p_title="PWM power")

        #these should go to the context menu
        self.params['swload_count'] = parameter('swload_count')
        self.params['fs_mounted'] = parameter('fs_mounted')
        self.params['boot_count'] = parameter('boot_count')
        self.params['boot_cause'] = parameter('boot_cause')
        self.params['clock'] = parameter('clock')

        if self.st is not None:
            self.Ts_conditions['$gte'] = int(self.st)
        else:
            self.Ts_conditions['$gte'] = int(
                1452160013)  #GMT: Thursday, January 7, 2016 9:46:53 AM
        if self.et is not None:
            self.Ts_conditions['$lt'] = int(self.et)
Ejemplo n.º 5
0
    def __init__(self, dbname='CQT', start_time=None, end_time=None):

        self.dbname = dbname
        self.st = start_time
        self.et = end_time

        self.client = None
        self.db = None

        self.Ts_conditions = {}
        self.common_conditions = {}

        self.params = {}

        self.params['vbatt'] = parameter('vbatt',
                                         y_label='Voltage (V)',
                                         p_title="Battery Level",
                                         n_factor=0.001)

        self.params['temp_0'] = parameter('temp',
                                          idx=0,
                                          y_label='Temperature (C)',
                                          p_title="EPS temperature T0")

        self.params['temp_1'] = parameter('temp',
                                          idx=1,
                                          y_label='Temperature (C)',
                                          p_title="EPS temperature T1")
        self.params['temp_2'] = parameter('temp',
                                          idx=2,
                                          y_label='Temperature (C)',
                                          p_title="EPS temperature T2")

        self.params['temp_3'] = parameter('temp',
                                          idx=3,
                                          y_label='Temperature (C)',
                                          p_title="EPS temperature T3")

        self.params['temp_4'] = parameter(
            'temp',
            idx=4,
            y_label='Temperature (C)',
            p_title="Battery temperature")  #battery temperature
        self.params['temp_5'] = parameter('temp',
                                          idx=5,
                                          y_label='Temperature (C)',
                                          p_title="EPS temperature T5")

        # Solar power input
        self.params['Vin_0'] = parameter(
            'vboost',
            idx=0,
            node=2,
            y_label="Voltage (mV)",
            p_title="Input voltage 0")  #node = 2 by default here
        self.params['Vin_1'] = parameter('vboost',
                                         idx=1,
                                         node=2,
                                         y_label="Voltage (mV)",
                                         p_title="Input voltage 1")
        self.params['Vin_2'] = parameter('vboost',
                                         idx=2,
                                         node=2,
                                         y_label="Voltage (mV)",
                                         p_title="Input voltage 2")
        self.params['Cin_0'] = parameter('curin',
                                         idx=0,
                                         node=2,
                                         y_label='Current (mA)',
                                         p_title='Input current 0')
        self.params['Cin_1'] = parameter('curin',
                                         idx=1,
                                         node=2,
                                         y_label='Current (mA)',
                                         p_title='Input current 1')
        self.params['Cin_2'] = parameter('curin',
                                         idx=2,
                                         node=2,
                                         y_label='Current (mA)',
                                         p_title='Input current 2')

        # Power output
        self.params['V_obc'] = parameter('out_val',
                                         idx=0,
                                         node=2,
                                         y_label='Enable',
                                         p_title="Supply to OBC")
        self.params['V_radio'] = parameter('out_val',
                                           idx=3,
                                           node=2,
                                           y_label='Enable',
                                           p_title="Supply to Radio")
        self.params['V_payload'] = parameter('out_val',
                                             idx=5,
                                             node=2,
                                             y_label='Enable',
                                             p_title="Supply to Payload")
        self.params['C_obc'] = parameter('curout',
                                         idx=0,
                                         node=2,
                                         y_label='Current (mA)',
                                         p_title="Supply current to OBC")
        self.params['C_radio'] = parameter('curout',
                                           idx=3,
                                           node=2,
                                           y_label='Current (mA)',
                                           p_title="Supply current to Radio")
        self.params['C_payload'] = parameter(
            'curout',
            idx=5,
            node=2,
            y_label='Current (mA)',
            p_title="Supply current to Payload")

        self.params['battmode'] = parameter('battmode',
                                            y_label="mode",
                                            p_title="Battery mode")

        # Watchdog timers and bootcauses
        self.params['wdt_i2c'] = parameter('wdtI2cS',
                                           y_label="value",
                                           p_title="I2c watchdog timer")
        self.params['wdt_GND'] = parameter('wdtGndS',
                                           y_label="value",
                                           p_title="Ground watchdog timer")
        self.params['boot_cnt'] = parameter('cntBoot')
        self.params['cntWdtI2c'] = parameter('cntWdtI2c')
        self.params['cntwdtGND'] = parameter('cntWdtGnd')
        self.params['cntWdtCsp_0'] = parameter('cntWdtCsp', idx=0)
        self.params['cntWdtCsp_1'] = parameter('cntWdtCsp', idx=1)
        self.params['bootCause'] = parameter('bootcause')

        if self.st is not None:
            self.Ts_conditions['$gte'] = int(self.st)
        else:
            self.Ts_conditions['$gte'] = int(
                1452160013)  #GMT: Thursday, January 7, 2016 9:46:53 AM
        if self.et is not None:
            self.Ts_conditions['$lt'] = int(self.et)
Ejemplo n.º 6
0
    def __init__(self, dbname = 'CQT', start_time=None, end_time=None):
        
        self.dbname = dbname
        self.st = start_time
        self.et = end_time
        
        self.client = None
        self.db = None

        self.Ts_conditions = {}
        self.common_conditions = {}
        
        self.params = {}
        
        self.params['gyro_0'] =  parameter('gyro',idx=0,y_label='rpm',p_title='gyro reading 0')
        self.params['gyro_1'] =  parameter('gyro',idx=1,y_label='rpm',p_title='gyro reading 1')
        self.params['gyro_2'] =  parameter('gyro',idx=2,y_label='rpm',p_title='gyro reading 2')
        self.params['gyro_trend_0'] =  parameter('gyro_trend',idx=0)
        self.params['gyro_trend_1'] =  parameter('gyro_trend',idx=1)
        self.params['gyro_trend_2'] =  parameter('gyro_trend',idx=2)
        self.params['gyro_temp'] = parameter('gyro_temp', y_label="Temperature (C)")
        self.params['gyro_valid'] = parameter('gyro_valid', y_label= 'Flag')
        
        self.params['mag_0'] =  parameter('mag',idx=0)
        self.params['mag_1'] =  parameter('mag',idx=1)
        self.params['mag_2'] =  parameter('mag',idx=2)
        self.params['mag_valid'] = parameter('mag_valid')
        
        self.params['suns_temp_0'] =  parameter('suns',idx=0,y_label="Temperature (C)", p_title="Outside temperature 0")
        self.params['suns_temp_1'] =  parameter('suns',idx=1,y_label="Temperature (C)", p_title="Outside temperature 1")
        self.params['suns_temp_2'] =  parameter('suns',idx=2,y_label="Temperature (C)", p_title="Outside temperature 2")
        self.params['suns_temp_3'] =  parameter('suns',idx=3,y_label="Temperature (C)", p_title="Outside temperature 3")
        self.params['suns_temp_4'] =  parameter('suns',idx=4,y_label="Temperature (C)", p_title="Outside temperature 4")
        self.params['suns_temp_5'] =  parameter('suns',idx=5,y_label="Temperature (C)", p_title="Outside temperature 5")
        #self.params['mag_valid'] =  parameter('mag_valid') 
        
        self.params['torquer_duty_0'] =  parameter('torquer_duty',idx=0)
        self.params['torquer_duty_1'] =  parameter('torquer_duty',idx=1)
        self.params['torquer_duty_2'] =  parameter('torquer_duty',idx=2)  
        
        self.params['status_mag'] = parameter('status_mag')
        self.params['status_css'] = parameter('status_css')
        self.params['status_gyro'] = parameter('status_gyro')
        self.params['status_bdot'] = parameter('status_bdot')
        self.params['status_run'] = parameter('status_run')
        self.params['looptime'] = parameter('looptime')
        self.params['maxlooptime'] = parameter('maxlooptime')
        self.params['bdot_rate_0'] = parameter('bdot_rate',idx=0)
        self.params['bdot_rate_1'] = parameter('bdot_rate',idx=1)
        self.params['bdot_dmag_0'] =  parameter('bdot_dmag',idx=0)
        self.params['bdot_dmag_1'] =  parameter('bdot_dmag',idx=1)
        self.params['bdot_dmag_2'] =  parameter('bdot_dmag',idx=2)       
        self.params['bdot_detumb'] =  parameter('bdot_detumb')       
              
        if self.st is not None:
            self.Ts_conditions['$gte'] = int(self.st)
        else:
            self.Ts_conditions['$gte'] = int(1452160013) #GMT: Thursday, January 7, 2016 9:46:53 AM
        if self.et is not None:
            self.Ts_conditions['$lt'] = int(self.et)
Ejemplo n.º 7
0
    def __init__(self, dbname='CQT', start_time=None, end_time=None):

        self.dbname = dbname
        self.st = start_time
        self.et = end_time

        self.client = None
        self.db = None

        self.Ts_conditions = {}
        self.common_conditions = {}

        self.params = {}

        self.params['temp_brd'] = parameter('temp_brd')
        self.params['temp_pa'] = parameter('temp_pa')
        self.params['last_rssi'] = parameter('last_rssi')
        self.params['last_rferr'] = parameter('last_rferr')
        self.params['bgnd_rssi'] = parameter('bgnd_rssi')
        self.params['tx_duty'] = parameter('tx_duty')
        self.params['tot_tx_cnt'] = parameter('tot_tx_count')
        self.params['tot_rx_cnt'] = parameter('tot_rx_count')
        self.params['tot_tx_bytes'] = parameter('tot_tx_bytes')
        self.params['tot_rx_bytes'] = parameter('tot_rx_bytes')
        self.params['boot_count'] = parameter('boot_count')
        self.params['boot_cause'] = parameter('boot_cause')
        self.params['tx_bytes'] = parameter('tx_bytes')
        self.params['rx_bytes'] = parameter('rx_bytes')
        self.params['active_conf'] = parameter('active_conf')
        self.params['tx_count'] = parameter('tx_count')
        self.params['rx_count'] = parameter('rx_count')

        if self.st is not None:
            self.Ts_conditions['$gte'] = int(self.st)
        else:
            self.Ts_conditions['$gte'] = int(
                1452160013)  #GMT: Thursday, January 7, 2016 9:46:53 AM
        if self.et is not None:
            self.Ts_conditions['$lt'] = int(self.et)
Ejemplo n.º 8
0
    def __init__(self, dbname='CQT', start_time=None, end_time=None):

        self.dbname = dbname
        self.st = start_time
        self.et = end_time

        self.client = None
        self.db = None

        self.Ts_conditions = {}
        self.common_conditions = {}

        self.params = {}

        self.params['temp_brd'] = parameter('temp_brd',
                                            y_label="Temperature (C)",
                                            p_title="Ax100 board temperature",
                                            n_factor=0.1)
        self.params['temp_pa'] = parameter('temp_pa',
                                           y_label="Temperature (C)",
                                           p_title="Ax100 temperature near PA",
                                           n_factor=0.1)
        self.params['last_rssi'] = parameter('last_rssi',
                                             y_label='rssi (dB)',
                                             p_title="Last_rssi")
        self.params['last_rferr'] = parameter('last_rferr')
        self.params['bgnd_rssi'] = parameter('bgnd_rssi')
        self.params['tx_duty'] = parameter('tx_duty', y_label='duty cycle %')
        self.params['tot_tx_cnt'] = parameter('tot_tx_count', y_label='count')
        self.params['tot_rx_cnt'] = parameter('tot_rx_count', y_label='count')
        self.params['tot_tx_bytes'] = parameter('tot_tx_bytes',
                                                y_label='count')
        self.params['tot_rx_bytes'] = parameter('tot_rx_bytes',
                                                y_label='count')

        self.params['boot_count'] = parameter('boot_count', y_label='count')
        self.params['boot_cause'] = parameter('boot_cause', y_label='count')
        self.params['tx_bytes'] = parameter('tx_bytes', y_label='count')
        self.params['rx_bytes'] = parameter('rx_bytes', y_label='count')
        self.params['active_conf'] = parameter('active_conf',
                                               y_label='conf. id')
        self.params['tx_count'] = parameter('tx_count', y_label='count')
        self.params['rx_count'] = parameter('rx_count', y_label='count')

        if self.st is not None:
            self.Ts_conditions['$gte'] = int(self.st)
        else:
            self.Ts_conditions['$gte'] = int(
                1452160013)  #GMT: Thursday, January 7, 2016 9:46:53 AM
        if self.et is not None:
            self.Ts_conditions['$lt'] = int(self.et)
Ejemplo n.º 9
0
    def __init__(self, dbname='CQT', start_time=None, end_time=None):

        self.dbname = dbname
        self.st = start_time
        self.et = end_time

        self.client = None
        self.db = None

        self.Ts_conditions = {}
        self.common_conditions = {}

        self.params = {}

        self.params['gyro_0'] = parameter('gyro', idx=0)
        self.params['gyro_1'] = parameter('gyro', idx=1)
        self.params['gyro_2'] = parameter('gyro', idx=2)
        self.params['gyro_trend_0'] = parameter('gyro_trend', idx=0)
        self.params['gyro_trend_1'] = parameter('gyro_trend', idx=1)
        self.params['gyro_trend_2'] = parameter('gyro_trend', idx=2)
        self.params['gyro_temp'] = parameter('gyro_temp')
        self.params['gyro_valid'] = parameter('gyro_valid')

        self.params['mag_0'] = parameter('mag', idx=0)
        self.params['mag_1'] = parameter('mag', idx=1)
        self.params['mag_2'] = parameter('mag', idx=2)
        self.params['mag_valid'] = parameter('mag_valid')

        self.params['suns_temp_0'] = parameter('suns', idx=0)
        self.params['suns_temp_1'] = parameter('suns', idx=1)
        self.params['suns_temp_2'] = parameter('suns', idx=2)
        self.params['suns_temp_3'] = parameter('suns', idx=3)
        self.params['suns_temp_4'] = parameter('suns', idx=4)
        self.params['suns_temp_5'] = parameter('suns', idx=5)
        self.params['mag_valid'] = parameter('mag_valid')

        self.params['torquer_duty_0'] = parameter('torquer_duty', idx=0)
        self.params['torquer_duty_1'] = parameter('torquer_duty', idx=1)
        self.params['torquer_duty_2'] = parameter('torquer_duty', idx=2)

        self.params['status_mag'] = parameter('status_mag')
        self.params['status_css'] = parameter('status_css')
        self.params['status_gyro'] = parameter('status_gyro')
        self.params['status_bdot'] = parameter('status_bdot')
        self.params['status_run'] = parameter('status_run')
        self.params['looptime'] = parameter('looptime')
        self.params['maxlooptime'] = parameter('maxlooptime')
        self.params['bdot_rate_0'] = parameter('bdot_rate', idx=0)
        self.params['bdot_rate_1'] = parameter('bdot_rate', idx=1)
        self.params['bdot_dmag_0'] = parameter('bdot_dmag', idx=0)
        self.params['bdot_dmag_1'] = parameter('bdot_dmag', idx=1)
        self.params['bdot_dmag_2'] = parameter('bdot_dmag', idx=2)
        self.params['bdot_detumb'] = parameter('bdot_detumb')

        if self.st is not None:
            self.Ts_conditions['$gte'] = int(self.st)
        else:
            self.Ts_conditions['$gte'] = int(
                1452160013)  #GMT: Thursday, January 7, 2016 9:46:53 AM
        if self.et is not None:
            self.Ts_conditions['$lt'] = int(self.et)