Пример #1
0
def plot():
    data_path = '/home/amigos/data/sql/sisiv/'
    all_file = glob.glob(data_path + '*')
    path = max(all_file, key=os.path.getctime)
    file_name = path.split('/')[-1]

    d = n2lite.N2lite(path + '/param.db')
    D = d.read_pandas_all()

    ncol = 4
    nrow = 3
    nax = ncol * nrow

    figsize = (ncol * 4, nrow * 4)

    fig = matplotlib.pyplot.figure(figsize=figsize)
    ax = [fig.add_subplot(nrow, ncol, i + 1) for i in range(nax)]

    for _ax, sis in zip(ax, sis_list):
        _ax.plot(D['sis_vol_' + sis], D['sis_cur_' + sis], '.')
        _ax.grid()
        _ax.set_xlabel('voltage [mV]')
        _ax.set_ylabel('current [uA]')
        _ax.set_title('{}'.format(sis))

    fig.subplots_adjust(wspace=1, hspace=1)
    fig.suptitle(path + '\nNASCO IV MEASUREMENT')

    # matplotlib.pyplot.savefig('{0}/{1}.png'.format(path, file_name))

    matplotlib.pyplot.show()

    matplotlib.rcParams.update({'font.size': 12})
Пример #2
0
    def log(self):
        print("DATABASE OPEN")
        t = datetime.datetime.fromtimestamp(time.time())
        dbpath = '/home/amigos/data/antenna_logger/{}.db'.format(
            t.strftime('%Y%m%d_%H%M%S'))
        self.n2 = n2lite.N2lite(dbpath)
        self.make_table()
        while not rospy.is_shutdown():

            self.n2.write("datatime", "", (time.time(), ))
            self.n2.write("drive", "",
                          (self.drive, self.drive_cmd, self.drive_cmd2))
            self.n2.write("az", "",
                          (self.az, self.az_cmd, self.az_cmd2, self.az_speed))
            self.n2.write("el", "",
                          (self.el, self.el_cmd, self.el_cmd2, self.el_speed))
            self.n2.write("io", "", (self.error, self.control, self.emergency))

            time.sleep(0.01)  # 0.1 msec.

        else:
            self.n2.commit_data()
            self.n2.close()
            print("DATABASE CLOSE")
        return
Пример #3
0
    def log(self):
        print("DATABASE OPEN")
        t = datetime.datetime.fromtimestamp(time.time())
        dbpath = '/home/amigos/data/dome_logger/{}.db'.format(
            t.strftime('%Y%m%d_%H%M%S'))
        self.n2 = n2lite.N2lite(dbpath)
        self.make_table()
        while not rospy.is_shutdown():

            self.n2.write("datatime", "", (time.time(), ))
            self.n2.write("dome_az", "",
                          (self.az, self.az_cmd, self.az_speed_cmd,
                           self.az_action, self.az_switch, self.az_tracking))
            self.n2.write(
                "door", "",
                (self.door, self.door_cmd, self.door_cmd2, self.door_right_pos,
                 self.door_left_pos, self.door_right_act, self.door_left_act))
            self.n2.write(
                "memb", "",
                (self.memb, self.memb_cmd, self.memb_cmd2, self.memb_act))
            self.n2.write("io", "", (self.error, self.control))

            time.sleep(0.0001)  # 0.1msec.

        else:
            self.n2.commit_data()
            self.n2.close()
            print("DATABASE CLOSE")
        return
Пример #4
0
    def log(self):

        if not os.path.exists(save_dir):
            os.makedirs(save_dir)
            pass

        self.timestamp = time.time()
        exp_time = datetime.datetime.fromtimestamp(time.time())
        self.ymd = exp_time.strftime('%Y%m%d_')
        self.hms = exp_time.strftime('%H%M%S')
        self.saveto = os.path.join(save_dir, self.ymd + self.hms)
        os.makedirs(self.saveto)

        dbpath = self.saveto + '/nasco_status.db'
        self.n2 = n2lite.N2lite(dbpath)
        print("OPEN DATABASE")
        self.make_table()

        while not rospy.is_shutdown():

            time.sleep(self.interval)
            self.n2.write("datatime",
                          "",
                          "({})".format(time.time()),
                          auto_commit=True)
            self.n2.write("l218_temp",
                          "",
                          tuple(self.l218_temp),
                          auto_commit=True)
            self.n2.write("tpg261_pressure",
                          "",
                          "({})".format(self.tpg261_pressure),
                          auto_commit=True)
            self.n2.write("temperture",
                          "",
                          "({})".format(self.ondo),
                          auto_commit=True)
            self.n2.write("humidity",
                          "",
                          "({})".format(self.hum),
                          auto_commit=True)

            time.sleep(1e-2)

            self.n2.commit_data()

        else:
            self.n2.close()
            print('COMMIT DATA')

        return
Пример #5
0
    def log(self):
        print("DATABASE OPEN")
        t = datetime.datetime.fromtimestamp(time.time())
        dbpath = '/home/amigos/data/cpz2724_rsw{}_logger/{}.db'.format(
            args[1], t.strftime('%Y%m%d_%H%M%S'))
        self.n2 = n2lite.N2lite(dbpath)
        self.make_table()
        while not rospy.is_shutdown():

            self.n2.write("datatime", "", (time.time(), ))
            self.n2.write("data_do", "", tuple(self.data_do))
            self.n2.write("data_di", "", tuple(self.data_di))

            time.sleep(0.0001)  # 0.1 msec.

        else:
            self.n2.commit_data()
            self.n2.close()
            print("DATABASE CLOSE")
        return