Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
Data Processing
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ACS
P
Public
VILLASframework
Data Processing
Commits
17b46be2
Commit
17b46be2
authored
Oct 05, 2018
by
Jan Dinkelbach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add log analysis
parent
ffc5f207
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
5 deletions
+35
-5
dataprocessing/readtools.py
dataprocessing/readtools.py
+35
-5
No files found.
dataprocessing/readtools.py
View file @
17b46be2
...
...
@@ -100,7 +100,7 @@ def read_timeseries_simulink(filename, timeseries_names=None):
return
timeseries_list
def
read_timeseries_dpsim
(
filename
,
timeseries_names
=
None
):
def
read_timeseries_dpsim
(
filename
,
timeseries_names
=
None
,
print_status
=
True
):
"""Reads complex time series data from DPsim log file. Real and
imaginary part are stored in one complex variable.
:param filename: name of the csv file that has the data
...
...
@@ -145,9 +145,39 @@ def read_timeseries_dpsim(filename, timeseries_names=None):
# Read in specified time series
print
(
'cannot read specified columns yet'
)
print
(
'DPsim results real column names: '
+
str
(
real_result_columns
))
print
(
'DPsim results complex column names: '
+
str
(
cmpl_result_columns
))
print
(
'DPsim results variable number: '
+
str
(
len
(
timeseries_list
)))
print
(
'DPsim results length: '
+
str
(
len
(
timestamps
)))
if
print_status
:
print
(
'DPsim results real column names: '
+
str
(
real_result_columns
))
print
(
'DPsim results complex column names: '
+
str
(
cmpl_result_columns
))
print
(
'DPsim results variable number: '
+
str
(
len
(
timeseries_list
)))
print
(
'DPsim results length: '
+
str
(
len
(
timestamps
)))
return
timeseries_list
def
read_dpsim_log
(
log_path
):
log_file
=
open
(
log_path
,
"r"
)
log_lines
=
[
line
for
line
in
log_file
]
log_file
.
close
()
# Sectionize
log_sections
=
{
'init'
:[],
'none'
:[],
'sysmat_stamp'
:[],
'sysmat_final'
:[],
'sourcevec_stamp'
:[],
'sourcevec_final'
:[],
'ludecomp'
:[]}
section
=
'init'
for
line_pos
in
range
(
len
(
log_lines
)):
if
re
.
search
(
'DEBUG: Stamping .+ into system matrix:'
,
log_lines
[
line_pos
]):
section
=
'sysmat_stamp'
elif
re
.
search
(
'INFO: System matrix:'
,
log_lines
[
line_pos
]):
section
=
'sysmat_final'
elif
re
.
search
(
'DEBUG: Stamping .+ into source vector:'
,
log_lines
[
line_pos
]):
section
=
'sourcevec_stamp'
elif
re
.
search
(
'INFO: Right side vector:'
,
log_lines
[
line_pos
]):
section
=
'sourcevec_final'
elif
re
.
search
(
'INFO: LU decomposition:'
,
log_lines
[
line_pos
]):
section
=
'ludecomp'
elif
re
.
search
(
'INFO: Number of network simulation nodes:'
,
log_lines
[
line_pos
]):
section
=
'none'
elif
re
.
search
(
'INFO: Added .+ to simulation.'
,
log_lines
[
line_pos
]):
section
=
'none'
elif
re
.
search
(
'INFO: Initial switch status:'
,
log_lines
[
line_pos
]):
section
=
'none'
log_sections
[
section
].
append
(
line_pos
)
return
log_lines
,
log_sections
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment