Skip to content
Snippets Groups Projects
Commit 2c9a8ec0 authored by leprob001's avatar leprob001
Browse files

Cleanup predictFromGps.

parent a0bb1b66
No related branches found
No related tags found
No related merge requests found
130 131
\ No newline at end of file \ No newline at end of file
...@@ -13,25 +13,13 @@ floatLaunchTime = artoa.convert.dmy2rd( ... ...@@ -13,25 +13,13 @@ floatLaunchTime = artoa.convert.dmy2rd( ...
pRfb.FLOAT.launchtime(2), ... pRfb.FLOAT.launchtime(2), ...
pRfb.FLOAT.launchtime(1) ... pRfb.FLOAT.launchtime(1) ...
) + pRfb.FLOAT.launchtime(4)/24 + pRfb.FLOAT.launchtime(5)/24/60; ) + pRfb.FLOAT.launchtime(4)/24 + pRfb.FLOAT.launchtime(5)/24/60;
% floatSurfaceEnd = artoa.convert.dmy2rd( ...
% pRfb.FLOAT.cycle(13), pRfb.FLOAT.cycle(12), pRfb.FLOAT.cycle(11) ...
% ) + pRfb.FLOAT.cycle(14)/24 + pRfb.FLOAT.cycle(15)/24/60;
%% Collect sound source data %% Collect sound source data
soundSourceTime = pSoundSource.reftime(1) + pSoundSource.reftime(2)/60; soundSourceTime = pSoundSource.reftime(1) + pSoundSource.reftime(2)/60;
%soundSourceSchedule = pSoundSource.schedule;
%soundSourceLaunchDate = [pSoundSource.launchtime(3) pSoundSource.launchtime(2) pSoundSource.launchtime(1)];
soundSourceEmissionBegin = artoa.convert.dmy2rd( ... soundSourceEmissionBegin = artoa.convert.dmy2rd( ...
[pSoundSource.begemis(3) pSoundSource.begemis(2) pSoundSource.begemis(1)] ... [pSoundSource.begemis(3) pSoundSource.begemis(2) pSoundSource.begemis(1)] ...
) + pSoundSource.begemis(4)/24 + pSoundSource.begemis(5)/24/60; ) + pSoundSource.begemis(4)/24 + pSoundSource.begemis(5)/24/60;
%soundSourceOffset = 0;
% if (~isempty(pSoundSource.offset))
% soundSourceOffset = pSoundSource.offset(4);
% end
soundSourceDrift = 0;
if ~isempty(pSoundSource.drift) && ~isnan(pSoundSource.drift)
soundSourceDrift = pSoundSource.drift;
end
soundSourcePosition = pSoundSource.position; soundSourcePosition = pSoundSource.position;
%% Collect generic variables %% Collect generic variables
...@@ -57,18 +45,6 @@ indicesInRange = (travelCorrection <= maxTime + buffer) & (travelCorrection >= m ...@@ -57,18 +45,6 @@ indicesInRange = (travelCorrection <= maxTime + buffer) & (travelCorrection >= m
windowStartTime = min(travelCorrection(indicesInRange)); windowStartTime = min(travelCorrection(indicesInRange));
clear maxTime minTime indicesInRange; clear maxTime minTime indicesInRange;
% sound xmit time (seconds) = (hours*60 plus minutes)*60 -leapseconds - sosooffset
%soundXmitTime = windowStartTime * 3600 - leapSeconds + soundSourceOffset + pAdditionalOffset;
soundSourceDriftSinceLaunch = soundSourceDrift ...
* (floatLaunchTime - soundSourceEmissionBegin);
%soundSourceDriftSinceSurfaceEnd = soundSourceDrift ...
% * (floatSurfaceEnd - artoa.convert.dmy2rd(soundSourceEmissionBegin));
%predictedToaAtLaunch = soundXmitTime + soundSourceDriftSinceLaunch;
%predictedToaAtSurface = soundXmitTime + soundSourceDriftSinceSurfaceEnd;
%% Predict toa for every gps position %% Predict toa for every gps position
gpsMeasurementCount = size(gpsData, 1); gpsMeasurementCount = size(gpsData, 1);
...@@ -85,11 +61,10 @@ for o = 1:gpsMeasurementCount ...@@ -85,11 +61,10 @@ for o = 1:gpsMeasurementCount
gpsData(o, pRfb.SAT_FORMAT.month_sat), ... gpsData(o, pRfb.SAT_FORMAT.month_sat), ...
gpsData(o, pRfb.SAT_FORMAT.year_sat) ... gpsData(o, pRfb.SAT_FORMAT.year_sat) ...
); );
currentSoundsourceDrift = soundSourceDrift * (gpsRafosDates(o) - soundSourceEmissionBegin);
% calculate distance between sound source and gps % calculate distance between sound source and gps
distanceSoundSourceToFloat = artoa.data.calculateGeodist(currentGpsPosition, soundSourcePosition); distanceSoundSourceToFloat = artoa.data.calculateGeodist(currentGpsPosition, soundSourcePosition);
predictedToa(o) = windowStartTime * 3600 - leapSeconds + currentSoundsourceDrift ... predictedToa(o) = windowStartTime * 3600 - leapSeconds ...
+ distanceSoundSourceToFloat / (artoa.data.calculateSoundVelocity( ... + distanceSoundSourceToFloat / (artoa.data.calculateSoundVelocity( ...
pSoundSpeedParameter.temperature, pSoundSpeedParameter.pressure, ... pSoundSpeedParameter.temperature, pSoundSpeedParameter.pressure, ...
pSoundSpeedParameter.method ... pSoundSpeedParameter.method ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment