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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
argoTools
artoa4argo
Commits
ceaecfaf
Commit
ceaecfaf
authored
5 years ago
by
leprob001
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix and calculation update of matrices A, B and X.
parent
bb49614b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
VERSION
+1
-1
1 addition, 1 deletion
VERSION
lib/+artoa/+offsets/createCalculationTables.m
+40
-19
40 additions, 19 deletions
lib/+artoa/+offsets/createCalculationTables.m
lib/+artoa/+offsets/solve.m
+2
-1
2 additions, 1 deletion
lib/+artoa/+offsets/solve.m
with
43 additions
and
21 deletions
VERSION
+
1
−
1
View file @
ceaecfaf
146
147
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/+artoa/+offsets/createCalculationTables.m
+
40
−
19
View file @
ceaecfaf
...
@@ -18,6 +18,15 @@ results = struct();
...
@@ -18,6 +18,15 @@ results = struct();
fnames
=
fieldnames
(
pSoundsources
);
fnames
=
fieldnames
(
pSoundsources
);
for
i
=
1
:
length
(
fnames
)
for
i
=
1
:
length
(
fnames
)
results
.
(
fnames
{
i
})
=
table
();
results
.
(
fnames
{
i
})
=
table
();
% get start and end date of soundsource
soundSourceBegin
=
artoa
.
convert
.
dmy2rd
(
pSoundsources
.
(
fnames
{
i
})
.
begemis
(
3
),
...
pSoundsources
.
(
fnames
{
i
})
.
begemis
(
2
),
...
pSoundsources
.
(
fnames
{
i
})
.
begemis
(
1
));
soundSourceEnd
=
artoa
.
convert
.
dmy2rd
(
pSoundsources
.
(
fnames
{
i
})
.
endemis
(
3
),
...
pSoundsources
.
(
fnames
{
i
})
.
endemis
(
2
),
...
pSoundsources
.
(
fnames
{
i
})
.
endemis
(
1
));
[
date
,
toa
]
=
artoa
.
toa
.
predictFromGps
(
...
[
date
,
toa
]
=
artoa
.
toa
.
predictFromGps
(
...
pRfb
,
...
pRfb
,
...
pSoundsources
.
(
fnames
{
i
}),
...
pSoundsources
.
(
fnames
{
i
}),
...
...
@@ -38,26 +47,33 @@ for i = 1:length(fnames)
...
@@ -38,26 +47,33 @@ for i = 1:length(fnames)
pSoundsources
.
(
fnames
{
i
})
.
begemis
(
2
),
...
pSoundsources
.
(
fnames
{
i
})
.
begemis
(
2
),
...
pSoundsources
.
(
fnames
{
i
})
.
begemis
(
1
)
...
pSoundsources
.
(
fnames
{
i
})
.
begemis
(
1
)
...
);
);
tmpDistances
=
[]
;
tmpDistances
=
NaN
(
size
(
satPositions
,
1
),
1
)
;
% calculate distances
% calculate distances
for
oDistance
=
1
:
length
(
toa
)
for
oDistance
=
1
:
length
(
toa
)
if
isnan
(
toa
(
oDistance
))
|
any
(
isnan
(
satPositions
(
oDistance
,
:)))
if
isnan
(
toa
(
oDistance
))
|
any
(
isnan
(
satPositions
(
oDistance
,
:)))
tmpDistances
=
[
tmpDistances
;
NaN
];
%
tmpDistances = [tmpDistances; NaN];
continue
;
continue
;
end
end
tmpDistances
=
[
...
tmpDistances
(
oDistance
)
=
artoa
.
data
.
calculateGeodist
(
...
tmpDistances
;
...
artoa
.
data
.
calculateGeodist
(
...
satPositions
(
oDistance
,
:),
...
satPositions
(
oDistance
,
:),
...
pSoundsources
.
(
fnames
{
i
})
.
position
...
pSoundsources
.
(
fnames
{
i
})
.
position
...
)
...
);
];
end
end
results
.
(
fnames
{
i
})
.
satDistances
=
tmpDistances
;
results
.
(
fnames
{
i
})
.
satDistances
=
tmpDistances
;
% set all sat dates to NaN that are not in soundsource mission range
satDatesInRangeIndex
=
...
(
results
.
(
fnames
{
i
})
.
satDate
>=
soundSourceBegin
)
...
&
(
results
.
(
fnames
{
i
})
.
satDate
<=
soundSourceEnd
);
results
.
(
fnames
{
i
})
.
satDate
(
~
satDatesInRangeIndex
)
=
NaN
;
results
.
(
fnames
{
i
})
.
satToa
(
~
satDatesInRangeIndex
)
=
NaN
;
results
.
(
fnames
{
i
})
.
daysSinceStart
(
~
satDatesInRangeIndex
)
=
NaN
;
results
.
(
fnames
{
i
})
.
satDistances
(
~
satDatesInRangeIndex
)
=
NaN
;
% find nearest neighbor toa
% find nearest neighbor toa
tmpMeasuredToas
=
NaN
(
size
(
results
.
(
fnames
{
i
})
.
satDate
));
tmpMeasuredToas
=
NaN
(
size
(
results
.
(
fnames
{
i
})
.
satDate
));
tmpIndexBelongingToSoso
=
strcmp
(
pToaData
.
soundSource
,
fnames
{
i
});
tmpIndexBelongingToSoso
=
strcmp
(
pToaData
.
soundSource
,
fnames
{
i
});
if
~
any
(
tmpIndexBelongingToSoso
)
if
~
any
(
tmpIndexBelongingToSoso
)
% no toa available so save NaN
results
.
(
fnames
{
i
})
.
measuredToa
=
tmpMeasuredToas
;
results
.
(
fnames
{
i
})
.
measuredToa
=
tmpMeasuredToas
;
continue
;
continue
;
end
end
...
@@ -78,18 +94,23 @@ for i = 1:length(fnames)
...
@@ -78,18 +94,23 @@ for i = 1:length(fnames)
lower
(
pTrackingParameter
.
interpolationMethodString
)
...
lower
(
pTrackingParameter
.
interpolationMethodString
)
...
);
);
results
.
(
fnames
{
i
})
.
measuredToa
=
NaN
(
size
(
results
.
(
fnames
{
i
})
.
satDate
));
% find measured toa dates that belong to a sat date
[
values
,
satIndex
,
toaIndex
]
=
intersect
(
results
.
(
fnames
{
i
})
.
satDate
,
ceil
(
tmpToaDate
));
results
.
(
fnames
{
i
})
.
measuredToa
(
satIndex
)
=
tmpToa
(
toaIndex
);
% find nearest neighbor
% find nearest neighbor
for
oSatDates
=
1
:
length
(
results
.
(
fnames
{
i
})
.
satDate
)
%
for oSatDates = 1:length(results.(fnames{i}).satDate)
tmpSatDate
=
results
.
(
fnames
{
i
})
.
satDate
(
oSatDates
);
%
tmpSatDate = results.(fnames{i}).satDate(oSatDates);
neighborDate
=
artoa
.
data
.
findNearestNeighbor
(
...
%
neighborDate = artoa.data.findNearestNeighbor( ...
tmpToaDate
,
...
%
tmpToaDate, ...
tmpSatDate
...
%
tmpSatDate ...
);
%
);
if
abs
(
neighborDate
-
tmpSatDate
)
<=
pTrackingParameter
.
gapSize
%
if abs(neighborDate - tmpSatDate) <= pTrackingParameter.gapSize
tmpMeasuredToas
(
oSatDates
)
=
tmpToa
(
tmpToaDate
==
neighborDate
);
%
tmpMeasuredToas(oSatDates) = tmpToa(tmpToaDate == neighborDate);
end
%
end
end
%
end
results
.
(
fnames
{
i
})
.
measuredToa
=
tmpMeasuredToas
;
%
results.(fnames{i}).measuredToa = tmpMeasuredToas;
clear
tmpDistances
;
clear
tmpDistances
;
end
end
...
...
This diff is collapsed.
Click to expand it.
lib/+artoa/+offsets/solve.m
+
2
−
1
View file @
ceaecfaf
...
@@ -48,7 +48,7 @@ if pOffsetsParameter.useFixedSoundspeed
...
@@ -48,7 +48,7 @@ if pOffsetsParameter.useFixedSoundspeed
end
end
%% Solve it!
%% Solve it!
X
=
B
.
toa
\
A
{:,
:}
;
X
=
A
{:,
:}
\
B
.
toa
;
%% Apply row names to X
%% Apply row names to X
if
isrow
(
X
)
if
isrow
(
X
)
...
@@ -60,6 +60,7 @@ varNames = X.Properties.RowNames;
...
@@ -60,6 +60,7 @@ varNames = X.Properties.RowNames;
for
i
=
1
:
length
(
varNames
)
for
i
=
1
:
length
(
varNames
)
if
strcmp
(
varNames
{
i
},
'Distances'
)
if
strcmp
(
varNames
{
i
},
'Distances'
)
X
.
Properties
.
RowNames
{
i
}
=
'Soundspeed'
;
X
.
Properties
.
RowNames
{
i
}
=
'Soundspeed'
;
X
{
'Soundspeed'
,
'Value'
}
=
1
/
X
{
'Soundspeed'
,
'Value'
};
end
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
register
or
sign in
to comment