Skip to content

Commit

Permalink
Update condition for velocity model 3D
Browse files Browse the repository at this point in the history
Problem: if the velocity model started at the exact origin chosen for the inversion then there are NaN.

Solution: Set isnan(az) to distance of 1 meter and azimuth 45 degrees.
  • Loading branch information
LucaDeSiena committed Jul 22, 2024
1 parent 44285cb commit 7e39737
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/Murat_modv3D.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@
sqrt(modvEqSpace(:,1).^2 + modvEqSpace(:,2).^2);
az =...
atan(modvEqSpace(:,1)./modvEqSpace(:,2))*360/2/pi;

% Condition to avoid NaN
if ~isempty(isnan(az))
d(isnan(az)) = 1;
az(isnan(az))= 45;
end


[lat2,lon2] = reckon(origin(1),origin(2),d,az,wgs84);
modvPlot = [lon2 lat2 modvEqSpace(:,3:4)];

Expand Down

0 comments on commit 7e39737

Please sign in to comment.