Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VILLASdataprocessing
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACS
Public
VILLASframework
VILLASdataprocessing
Commits
a3ba9ed8
Commit
a3ba9ed8
authored
7 years ago
by
Markus Mirz
Browse files
Options
Downloads
Patches
Plain Diff
adding simulink read function
parent
26ea09db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dataprocessing/readtools.py
+19
-0
19 additions, 0 deletions
dataprocessing/readtools.py
with
19 additions
and
0 deletions
dataprocessing/readtools.py
+
19
−
0
View file @
a3ba9ed8
...
...
@@ -54,6 +54,25 @@ def read_timeseries_PLECS(filename, timeseries_names=None):
return
timeseries_list
def
read_timeseries_simulink
(
filename
,
timeseries_names
=
None
):
pd_df
=
pd
.
read_csv
(
filename
)
timeseries_list
=
[]
if
timeseries_names
is
None
:
# No trajectory names specified, thus read in all
timeseries_names
=
list
(
pd_df
.
columns
.
values
)
timeseries_names
.
remove
(
'
time
'
)
for
name
in
timeseries_names
:
timeseries_list
.
append
(
TimeSeries
(
name
,
pd_df
[
'
time
'
].
values
,
pd_df
[
name
].
values
))
else
:
# Read in specified time series
for
name
in
timeseries_names
:
timeseries_list
.
append
(
TimeSeries
(
name
,
pd_df
[
'
time
'
].
values
,
pd_df
[
name
].
values
))
print
(
'
Simulink results column names:
'
+
str
(
timeseries_names
))
print
(
'
Simulink results number:
'
+
str
(
len
(
timeseries_list
)))
return
timeseries_list
def
read_timeseries_dpsim_real
(
filename
,
timeseries_names
=
None
):
"""
Reads real time series data from DPsim log file which may have a header.
Timeseries names are assigned according to the header names if available.
...
...
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