Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NASA Battery Dataset
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GC TICc
16TICc19 HES-SO - Predict
NASA Battery Dataset
Commits
216e29a3
Unverified
Commit
216e29a3
authored
6 years ago
by
Etienne Frank
Browse files
Options
Downloads
Patches
Plain Diff
Explore a bit with the example file
parent
9f270b63
Branches
fix-typos
No related tags found
1 merge request
!2
Fix typos
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
example_retrieve_battery_data.py
+42
-12
42 additions, 12 deletions
example_retrieve_battery_data.py
with
42 additions
and
12 deletions
example_retrieve_battery_data.py
+
42
−
12
View file @
216e29a3
...
...
@@ -3,6 +3,11 @@ from glob import glob
from
extraction.retrieve_battery_data
import
extract_charge_discharge_impedance
def
print_length
(
items
,
key
):
mesures
=
[
x
[
key
]
for
x
in
items
]
len_measures
=
[
len
(
x
)
for
x
in
mesures
]
print
(
sum
(
len_measures
))
def
example_how_to_use_this_module
():
all_folders_containing_batteries_mat_files
=
[
...
...
@@ -14,18 +19,43 @@ def example_how_to_use_this_module():
"
./data/BatteryAgingARC-FY08Q4/
"
,
]
filepaths
=
[
y
for
x
in
os
.
walk
(
"
./data/
"
)
for
y
in
glob
(
os
.
path
.
join
(
x
[
0
],
'
*.mat
'
))]
filepaths
=
sorted
(
filepaths
)
# TODO warning for for the [:1]
for
filepath
in
filepaths
[:]:
print
(
filepath
)
charge_items
,
discharge_items
,
impedance_items
=
extract_charge_discharge_impedance
(
filepath
)
print
(
len
(
charge_items
[
0
][
"
voltage_measured
"
])
==
len
(
charge_items
[
1
][
"
voltage_measured
"
]))
print
(
len
(
charge_items
[
0
][
"
voltage_measured
"
])
==
len
(
discharge_items
[
0
][
"
voltage_measured
"
]))
print
(
len
(
charge_items
[
0
][
"
voltage_measured
"
]))
print
(
len
(
charge_items
[
1
][
"
voltage_measured
"
]))
print
(
len
(
discharge_items
[
0
][
"
voltage_measured
"
]))
for
root
in
all_folders_containing_batteries_mat_files
:
print
(
"
----------------------------
"
)
# filepaths = [y for x in os.walk("./data/") for y in glob(os.path.join(x[0], '*.mat'))]
filepaths
=
[
y
for
x
in
os
.
walk
(
root
)
for
y
in
glob
(
os
.
path
.
join
(
x
[
0
],
'
*.mat
'
))]
filepaths
=
sorted
(
filepaths
)
for
filepath
in
filepaths
[:]:
print
(
filepath
)
charge_items
,
discharge_items
,
impedance_items
=
extract_charge_discharge_impedance
(
filepath
)
## EXPLORATION PART
# print("charges")
# print_length(charge_items, "voltage_measured")
# print_length(charge_items, "current_measured")
# print_length(charge_items, "temperature_measured")
# print_length(charge_items, "current_charge")
# print_length(charge_items, "voltage_charge")
# print("discharges")
# print_length(discharge_items, "voltage_measured")
# print_length(discharge_items, "current_measured")
# print_length(discharge_items, "temperature_measured")
# print_length(discharge_items, "current_charge")
# print_length(discharge_items, "voltage_charge")
# print("impedance")
print_length
(
impedance_items
,
"
sense_current
"
)
print_length
(
impedance_items
,
"
battery_current
"
)
print_length
(
impedance_items
,
"
current_ratio
"
)
print_length
(
impedance_items
,
"
battery_impedance
"
)
print_length
(
impedance_items
,
"
rectified_impedance
"
)
# print(len() == len(charge_items[1]["voltage_measured"]))
# print(len(charge_items[0]["voltage_measured"]) == len(discharge_items[0]["voltage_measured"]))
# print(len(charge_items[0]["voltage_measured"]))
# print(len(charge_items[1]["voltage_measured"]))
# print(len(discharge_items[0]["voltage_measured"]))
if
__name__
==
"
__main__
"
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment