Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MechaRaptor - Data Processing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Aerospace and Mechanical Engineering
tlambert
MechaRaptor - Data Processing
Commits
3aaf84a9
Verified
Commit
3aaf84a9
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
fix(process): comply with new id format and data dir
parent
1b63ec95
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
processall.m
+15
-9
15 additions, 9 deletions
processall.m
utils/loadardu.m
+1
-1
1 addition, 1 deletion
utils/loadardu.m
utils/loadid.m
+18
-3
18 additions, 3 deletions
utils/loadid.m
utils/loadtunnel.m
+1
-1
1 addition, 1 deletion
utils/loadtunnel.m
utils/savecsv.m
+2
-1
2 additions, 1 deletion
utils/savecsv.m
with
37 additions
and
15 deletions
processall.m
+
15
−
9
View file @
3aaf84a9
...
...
@@ -44,21 +44,27 @@ function ExpData = processall(idFile)
% Input checks and processing
% [filePaths, fileNames] = getfiles(idFile); %TODO
% FIXME: Detect automatically from idFile
fileRootDir
=
'data/2022-campaign1'
;
% Root directory of data files (e.g. data/YYYY-campaignX)
idTable
=
loadid
(
idFile
);
ExpData
(
size
(
idTable
,
1
))
=
struct
;
for
iTest
=
1
:
size
(
idTable
,
1
)
ExpData
(
iTest
)
.
arduFile
=
idTable
(
iTest
,
:)
.
arduinoFile
{:};
ExpData
(
iTest
)
.
tunnelFile
=
idTable
(
iTest
,
:)
.
wtFile
{:};
ExpData
(
iTest
)
.
arduFile
=
fullfile
(
fileRootDir
,
'arduinoData'
,
...
idTable
(
iTest
,
:)
.
arduinoData
{:});
ExpData
(
iTest
)
.
tunnelFile
=
fullfile
(
fileRootDir
,
'windtunnelData'
,
...
idTable
(
iTest
,
:)
.
windtunnelData
{:});
ExpData
(
iTest
)
.
dx
=
idTable
(
iTest
,
:)
.
dstX
;
ExpData
(
iTest
)
.
airspeed
=
idTable
(
iTest
,
:)
.
v_
air
;
ExpData
(
iTest
)
.
freq
=
idTable
(
iTest
,
:)
.
freq
;
ExpData
(
iTest
)
.
airspeed
=
idTable
(
iTest
,
:)
.
air
speed
;
ExpData
(
iTest
)
.
freq
=
idTable
(
iTest
,
:)
.
target_
freq
;
fprintf
(
'Processing file: %s\n'
,
ExpData
(
iTest
)
.
tunnelFile
);
% Load, clean and sync experimental data
tunnelData
=
loadtunnel
(
ExpData
(
iTest
)
.
tunnelFile
,
...
CUTOFF_MULTIPLIER
*
idTable
(
iTest
,
:)
.
freq
);
CUTOFF_MULTIPLIER
*
idTable
(
iTest
,
:)
.
target_
freq
);
if
~
isempty
(
ExpData
(
iTest
)
.
arduFile
)
% Not for static tests (no ardu data)
[
arduShort
,
~
]
=
loadardu
(
ExpData
(
iTest
)
.
arduFile
);
...
...
@@ -103,10 +109,10 @@ function ExpData = processall(idFile)
ExpData
(
iTest
)
.
Aft
.
moments
=
tunnelData
(:,
6
+
(
4
:
6
));
ExpData
(
iTest
)
.
Testcase
.
dx
=
idTable
(
iTest
,
:)
.
dstX
;
ExpData
(
iTest
)
.
Testcase
.
airspeed
=
idTable
(
iTest
,
:)
.
v_
air
;
ExpData
(
iTest
)
.
Testcase
.
freq
=
idTable
(
iTest
,
:)
.
freq
;
ExpData
(
iTest
)
.
Testcase
.
temp
=
idTable
(
iTest
,
:)
.
temp
_air
;
ExpData
(
iTest
)
.
Testcase
.
press
=
idTable
(
iTest
,
:)
.
pres
_air
;
ExpData
(
iTest
)
.
Testcase
.
airspeed
=
idTable
(
iTest
,
:)
.
air
speed
;
ExpData
(
iTest
)
.
Testcase
.
freq
=
idTable
(
iTest
,
:)
.
target_
freq
;
ExpData
(
iTest
)
.
Testcase
.
temp
=
idTable
(
iTest
,
:)
.
temp
erature
;
ExpData
(
iTest
)
.
Testcase
.
press
=
idTable
(
iTest
,
:)
.
pres
sure
;
if
PLOT_CLEANED
figure
;
...
...
This diff is collapsed.
Click to expand it.
utils/loadardu.m
+
1
−
1
View file @
3aaf84a9
...
...
@@ -35,7 +35,7 @@ function [arduShort, arduData] = loadardu(arduFile)
% Load data
arduTable
=
table
;
if
~
isempty
(
arduFile
)
arduTable
=
loadcsv
([
'arduinoFiles/'
,
arduFile
,
'.csv'
]);
arduTable
=
loadcsv
([
arduFile
,
'.csv'
]);
end
arduTable
.
time
=
timetosec
(
arduTable
.
time
);
...
...
This diff is collapsed.
Click to expand it.
utils/loadid.m
+
18
−
3
View file @
3aaf84a9
function
idTable
=
loadid
(
idFile
)
% LOADID Load the identification file into a table.
%
% Note
% The identification table must obey to the following scheme
% # Header line 1
% # ... (any number of header lines)
% # Header last line
% DataName1, DataName2, ..., DataNameN
% DataUnit1, DataUnit2, ..., DataUnitN
% Data1, Data2, ..., Data3
%
% The number of header lines is NOT detected automatically and must be specified as a constant
% -----
%
% Syntax:
...
...
@@ -22,12 +33,16 @@ function idTable = loadid(idFile)
% MIT License
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Defaults and constants
COMMENT_LINES
=
3
;
% Number of commented lines in the header
% Tweak options before import
opts
=
detectImportOptions
(
idFile
);
opts
.
VariableNamesLine
=
3
;
opts
.
VariableUnitsLine
=
4
;
opts
.
DataLines
=
[
5
Inf
];
opts
.
VariableNamesLine
=
COMMENT_LINES
+
1
;
opts
.
VariableUnitsLine
=
COMMENT_LINES
+
2
;
opts
.
DataLines
=
[
COMMENT_LINES
+
3
Inf
];
% Import
idTable
=
readtable
(
idFile
,
opts
);
end
This diff is collapsed.
Click to expand it.
utils/loadtunnel.m
+
1
−
1
View file @
3aaf84a9
...
...
@@ -35,7 +35,7 @@ function tunnelData = loadtunnel(tunnelFile, cutoff)
% Load data
tunnelTable
=
table
;
if
~
isempty
(
tunnelFile
)
tunnelTable
=
loadcsv
([
'wtFiles/'
,
tunnelFile
,
'.txt'
]);
tunnelTable
=
loadcsv
([
tunnelFile
,
'.txt'
]);
end
% Convert into table
...
...
This diff is collapsed.
Click to expand it.
utils/savecsv.m
+
2
−
1
View file @
3aaf84a9
...
...
@@ -36,7 +36,8 @@ function savecsv(ExpData, arduShort, tunnelData)
testCase
=
string
(
dirSplits
(
end
));
filename
=
sprintf
(
'%s-%0.0fcm-f%0.2f-U%0.1f.csv'
,
...
testCase
,
ExpData
.
dx
*
100
,
ExpData
.
freq
,
ExpData
.
airspeed
);
savefile
=
fullfile
(
'data/cleaned'
,
dirSplits
(
1
),
filename
);
savefile
=
fullfile
(
'data/cleaned'
,
dirSplits
(
4
),
filename
);
% FIXME Better detect splits
if
~
exist
(
string
(
savefile
),
'file'
)
||
ALWAYS_OVERWRITE
% Merges the two arrays together and put it in table
...
...
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