In [ ]:
import os
import time
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import cellpy
from cellpy import cellreader
%matplotlib inline
In [ ]:
from cellpy import log
log.setup_logging(default_level="INFO")
In [ ]:
filename = Path("/Users/jepe/Arbeid/Data/celldata/20171120_nb034_11_cc.h5")
print(f"size: {filename.stat().st_size/1_048_576}")
my_data = cellreader.CellpyData()
my_data.load(filename)
dataset = my_data.dataset
In [ ]:
dataset.steps.head()
print(dataset.steps.columns)
tot usage for `make_step_table``:
_extract_step_values
In [ ]:
old_step_table = my_data.dataset.steps.copy()
In [ ]:
my_data.make_step_table_new()
In [ ]:
new_step_table = my_data.dataset.steps.copy()
In [ ]:
mask_current_negative = new_step_table.loc[:, "current_avr"] < - 0.0000000000001
mask_discharge_changed = new_step_table.loc[:, "discharge_delta"].abs() > 2.0
mask_current_negative & mask_discharge_changed
In [ ]:
old_step_table[["I_avr", "Charge_delta", "Discharge_delta", "type"]].head(20)
In [ ]:
new_step_table[["current_avr", "charge_delta", "discharge_delta", "type"]].head(20)
In [ ]:
new_step_table.type.unique()
In [ ]:
old_step_table.type.unique()
raw_limits["current_hard"] = 0.0000000000001
raw_limits["current_soft"] = 0.00001
raw_limits["stable_current_hard"] = 2.0
raw_limits["stable_current_soft"] = 4.0
raw_limits["stable_voltage_hard"] = 2.0
raw_limits["stable_voltage_soft"] = 4.0
raw_limits["stable_charge_hard"] = 2.0
raw_limits["stable_charge_soft"] = 5.0
raw_limits["ir_change"] = 0.00001
current_limit_value_hard = self.raw_limits["current_hard"]
current_limit_value_soft = self.raw_limits["current_soft"]
stable_current_limit_hard = self.raw_limits["stable_current_hard"]
stable_current_limit_soft = self.raw_limits["stable_current_soft"]
stable_voltage_limit_hard = self.raw_limits["stable_voltage_hard"]
stable_voltage_limit_soft = self.raw_limits["stable_voltage_soft"]
stable_charge_limit_hard = self.raw_limits["stable_charge_hard"]
stable_charge_limit_soft = self.raw_limits["stable_charge_soft"]
ir_change_limit = self.raw_limits["ir_change"]
In [ ]:
#df_steps.loc[mask_discharge_changed & mask_current_negative, shdr.type] = 'discharge'
#mask_discharge_changed = df_steps.loc[:, (shdr.charge, "delta")].abs() > stable_charge_limit_hard
#mask_current_negative = df_steps.loc[:, (shdr.current, "avr")] < - current_limit_value_hard
n3 = new_step_table.iloc[2,:]
o3 = old_step_table.iloc[2,:]
In [ ]:
t1 = "current_avr"
t2 = "I_avr"
print(n3[t1] == o3[t2])
print(f"old value (for steptable[{t2}]): {o3[t2]}")
print(f"new value (for steptable[{t1}]): {n3[t1]}")
print(o3[t2] < - 0.0000000000001)
print(n3[t1] < - 0.0000000000001)
In [ ]:
t1 = "discharge_delta"
t2 = "Discharge_delta"
print(n3[t1] == o3[t2])
print(f"old value (for steptable[{t2}]): {o3[t2]}")
print(f"new value (for steptable[{t1}]): {n3[t1]}")
print(o3[t2] > 2.0)
print(n3[t1] > 2.0)
In [ ]: