Remove broken charge file
This commit is contained in:
@ -132,9 +132,13 @@ class ChargeFile:
|
||||
if soc > 1.05 or soc < -0.05:
|
||||
return -1
|
||||
|
||||
assert not (end_voltage < 3.4 and soc > 0.8)
|
||||
assert not (end_voltage > 4.0 and soc < 0.6)
|
||||
assert not (soc < -0.1 or soc > 1.1)
|
||||
if end_voltage > 4.0 and soc < 0.6:
|
||||
print(f"Warning: end_voltage = {end_voltage}V and soc = {soc} for cellid = {cellid}")
|
||||
return -1
|
||||
|
||||
if end_voltage < 3.4 and soc > 0.8:
|
||||
print(f"Warning: end_voltage = {end_voltage}V and soc = {soc} for cellid = {cellid}")
|
||||
return -1
|
||||
|
||||
return soc
|
||||
|
||||
|
@ -27,10 +27,13 @@ if __name__ == "__main__":
|
||||
charge_files = list()
|
||||
for filename in charge_filenames:
|
||||
charge_files.append(ChargeFile(os.path.join(args.data, filename)))
|
||||
charge_files.sort(key=lambda charge_file: charge_file.step)
|
||||
|
||||
cells = set()
|
||||
for filename in tqdm(spectra_filenames, desc="Finding cells"):
|
||||
tokens = filename.split('.')[0].split('-')
|
||||
if len(tokens) != 3:
|
||||
continue
|
||||
cellid = int(tokens[1])
|
||||
cells.add(cellid)
|
||||
|
||||
@ -40,11 +43,14 @@ if __name__ == "__main__":
|
||||
|
||||
for filename in tqdm(spectra_filenames, desc="Resolveing data"):
|
||||
tokens = filename.split('.')[0].split('-')
|
||||
if len(tokens) != 3:
|
||||
continue
|
||||
step = int(tokens[0])
|
||||
cellid = int(tokens[1])
|
||||
substep = int(tokens[2])
|
||||
sf = SpectraFile(os.path.join(args.data, filename), cellid, step, substep, charge_files, len(cells))
|
||||
spectras.append(sf)
|
||||
spectras.sort(key=lambda spectra: spectra.step)
|
||||
|
||||
add_soc_estimate(spectras)
|
||||
|
||||
|
Reference in New Issue
Block a user