Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
artoa4argo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
argoTools
artoa4argo
Commits
da487ee8
Commit
da487ee8
authored
Aug 16, 2019
by
leprob001
Browse files
Options
Downloads
Patches
Plain Diff
Added function to plot soundsource toa where float GPS positions are available.
parent
6c63433f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/+artoa/+controller/+edit/+timeOfArrival/plot.m
+2
-49
2 additions, 49 deletions
lib/+artoa/+controller/+edit/+timeOfArrival/plot.m
lib/+artoa/+controller/+edit/+timeOfArrival/plotSoundsourceToaFromGps.m
+108
-0
108 additions, 0 deletions
...ntroller/+edit/+timeOfArrival/plotSoundsourceToaFromGps.m
with
110 additions
and
49 deletions
lib/+artoa/+controller/+edit/+timeOfArrival/plot.m
+
2
−
49
View file @
da487ee8
...
...
@@ -66,55 +66,8 @@ colormap(artoaGui.editTimeOfArrival.scatterTimeOfArrival.Parent, artoa.vendor.cm
artoaGui
.
editTimeOfArrival
.
scatterTimeOfArrival
.
Parent
.
CLim
=
[
0
,
1
];
%% Setup GPS information plot
[
gpsDates
,
predictedToas
]
=
artoa
.
data
.
predictToaFromGps
(
...
artoaDataInput
.
rfb
,
artoaDataInput
.
soundsources
.
W11e
,
...
struct
(
...
'temperature'
,
artoaWorkspace
.
temperature
(
artoaWorkspace
.
statusTemperature
==
1
),
...
'pressure'
,
artoaWorkspace
.
pressure
(
artoaWorkspace
.
statusPressure
==
1
),
...
'method'
,
'del grosso'
,
...
'soundSource'
,
NaN
...
)
...
);
scatter
(
gpsDates
-
1
,
predictedToas
,
20
,
'MarkerFaceColor'
,
[
1
1
1
]);
text
(
gpsDates
,
predictedToas
,
[
'-'
,
'W11e'
],
...
¬
'HorizontalAlignment'
,
'left'
,
...
¬
'VerticalAlignment'
,
'top'
,
...
¬
'FontName'
,
'Helvetica'
,
...
¬
'FontSize'
,
10
,
...
¬
'FontWeight'
,
'demi'
,
...
¬
'Color'
,
[
1
1
1
]
...
);
for
o
=
1
:
length
(
soundsources
)
[
gpsDates
,
predictedToas
]
=
artoa
.
data
.
predictToaFromGps
(
...
artoaDataInput
.
rfb
,
artoaDataInput
.
soundsources
.
(
soundsources
{
o
}),
...
struct
(
...
'temperature'
,
artoaWorkspace
.
temperature
(
artoaWorkspace
.
statusTemperature
==
1
),
...
'pressure'
,
artoaWorkspace
.
pressure
(
artoaWorkspace
.
statusPressure
==
1
),
...
'method'
,
'del grosso'
,
...
'soundSource'
,
NaN
...
)
...
);
scatter
(
gpsDates
,
predictedToas
,
20
,
'MarkerFaceColor'
,
[
1
1
1
]);
text
(
gpsDates
,
predictedToas
,
[
'-'
,
soundsources
{
o
}],
...
¬
'HorizontalAlignment'
,
'left'
,
...
¬
'VerticalAlignment'
,
'top'
,
...
¬
'FontName'
,
'Helvetica'
,
...
¬
'FontSize'
,
10
,
...
¬
'FontWeight'
,
'demi'
,
...
¬
'Color'
,
[
1
1
1
]
...
);
tmp
=
artoa
.
convert
.
dmy2rd
(
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
begemis
(
3
),
...
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
begemis
(
2
),
...
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
begemis
(
1
));
plot
([
tmp
tmp
],[
max
(
y
)
min
(
y
)],
'color'
,
[
1
.
4
.
4
],
'LineStyle'
,
'-.'
)
tmp
=
artoa
.
convert
.
dmy2rd
(
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
endemis
(
3
),
...
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
endemis
(
2
),
...
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
endemis
(
1
));
plot
([
tmp
tmp
],[
max
(
y
)
min
(
y
)],
'color'
,
[
1
.
4
.
4
],
'LineStyle'
,
'-.'
)
end
artoa
.
controller
.
edit
.
timeOfArrival
.
plotSoundsourceToaFromGps
(
soundsources
);
%% Setup gui
...
...
...
...
This diff is collapsed.
Click to expand it.
lib/+artoa/+controller/+edit/+timeOfArrival/plotSoundsourceToaFromGps.m
0 → 100644
+
108
−
0
View file @
da487ee8
function
[]
=
plotSoundsourceToaFromGps
(
soundsources
)
%PLOTSOUNDSOURCETOAFROMGPS Summary of this function goes here
% Detailed explanation goes here
global
artoaDataInput
artoaWorkspace
artoaGui
;
%% Collect required data
yMax
=
max
(
artoaGui
.
editTimeOfArrival
.
scatterTimeOfArrival
.
Parent
.
YLim
);
yMin
=
min
(
artoaGui
.
editTimeOfArrival
.
scatterTimeOfArrival
.
Parent
.
YLim
);
for
o
=
1
:
length
(
soundsources
)
% skip sound source if it went out of the water before the float range, or
% went in the water after the float range
soundSourceBegin
=
artoa
.
convert
.
dmy2rd
(
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
begemis
(
3
),
...
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
begemis
(
2
),
...
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
begemis
(
1
));
soundSourceEnd
=
artoa
.
convert
.
dmy2rd
(
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
endemis
(
3
),
...
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
endemis
(
2
),
...
artoaDataInput
.
soundsources
.
(
soundsources
{
o
})
.
endemis
(
1
));
if
soundSourceEnd
<
min
(
artoaWorkspace
.
toaData
.
toaDate
(
artoaWorkspace
.
toaData
.
status
~=
2
))
...
||
soundSourceBegin
>
max
(
artoaWorkspace
.
toaData
.
toaDate
(
artoaWorkspace
.
toaData
.
status
~=
2
))
continue
;
end
[
gpsDates
,
predictedToas
]
=
artoa
.
data
.
predictToaFromGps
(
...
artoaDataInput
.
rfb
,
artoaDataInput
.
soundsources
.
(
soundsources
{
o
}),
...
struct
(
...
'temperature'
,
artoaWorkspace
.
temperature
(
artoaWorkspace
.
statusTemperature
==
1
),
...
'pressure'
,
artoaWorkspace
.
pressure
(
artoaWorkspace
.
statusPressure
==
1
),
...
'method'
,
'del grosso'
,
...
'soundSource'
,
NaN
...
)
...
);
scatter
(
...
artoaGui
.
editTimeOfArrival
.
scatterTimeOfArrival
.
Parent
,
...
gpsDates
,
predictedToas
,
20
,
...
'MarkerFaceColor'
,
[
1
1
1
]
...
);
text
(
...
artoaGui
.
editTimeOfArrival
.
scatterTimeOfArrival
.
Parent
,
...
gpsDates
,
predictedToas
,
[
'-'
,
soundsources
{
o
}],
...
¬
'HorizontalAlignment'
,
'left'
,
...
¬
'VerticalAlignment'
,
'top'
,
...
¬
'FontName'
,
'Helvetica'
,
...
¬
'FontSize'
,
10
,
...
¬
'FontWeight'
,
'demi'
,
...
¬
'Color'
,
[
1
1
1
]
...
);
% Soundsource lines
% define step size of the text for sound source lines
tmpSteps
=
floor
((
yMax
-
yMin
)/
10
);
additionalYOffset
=
o
*
(
tmpSteps
/
length
(
soundsources
));
% deployment
if
(
min
(
artoaWorkspace
.
toaData
.
toaDate
(
artoaWorkspace
.
toaData
.
status
~=
2
))
-
soundSourceBegin
)
<
50
for
textSteps
=
yMin
:
tmpSteps
:(
yMax
-
tmpSteps
)
text
(
...
artoaGui
.
editTimeOfArrival
.
scatterTimeOfArrival
.
Parent
,
...
soundSourceBegin
,
textSteps
+
additionalYOffset
,
...
[
'<-- '
,
soundsources
{
o
}],
...
'Color'
,[
1
.
4
.
4
],
...
'HorizontalAlignment'
,
'center'
,
...
'VerticalAlignment'
,
'bottom'
,
...
'FontName'
,
'Helvetica'
,
...
'FontSize'
,
10
,
...
'FontWeight'
,
'demi'
,
...
'Rotation'
,
90
...
);
end
plot
(
...
artoaGui
.
editTimeOfArrival
.
scatterTimeOfArrival
.
Parent
,
...
[
soundSourceBegin
soundSourceBegin
],
[
yMax
yMin
],
...
'color'
,
[
1
.
4
.
4
],
...
'LineStyle'
,
'-.'
...
);
end
% recovering
if
(
soundSourceEnd
-
max
(
artoaWorkspace
.
toaData
.
toaDate
(
artoaWorkspace
.
toaData
.
status
~=
2
)))
<
50
for
textSteps
=
yMin
:
tmpSteps
:(
yMax
-
tmpSteps
)
text
(
...
artoaGui
.
editTimeOfArrival
.
scatterTimeOfArrival
.
Parent
,
...
soundSourceEnd
,
textSteps
+
additionalYOffset
,
...
[
soundsources
{
o
},
' -->'
],
...
'Color'
,[
1
.
4
.
4
],
...
'HorizontalAlignment'
,
'center'
,
...
'VerticalAlignment'
,
'bottom'
,
...
'FontName'
,
'Helvetica'
,
...
'FontSize'
,
10
,
...
'FontWeight'
,
'demi'
,
...
'Rotation'
,
90
...
);
end
plot
(
...
artoaGui
.
editTimeOfArrival
.
scatterTimeOfArrival
.
Parent
,
...
[
soundSourceEnd
soundSourceEnd
],
[
yMax
yMin
],
...
'color'
,
[
1
.
4
.
4
],
...
'LineStyle'
,
'-.'
...
);
end
end
end
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
sign in
to comment