Skip to content

Commit 7e39737

Browse files
committed
Update condition for velocity model 3D
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.
1 parent 44285cb commit 7e39737

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bin/Murat_modv3D.m

+8
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@
6363
sqrt(modvEqSpace(:,1).^2 + modvEqSpace(:,2).^2);
6464
az =...
6565
atan(modvEqSpace(:,1)./modvEqSpace(:,2))*360/2/pi;
66+
67+
% Condition to avoid NaN
68+
if ~isempty(isnan(az))
69+
d(isnan(az)) = 1;
70+
az(isnan(az))= 45;
71+
end
72+
73+
6674
[lat2,lon2] = reckon(origin(1),origin(2),d,az,wgs84);
6775
modvPlot = [lon2 lat2 modvEqSpace(:,3:4)];
6876

0 commit comments

Comments
 (0)