From 7e397379cd85d7803e67f00f1c6f07dfa4dece24 Mon Sep 17 00:00:00 2001 From: Luca De Siena Date: Mon, 22 Jul 2024 16:51:40 +0200 Subject: [PATCH] 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. --- bin/Murat_modv3D.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/Murat_modv3D.m b/bin/Murat_modv3D.m index 20c102a..c5ad8b0 100644 --- a/bin/Murat_modv3D.m +++ b/bin/Murat_modv3D.m @@ -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)];