diff --git a/explore_data.py b/explore_data.py index 2bc99c912199ca15df4830a0a2cf725cb0345405..b101d634d72f6602b98ef1444b8d07bc2a3836cc 100644 --- a/explore_data.py +++ b/explore_data.py @@ -29,7 +29,9 @@ def plot(name, values, path, datetime, filename, current_color): axe = "0" + str(axe) plt.plot(range(len(values)), values, color='#A0'+axe+axe) - filepath = path + "/" + name + "/" + filename + "/" + str(datetime) + '.png' + datetime = str(datetime).replace('.', '_') + datetime = str(datetime).replace(':', '-') + filepath = os.path.join(path, name, filename, datetime + '.png') create_path(filepath) plt.savefig(filepath) @@ -51,7 +53,7 @@ def charge_iteration(charge_items, filename): ambiant_temp = format_temperature(item[1][0][0]) # temperature: 4 ~24 ~43 datetime = convert_matlab_datetime_vector_to_utc(item[2][0]) - path = "output_graphs/charges/degree" + str(ambiant_temp) + path = os.path.join("output_graphs", "charges", "degree" + str(ambiant_temp)) voltage_measured = item[3][0][0][0][0] # Battery terminal voltage (Volts) floats current_measured = item[3][0][0][1][0] # Battery output current (Amps) floats @@ -139,9 +141,9 @@ def main(): # TODO warning for for the [:1] for filepath in filepaths[:1]: - filename = filepath.split("/")[-1].split(".")[0] - print(filename) + filename = os.path.split(filepath)[-1].split(".")[0] raw_mat = scipy.io.loadmat(filepath) + mat = raw_mat[filename][0][0][0][0] impedance_items = filter_mat(mat, "impedance")